Skip to content

Commit 5260c77

Browse files
authoredOct 27, 2022
refactor!: allow for serialization of proto message without fulfillment of sdk.Msg interface (#2607)
## Description ref: #2397 --- Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why. - [x] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [x] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/building-modules/10-structure.md). - [x] Wrote unit and integration [tests](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#testing) - [x] Updated relevant documentation (`docs/`) or specification (`x/<module>/spec/`) - [x] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). - [x] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md` - [x] Re-reviewed `Files changed` in the Github PR explorer - [x] Review `Codecov Report` in the comment section below once CI passes
1 parent eab24e8 commit 5260c77

File tree

12 files changed

+94
-53
lines changed

12 files changed

+94
-53
lines changed
 

‎CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
4242

4343
### API Breaking
4444

45+
* (apps/27-interchain-accounts) [\#2607](https://github.com/cosmos/ibc-go/pull/2607) `SerializeCosmosTx` now takes in a `[]proto.Message` instead of `[]sdk.Msg`.
4546
* (apps/transfer) [\#2446](https://github.com/cosmos/ibc-go/pull/2446) Remove `SendTransfer` function in favor of a private `sendTransfer` function. All IBC transfers must be initiated with `MsgTransfer`.
4647
* (apps/29-fee) [\#2395](https://github.com/cosmos/ibc-go/pull/2395) Remove param space from ics29 NewKeeper function. The field was unused.
4748
* (apps/27-interchain-accounts) [\#2133](https://github.com/cosmos/ibc-go/pull/2133) Generates genesis protos in a separate directory to avoid circular import errors. The protobuf package name has changed for the genesis types.

‎docs/apps/interchain-accounts/auth-modules.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ if !found {
241241
// The appropriate serialization function should be called. The host chain must be able to deserialize the transaction.
242242
// If the host chain is using the ibc-go host module, `SerializeCosmosTx` should be used.
243243
msg := &banktypes.MsgSend{FromAddress: fromAddr, ToAddress: toAddr, Amount: amt}
244-
data, err := icatypes.SerializeCosmosTx(keeper.cdc, []sdk.Msg{msg})
244+
data, err := icatypes.SerializeCosmosTx(keeper.cdc, []proto.Message{msg})
245245
if err != nil {
246246
return err
247247
}

‎docs/migrations/v5-to-v6.md

+2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ func DefaultParams() Params {
123123

124124
#### API breaking changes
125125

126+
`SerializeCosmosTx` takes in a `[]proto.Message` instead of `[]sdk.Message`. This allows for the serialization of proto messages without requiring the fulfillment of the `sdk.Msg` interface.
127+
126128
The `27-interchain-accounts` genesis types have been moved to their own package: `modules/apps/27-interchain-acccounts/genesis/types`.
127129
This change facilitates the addition of the ICS27 controller submodule `MsgServer` and avoids cyclic imports. This should have minimal disruption to chain developers integrating `27-interchain-accounts`.
128130

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55

66
sdk "github.com/cosmos/cosmos-sdk/types"
77
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
8+
"github.com/gogo/protobuf/proto"
89

910
"github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller/keeper"
1011
"github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller/types"
@@ -167,7 +168,7 @@ func (suite *KeeperTestSuite) TestSubmitTx() {
167168
Amount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))),
168169
}
169170

170-
data, err := icatypes.SerializeCosmosTx(suite.chainA.Codec, []sdk.Msg{icaMsg})
171+
data, err := icatypes.SerializeCosmosTx(suite.chainA.Codec, []proto.Message{icaMsg})
171172
suite.Require().NoError(err)
172173

173174
packetData := icatypes.InterchainAccountPacketData{

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package keeper_test
33
import (
44
sdk "github.com/cosmos/cosmos-sdk/types"
55
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
6+
"github.com/gogo/protobuf/proto"
67

78
icatypes "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/types"
89
clienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"
@@ -34,7 +35,7 @@ func (suite *KeeperTestSuite) TestSendTx() {
3435
Amount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))),
3536
}
3637

37-
data, err := icatypes.SerializeCosmosTx(suite.chainB.GetSimApp().AppCodec(), []sdk.Msg{msg})
38+
data, err := icatypes.SerializeCosmosTx(suite.chainB.GetSimApp().AppCodec(), []proto.Message{msg})
3839
suite.Require().NoError(err)
3940

4041
packetData = icatypes.InterchainAccountPacketData{
@@ -50,7 +51,7 @@ func (suite *KeeperTestSuite) TestSendTx() {
5051
interchainAccountAddr, found := suite.chainA.GetSimApp().ICAControllerKeeper.GetInterchainAccountAddress(suite.chainA.GetContext(), ibctesting.FirstConnectionID, path.EndpointA.ChannelConfig.PortID)
5152
suite.Require().True(found)
5253

53-
msgsBankSend := []sdk.Msg{
54+
msgsBankSend := []proto.Message{
5455
&banktypes.MsgSend{
5556
FromAddress: interchainAccountAddr,
5657
ToAddress: suite.chainB.SenderAccount.GetAddress().String(),
@@ -121,7 +122,7 @@ func (suite *KeeperTestSuite) TestSendTx() {
121122
Amount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))),
122123
}
123124

124-
data, err := icatypes.SerializeCosmosTx(suite.chainB.GetSimApp().AppCodec(), []sdk.Msg{msg})
125+
data, err := icatypes.SerializeCosmosTx(suite.chainB.GetSimApp().AppCodec(), []proto.Message{msg})
125126
suite.Require().NoError(err)
126127

127128
packetData = icatypes.InterchainAccountPacketData{

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55

66
sdk "github.com/cosmos/cosmos-sdk/types"
77
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
8+
"github.com/gogo/protobuf/proto"
89
"github.com/stretchr/testify/require"
910

1011
"github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller/types"
@@ -155,7 +156,7 @@ func TestMsgSendTxValidateBasic(t *testing.T) {
155156
Amount: ibctesting.TestCoins,
156157
}
157158

158-
data, err := icatypes.SerializeCosmosTx(simapp.MakeTestEncodingConfig().Marshaler, []sdk.Msg{msgBankSend})
159+
data, err := icatypes.SerializeCosmosTx(simapp.MakeTestEncodingConfig().Marshaler, []proto.Message{msgBankSend})
159160
require.NoError(t, err)
160161

161162
packetData := icatypes.InterchainAccountPacketData{
@@ -191,7 +192,7 @@ func TestMsgSendTxGetSigners(t *testing.T) {
191192
Amount: ibctesting.TestCoins,
192193
}
193194

194-
data, err := icatypes.SerializeCosmosTx(simapp.MakeTestEncodingConfig().Marshaler, []sdk.Msg{msgBankSend})
195+
data, err := icatypes.SerializeCosmosTx(simapp.MakeTestEncodingConfig().Marshaler, []proto.Message{msgBankSend})
195196
require.NoError(t, err)
196197

197198
packetData := icatypes.InterchainAccountPacketData{

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

+9-8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/cosmos/cosmos-sdk/codec"
99
sdk "github.com/cosmos/cosmos-sdk/types"
1010
"github.com/cosmos/cosmos-sdk/version"
11+
"github.com/gogo/protobuf/proto"
1112
"github.com/spf13/cobra"
1213

1314
icatypes "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/types"
@@ -90,17 +91,17 @@ which submits pre-built packet data containing messages to be executed on the ho
9091
// generatePacketData takes in message bytes and a memo and serializes the message into an
9192
// instance of InterchainAccountPacketData which is returned as bytes.
9293
func generatePacketData(cdc *codec.ProtoCodec, msgBytes []byte, memo string) ([]byte, error) {
93-
sdkMessages, err := convertBytesIntoSdkMessages(cdc, msgBytes)
94+
protoMessages, err := convertBytesIntoProtoMessages(cdc, msgBytes)
9495
if err != nil {
9596
return nil, err
9697
}
9798

98-
return generateIcaPacketDataFromSdkMessages(cdc, sdkMessages, memo)
99+
return generateIcaPacketDataFromProtoMessages(cdc, protoMessages, memo)
99100
}
100101

101-
// convertBytesIntoSdkMessages returns a list of sdk messages from bytes. The bytes can be in the form of a single
102+
// convertBytesIntoProtoMessages returns a list of proto messages from bytes. The bytes can be in the form of a single
102103
// message, or a json array of messages.
103-
func convertBytesIntoSdkMessages(cdc *codec.ProtoCodec, msgBytes []byte) ([]sdk.Msg, error) {
104+
func convertBytesIntoProtoMessages(cdc *codec.ProtoCodec, msgBytes []byte) ([]proto.Message, error) {
104105
var rawMessages []json.RawMessage
105106
if err := json.Unmarshal(msgBytes, &rawMessages); err != nil {
106107
// if we fail to unmarshal a list of messages, we assume we are just dealing with a single message.
@@ -110,10 +111,10 @@ func convertBytesIntoSdkMessages(cdc *codec.ProtoCodec, msgBytes []byte) ([]sdk.
110111
return nil, err
111112
}
112113

113-
return []sdk.Msg{msg}, nil
114+
return []proto.Message{msg}, nil
114115
}
115116

116-
sdkMessages := make([]sdk.Msg, len(rawMessages))
117+
sdkMessages := make([]proto.Message, len(rawMessages))
117118
for i, anyJSON := range rawMessages {
118119
var msg sdk.Msg
119120
if err := cdc.UnmarshalInterfaceJSON(anyJSON, &msg); err != nil {
@@ -126,8 +127,8 @@ func convertBytesIntoSdkMessages(cdc *codec.ProtoCodec, msgBytes []byte) ([]sdk.
126127
return sdkMessages, nil
127128
}
128129

129-
// generateIcaPacketDataFromSdkMessages generates ica packet data as bytes from a given set of sdk messages and a memo.
130-
func generateIcaPacketDataFromSdkMessages(cdc *codec.ProtoCodec, sdkMessages []sdk.Msg, memo string) ([]byte, error) {
130+
// generateIcaPacketDataFromProtoMessages generates ica packet data as bytes from a given set of proto encoded sdk messages and a memo.
131+
func generateIcaPacketDataFromProtoMessages(cdc *codec.ProtoCodec, sdkMessages []proto.Message, memo string) ([]byte, error) {
131132
icaPacketDataBytes, err := icatypes.SerializeCosmosTx(cdc, sdkMessages)
132133
if err != nil {
133134
return nil, err

‎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, []sdk.Msg{msg})
449+
data, err := icatypes.SerializeCosmosTx(suite.chainA.Codec, []proto.Message{msg})
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(), []sdk.Msg{msg})
658+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
659659
suite.Require().NoError(err)
660660

661661
icaPacketData := icatypes.InterchainAccountPacketData{

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

+34-13
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
99
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
1010
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
11+
"github.com/gogo/protobuf/proto"
1112

1213
"github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/host/types"
1314
icatypes "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/types"
@@ -55,7 +56,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
5556
Option: govtypes.OptionYes,
5657
}
5758

58-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []sdk.Msg{msg})
59+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
5960
suite.Require().NoError(err)
6061

6162
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -82,7 +83,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
8283
Amount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))),
8384
}
8485

85-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []sdk.Msg{msg})
86+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
8687
suite.Require().NoError(err)
8788

8889
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -110,7 +111,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
110111
Amount: sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(5000)),
111112
}
112113

113-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []sdk.Msg{msg})
114+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
114115
suite.Require().NoError(err)
115116

116117
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -144,7 +145,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
144145
Amount: sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(5000)),
145146
}
146147

147-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []sdk.Msg{msgDelegate, msgUndelegate})
148+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msgDelegate, msgUndelegate})
148149
suite.Require().NoError(err)
149150

150151
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -179,7 +180,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
179180
Proposer: interchainAccountAddr,
180181
}
181182

182-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []sdk.Msg{msg})
183+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
183184
suite.Require().NoError(err)
184185

185186
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -221,7 +222,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
221222
Option: govtypes.OptionYes,
222223
}
223224

224-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []sdk.Msg{msg})
225+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
225226
suite.Require().NoError(err)
226227

227228
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -247,7 +248,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
247248
Depositor: interchainAccountAddr,
248249
}
249250

250-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []sdk.Msg{msg})
251+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
251252
suite.Require().NoError(err)
252253

253254
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -273,7 +274,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
273274
WithdrawAddress: suite.chainB.SenderAccount.GetAddress().String(),
274275
}
275276

276-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []sdk.Msg{msg})
277+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
277278
suite.Require().NoError(err)
278279

279280
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -312,7 +313,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
312313
TimeoutTimestamp: uint64(0),
313314
}
314315

315-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []sdk.Msg{msg})
316+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
316317
suite.Require().NoError(err)
317318

318319
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -327,6 +328,26 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
327328
},
328329
true,
329330
},
331+
{
332+
"unregistered sdk.Msg",
333+
func() {
334+
msg := &banktypes.MsgSendResponse{}
335+
336+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
337+
suite.Require().NoError(err)
338+
339+
icaPacketData := icatypes.InterchainAccountPacketData{
340+
Type: icatypes.EXECUTE_TX,
341+
Data: data,
342+
}
343+
344+
packetData = icaPacketData.GetBytes()
345+
346+
params := types.NewParams(true, []string{"/" + proto.MessageName(msg)})
347+
suite.chainB.GetSimApp().ICAHostKeeper.SetParams(suite.chainB.GetContext(), params)
348+
},
349+
false,
350+
},
330351
{
331352
"cannot unmarshal interchain account packet data",
332353
func() {
@@ -351,7 +372,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
351372
{
352373
"invalid packet type - UNSPECIFIED",
353374
func() {
354-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []sdk.Msg{&banktypes.MsgSend{}})
375+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{&banktypes.MsgSend{}})
355376
suite.Require().NoError(err)
356377

357378
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -368,7 +389,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
368389
func() {
369390
path.EndpointA.ChannelConfig.PortID = "invalid-port-id"
370391

371-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []sdk.Msg{&banktypes.MsgSend{}})
392+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{&banktypes.MsgSend{}})
372393
suite.Require().NoError(err)
373394

374395
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -389,7 +410,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
389410
Amount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))),
390411
}
391412

392-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []sdk.Msg{msg})
413+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
393414
suite.Require().NoError(err)
394415

395416
icaPacketData := icatypes.InterchainAccountPacketData{
@@ -410,7 +431,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() {
410431
Amount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))),
411432
}
412433

413-
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []sdk.Msg{msg})
434+
data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []proto.Message{msg})
414435
suite.Require().NoError(err)
415436

416437
icaPacketData := icatypes.InterchainAccountPacketData{

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
sdk "github.com/cosmos/cosmos-sdk/types"
77
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
88
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
9+
"github.com/gogo/protobuf/proto"
910
)
1011

1112
// ModuleCdc references the global interchain accounts module codec. Note, the codec
@@ -25,7 +26,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
2526
// SerializeCosmosTx serializes a slice of sdk.Msg's using the CosmosTx type. The sdk.Msg's are
2627
// packed into Any's and inserted into the Messages field of a CosmosTx. The proto marshaled CosmosTx
2728
// bytes are returned. Only the ProtoCodec is supported for serializing messages.
28-
func SerializeCosmosTx(cdc codec.BinaryCodec, msgs []sdk.Msg) (bz []byte, err error) {
29+
func SerializeCosmosTx(cdc codec.BinaryCodec, msgs []proto.Message) (bz []byte, err error) {
2930
// only ProtoCodec is supported
3031
if _, ok := cdc.(*codec.ProtoCodec); !ok {
3132
return nil, sdkerrors.Wrap(ErrInvalidCodec, "only ProtoCodec is supported for receiving messages on the host chain")

0 commit comments

Comments
 (0)
Please sign in to comment.