Add receipt waits to all runnables

This commit is contained in:
nolash 2021-03-22 17:59:36 +01:00
parent 426b0adc79
commit e698f51c84
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
4 changed files with 31 additions and 33 deletions

View File

@ -49,6 +49,9 @@ if args.vv:
elif args.v: elif args.v:
logg.setLevel(logging.INFO) logg.setLevel(logging.INFO)
block_last = args.w
block_all = args.ww
passphrase_env = 'ETH_PASSPHRASE' passphrase_env = 'ETH_PASSPHRASE'
if args.env_prefix != None: if args.env_prefix != None:
passphrase_env = args.env_prefix + '_' + passphrase_env passphrase_env = args.env_prefix + '_' + passphrase_env
@ -81,8 +84,8 @@ def main():
c = AddressDeclarator(signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle, chain_id=chain_id) 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) (tx_hash_hex, o) = c.add_declaration(contract_address, signer_address, subject_address, declaration)
rpc.do(o) rpc.do(o)
o = receipt(tx_hash_hex) if block_last:
r = rpc.do(o) r = rpc.wait(tx_hash_hex)
if r['status'] == 0: if r['status'] == 0:
sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you') sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you')
sys.exit(1) sys.exit(1)

View File

@ -80,18 +80,17 @@ def main():
c = AddressDeclarator(signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle, chain_id=chain_id) 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) (tx_hash_hex, o) = c.constructor(signer_address, initial_description)
rpc.do(o) rpc.do(o)
o = receipt(tx_hash_hex) if block_last:
r = rpc.do(o) r = rpc.wait(tx_hash_hex)
if r['status'] == 0: if r['status'] == 0:
sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you') sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you')
sys.exit(1) sys.exit(1)
# TODO: pass through translator for keys (evm tester uses underscore instead of camelcase) # TODO: pass through translator for keys (evm tester uses underscore instead of camelcase)
address = r['contractAddress'] address = r['contractAddress']
if block_last:
rpc.wait(tx_hash_hex)
print(address) print(address)
else:
print(tx_hash_hex)
sys.exit(0) sys.exit(0)

View File

@ -83,8 +83,8 @@ def main():
c = TokenUniqueSymbolIndex(signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle, chain_id=chain_id) 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) (tx_hash_hex, o) = c.register(contract_address, signer_address, token_address)
rpc.do(o) rpc.do(o)
o = receipt(tx_hash_hex) if block_last:
r = rpc.do(o) r = rpc.wait(tx_hash_hex)
if r['status'] == 0: if r['status'] == 0:
sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you') sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you')
sys.exit(1) sys.exit(1)
@ -94,9 +94,6 @@ def main():
r = rpc.do(o) r = rpc.do(o)
token_symbol = ERC20.parse_symbol(r) 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)) logg.info('added token {} at {} to token index {}'.format(token_symbol, token_address, contract_address))
print(tx_hash_hex) print(tx_hash_hex)

View File

@ -78,18 +78,17 @@ def main():
c = TokenUniqueSymbolIndex(signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle, chain_id=chain_id) c = TokenUniqueSymbolIndex(signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle, chain_id=chain_id)
(tx_hash_hex, o) = c.constructor(signer_address) (tx_hash_hex, o) = c.constructor(signer_address)
rpc.do(o) rpc.do(o)
o = receipt(tx_hash_hex) if block_last:
r = rpc.do(o) r = rpc.wait(tx_hash_hex)
if r['status'] == 0: if r['status'] == 0:
sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you') sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you')
sys.exit(1) sys.exit(1)
# TODO: pass through translator for keys (evm tester uses underscore instead of camelcase) # TODO: pass through translator for keys (evm tester uses underscore instead of camelcase)
address = r['contractAddress'] address = r['contractAddress']
if block_last:
rpc.wait(tx_hash_hex)
print(address) print(address)
else:
print(tx_hash_hex)
sys.exit(0) sys.exit(0)