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:
Alexander Kolotov 2018-05-31 20:39:36 +03:00
parent 56962ff6e3
commit a81c03bc76
1 changed files with 3 additions and 0 deletions

View File

@ -29,6 +29,9 @@ def initContractAtAddress(_web3, _file, _address):
contract_abi = jload(f)
f.close()
if type(contract_abi) == dict:
contract_abi = contract_abi['abi']
contract_factory = _web3.eth.contract(
abi = contract_abi,
)