github.com/cosmos/cosmos-sdk@v0.50.10/x/staking/types/codec.go (about) 1 package types 2 3 import ( 4 "github.com/cosmos/cosmos-sdk/codec" 5 "github.com/cosmos/cosmos-sdk/codec/legacy" 6 "github.com/cosmos/cosmos-sdk/codec/types" 7 sdk "github.com/cosmos/cosmos-sdk/types" 8 "github.com/cosmos/cosmos-sdk/types/msgservice" 9 "github.com/cosmos/cosmos-sdk/x/authz" 10 ) 11 12 // RegisterLegacyAminoCodec registers the necessary x/staking interfaces and concrete types 13 // on the provided LegacyAmino codec. These types are used for Amino JSON serialization. 14 func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { 15 legacy.RegisterAminoMsg(cdc, &MsgCreateValidator{}, "cosmos-sdk/MsgCreateValidator") 16 legacy.RegisterAminoMsg(cdc, &MsgEditValidator{}, "cosmos-sdk/MsgEditValidator") 17 legacy.RegisterAminoMsg(cdc, &MsgDelegate{}, "cosmos-sdk/MsgDelegate") 18 legacy.RegisterAminoMsg(cdc, &MsgUndelegate{}, "cosmos-sdk/MsgUndelegate") 19 legacy.RegisterAminoMsg(cdc, &MsgBeginRedelegate{}, "cosmos-sdk/MsgBeginRedelegate") 20 legacy.RegisterAminoMsg(cdc, &MsgCancelUnbondingDelegation{}, "cosmos-sdk/MsgCancelUnbondingDelegation") 21 legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/x/staking/MsgUpdateParams") 22 23 cdc.RegisterInterface((*isStakeAuthorization_Validators)(nil), nil) 24 cdc.RegisterConcrete(&StakeAuthorization_AllowList{}, "cosmos-sdk/StakeAuthorization/AllowList", nil) 25 cdc.RegisterConcrete(&StakeAuthorization_DenyList{}, "cosmos-sdk/StakeAuthorization/DenyList", nil) 26 cdc.RegisterConcrete(&StakeAuthorization{}, "cosmos-sdk/StakeAuthorization", nil) 27 cdc.RegisterConcrete(Params{}, "cosmos-sdk/x/staking/Params", nil) 28 } 29 30 // RegisterInterfaces registers the x/staking interfaces types with the interface registry 31 func RegisterInterfaces(registry types.InterfaceRegistry) { 32 registry.RegisterImplementations((*sdk.Msg)(nil), 33 &MsgCreateValidator{}, 34 &MsgEditValidator{}, 35 &MsgDelegate{}, 36 &MsgUndelegate{}, 37 &MsgBeginRedelegate{}, 38 &MsgCancelUnbondingDelegation{}, 39 &MsgUpdateParams{}, 40 ) 41 registry.RegisterImplementations( 42 (*authz.Authorization)(nil), 43 &StakeAuthorization{}, 44 ) 45 46 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) 47 }