eth-prototype 1.3.4__py3-none-any.whl → 1.3.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {eth_prototype-1.3.4.dist-info → eth_prototype-1.3.5.dist-info}/METADATA +1 -1
- {eth_prototype-1.3.4.dist-info → eth_prototype-1.3.5.dist-info}/RECORD +7 -7
- {eth_prototype-1.3.4.dist-info → eth_prototype-1.3.5.dist-info}/WHEEL +1 -1
- ethproto/wrappers.py +14 -6
- {eth_prototype-1.3.4.dist-info → eth_prototype-1.3.5.dist-info}/licenses/AUTHORS.rst +0 -0
- {eth_prototype-1.3.4.dist-info → eth_prototype-1.3.5.dist-info}/licenses/LICENSE.txt +0 -0
- {eth_prototype-1.3.4.dist-info → eth_prototype-1.3.5.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
|
|
1
|
-
eth_prototype-1.3.
|
2
|
-
eth_prototype-1.3.
|
1
|
+
eth_prototype-1.3.5.dist-info/licenses/AUTHORS.rst,sha256=Ui-05yYXtDZxna6o1yNcfdm8Jt68UIDQ01osiLxlYlU,95
|
2
|
+
eth_prototype-1.3.5.dist-info/licenses/LICENSE.txt,sha256=U_Q6_nDYDwZPIuhttHi37hXZ2qU2-HlV2geo9hzHXFw,1087
|
3
3
|
ethproto/__init__.py,sha256=YWkAFysBp4tZjLWWB2FFmp5yG23pUYhQvgQW9b3soXs,579
|
4
4
|
ethproto/aa_bundler.py,sha256=W47fIA_w7orUu7yczfHPaHpUJRFh5op0YZHPgW3Iwik,17420
|
5
5
|
ethproto/build_artifacts.py,sha256=whIXEqnh5f89UYu4Cb3KDigGV7juUCbDnfZkg-SYMKA,9878
|
@@ -7,12 +7,12 @@ ethproto/contracts.py,sha256=rNVbCK1hURy7lWKhzSdXgVWo3wx9O_Ghk-6PfgOsRNk,18662
|
|
7
7
|
ethproto/defender_relay.py,sha256=05A8TfRZwiBhCpo924Pf9CjfKSir2Wvgg1p_asFxJbw,1777
|
8
8
|
ethproto/w3wrappers.py,sha256=aA5yQ25d01s8gtWkGSxSEZlVRdq6JM1ceS3cfvSj4uM,22614
|
9
9
|
ethproto/wadray.py,sha256=JBsu5KcyU9k70bDK03T2IY6qPVFO30WbYPhwrAHdXao,8262
|
10
|
-
ethproto/wrappers.py,sha256=
|
10
|
+
ethproto/wrappers.py,sha256=kqv6_1lPbRBlncaeMtXjas80GSxzErflN_KwawYyL3E,17725
|
11
11
|
ethproto/test_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
12
|
ethproto/test_utils/factories.py,sha256=G8DnUDG_yThRxMTCkymzcjm9lR_ni0_ZmTsb3sEfIdI,1805
|
13
13
|
ethproto/test_utils/hardhat.py,sha256=HzTqIznu6zVd_-doL96ftFJ235ktDCQen1QDQbNuwfM,2361
|
14
14
|
ethproto/test_utils/vcr_utils.py,sha256=1FH2sgJlElSjWkJLuO3C7E2J-4HKyFvjAqkCnGRZJyk,797
|
15
|
-
eth_prototype-1.3.
|
16
|
-
eth_prototype-1.3.
|
17
|
-
eth_prototype-1.3.
|
18
|
-
eth_prototype-1.3.
|
15
|
+
eth_prototype-1.3.5.dist-info/METADATA,sha256=e7dqeWwx0k7h3zIJLkhi_uKAt2X9KJFkHiZ8rMk97Fs,2695
|
16
|
+
eth_prototype-1.3.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
17
|
+
eth_prototype-1.3.5.dist-info/top_level.txt,sha256=Dl0X7m6N1hxeo4JpGpSNqWC2gtsN0731g-DL1J0mpjc,9
|
18
|
+
eth_prototype-1.3.5.dist-info/RECORD,,
|
ethproto/wrappers.py
CHANGED
@@ -18,6 +18,8 @@ DEFAULT_PROVIDER = env.str("DEFAULT_PROVIDER", None)
|
|
18
18
|
ETHERSCAN_TOKEN = env.str("ETHERSCAN_TOKEN", None)
|
19
19
|
ETHERSCAN_DOMAIN = env.str("ETHERSCAN_DOMAIN", "api.etherscan.io")
|
20
20
|
ETHERSCAN_URL = env.str("ETHERSCAN_URL", "https://{domain}/v2/api?apikey={token}&chainid={chainid}&")
|
21
|
+
ETHERSCAN_CHAIN_ID = env.int("ETHERSCAN_CHAIN_ID", None)
|
22
|
+
|
21
23
|
AMOUNT_DECIMALS = env.int("AMOUNT_DECIMALS", 18)
|
22
24
|
AMOUNT_CLASSNAME = env.str("AMOUNT_CLASSNAME", None)
|
23
25
|
|
@@ -31,6 +33,10 @@ MAXUINT256 = 2**256 - 1
|
|
31
33
|
_providers = {}
|
32
34
|
|
33
35
|
|
36
|
+
class EtherscanError(Exception):
|
37
|
+
...
|
38
|
+
|
39
|
+
|
34
40
|
def get_provider(provider_key=None):
|
35
41
|
global DEFAULT_PROVIDER
|
36
42
|
provider_key = provider_key or DEFAULT_PROVIDER
|
@@ -266,9 +272,8 @@ class BaseProvider(ABC):
|
|
266
272
|
def get_etherscan_url(self):
|
267
273
|
if ETHERSCAN_TOKEN is None:
|
268
274
|
return None
|
269
|
-
|
270
|
-
|
271
|
-
)
|
275
|
+
chain_id = ETHERSCAN_CHAIN_ID or self.w3.eth.chain_id
|
276
|
+
return ETHERSCAN_URL.format(token=ETHERSCAN_TOKEN, domain=ETHERSCAN_DOMAIN, chainid=chain_id)
|
272
277
|
|
273
278
|
def get_first_block(self, eth_wrapper):
|
274
279
|
etherscan_url = self.get_etherscan_url()
|
@@ -283,9 +288,12 @@ class BaseProvider(ABC):
|
|
283
288
|
resp = requests.get(url)
|
284
289
|
resp.raise_for_status()
|
285
290
|
resp = resp.json()
|
286
|
-
if
|
287
|
-
|
288
|
-
|
291
|
+
if resp.get("status") != "1":
|
292
|
+
raise EtherscanError(f"Failed to get first block from {etherscan_url}: {resp}")
|
293
|
+
try:
|
294
|
+
return int(resp["result"][0]["blockNumber"])
|
295
|
+
except (KeyError, TypeError):
|
296
|
+
raise EtherscanError(f"Failed to parse first block for {address}: {resp}")
|
289
297
|
|
290
298
|
def get_contract_address(self, eth_wrapper):
|
291
299
|
return eth_wrapper.contract.address
|
File without changes
|
File without changes
|
File without changes
|