Skip to content

Commit

Permalink
feat: SetGasLimitAndFee should round up (backport #2963) (#2965)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Dec 29, 2023
1 parent 6f19fd8 commit 1d18081
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/user/tx_options.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package user

import (
"math"

"github.com/celestiaorg/celestia-app/pkg/appconsts"
sdkclient "github.com/cosmos/cosmos-sdk/client"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -74,7 +76,7 @@ func SetGasLimitAndFee(gasLimit uint64, gasPrice float64) TxOption {
builder.SetGasLimit(gasLimit)
builder.SetFeeAmount(
sdk.NewCoins(
sdk.NewCoin(appconsts.BondDenom, sdk.NewInt(int64(gasPrice*float64(gasLimit)))),
sdk.NewInt64Coin(appconsts.BondDenom, int64(math.Ceil(gasPrice*float64(gasLimit)))),
),
)
return builder
Expand Down

0 comments on commit 1d18081

Please sign in to comment.