Skip to content

Commit 88fe2d3

Browse files
committed
Add tests on x/collection CreateContract
1 parent 9608448 commit 88fe2d3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

x/collection/keeper/msg_server_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ func (s *KeeperTestSuite) TestMsgCreateContract() {
377377
}{
378378
"valid request": {
379379
owner: s.vendor,
380+
events: sdk.Events{sdk.Event{Type:"create_collection", Attributes:[]abci.EventAttribute{abci.EventAttribute{Key:[]uint8{0x6e, 0x61, 0x6d, 0x65}, Value:[]uint8{}, Index:false}, abci.EventAttribute{Key:[]uint8{0x6d, 0x65, 0x74, 0x61}, Value:[]uint8{}, Index:false}, abci.EventAttribute{Key:[]uint8{0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64}, Value:[]uint8{0x33, 0x33, 0x33, 0x36, 0x62, 0x37, 0x36, 0x66}, Index:false}, abci.EventAttribute{Key:[]uint8{0x6f, 0x77, 0x6e, 0x65, 0x72}, Value:[]uint8{0x6c, 0x69, 0x6e, 0x6b, 0x31, 0x76, 0x39, 0x6a, 0x78, 0x67, 0x75, 0x6e, 0x39, 0x77, 0x64, 0x65, 0x6e, 0x71, 0x61, 0x32, 0x78, 0x7a, 0x66, 0x78}, Index:false}, abci.EventAttribute{Key:[]uint8{0x62, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x69}, Value:[]uint8{}, Index:false}}}, sdk.Event{Type:"lbm.collection.v1.EventCreatedContract", Attributes:[]abci.EventAttribute{abci.EventAttribute{Key:[]uint8{0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64}, Value:[]uint8{0x22, 0x33, 0x33, 0x33, 0x36, 0x62, 0x37, 0x36, 0x66, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72}, Value:[]uint8{0x22, 0x6c, 0x69, 0x6e, 0x6b, 0x31, 0x76, 0x39, 0x6a, 0x78, 0x67, 0x75, 0x6e, 0x39, 0x77, 0x64, 0x65, 0x6e, 0x71, 0x61, 0x32, 0x78, 0x7a, 0x66, 0x78, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x6d, 0x65, 0x74, 0x61}, Value:[]uint8{0x22, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x6e, 0x61, 0x6d, 0x65}, Value:[]uint8{0x22, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x75, 0x72, 0x69}, Value:[]uint8{0x22, 0x22}, Index:false}}}, sdk.Event{Type:"grant_perm", Attributes:[]abci.EventAttribute{abci.EventAttribute{Key:[]uint8{0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64}, Value:[]uint8{0x33, 0x33, 0x33, 0x36, 0x62, 0x37, 0x36, 0x66}, Index:false}, abci.EventAttribute{Key:[]uint8{0x74, 0x6f}, Value:[]uint8{0x6c, 0x69, 0x6e, 0x6b, 0x31, 0x76, 0x39, 0x6a, 0x78, 0x67, 0x75, 0x6e, 0x39, 0x77, 0x64, 0x65, 0x6e, 0x71, 0x61, 0x32, 0x78, 0x7a, 0x66, 0x78}, Index:false}}}, sdk.Event{Type:"grant_perm", Attributes:[]abci.EventAttribute{abci.EventAttribute{Key:[]uint8{0x70, 0x65, 0x72, 0x6d}, Value:[]uint8{0x69, 0x73, 0x73, 0x75, 0x65}, Index:false}}}, sdk.Event{Type:"lbm.collection.v1.EventGranted", Attributes:[]abci.EventAttribute{abci.EventAttribute{Key:[]uint8{0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64}, Value:[]uint8{0x22, 0x33, 0x33, 0x33, 0x36, 0x62, 0x37, 0x36, 0x66, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65}, Value:[]uint8{0x22, 0x6c, 0x69, 0x6e, 0x6b, 0x31, 0x76, 0x39, 0x6a, 0x78, 0x67, 0x75, 0x6e, 0x39, 0x77, 0x64, 0x65, 0x6e, 0x71, 0x61, 0x32, 0x78, 0x7a, 0x66, 0x78, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72}, Value:[]uint8{0x22, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e}, Value:[]uint8{0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x22}, Index:false}}}, sdk.Event{Type:"grant_perm", Attributes:[]abci.EventAttribute{abci.EventAttribute{Key:[]uint8{0x70, 0x65, 0x72, 0x6d}, Value:[]uint8{0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79}, Index:false}}}, sdk.Event{Type:"lbm.collection.v1.EventGranted", Attributes:[]abci.EventAttribute{abci.EventAttribute{Key:[]uint8{0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64}, Value:[]uint8{0x22, 0x33, 0x33, 0x33, 0x36, 0x62, 0x37, 0x36, 0x66, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65}, Value:[]uint8{0x22, 0x6c, 0x69, 0x6e, 0x6b, 0x31, 0x76, 0x39, 0x6a, 0x78, 0x67, 0x75, 0x6e, 0x39, 0x77, 0x64, 0x65, 0x6e, 0x71, 0x61, 0x32, 0x78, 0x7a, 0x66, 0x78, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72}, Value:[]uint8{0x22, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e}, Value:[]uint8{0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x59, 0x22}, Index:false}}}, sdk.Event{Type:"grant_perm", Attributes:[]abci.EventAttribute{abci.EventAttribute{Key:[]uint8{0x70, 0x65, 0x72, 0x6d}, Value:[]uint8{0x6d, 0x69, 0x6e, 0x74}, Index:false}}}, sdk.Event{Type:"lbm.collection.v1.EventGranted", Attributes:[]abci.EventAttribute{abci.EventAttribute{Key:[]uint8{0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64}, Value:[]uint8{0x22, 0x33, 0x33, 0x33, 0x36, 0x62, 0x37, 0x36, 0x66, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65}, Value:[]uint8{0x22, 0x6c, 0x69, 0x6e, 0x6b, 0x31, 0x76, 0x39, 0x6a, 0x78, 0x67, 0x75, 0x6e, 0x39, 0x77, 0x64, 0x65, 0x6e, 0x71, 0x61, 0x32, 0x78, 0x7a, 0x66, 0x78, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72}, Value:[]uint8{0x22, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e}, Value:[]uint8{0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x49, 0x4e, 0x54, 0x22}, Index:false}}}, sdk.Event{Type:"grant_perm", Attributes:[]abci.EventAttribute{abci.EventAttribute{Key:[]uint8{0x70, 0x65, 0x72, 0x6d}, Value:[]uint8{0x62, 0x75, 0x72, 0x6e}, Index:false}}}, sdk.Event{Type:"lbm.collection.v1.EventGranted", Attributes:[]abci.EventAttribute{abci.EventAttribute{Key:[]uint8{0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64}, Value:[]uint8{0x22, 0x33, 0x33, 0x33, 0x36, 0x62, 0x37, 0x36, 0x66, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65}, Value:[]uint8{0x22, 0x6c, 0x69, 0x6e, 0x6b, 0x31, 0x76, 0x39, 0x6a, 0x78, 0x67, 0x75, 0x6e, 0x39, 0x77, 0x64, 0x65, 0x6e, 0x71, 0x61, 0x32, 0x78, 0x7a, 0x66, 0x78, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72}, Value:[]uint8{0x22, 0x22}, Index:false}, abci.EventAttribute{Key:[]uint8{0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e}, Value:[]uint8{0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x52, 0x4e, 0x22}, Index:false}}}},
380381
},
381382
}
382383

@@ -395,9 +396,9 @@ func (s *KeeperTestSuite) TestMsgCreateContract() {
395396

396397
s.Require().NotNil(res)
397398

398-
// if s.deterministic {
399-
// s.Require().Equal(tc.events, ctx.EventManager().Events())
400-
// }
399+
if s.deterministic {
400+
s.Require().Equal(tc.events, ctx.EventManager().Events())
401+
}
401402
})
402403
}
403404
}

0 commit comments

Comments
 (0)