File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -326,11 +326,11 @@ def main(
326
326
):
327
327
w3 = Web3Advanced (node_url = node_url )
328
328
329
- with open ( ". /abi/Counter.abi" ) as f :
329
+ with files ( "IceCreamSwapWeb3" ). joinpath ( ". /abi/Counter.abi"). open ( 'r' ) as f :
330
330
counter_contract_abi = f .read ()
331
- with open ( ". /bytecode/Counter.bytecode" ) as f :
331
+ with files ( "IceCreamSwapWeb3" ). joinpath ( ". /bytecode/Counter.bytecode"). open ( 'r' ) as f :
332
332
counter_contract_bytecode = f .read ()
333
- with open ( ". /abi/ERC20.abi" ) as f :
333
+ with files ( "IceCreamSwapWeb3" ). joinpath ( ". /abi/ERC20.abi"). open ( 'r' ) as f :
334
334
erc20_abi = f .read ()
335
335
336
336
counter_contract = w3 .eth .contract (bytecode = counter_contract_bytecode , abi = counter_contract_abi )
Original file line number Diff line number Diff line change
1
+ from importlib .resources import files
2
+
1
3
from web3 import Web3
2
4
from web3 .exceptions import ContractLogicError
3
5
from web3 .main import get_default_modules
@@ -83,9 +85,9 @@ def _find_max_filter_range(self):
83
85
return 0
84
86
85
87
def _check_revert_reason_available (self ):
86
- with open ( " abi/RevertTester.abi" ) as f :
88
+ with files ( "IceCreamSwapWeb3" ). joinpath ( "./ abi/RevertTester.abi"). open ( 'r' ) as f :
87
89
revert_tester_abi = f .read ()
88
- with open ( " bytecode/RevertTester.bytecode" ) as f :
90
+ with files ( "IceCreamSwapWeb3" ). joinpath ( "./ bytecode/RevertTester.bytecode"). open ( 'r' ) as f :
89
91
revert_tester_bytecode = f .read ()
90
92
revert_tester_contract = self .eth .contract (abi = revert_tester_abi , bytecode = revert_tester_bytecode )
91
93
try :
You can’t perform that action at this time.
0 commit comments