Skip to content

Commit

Permalink
refactor clean
Browse files Browse the repository at this point in the history
  • Loading branch information
aljo242 committed Dec 5, 2023
1 parent 98479ef commit 840d6a9
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions x/feemarket/keeper/keeper_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package keeper_test

import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
testkeeper "github.com/skip-mev/feemarket/testutils/keeper"
"testing"

"cosmossdk.io/math"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/testutil"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/suite"

Expand Down Expand Up @@ -39,27 +41,13 @@ func TestKeeperTestSuite(t *testing.T) {

func (s *KeeperTestSuite) SetupTest() {
s.encCfg = encoding.MakeTestEncodingConfig()
s.key = storetypes.NewKVStoreKey(types.StoreKey)
testCtx := testutil.DefaultContextWithDB(s.T(), s.key, storetypes.NewTransientStoreKey("transient_test"))
s.ctx = testCtx.Ctx

s.authorityAccount = []byte("authority")
s.authorityAccount = authtypes.NewModuleAddress(govtypes.ModuleName)
s.accountKeeper = mocks.NewAccountKeeper(s.T())
ctx, tk, tm := testkeeper.NewTestSetup(s.T())

s.feeMarketKeeper = keeper.NewKeeper(
s.encCfg.Codec,
s.key,
s.accountKeeper,
s.authorityAccount.String(),
)

err := s.feeMarketKeeper.SetParams(s.ctx, types.DefaultParams())
s.Require().NoError(err)

err = s.feeMarketKeeper.SetState(s.ctx, types.DefaultState())
s.Require().NoError(err)

s.msgServer = keeper.NewMsgServer(*s.feeMarketKeeper)
s.ctx = ctx
s.feeMarketKeeper = tk.FeeMarketKeeper
s.msgServer = tm.FeeMarketMsgServer
s.queryServer = keeper.NewQueryServer(*s.feeMarketKeeper)
}

Expand Down

0 comments on commit 840d6a9

Please sign in to comment.