Skip to content

Commit

Permalink
test: add missing check
Browse files Browse the repository at this point in the history
  • Loading branch information
dadamu committed Jun 28, 2023
1 parent 6334a79 commit 2b64be8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions x/tokenfactory/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func (suite *KeeperTestSuite) TestMsgServer_CreateDenom() {
shouldErr bool
expResponse *types.MsgCreateDenomResponse
expEvents sdk.Events
check func(ctx sdk.Context)
}{
{
name: "subspace does not exist returns error",
Expand Down Expand Up @@ -174,6 +175,16 @@ func (suite *KeeperTestSuite) TestMsgServer_CreateDenom() {
sdk.NewAttribute(types.AttributeNewTokenDenom, "factory/cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47/uminttoken"),
),
},
check: func(ctx sdk.Context) {
suite.Require().Equal(
types.DenomAuthorityMetadata{Admin: "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"},
suite.k.GetAuthorityMetadata(ctx, "factory/cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47/uminttoken"),
)
suite.Require().Equal(
[]string{"factory/cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47/uminttoken"},
suite.k.GetDenomsFromCreator(ctx, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"),
)
},
},
}

Expand All @@ -193,6 +204,9 @@ func (suite *KeeperTestSuite) TestMsgServer_CreateDenom() {
suite.Require().NoError(err)
suite.Require().Equal(tc.expResponse, res)
suite.Require().Equal(tc.expEvents, ctx.EventManager().Events())
if tc.check != nil {
tc.check(ctx)
}
}
})
}
Expand Down Expand Up @@ -943,6 +957,9 @@ func (suite *KeeperTestSuite) TestMsgServer_UpdateParams() {
} else {
suite.Require().NoError(err)
suite.Require().Equal(tc.expEvents, ctx.EventManager().Events())
if tc.check != nil {
tc.check(ctx)
}
}
})
}
Expand Down

0 comments on commit 2b64be8

Please sign in to comment.