eth-address-index

signed metadata declarations for ethereum addresses
Log | Files | Refs

commit e698f51c84ef5c5a77dac84d9a5abc2e1e6eb161
parent 426b0adc79371c98d90b5c98f9da8d7b5eafe7ce
Author: nolash <dev@holbrook.no>
Date:   Mon, 22 Mar 2021 17:59:36 +0100

Add receipt waits to all runnables

Diffstat:
Mpython/eth_address_declarator/runnable/add.py | 13++++++++-----
Mpython/eth_address_declarator/runnable/deploy.py | 21++++++++++-----------
Mpython/eth_token_index/runnable/add.py | 13+++++--------
Mpython/eth_token_index/runnable/deploy.py | 21++++++++++-----------
4 files changed, 33 insertions(+), 35 deletions(-)

diff --git a/python/eth_address_declarator/runnable/add.py b/python/eth_address_declarator/runnable/add.py @@ -49,6 +49,9 @@ if args.vv: elif args.v: logg.setLevel(logging.INFO) +block_last = args.w +block_all = args.ww + passphrase_env = 'ETH_PASSPHRASE' if args.env_prefix != None: passphrase_env = args.env_prefix + '_' + passphrase_env @@ -81,11 +84,11 @@ def main(): c = AddressDeclarator(signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle, chain_id=chain_id) (tx_hash_hex, o) = c.add_declaration(contract_address, signer_address, subject_address, declaration) rpc.do(o) - o = receipt(tx_hash_hex) - r = rpc.do(o) - if r['status'] == 0: - sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you') - sys.exit(1) + if block_last: + r = rpc.wait(tx_hash_hex) + if r['status'] == 0: + sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you') + sys.exit(1) print(tx_hash_hex) diff --git a/python/eth_address_declarator/runnable/deploy.py b/python/eth_address_declarator/runnable/deploy.py @@ -80,18 +80,17 @@ def main(): c = AddressDeclarator(signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle, chain_id=chain_id) (tx_hash_hex, o) = c.constructor(signer_address, initial_description) rpc.do(o) - o = receipt(tx_hash_hex) - r = rpc.do(o) - if r['status'] == 0: - sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you') - sys.exit(1) - # TODO: pass through translator for keys (evm tester uses underscore instead of camelcase) - address = r['contractAddress'] - if block_last: - rpc.wait(tx_hash_hex) - - print(address) + r = rpc.wait(tx_hash_hex) + if r['status'] == 0: + sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you') + sys.exit(1) + # TODO: pass through translator for keys (evm tester uses underscore instead of camelcase) + address = r['contractAddress'] + + print(address) + else: + print(tx_hash_hex) sys.exit(0) diff --git a/python/eth_token_index/runnable/add.py b/python/eth_token_index/runnable/add.py @@ -83,20 +83,17 @@ def main(): c = TokenUniqueSymbolIndex(signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle, chain_id=chain_id) (tx_hash_hex, o) = c.register(contract_address, signer_address, token_address) rpc.do(o) - o = receipt(tx_hash_hex) - r = rpc.do(o) - if r['status'] == 0: - sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you') - sys.exit(1) + if block_last: + r = rpc.wait(tx_hash_hex) + if r['status'] == 0: + sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you') + sys.exit(1) c = ERC20() o = c.symbol(token_address) r = rpc.do(o) token_symbol = ERC20.parse_symbol(r) - if block_last: - helper.wait_for() - logg.info('added token {} at {} to token index {}'.format(token_symbol, token_address, contract_address)) print(tx_hash_hex) diff --git a/python/eth_token_index/runnable/deploy.py b/python/eth_token_index/runnable/deploy.py @@ -78,18 +78,17 @@ def main(): c = TokenUniqueSymbolIndex(signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle, chain_id=chain_id) (tx_hash_hex, o) = c.constructor(signer_address) rpc.do(o) - o = receipt(tx_hash_hex) - r = rpc.do(o) - if r['status'] == 0: - sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you') - sys.exit(1) - # TODO: pass through translator for keys (evm tester uses underscore instead of camelcase) - address = r['contractAddress'] - if block_last: - rpc.wait(tx_hash_hex) - - print(address) + r = rpc.wait(tx_hash_hex) + if r['status'] == 0: + sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you') + sys.exit(1) + # TODO: pass through translator for keys (evm tester uses underscore instead of camelcase) + address = r['contractAddress'] + + print(address) + else: + print(tx_hash_hex) sys.exit(0)