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:
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)

View File

@ -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)
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)
print(address)
else:
print(tx_hash_hex)
sys.exit(0)

View File

@ -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)

View File

@ -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)
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)
print(address)
else:
print(tx_hash_hex)
sys.exit(0)