Skip to content

Commit

Permalink
Update other tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0Tech committed Aug 11, 2023
1 parent 29bf70d commit 2afab69
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client/grpc/tmservice/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (s IntegrationTestSuite) TestQueryBlockResultsByHeight() {
s.Require().Equal(0, len(txResult))

beginBlock := blockResultsRes.GetResBeginBlock()
s.Require().Equal(11, len(beginBlock.Events)) // coinbase event (6) + transfer mintModule to feeCollectorName(5)
s.Require().Equal(9, len(beginBlock.Events)) // coinbase event (6) + transfer mintModule to feeCollectorName(3)

endBlock := blockResultsRes.GetResEndBlock()
s.Require().Equal(0, len(endBlock.Events))
Expand Down
8 changes: 4 additions & 4 deletions x/auth/tx/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ func (s IntegrationTestSuite) TestSimulateTx_GRPC() {
// Check the result and gas used are correct.
//
// NOTE(0Tech): This comment should be updated after applying #11985.
// Events from the antehandlers would not be included in the simulation. The 5 events are:
// - Sending Amount to recipient: coin_spent, coin_received, transfer and message.sender=<val1>
// Events from the antehandlers would not be included in the simulation. The 4 events are:
// - Sending Amount to recipient: coin_spent, coin_received and transfer
// - Msg events: message.module=bank, message.action=/cosmos.bank.v1beta1.MsgSend and message.sender=<val1> (in one message)
s.Require().Equal(5, len(res.GetResult().GetEvents()))
s.Require().Equal(4, len(res.GetResult().GetEvents()))
s.Require().True(res.GetGasInfo().GetGasUsed() > 0) // Gas used sometimes change, just check it's not empty.
}
})
Expand Down Expand Up @@ -191,7 +191,7 @@ func (s IntegrationTestSuite) TestSimulateTx_GRPCGateway() {
err = val.ClientCtx.Codec.UnmarshalJSON(res, &result)
s.Require().NoError(err)
// Check the result and gas used are correct.
s.Require().Equal(5, len(result.GetResult().GetEvents())) // See TestSimulateTx_GRPC for the 5 events.
s.Require().Equal(4, len(result.GetResult().GetEvents())) // See TestSimulateTx_GRPC for the 4 events.
s.Require().True(result.GetGasInfo().GetGasUsed() > 0) // Gas used sometimes change, just check it's not empty.
}
})
Expand Down
3 changes: 1 addition & 2 deletions x/authz/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,12 @@ func (s *TestSuite) TestDispatchedEvents() {
events := s.ctx.EventManager().Events()

// get last 5 events (events that occur *after* the grant)
events = events[len(events)-5:]
events = events[len(events)-4:]

requiredEvents := map[string]bool{
"coin_spent": false,
"coin_received": false,
"transfer": false,
"message": false,
}
for _, e := range events {
requiredEvents[e.Type] = true
Expand Down

0 comments on commit 2afab69

Please sign in to comment.