Skip to content

Commit

Permalink
Add test cases (#7018)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattverse authored Dec 7, 2023
1 parent a5cc4e9 commit f633ec2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions x/tokenfactory/keeper/before_send_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ func (s *KeeperTestSuite) TestBeforeSendHook() {
} else {
s.Require().Error(err, "test: %v", sendTc.desc)
}

// this is a check to ensure bank keeper wired in token factory keeper has hooks properly set
// to check this, we try triggering bank hooks via token factory keeper
for _, coin := range sendTc.msg(denom).Amount {
_, err = s.msgServer.Mint(sdk.WrapSDKContext(s.Ctx), types.NewMsgMint(s.TestAccs[0].String(), sdk.NewInt64Coin(coin.Denom, coin.Amount.Int64())))
if coin.Denom == denom && coin.Amount.Equal(sdk.NewInt(100)) {
s.Require().Error(err, "test: %v", sendTc.desc)
}
}

}
})
}
Expand Down

0 comments on commit f633ec2

Please sign in to comment.