Skip to content

Commit

Permalink
turn off estimate gas for testing custom-error
Browse files Browse the repository at this point in the history
  • Loading branch information
siburu committed Apr 26, 2024
1 parent 0cd6f63 commit e8f6f55
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions pkg/relay/ethereum/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,20 @@ func (c *Chain) SendMsgs(msgs []sdk.Msg) ([]core.MsgID, error) {
logger.Error("failed to send msg / NoSend: true", err, "msg_index", i)
return nil, err
}
estimatedGas, err := c.client.EstimateGasFromTx(ctx, tx)
if err != nil {
revertReason, err2 := c.getRevertReasonFromEstimateGas(err)
if err2 != nil {
logger.Error("failed to get revert reason", err2, "msg_index", i)
}
/*
estimatedGas, err := c.client.EstimateGasFromTx(ctx, tx)
if err != nil {
revertReason, err2 := c.getRevertReasonFromEstimateGas(err)
if err2 != nil {
logger.Error("failed to get revert reason", err2, "msg_index", i)
}
logger.Error("failed to estimate gas", err, "revert_reason", revertReason, "msg_index", i)
return nil, err
}
txGasLimit := estimatedGas * c.Config().GasEstimateRate.Numerator / c.Config().GasEstimateRate.Denominator
logger.Error("failed to estimate gas", err, "revert_reason", revertReason, "msg_index", i)
return nil, err
}
txGasLimit := estimatedGas * c.Config().GasEstimateRate.Numerator / c.Config().GasEstimateRate.Denominator
*/
txGasLimit := uint64(5000000)
if txGasLimit > c.Config().MaxGasLimit {
logger.Warn("estimated gas exceeds max gas limit", "estimated_gas", txGasLimit, "max_gas_limit", c.Config().MaxGasLimit, "msg_index", i)
txGasLimit = c.Config().MaxGasLimit
Expand Down

0 comments on commit e8f6f55

Please sign in to comment.