added support of two types of JSON files for abi
a contract API will be initialized if JSON represents ABI (list of methods) or contains complete description of the contract (dictionary with abi field)
This commit is contained in:
parent
56962ff6e3
commit
a81c03bc76
|
@ -29,6 +29,9 @@ def initContractAtAddress(_web3, _file, _address):
|
||||||
contract_abi = jload(f)
|
contract_abi = jload(f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
if type(contract_abi) == dict:
|
||||||
|
contract_abi = contract_abi['abi']
|
||||||
|
|
||||||
contract_factory = _web3.eth.contract(
|
contract_factory = _web3.eth.contract(
|
||||||
abi = contract_abi,
|
abi = contract_abi,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue