Skip to content

Commit eca892b

Browse files
committed
Raise Web3ValidationError over TypeError:
- We should raise web3 internal exceptions.
1 parent d8759f8 commit eca892b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

web3/utils/address.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
)
1010
import rlp
1111

12+
from web3.exceptions import (
13+
Web3ValidationError,
14+
)
1215
from web3.types import (
1316
HexStr,
1417
Nonce,
@@ -31,7 +34,9 @@ def get_create2_address(
3134
bytecode.
3235
"""
3336
if len(to_bytes(hexstr=salt)) != 32:
34-
raise TypeError(f"`salt` must be 32 bytes, {len(to_bytes(hexstr=salt))} != 32")
37+
raise Web3ValidationError(
38+
f"`salt` must be 32 bytes, {len(to_bytes(hexstr=salt))} != 32"
39+
)
3540

3641
contract_address = keccak(
3742
b"\xff"

0 commit comments

Comments
 (0)