Skip to content

Commit

Permalink
Fix initializing existing mailbox with failing gas estimation (#3099)
Browse files Browse the repository at this point in the history
### Description

Add additional check to handle a situation when the transaction fails during the gas estimation phase.

### Backward compatibility

Yes

### Testing

Manual
  • Loading branch information
aostrun authored Dec 22, 2023
1 parent 2b49baa commit 0e60c22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion typescript/sdk/src/core/HyperlaneCoreDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ export class HyperlaneCoreDeployer extends HyperlaneDeployer<
if (
!e.message.includes('already initialized') &&
// Some RPC providers dont return the revert reason (nor allow ethers to parse it), so we have to check the message
!e.message.includes('Reverted 0x08c379a')
!e.message.includes('Reverted 0x08c379a') &&
// Handle situation where the gas estimation fails on the call function,
// then the real error reason is not available in `e.message`, but rather in `e.error.reason`
!e.error?.reason?.includes('already initialized')
) {
throw e;
}
Expand Down

0 comments on commit 0e60c22

Please sign in to comment.