laconicd-deprecated/x/evm/migrations/v2/migration.go
crypto-facs c4417713fa
imp(evm): define minimum GasUsed proportional to GasLimit (#1087)
* min gas denominator implementation

* update changelog

* modify MinGasDenominator type to sdk.Dec

* fix typo in comments

* add comments

* update comment

* refactor logic

* remove unnecesary test

* fix typo on proto

* rename param

* fix tests

* use truncate and run mod tidy

* comment to default value

* update changelog

* rename temporary gas used

* integration tests

* add migrations

* add default as var

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2022-05-25 13:52:34 +00:00

19 lines
550 B
Go

package v2
import (
sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/tharsis/ethermint/x/evm/types"
)
// AddMinGasMultiplierParam updates the module parameter MinGasMultiplier to 0.5
func AddMinGasMultiplierParam(ctx sdk.Context, paramStore *paramtypes.Subspace) error {
if !paramStore.HasKeyTable() {
ps := paramStore.WithKeyTable(types.ParamKeyTable())
paramStore = &ps
}
paramStore.Set(ctx, types.ParamStoreKeyMinGasMultiplier, types.DefaultMinGasMultiplier)
return nil
}