Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Fee-Market(keeper): Set NoBaseFee to true by default
Browse files Browse the repository at this point in the history
  • Loading branch information
danburck committed Nov 19, 2021
1 parent c242647 commit c905bda
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions x/feemarket/keeper/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ import (
func (suite *KeeperTestSuite) TestEndBlock() {
testCases := []struct {
name string
NoBaseFee bool
malleate func()
expGasUsed uint64
}{
{
"basFee nil",
func() {
params := suite.app.FeeMarketKeeper.GetParams(suite.ctx)
params.NoBaseFee = true
suite.app.FeeMarketKeeper.SetParams(suite.ctx, params)
},
true,
func() {},
uint64(0),
},
{
"Block gas meter is nil",
false,
func() {},
uint64(0),
},
{
"pass",
false,
func() {
meter := sdk.NewGasMeter(uint64(1000000000))
suite.ctx = suite.ctx.WithBlockGasMeter(meter)
Expand All @@ -40,13 +40,15 @@ func (suite *KeeperTestSuite) TestEndBlock() {
for _, tc := range testCases {
suite.Run(fmt.Sprintf("Case %s", tc.name), func() {
suite.SetupTest() // reset
params := suite.app.FeeMarketKeeper.GetParams(suite.ctx)
params.NoBaseFee = tc.NoBaseFee
suite.app.FeeMarketKeeper.SetParams(suite.ctx, params)

tc.malleate()

req := abci.RequestEndBlock{Height: 1}
suite.app.FeeMarketKeeper.EndBlock(suite.ctx, req)
gasUsed := suite.app.FeeMarketKeeper.GetBlockGasUsed(suite.ctx)
// TODO TEST LOGGING EVENT
suite.Require().Equal(tc.expGasUsed, gasUsed, tc.name)
})
}
Expand Down
2 changes: 1 addition & 1 deletion x/feemarket/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func NewParams(noBaseFee bool, baseFeeChangeDenom, elasticityMultiplier uint32,
// DefaultParams returns default evm parameters
func DefaultParams() Params {
return Params{
NoBaseFee: false,
NoBaseFee: true,
BaseFeeChangeDenominator: params.BaseFeeChangeDenominator,
ElasticityMultiplier: params.ElasticityMultiplier,
InitialBaseFee: params.InitialBaseFee,
Expand Down

0 comments on commit c905bda

Please sign in to comment.