Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: convert keeper tests to testsuite #10187

Merged
merged 17 commits into from
Sep 22, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
legacyQuerierCdc added in SetupTest
  • Loading branch information
NagaTulasi committed Sep 21, 2021
commit 59451baeae257d969e1cf2d516cdfa6979baf1af
21 changes: 10 additions & 11 deletions x/mint/keeper/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ import (
type MintKeeperTestSuite struct {
suite.Suite

app *simapp.SimApp
ctx sdk.Context
app *simapp.SimApp
ctx sdk.Context
legacyQuerierCdc *codec.AminoCodec
}

func (suite *MintKeeperTestSuite) SetupTest() {
Expand All @@ -29,14 +30,15 @@ func (suite *MintKeeperTestSuite) SetupTest() {
app.MintKeeper.SetParams(ctx, types.DefaultParams())
app.MintKeeper.SetMinter(ctx, types.DefaultInitialMinter())

legacyQuerierCdc := codec.NewAminoCodec(app.LegacyAmino())

suite.app = app
suite.ctx = ctx
suite.legacyQuerierCdc = legacyQuerierCdc
}

func (suite *MintKeeperTestSuite) TestNewQuerier(t *testing.T) {
app, ctx := suite.app, suite.ctx

legacyQuerierCdc := codec.NewAminoCodec(app.LegacyAmino())
app, ctx, legacyQuerierCdc := suite.app, suite.ctx, suite.legacyQuerierCdc
querier := keep.NewQuerier(app.MintKeeper, legacyQuerierCdc.LegacyAmino)

query := abci.RequestQuery{
Expand All @@ -58,8 +60,7 @@ func (suite *MintKeeperTestSuite) TestNewQuerier(t *testing.T) {
}

func (suite *MintKeeperTestSuite) TestQueryParams(t *testing.T) {
app, ctx := suite.app, suite.ctx
legacyQuerierCdc := codec.NewAminoCodec(app.LegacyAmino())
app, ctx, legacyQuerierCdc := suite.app, suite.ctx, suite.legacyQuerierCdc
querier := keep.NewQuerier(app.MintKeeper, legacyQuerierCdc.LegacyAmino)

var params types.Params
Expand All @@ -74,8 +75,7 @@ func (suite *MintKeeperTestSuite) TestQueryParams(t *testing.T) {
}

func (suite *MintKeeperTestSuite) TestQueryInflation(t *testing.T) {
app, ctx := suite.app, suite.ctx
legacyQuerierCdc := codec.NewAminoCodec(app.LegacyAmino())
app, ctx, legacyQuerierCdc := suite.app, suite.ctx, suite.legacyQuerierCdc
querier := keep.NewQuerier(app.MintKeeper, legacyQuerierCdc.LegacyAmino)

var inflation sdk.Dec
Expand All @@ -90,8 +90,7 @@ func (suite *MintKeeperTestSuite) TestQueryInflation(t *testing.T) {
}

func (suite *MintKeeperTestSuite) TestQueryAnnualProvisions(t *testing.T) {
app, ctx := suite.app, suite.ctx
legacyQuerierCdc := codec.NewAminoCodec(app.LegacyAmino())
app, ctx, legacyQuerierCdc := suite.app, suite.ctx, suite.legacyQuerierCdc
querier := keep.NewQuerier(app.MintKeeper, legacyQuerierCdc.LegacyAmino)

var annualProvisions sdk.Dec
Expand Down