forked from cerc-io/laconicd-deprecated
fix: default base fee state in genesis (#919)
* fix defualt base fee state in genesis Closes: #918 Solution: - initialise the default base fee value in genesis * changelog
This commit is contained in:
@@ -2,6 +2,7 @@ package keeper_test
|
||||
|
||||
import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
ethparams "github.com/ethereum/go-ethereum/params"
|
||||
"github.com/tharsis/ethermint/x/feemarket/types"
|
||||
)
|
||||
|
||||
@@ -41,9 +42,10 @@ func (suite *KeeperTestSuite) TestQueryBaseFee() {
|
||||
expPass bool
|
||||
}{
|
||||
{
|
||||
"pass - nil Base Fee",
|
||||
"pass - default Base Fee",
|
||||
func() {
|
||||
expRes = &types.QueryBaseFeeResponse{}
|
||||
initialBaseFee := sdk.NewInt(ethparams.InitialBaseFee)
|
||||
expRes = &types.QueryBaseFeeResponse{BaseFee: &initialBaseFee}
|
||||
},
|
||||
true,
|
||||
},
|
||||
|
||||
@@ -4,13 +4,15 @@ import (
|
||||
"fmt"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
)
|
||||
|
||||
// DefaultGenesisState sets default fee market genesis state.
|
||||
func DefaultGenesisState() *GenesisState {
|
||||
return &GenesisState{
|
||||
Params: DefaultParams(),
|
||||
BaseFee: sdk.ZeroInt(),
|
||||
Params: DefaultParams(),
|
||||
// the default base fee should be initialized because the default enable height is zero.
|
||||
BaseFee: sdk.NewIntFromUint64(params.InitialBaseFee),
|
||||
BlockGas: 0,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user