Skip to content

Commit

Permalink
add get
Browse files Browse the repository at this point in the history
  • Loading branch information
aljo242 committed Nov 15, 2023
1 parent 364aaa1 commit 018da67
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions x/feemarket/keeper/feemarket.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,21 @@ func (k *Keeper) GetLearningRate(ctx sdk.Context) (math.LegacyDec, error) {

return state.LearningRate, nil
}

// GetMinGasPrices returns the mininum gas prices as sdk.Coins from the fee market state.
func (k *Keeper) GetMinGasPrices(ctx sdk.Context) (sdk.Coins, error) {
baseFee, err := k.GetBaseFee(ctx)
if err != nil {
return sdk.NewCoins(), err
}

params, err := k.GetParams(ctx)
if err != nil {
return sdk.NewCoins(), err
}

fee := sdk.NewCoin(params.FeeDenom, baseFee)
minGasPrices := sdk.NewCoins(fee)

return minGasPrices, nil
}

0 comments on commit 018da67

Please sign in to comment.