diff --git a/x/registry/types/codec.go b/x/registry/types/codec.go index 0d68a5f6..3c0b1923 100644 --- a/x/registry/types/codec.go +++ b/x/registry/types/codec.go @@ -11,7 +11,6 @@ import ( // RegisterLegacyAminoCodec registers the necessary x/bond interfaces and concrete types // on the provided LegacyAmino codec. These types are used for Amino JSON serialization. func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - // legacy.RegisterAminoMsg(cdc, &MsgSetRecord{}, "registry/SetRecord") cdc.RegisterConcrete(&MsgSetName{}, "registry/SetName", nil) cdc.RegisterConcrete(&MsgReserveAuthority{}, "registry/ReserveAuthority", nil) @@ -24,10 +23,6 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgDissociateBond{}, "registry/DissociateBond", nil) cdc.RegisterConcrete(&MsgDissociateRecords{}, "registry/DissociateRecords", nil) cdc.RegisterConcrete(&MsgReAssociateRecords{}, "registry/ReassociateRecords", nil) - - cdc.RegisterInterface((*Attributes)(nil), nil) - cdc.RegisterConcrete(&WebsiteRegistrationRecord{}, "registry/WebsiteRegistrationRecord", nil) - cdc.RegisterConcrete(&ServiceProviderRegistration{}, "registry/ServiceProviderRegistration", nil) } func RegisterInterfaces(registry types.InterfaceRegistry) { diff --git a/x/registry/types/record_msg.go b/x/registry/types/record_msg.go index 4d7d4dbc..b30344c0 100644 --- a/x/registry/types/record_msg.go +++ b/x/registry/types/record_msg.go @@ -1,11 +1,9 @@ package types import ( + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" ) var ( @@ -16,9 +14,6 @@ var ( _ sdk.Msg = &MsgDissociateRecords{} _ sdk.Msg = &MsgReAssociateRecords{} - // // For amino support. - _ legacytx.LegacyMsg = &MsgSetRecord{} - _ cdctypes.UnpackInterfacesMessage = &MsgSetRecord{} ) @@ -67,27 +62,8 @@ func (msg MsgSetRecord) GetSignBytes() []byte { // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces func (msg MsgSetRecord) UnpackInterfaces(unpacker cdctypes.AnyUnpacker) error { - x := msg.Payload.Record.Attributes - switch x.TypeUrl { - case "/vulcanize.registry.v1beta1.WebsiteRegistrationRecord": - { - var attr WebsiteRegistrationRecord - err := unpacker.UnpackAny(x, &attr) - if err != nil { - return err - } - } - case "/vulcanize.registry.v1beta1.ServiceProviderRegistration": - { - var attr ServiceProviderRegistration - err := unpacker.UnpackAny(x, &attr) - if err != nil { - return err - } - } - } - - return nil + var attr Attributes + return unpacker.UnpackAny(msg.Payload.Record.Attributes, &attr) } // NewMsgRenewRecord is the constructor function for MsgRenewRecord.