Skip to content

Commit e55aa98

Browse files
committed
fix: error message on chain id hex to int
1 parent b4fac7b commit e55aa98

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web3/middleware/validation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@
5555

5656
@curry
5757
def _validate_chain_id(web3_chain_id: int, chain_id: int) -> int:
58-
if to_integer_if_hex(chain_id) == web3_chain_id:
58+
chain_id_int = to_integer_if_hex(chain_id)
59+
if chain_id_int == web3_chain_id:
5960
return chain_id
6061
else:
6162
raise ValidationError(
62-
f"The transaction declared chain ID {chain_id!r}, "
63+
f"The transaction declared chain ID {chain_id_int!r}, "
6364
f"but the connected node is on {web3_chain_id!r}"
6465
)
6566

0 commit comments

Comments
 (0)