Skip to content

Commit

Permalink
Fix tx confirm
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeny-stakewise committed Mar 3, 2024
1 parent 5ed5454 commit a4514c7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/exits/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ async def submit_exit_signatures(
return None

logger.info('Waiting for transaction %s confirmation', Web3.to_hex(tx))
await execution_client.eth.wait_for_transaction_receipt(
tx_receipt = await execution_client.eth.wait_for_transaction_receipt(
tx, timeout=settings.execution_transaction_timeout
)
if not tx_receipt['status']:
logger.error('UpdateExitSignatures transaction failed')
return None
return Web3.to_hex(tx)
6 changes: 5 additions & 1 deletion src/harvest/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ async def submit_harvest_transaction(harvest_params: HarvestParams) -> HexStr |

tx_hash = Web3.to_hex(tx)
logger.info('Waiting for transaction %s confirmation', tx_hash)
await execution_client.eth.wait_for_transaction_receipt(
tx_receipt = await execution_client.eth.wait_for_transaction_receipt(
tx, timeout=settings.execution_transaction_timeout
)
if not tx_receipt['status']:
logger.error('Harvest transaction failed')
return None

return tx_hash
11 changes: 9 additions & 2 deletions src/validators/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,13 @@ async def register_single_validator(

tx_hash = Web3.to_hex(tx)
logger.info('Waiting for transaction %s confirmation', tx_hash)
await execution_client.eth.wait_for_transaction_receipt(
tx_receipt = await execution_client.eth.wait_for_transaction_receipt(
tx, timeout=settings.execution_transaction_timeout
)
if not tx_receipt['status']:
logger.error('Registration transaction failed')
return None

return tx_hash


Expand Down Expand Up @@ -319,7 +323,10 @@ async def register_multiple_validator(

tx_hash = Web3.to_hex(tx)
logger.info('Waiting for transaction %s confirmation', tx_hash)
await execution_client.eth.wait_for_transaction_receipt(
tx_receipt = await execution_client.eth.wait_for_transaction_receipt(
tx, timeout=settings.execution_transaction_timeout
)
if not tx_receipt['status']:
logger.error('Registration transaction failed')
return None
return tx_hash

0 comments on commit a4514c7

Please sign in to comment.