Skip to content

Commit

Permalink
fix: set gas adjustment before calc (#4250)
Browse files Browse the repository at this point in the history
  • Loading branch information
shapeshed committed Jul 15, 2024
1 parent 4135601 commit 4b57603
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ignite/pkg/cosmosclient/cosmosclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,10 @@ func (c Client) CreateTx(goCtx context.Context, account cosmosaccount.Account, m
return TxService{}, err
}

if c.gasAdjustment != 0 && c.gasAdjustment != defaultGasAdjustment {
txf = txf.WithGasAdjustment(c.gasAdjustment)
}

var gas uint64
if c.gas != "" && c.gas != GasAuto {
gas, err = strconv.ParseUint(c.gas, 10, 64)
Expand All @@ -595,10 +599,6 @@ func (c Client) CreateTx(goCtx context.Context, account cosmosaccount.Account, m
txf = txf.WithGasPrices(c.gasPrices)
}

if c.gasAdjustment != 0 && c.gasAdjustment != defaultGasAdjustment {
txf = txf.WithGasAdjustment(c.gasAdjustment)
}

txUnsigned, err := txf.BuildUnsignedTx(msgs...)
if err != nil {
return TxService{}, errors.WithStack(err)
Expand Down

0 comments on commit 4b57603

Please sign in to comment.