2018-06-26 19:00:12 -07:00
|
|
|
package types
|
|
|
|
|
|
|
|
import (
|
2018-09-13 11:17:32 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
2022-02-22 03:03:01 -08:00
|
|
|
"github.com/cosmos/cosmos-sdk/codec/legacy"
|
2020-05-05 07:28:20 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/codec/types"
|
2020-07-23 19:45:34 -07:00
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
2020-10-28 12:20:45 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
2021-05-06 11:23:48 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/x/authz"
|
2018-06-26 19:00:12 -07:00
|
|
|
)
|
|
|
|
|
2020-09-07 07:47:12 -07:00
|
|
|
// RegisterLegacyAminoCodec registers the necessary x/staking interfaces and concrete types
|
|
|
|
// on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
|
|
|
|
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
2020-06-03 12:52:05 -07:00
|
|
|
cdc.RegisterConcrete(&MsgCreateValidator{}, "cosmos-sdk/MsgCreateValidator", nil)
|
|
|
|
cdc.RegisterConcrete(&MsgEditValidator{}, "cosmos-sdk/MsgEditValidator", nil)
|
|
|
|
cdc.RegisterConcrete(&MsgDelegate{}, "cosmos-sdk/MsgDelegate", nil)
|
|
|
|
cdc.RegisterConcrete(&MsgUndelegate{}, "cosmos-sdk/MsgUndelegate", nil)
|
|
|
|
cdc.RegisterConcrete(&MsgBeginRedelegate{}, "cosmos-sdk/MsgBeginRedelegate", nil)
|
2022-02-22 03:03:01 -08:00
|
|
|
|
|
|
|
cdc.RegisterInterface((*isStakeAuthorization_Validators)(nil), nil)
|
|
|
|
cdc.RegisterConcrete(&StakeAuthorization_AllowList{}, "cosmos-sdk/StakeAuthorization/AllowList", nil)
|
|
|
|
cdc.RegisterConcrete(&StakeAuthorization_DenyList{}, "cosmos-sdk/StakeAuthorization/DenyList", nil)
|
|
|
|
cdc.RegisterConcrete(&StakeAuthorization{}, "cosmos-sdk/StakeAuthorization", nil)
|
2018-06-26 19:00:12 -07:00
|
|
|
}
|
|
|
|
|
2020-07-23 19:45:34 -07:00
|
|
|
// RegisterInterfaces registers the x/staking interfaces types with the interface registry
|
|
|
|
func RegisterInterfaces(registry types.InterfaceRegistry) {
|
|
|
|
registry.RegisterImplementations((*sdk.Msg)(nil),
|
|
|
|
&MsgCreateValidator{},
|
|
|
|
&MsgEditValidator{},
|
|
|
|
&MsgDelegate{},
|
|
|
|
&MsgUndelegate{},
|
|
|
|
&MsgBeginRedelegate{},
|
|
|
|
)
|
2021-05-06 11:23:48 -07:00
|
|
|
registry.RegisterImplementations(
|
|
|
|
(*authz.Authorization)(nil),
|
|
|
|
&StakeAuthorization{},
|
|
|
|
)
|
2020-10-28 12:20:45 -07:00
|
|
|
|
|
|
|
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
2020-07-23 19:45:34 -07:00
|
|
|
}
|
|
|
|
|
2020-02-18 04:50:13 -08:00
|
|
|
func init() {
|
2022-02-22 03:03:01 -08:00
|
|
|
RegisterLegacyAminoCodec(legacy.Cdc)
|
2018-06-26 19:00:12 -07:00
|
|
|
}
|