Skip to content

Commit 2631cc0

Browse files
committed
style
1 parent 09444dd commit 2631cc0

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

ibc_test.go

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,16 @@ func TestIBCHandshake(t *testing.T) {
127127
res, _, err := vm.IBCChannelConnect(checksum, env, connectMsg, store, *goapi, querier, gasMeter2, TESTING_GAS_LIMIT, deserCost)
128128
require.NoError(t, err)
129129
require.Equal(t, 1, len(res.Messages))
130-
require.Equal(t, 1, len(res.Events))
131-
event := res.Events[0]
132-
require.Equal(t, "ibc", event.Type)
133-
require.Equal(t, 1, len(event.Attributes))
134-
attr := event.Attributes[0]
135-
require.Equal(t, "channel", attr.Key)
136-
require.Equal(t, "connect", attr.Value)
130+
131+
// check for the expected custom event
132+
expected_events := []types.Event{types.Event{
133+
Type: "ibc",
134+
Attributes: []types.EventAttribute{types.EventAttribute{
135+
Key: "channel",
136+
Value: "connect",
137+
}},
138+
}}
139+
require.Equal(t, expected_events, res.Events)
137140

138141
// make sure it read the balance properly and we got 250 atoms
139142
dispatch := res.Messages[0].Msg
@@ -259,14 +262,15 @@ func TestIBCPacketDispatch(t *testing.T) {
259262
err = json.Unmarshal(pres2.Acknowledgement, &ack2)
260263
require.Equal(t, "invalid packet: cosmwasm_std::addresses::Addr not found", ack2.Err)
261264

262-
// check for the emitted custom event
263-
require.Equal(t, 1, len(pres2.Events))
264-
event := pres2.Events[0]
265-
require.Equal(t, "ibc", event.Type)
266-
require.Equal(t, 1, len(event.Attributes))
267-
attr := event.Attributes[0]
268-
require.Equal(t, "packet", attr.Key)
269-
require.Equal(t, "receive", attr.Value)
265+
// check for the expected custom event
266+
expected_events := []types.Event{types.Event{
267+
Type: "ibc",
268+
Attributes: []types.EventAttribute{types.EventAttribute{
269+
Key: "packet",
270+
Value: "receive",
271+
}},
272+
}}
273+
require.Equal(t, expected_events, pres2.Events)
270274
}
271275

272276
func TestAnalyzeCode(t *testing.T) {

0 commit comments

Comments
 (0)