Skip to content

Commit

Permalink
Add types for constants (#3138)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uxio0 committed Nov 7, 2023
1 parent ec37f2f commit f14936a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions newsfragments/3138.internal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix type annotations for ``web3`` constants.
13 changes: 10 additions & 3 deletions web3/constants.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
from eth_typing import (
ChecksumAddress,
HexAddress,
HexStr,
)

# Constants as Strings
ADDRESS_ZERO = "0x0000000000000000000000000000000000000000"
MAX_INT = "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
HASH_ZERO = "0x0000000000000000000000000000000000000000000000000000000000000000"
ADDRESS_ZERO = HexAddress(HexStr("0x0000000000000000000000000000000000000000"))
CHECKSUM_ADDRESSS_ZERO = ChecksumAddress(ADDRESS_ZERO)
MAX_INT = HexStr("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")
HASH_ZERO = HexStr("0x0000000000000000000000000000000000000000000000000000000000000000")

# Constants as Int
WEI_PER_ETHER = 1000000000000000000
Expand Down

0 comments on commit f14936a

Please sign in to comment.