@@ -29,11 +29,11 @@ func (suite *KeeperTestSuite) TestTrySendTx() {
29
29
"success" , func () {
30
30
amount , _ := sdk .ParseCoinsNormalized ("100stake" )
31
31
interchainAccountAddr , _ := suite .chainB .GetSimApp ().ICAKeeper .GetInterchainAccountAddress (suite .chainB .GetContext (), path .EndpointA .ChannelConfig .PortID )
32
- msg = & banktypes.MsgSend {FromAddress : interchainAccountAddr , ToAddress : suite .chainB .SenderAccount .GetAddress ().String (), Amount : amount }
32
+ msg = []sdk. Msg { & banktypes.MsgSend {FromAddress : interchainAccountAddr , ToAddress : suite .chainB .SenderAccount .GetAddress ().String (), Amount : amount } }
33
33
}, true ,
34
34
},
35
35
{
36
- "success with [] sdk.Message " , func () {
36
+ "success with multiple sdk.Msg " , func () {
37
37
amount , _ := sdk .ParseCoinsNormalized ("100stake" )
38
38
interchainAccountAddr , _ := suite .chainB .GetSimApp ().ICAKeeper .GetInterchainAccountAddress (suite .chainB .GetContext (), path .EndpointA .ChannelConfig .PortID )
39
39
msg1 := & banktypes.MsgSend {FromAddress : interchainAccountAddr , ToAddress : suite .chainB .SenderAccount .GetAddress ().String (), Amount : amount }
@@ -46,6 +46,13 @@ func (suite *KeeperTestSuite) TestTrySendTx() {
46
46
msg = []byte {}
47
47
}, false ,
48
48
},
49
+ {
50
+ "incorrect outgoing data - []sdk.Msg is not used" , func () {
51
+ amount , _ := sdk .ParseCoinsNormalized ("100stake" )
52
+ interchainAccountAddr , _ := suite .chainB .GetSimApp ().ICAKeeper .GetInterchainAccountAddress (suite .chainB .GetContext (), path .EndpointA .ChannelConfig .PortID )
53
+ msg = & banktypes.MsgSend {FromAddress : interchainAccountAddr , ToAddress : suite .chainB .SenderAccount .GetAddress ().String (), Amount : amount }
54
+ }, false ,
55
+ },
49
56
{
50
57
"active channel not found" , func () {
51
58
amount , _ := sdk .ParseCoinsNormalized ("100stake" )
@@ -122,7 +129,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
122
129
interchainAccountAddr , _ := suite .chainB .GetSimApp ().ICAKeeper .GetInterchainAccountAddress (suite .chainB .GetContext (), path .EndpointA .ChannelConfig .PortID )
123
130
msg = & banktypes.MsgSend {FromAddress : interchainAccountAddr , ToAddress : suite .chainB .SenderAccount .GetAddress ().String (), Amount : amount }
124
131
// build packet data
125
- txBytes , err := suite .chainA .GetSimApp ().ICAKeeper .SerializeCosmosTx (suite .chainA .Codec , msg )
132
+ txBytes , err := suite .chainA .GetSimApp ().ICAKeeper .SerializeCosmosTx (suite .chainA .Codec , []sdk. Msg { msg } )
126
133
suite .Require ().NoError (err )
127
134
128
135
data := types.InterchainAccountPacketData {Type : types .EXECUTE_TX ,
@@ -165,7 +172,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
165
172
// Incorrect FromAddress
166
173
msg = & banktypes.MsgSend {FromAddress : suite .chainB .SenderAccount .GetAddress ().String (), ToAddress : suite .chainB .SenderAccount .GetAddress ().String (), Amount : amount }
167
174
// build packet data
168
- txBytes , err := suite .chainA .GetSimApp ().ICAKeeper .SerializeCosmosTx (suite .chainA .Codec , msg )
175
+ txBytes , err := suite .chainA .GetSimApp ().ICAKeeper .SerializeCosmosTx (suite .chainA .Codec , []sdk. Msg { msg } )
169
176
suite .Require ().NoError (err )
170
177
data := types.InterchainAccountPacketData {Type : types .EXECUTE_TX ,
171
178
Data : txBytes }
0 commit comments