Skip to content

Commit

Permalink
refactor positive test case code
Browse files Browse the repository at this point in the history
  • Loading branch information
nir1218 committed Jan 8, 2022
1 parent 5c96dd8 commit 135650e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions modules/apps/transfer/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,20 +171,14 @@ func (suite *KeeperTestSuite) TestQueryDenomHash() {
"not found denom trace",
func() {
req = &types.QueryDenomHashRequest{
Trace: reqTrace.GetFullDenomPath(),
Trace: "transfer/channelToC/uatom",
}
},
false,
},
{
"success",
func() {
suite.chainA.GetSimApp().TransferKeeper.SetDenomTrace(suite.chainA.GetContext(), reqTrace)

req = &types.QueryDenomHashRequest{
Trace: reqTrace.GetFullDenomPath(),
}
},
func() {},
true,
},
}
Expand All @@ -193,6 +187,11 @@ func (suite *KeeperTestSuite) TestQueryDenomHash() {
suite.Run(fmt.Sprintf("Case %s", tc.msg), func() {
suite.SetupTest() // reset

req = &types.QueryDenomHashRequest{
Trace: reqTrace.GetFullDenomPath(),
}
suite.chainA.GetSimApp().TransferKeeper.SetDenomTrace(suite.chainA.GetContext(), reqTrace)

tc.malleate()
ctx := sdk.WrapSDKContext(suite.chainA.GetContext())

Expand Down

0 comments on commit 135650e

Please sign in to comment.