Skip to content

Commit

Permalink
fix: remove codec registration
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-axner committed Mar 23, 2023
1 parent 767c5af commit a02ec51
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 45 deletions.
5 changes: 0 additions & 5 deletions modules/apps/27-interchain-accounts/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ var ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterImplementations((*authtypes.AccountI)(nil), &InterchainAccount{})
registry.RegisterImplementations((*authtypes.GenesisAccount)(nil), &InterchainAccount{})

registry.RegisterImplementations(
(*exported.CallbackPacketData)(nil),
&InterchainAccountPacketData{},
)
}

// SerializeCosmosTx serializes a slice of sdk.Msg's using the CosmosTx type. The sdk.Msg's are
Expand Down
22 changes: 0 additions & 22 deletions modules/apps/27-interchain-accounts/types/codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,6 @@ import (
"github.com/cosmos/ibc-go/v7/testing/simapp"
)

func (suite *TypesTestSuite) TestUnmarshalCallbackPacketData() {
sourceCallbackAddress := "sourceCallbackAddress"

packetData := types.InterchainAccountPacketData{
Type: types.EXECUTE_TX,
Data: []byte("data"),
Memo: fmt.Sprintf("{\"callbacks\": {\"src_callback_address\": \"%s\"}}", sourceCallbackAddress),
}

types.RegisterInterfaces(types.ModuleCdc.InterfaceRegistry())
data, err := types.ModuleCdc.MarshalInterfaceJSON(&packetData)
suite.Require().NoError(err)

var callbackPacketData exported.CallbackPacketData
err = suite.chainA.App.AppCodec().UnmarshalInterfaceJSON(data, &callbackPacketData)
suite.Require().NoError(err, "failed to unmarshal into callback packet data interface")

suite.Require().Equal(sourceCallbackAddress, callbackPacketData.GetSourceCallbackAddress())
suite.Require().Equal("", callbackPacketData.GetDestCallbackAddress())
suite.Require().Equal(uint64(0), callbackPacketData.UserDefinedGasLimit())
}

// mockSdkMsg defines a mock struct, used for testing codec error scenarios
type mockSdkMsg struct{}

Expand Down
5 changes: 0 additions & 5 deletions modules/apps/transfer/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
&TransferAuthorization{},
)

registry.RegisterImplementations(
(*exported.CallbackPacketData)(nil),
&FungibleTokenPacketData{},
)

msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}

Expand Down
13 changes: 0 additions & 13 deletions modules/core/exported/codec.go

This file was deleted.

0 comments on commit a02ec51

Please sign in to comment.