Skip to content

Commit

Permalink
fix: Verify chainId only if present in domain (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
y3fers0n authored May 2, 2024
1 parent a71e0e9 commit 74331fd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ethereum_provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,10 @@ class TrustWeb3Provider extends BaseProvider {

const { chainId } = message.domain || {};

if (!chainId || Number(chainId) !== Number(this.chainId)) {
if (
typeof chainId !== "undefined" &&
Number(chainId) !== Number(this.chainId)
) {
throw new Error(
"Provided chainId does not match the currently active chain"
);
Expand Down

1 comment on commit 74331fd

@Alshaib2222
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``

Please sign in to comment.