From a3cb99132c821dee37ac723dd4470be88f4443f5 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 11 Oct 2023 13:53:07 +0800 Subject: [PATCH] Problem: estimate less gas when miss max gas on txf when simualte runTx (#1303) * Problem: estimate less gas when miss max gas on txf when simualte runTx * Update CHANGELOG.md --- CHANGELOG.md | 1 + relayer/chains/cosmos/tx.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93f9f9358..6ada6cea6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ * [\#1221](https://github.com/cosmos/relayer/pull/1221) Update cometbft to v0.37.2 and ibc-go to v7.2.0. * [\#1226](https://github.com/cosmos/relayer/pull/1226) Avoid invalid Bech32 prefix error in parallel tests when sdk Config get overwritten by each other in single process. * [\#1231](https://github.com/cosmos/relayer/pull/1231) Reduce get bech32 prefix when get signer. +* [\#1303](https://github.com/cosmos/relayer/pull/1303) Add missing max gas amount on txf to avoid estimate less gas when simualte runTx. ## v0.9.3 diff --git a/relayer/chains/cosmos/tx.go b/relayer/chains/cosmos/tx.go index 44e002889..a8574b5f1 100644 --- a/relayer/chains/cosmos/tx.go +++ b/relayer/chains/cosmos/tx.go @@ -1668,6 +1668,9 @@ func (cc *CosmosProvider) PrepareFactory(txf tx.Factory, signingKey string) (tx. txf = txf.WithGas(cc.PCfg.MinGasAmount) } + if cc.PCfg.MaxGasAmount != 0 { + txf = txf.WithGas(cc.PCfg.MaxGasAmount) + } txf, err = cc.SetWithExtensionOptions(txf) if err != nil { return tx.Factory{}, err