Skip to content

Commit

Permalink
test: feeshare
Browse files Browse the repository at this point in the history
  • Loading branch information
emidev98 committed Oct 12, 2023
1 parent f74b838 commit 762554b
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions x/feeshare/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ import (
)

type GenesisTestSuite struct {
*app_test.AppTestSuite
suite.Suite

ctx sdk.Context

genesis types.GenesisState
app_test.AppTestSuite
}

func TestGenesisTestSuite(t *testing.T) {
Expand All @@ -34,7 +29,9 @@ func (suite *GenesisTestSuite) TestFeeShareInitGenesis() {
}{
{
"default genesis",
suite.genesis,
types.GenesisState{
Params: types.DefaultParams(),
},
false,
},
{
Expand Down Expand Up @@ -85,18 +82,18 @@ func (suite *GenesisTestSuite) TestFeeShareInitGenesis() {

for _, tc := range testCases {
suite.Run(fmt.Sprintf("Case %s", tc.name), func() {
suite.Setup() // reset
suite.AppTestSuite.Setup() // reset

if tc.expPanic {
suite.Require().Panics(func() {
feeshare.InitGenesis(suite.ctx, suite.App.FeeShareKeeper, tc.genesis)
feeshare.InitGenesis(suite.Ctx, suite.App.FeeShareKeeper, tc.genesis)
})
} else {
suite.Require().NotPanics(func() {
feeshare.InitGenesis(suite.ctx, suite.App.FeeShareKeeper, tc.genesis)
feeshare.InitGenesis(suite.Ctx, suite.App.FeeShareKeeper, tc.genesis)
})

params := suite.App.FeeShareKeeper.GetParams(suite.ctx)
params := suite.App.FeeShareKeeper.GetParams(suite.Ctx)
suite.Require().Equal(tc.genesis.Params, params)
}
})
Expand Down

0 comments on commit 762554b

Please sign in to comment.