c4417713fa
* 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>
19 lines
550 B
Go
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
|
|
}
|