From 240904b39c5198e657e54138205615087db9a4cc Mon Sep 17 00:00:00 2001 From: beer-1 <147697694+beer-1@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:39:14 +0900 Subject: [PATCH] handle upgrade empty params (#101) --- app/upgrade.go | 2 +- x/evm/keeper/params.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/upgrade.go b/app/upgrade.go index fbc11ac..688214c 100644 --- a/app/upgrade.go +++ b/app/upgrade.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" ) -const upgradeName = "0.6.0" +const upgradeName = "0.6.3" // RegisterUpgradeHandlers returns upgrade handlers func (app *MinitiaApp) RegisterUpgradeHandlers(cfg module.Configurator) { diff --git a/x/evm/keeper/params.go b/x/evm/keeper/params.go index 1d2044d..ffbda9a 100644 --- a/x/evm/keeper/params.go +++ b/x/evm/keeper/params.go @@ -19,6 +19,8 @@ func (k Keeper) GasRefundRatio(ctx context.Context) (math.LegacyDec, error) { params, err := k.Params.Get(ctx) if err != nil { return math.LegacyZeroDec(), err + } else if params.GasRefundRatio.IsNil() { + return math.LegacyZeroDec(), nil } return params.GasRefundRatio, nil