Skip to content

Commit

Permalink
fix: apply estimate before attempting to send handover
Browse files Browse the repository at this point in the history
  • Loading branch information
byte-bandit committed Aug 30, 2024
1 parent 956fa20 commit e1eaa20
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions chain/evm/compass.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ func (t compass) compass_handover(
return CompassLogicCallArgs{arg.GetPayload(), common.HexToAddress(arg.GetHexContractAddress())}
})

if opts.estimateOnly {
// Simulate maximum gas estimate to ensure the transaction is not rejected
estimate = big.NewInt(0).SetUint64(cConservativeDummyGasEstimate)
}

// TODO: Use generated contract code directly
// compass 2.0.0
// def compass_update_batch(consensus: Consensus, update_compass_args: DynArray[LogicCallArgs, MAX_BATCH], deadline: uint256, gas_estimate: uint256, relayer: address):
Expand Down

0 comments on commit e1eaa20

Please sign in to comment.