Skip to content

Commit 4a43279

Browse files
authored
imp!: add encoding type as argument to ICA encoding/decoding functions (#3967)
1 parent 3559e58 commit 4a43279

File tree

18 files changed

+49
-49
lines changed

18 files changed

+49
-49
lines changed

e2e/tests/interchain_accounts/base_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (s *InterchainAccountsTestSuite) TestMsgSendTx_SuccessfulTransfer() {
9797
}
9898

9999
cdc := testsuite.Codec()
100-
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend})
100+
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend}, icatypes.EncodingProtobuf)
101101
s.Require().NoError(err)
102102

103103
packetData := icatypes.InterchainAccountPacketData{
@@ -189,7 +189,7 @@ func (s *InterchainAccountsTestSuite) TestMsgSendTx_FailedTransfer_InsufficientF
189189
}
190190

191191
cdc := testsuite.Codec()
192-
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend})
192+
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend}, icatypes.EncodingProtobuf)
193193
s.Require().NoError(err)
194194

195195
packetData := icatypes.InterchainAccountPacketData{
@@ -295,7 +295,7 @@ func (s *InterchainAccountsTestSuite) TestMsgSendTx_SuccessfulTransfer_AfterReop
295295

296296
cdc := testsuite.Codec()
297297

298-
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend})
298+
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend}, icatypes.EncodingProtobuf)
299299
s.Require().NoError(err)
300300

301301
packetData := icatypes.InterchainAccountPacketData{
@@ -370,7 +370,7 @@ func (s *InterchainAccountsTestSuite) TestMsgSendTx_SuccessfulTransfer_AfterReop
370370

371371
cdc := testsuite.Codec()
372372

373-
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend})
373+
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend}, icatypes.EncodingProtobuf)
374374
s.Require().NoError(err)
375375

376376
packetData := icatypes.InterchainAccountPacketData{

e2e/tests/interchain_accounts/gov_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (s *InterchainAccountsGovTestSuite) TestInterchainAccountsGovIntegration()
9090
}
9191

9292
cdc := testsuite.Codec()
93-
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgBankSend})
93+
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgBankSend}, icatypes.EncodingProtobuf)
9494
s.Require().NoError(err)
9595

9696
packetData := icatypes.InterchainAccountPacketData{

e2e/tests/interchain_accounts/groups_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func (s *InterchainAccountsGroupsTestSuite) TestInterchainAccountsGroupsIntegrat
162162

163163
cdc := testsuite.Codec()
164164

165-
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgBankSend})
165+
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgBankSend}, icatypes.EncodingProtobuf)
166166
s.Require().NoError(err)
167167

168168
packetData := icatypes.InterchainAccountPacketData{

e2e/tests/interchain_accounts/incentivized_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func (s *IncentivizedInterchainAccountsTestSuite) TestMsgSendTx_SuccessfulBankSe
140140
}
141141

142142
cdc := testsuite.Codec()
143-
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend})
143+
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend}, icatypes.EncodingProtobuf)
144144
s.Require().NoError(err)
145145

146146
packetData := icatypes.InterchainAccountPacketData{
@@ -309,7 +309,7 @@ func (s *IncentivizedInterchainAccountsTestSuite) TestMsgSendTx_FailedBankSend_I
309309
}
310310

311311
cdc := testsuite.Codec()
312-
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend})
312+
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend}, icatypes.EncodingProtobuf)
313313
s.Require().NoError(err)
314314

315315
packetData := icatypes.InterchainAccountPacketData{

e2e/tests/interchain_accounts/localhost_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func (s *LocalhostInterchainAccountsTestSuite) TestInterchainAccounts_Localhost(
140140
}
141141

142142
cdc := testsuite.Codec()
143-
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend})
143+
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend}, icatypes.EncodingProtobuf)
144144
s.Require().NoError(err)
145145

146146
packetData := icatypes.InterchainAccountPacketData{
@@ -297,7 +297,7 @@ func (s *LocalhostInterchainAccountsTestSuite) TestInterchainAccounts_ReopenChan
297297
}
298298

299299
cdc := testsuite.Codec()
300-
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend})
300+
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend}, icatypes.EncodingProtobuf)
301301
s.Require().NoError(err)
302302

303303
packetData := icatypes.InterchainAccountPacketData{
@@ -425,7 +425,7 @@ func (s *LocalhostInterchainAccountsTestSuite) TestInterchainAccounts_ReopenChan
425425
}
426426

427427
cdc := testsuite.Codec()
428-
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend})
428+
bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend}, icatypes.EncodingProtobuf)
429429
s.Require().NoError(err)
430430

431431
packetData := icatypes.InterchainAccountPacketData{

e2e/tests/upgrades/upgrade_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ func (s *UpgradeTestSuite) TestV5ToV6ChainUpgrade() {
408408
Amount: sdk.NewCoins(testvalues.DefaultTransferAmount(chainB.Config().Denom)),
409409
}
410410

411-
data, err := icatypes.SerializeCosmosTx(testsuite.Codec(), []proto.Message{msgSend})
411+
data, err := icatypes.SerializeCosmosTx(testsuite.Codec(), []proto.Message{msgSend}, icatypes.EncodingProtobuf)
412412
s.Require().NoError(err)
413413

414414
icaPacketData := icatypes.InterchainAccountPacketData{

modules/apps/27-interchain-accounts/controller/keeper/msg_server_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func (suite *KeeperTestSuite) TestSubmitTx() {
171171
Amount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(100))),
172172
}
173173

174-
data, err := icatypes.SerializeCosmosTx(suite.chainA.Codec, []proto.Message{icaMsg})
174+
data, err := icatypes.SerializeCosmosTx(suite.chainA.Codec, []proto.Message{icaMsg}, icatypes.EncodingProtobuf)
175175
suite.Require().NoError(err)
176176

177177
packetData := icatypes.InterchainAccountPacketData{

modules/apps/27-interchain-accounts/controller/keeper/relay_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (suite *KeeperTestSuite) TestSendTx() {
3838
Amount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(100))),
3939
}
4040

41-
data, err := icatypes.SerializeCosmosTx(suite.chainB.GetSimApp().AppCodec(), []proto.Message{msg})
41+
data, err := icatypes.SerializeCosmosTx(suite.chainB.GetSimApp().AppCodec(), []proto.Message{msg}, icatypes.EncodingProtobuf)
4242
suite.Require().NoError(err)
4343

4444
packetData = icatypes.InterchainAccountPacketData{
@@ -67,7 +67,7 @@ func (suite *KeeperTestSuite) TestSendTx() {
6767
},
6868
}
6969

70-
data, err := icatypes.SerializeCosmosTx(suite.chainB.GetSimApp().AppCodec(), msgsBankSend)
70+
data, err := icatypes.SerializeCosmosTx(suite.chainB.GetSimApp().AppCodec(), msgsBankSend, icatypes.EncodingProtobuf)
7171
suite.Require().NoError(err)
7272

7373
packetData = icatypes.InterchainAccountPacketData{
@@ -125,7 +125,7 @@ func (suite *KeeperTestSuite) TestSendTx() {
125125
Amount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(100))),
126126
}
127127

128-
data, err := icatypes.SerializeCosmosTx(suite.chainB.GetSimApp().AppCodec(), []proto.Message{msg})
128+
data, err := icatypes.SerializeCosmosTx(suite.chainB.GetSimApp().AppCodec(), []proto.Message{msg}, icatypes.EncodingProtobuf)
129129
suite.Require().NoError(err)
130130

131131
packetData = icatypes.InterchainAccountPacketData{

modules/apps/27-interchain-accounts/controller/types/msgs_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func TestMsgSendTxValidateBasic(t *testing.T) {
143143
Amount: ibctesting.TestCoins,
144144
}
145145

146-
data, err := icatypes.SerializeCosmosTx(simapp.MakeTestEncodingConfig().Codec, []proto.Message{msgBankSend})
146+
data, err := icatypes.SerializeCosmosTx(simapp.MakeTestEncodingConfig().Codec, []proto.Message{msgBankSend}, icatypes.EncodingProtobuf)
147147
require.NoError(t, err)
148148

149149
packetData := icatypes.InterchainAccountPacketData{
@@ -179,7 +179,7 @@ func TestMsgSendTxGetSigners(t *testing.T) {
179179
Amount: ibctesting.TestCoins,
180180
}
181181

182-
data, err := icatypes.SerializeCosmosTx(simapp.MakeTestEncodingConfig().Codec, []proto.Message{msgBankSend})
182+
data, err := icatypes.SerializeCosmosTx(simapp.MakeTestEncodingConfig().Codec, []proto.Message{msgBankSend}, icatypes.EncodingProtobuf)
183183
require.NoError(t, err)
184184

185185
packetData := icatypes.InterchainAccountPacketData{

modules/apps/27-interchain-accounts/host/client/cli/tx.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func convertBytesIntoProtoMessages(cdc *codec.ProtoCodec, msgBytes []byte) ([]pr
130130

131131
// generateIcaPacketDataFromProtoMessages generates ica packet data as bytes from a given set of proto encoded sdk messages and a memo.
132132
func generateIcaPacketDataFromProtoMessages(cdc *codec.ProtoCodec, sdkMessages []proto.Message, memo string) ([]byte, error) {
133-
icaPacketDataBytes, err := icatypes.SerializeCosmosTx(cdc, sdkMessages)
133+
icaPacketDataBytes, err := icatypes.SerializeCosmosTx(cdc, sdkMessages, icatypes.EncodingProtobuf)
134134
if err != nil {
135135
return nil, err
136136
}

modules/apps/27-interchain-accounts/host/client/cli/tx_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func TestGeneratePacketData(t *testing.T) {
125125
require.Equal(t, tc.memo, packetData.Memo)
126126

127127
data := packetData.Data
128-
messages, err := icatypes.DeserializeCosmosTx(cdc, data)
128+
messages, err := icatypes.DeserializeCosmosTx(cdc, data, icatypes.EncodingProtobuf)
129129

130130
require.NoError(t, err)
131131
require.NotNil(t, messages)

modules/apps/27-interchain-accounts/host/ibc_module_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ func (suite *InterchainAccountsTestSuite) TestOnRecvPacket() {
446446
ToAddress: suite.chainB.SenderAccount.GetAddress().String(),
447447
Amount: amount,
448448
}
449-
data, err := icatypes.SerializeCosmosTx(suite.chainA.Codec, []proto.Message{msg})
449+
data, err := icatypes.SerializeCosmosTx(suite.chainA.Codec, []proto.Message{msg}, icatypes.EncodingProtobuf)
450450
suite.Require().NoError(err)
451451

452452
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -655,7 +655,7 @@ func (suite *InterchainAccountsTestSuite) TestControlAccountAfterChannelClose()
655655
Amount: tokenAmt,
656656
}
657657

658-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
658+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg}, icatypes.EncodingProtobuf)
659659
suite.Require().NoError(err)
660660

661661
icaPacketData := icatypes.InterchainAccountPacketData{

modules/apps/27-interchain-accounts/host/keeper/keeper.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
// Keeper defines the IBC interchain accounts host keeper
2525
type Keeper struct {
2626
storeKey storetypes.StoreKey
27-
cdc codec.BinaryCodec
27+
cdc codec.Codec
2828
legacySubspace paramtypes.Subspace
2929

3030
ics4Wrapper porttypes.ICS4Wrapper
@@ -43,7 +43,7 @@ type Keeper struct {
4343

4444
// NewKeeper creates a new interchain accounts host Keeper instance
4545
func NewKeeper(
46-
cdc codec.BinaryCodec, key storetypes.StoreKey, legacySubspace paramtypes.Subspace,
46+
cdc codec.Codec, key storetypes.StoreKey, legacySubspace paramtypes.Subspace,
4747
ics4Wrapper porttypes.ICS4Wrapper, channelKeeper icatypes.ChannelKeeper, portKeeper icatypes.PortKeeper,
4848
accountKeeper icatypes.AccountKeeper, scopedKeeper exported.ScopedKeeper, msgRouter icatypes.MessageRouter,
4949
authority string,

modules/apps/27-interchain-accounts/host/keeper/relay.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet) ([]byt
2626

2727
switch data.Type {
2828
case icatypes.EXECUTE_TX:
29-
msgs, err := icatypes.DeserializeCosmosTx(k.cdc, data.Data)
29+
msgs, err := icatypes.DeserializeCosmosTx(k.cdc, data.Data, icatypes.EncodingProtobuf)
3030
if err != nil {
3131
return nil, errorsmod.Wrapf(err, "failed to deserialize interchain account transaction")
3232
}

modules/apps/27-interchain-accounts/host/keeper/relay_test.go

+14-14
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
5959
Option: govtypes.OptionYes,
6060
}
6161

62-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
62+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg}, icatypes.EncodingProtobuf)
6363
suite.Require().NoError(err)
6464

6565
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -86,7 +86,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
8686
Amount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(100))),
8787
}
8888

89-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
89+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg}, icatypes.EncodingProtobuf)
9090
suite.Require().NoError(err)
9191

9292
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -114,7 +114,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
114114
Amount: sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(5000)),
115115
}
116116

117-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
117+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg}, icatypes.EncodingProtobuf)
118118
suite.Require().NoError(err)
119119

120120
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -148,7 +148,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
148148
Amount: sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(5000)),
149149
}
150150

151-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msgDelegate, msgUndelegate})
151+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msgDelegate, msgUndelegate}, icatypes.EncodingProtobuf)
152152
suite.Require().NoError(err)
153153

154154
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -183,7 +183,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
183183
Proposer: interchainAccountAddr,
184184
}
185185

186-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
186+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg}, icatypes.EncodingProtobuf)
187187
suite.Require().NoError(err)
188188

189189
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -225,7 +225,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
225225
Option: govtypes.OptionYes,
226226
}
227227

228-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
228+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg}, icatypes.EncodingProtobuf)
229229
suite.Require().NoError(err)
230230

231231
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -251,7 +251,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
251251
Depositor: interchainAccountAddr,
252252
}
253253

254-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
254+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg}, icatypes.EncodingProtobuf)
255255
suite.Require().NoError(err)
256256

257257
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -277,7 +277,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
277277
WithdrawAddress: suite.chainB.SenderAccount.GetAddress().String(),
278278
}
279279

280-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
280+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg}, icatypes.EncodingProtobuf)
281281
suite.Require().NoError(err)
282282

283283
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -316,7 +316,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
316316
TimeoutTimestamp: uint64(0),
317317
}
318318

319-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
319+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg}, icatypes.EncodingProtobuf)
320320
suite.Require().NoError(err)
321321

322322
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -336,7 +336,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
336336
func() {
337337
msg := &banktypes.MsgSendResponse{}
338338

339-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
339+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg}, icatypes.EncodingProtobuf)
340340
suite.Require().NoError(err)
341341

342342
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -375,7 +375,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
375375
{
376376
"invalid packet type - UNSPECIFIED",
377377
func() {
378-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{&banktypes.MsgSend{}})
378+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{&banktypes.MsgSend{}}, icatypes.EncodingProtobuf)
379379
suite.Require().NoError(err)
380380

381381
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -392,7 +392,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
392392
func() {
393393
path.EndpointA.ChannelConfig.PortID = "invalid-port-id"
394394

395-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{&banktypes.MsgSend{}})
395+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{&banktypes.MsgSend{}}, icatypes.EncodingProtobuf)
396396
suite.Require().NoError(err)
397397

398398
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -413,7 +413,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
413413
Amount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(100))),
414414
}
415415

416-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
416+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg}, icatypes.EncodingProtobuf)
417417
suite.Require().NoError(err)
418418

419419
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -434,7 +434,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
434434
Amount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(100))),
435435
}
436436

437-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
437+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg}, icatypes.EncodingProtobuf)
438438
suite.Require().NoError(err)
439439

440440
icaPacketData := icatypes.InterchainAccountPacketData{

modules/apps/27-interchain-accounts/types/codec.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
2828
// SerializeCosmosTx serializes a slice of sdk.Msg's using the CosmosTx type. The sdk.Msg's are
2929
// packed into Any's and inserted into the Messages field of a CosmosTx. The proto marshaled CosmosTx
3030
// bytes are returned. Only the ProtoCodec is supported for serializing messages.
31-
func SerializeCosmosTx(cdc codec.BinaryCodec, msgs []proto.Message) (bz []byte, err error) {
31+
func SerializeCosmosTx(cdc codec.BinaryCodec, msgs []proto.Message, encoding string) (bz []byte, err error) {
3232
// only ProtoCodec is supported
3333
if _, ok := cdc.(*codec.ProtoCodec); !ok {
3434
return nil, errorsmod.Wrap(ErrInvalidCodec, "only ProtoCodec is supported for receiving messages on the host chain")
@@ -58,7 +58,7 @@ func SerializeCosmosTx(cdc codec.BinaryCodec, msgs []proto.Message) (bz []byte,
5858
// DeserializeCosmosTx unmarshals and unpacks a slice of transaction bytes
5959
// into a slice of sdk.Msg's. Only the ProtoCodec is supported for message
6060
// deserialization.
61-
func DeserializeCosmosTx(cdc codec.BinaryCodec, data []byte) ([]sdk.Msg, error) {
61+
func DeserializeCosmosTx(cdc codec.BinaryCodec, data []byte, encoding string) ([]sdk.Msg, error) {
6262
// only ProtoCodec is supported
6363
if _, ok := cdc.(*codec.ProtoCodec); !ok {
6464
return nil, errorsmod.Wrap(ErrInvalidCodec, "only ProtoCodec is supported for receiving messages on the host chain")

0 commit comments

Comments
 (0)