Skip to content

Commit

Permalink
fix: method handler crash due to nil min fee per gas
Browse files Browse the repository at this point in the history
  • Loading branch information
blindchaser committed Dec 9, 2024
1 parent 5ddb9ab commit bfbc7f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion x/evm/keeper/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ func (k *Keeper) GetDynamicBaseFeePerGas(ctx sdk.Context) sdk.Dec {
store := ctx.KVStore(k.storeKey)
bz := store.Get(types.BaseFeePerGasPrefix)
if bz == nil {
return k.GetMinimumFeePerGas(ctx)
minFeePerGas := k.GetMinimumFeePerGas(ctx)
if minFeePerGas.IsNil() {
minFeePerGas = types.DefaultParams().MinimumFeePerGas
}

Check warning on line 69 in x/evm/keeper/fee.go

View check run for this annotation

Codecov / codecov/patch

x/evm/keeper/fee.go#L68-L69

Added lines #L68 - L69 were not covered by tests
return minFeePerGas
}
d := sdk.Dec{}
err := d.UnmarshalJSON(bz)
Expand Down

0 comments on commit bfbc7f1

Please sign in to comment.