2019-10-10 08:53:30 -07:00
|
|
|
package types
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
2020-05-20 12:21:00 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/codec/types"
|
2020-09-08 09:09:50 -07:00
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
2020-10-28 12:20:45 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
2020-05-20 12:21:00 -07:00
|
|
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
2019-10-10 08:53:30 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/x/auth/vesting/exported"
|
|
|
|
)
|
|
|
|
|
2020-09-07 07:47:12 -07:00
|
|
|
// RegisterLegacyAminoCodec registers the vesting interfaces and concrete types on the
|
|
|
|
// provided LegacyAmino codec. These types are used for Amino JSON serialization
|
|
|
|
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
2019-10-10 08:53:30 -07:00
|
|
|
cdc.RegisterInterface((*exported.VestingAccount)(nil), nil)
|
|
|
|
cdc.RegisterConcrete(&BaseVestingAccount{}, "cosmos-sdk/BaseVestingAccount", nil)
|
|
|
|
cdc.RegisterConcrete(&ContinuousVestingAccount{}, "cosmos-sdk/ContinuousVestingAccount", nil)
|
|
|
|
cdc.RegisterConcrete(&DelayedVestingAccount{}, "cosmos-sdk/DelayedVestingAccount", nil)
|
|
|
|
cdc.RegisterConcrete(&PeriodicVestingAccount{}, "cosmos-sdk/PeriodicVestingAccount", nil)
|
2021-04-21 09:18:28 -07:00
|
|
|
cdc.RegisterConcrete(&PermanentLockedAccount{}, "cosmos-sdk/PermanentLockedAccount", nil)
|
2019-10-10 08:53:30 -07:00
|
|
|
}
|
2020-05-20 12:21:00 -07:00
|
|
|
|
|
|
|
// RegisterInterface associates protoName with AccountI and VestingAccount
|
|
|
|
// Interfaces and creates a registry of it's concrete implementations
|
|
|
|
func RegisterInterfaces(registry types.InterfaceRegistry) {
|
|
|
|
registry.RegisterInterface(
|
2020-08-11 04:49:45 -07:00
|
|
|
"cosmos.vesting.v1beta1.VestingAccount",
|
2020-05-20 12:21:00 -07:00
|
|
|
(*exported.VestingAccount)(nil),
|
|
|
|
&ContinuousVestingAccount{},
|
|
|
|
&DelayedVestingAccount{},
|
|
|
|
&PeriodicVestingAccount{},
|
2021-04-21 09:18:28 -07:00
|
|
|
&PermanentLockedAccount{},
|
2020-05-20 12:21:00 -07:00
|
|
|
)
|
2020-08-11 07:22:30 -07:00
|
|
|
|
2020-05-20 12:21:00 -07:00
|
|
|
registry.RegisterImplementations(
|
|
|
|
(*authtypes.AccountI)(nil),
|
2020-10-15 06:07:59 -07:00
|
|
|
&BaseVestingAccount{},
|
2020-05-20 12:21:00 -07:00
|
|
|
&DelayedVestingAccount{},
|
|
|
|
&ContinuousVestingAccount{},
|
|
|
|
&PeriodicVestingAccount{},
|
2021-04-21 09:18:28 -07:00
|
|
|
&PermanentLockedAccount{},
|
2020-05-20 12:21:00 -07:00
|
|
|
)
|
2020-08-11 07:22:30 -07:00
|
|
|
|
|
|
|
registry.RegisterImplementations(
|
|
|
|
(*authtypes.GenesisAccount)(nil),
|
2020-10-15 06:07:59 -07:00
|
|
|
&BaseVestingAccount{},
|
2020-08-11 07:22:30 -07:00
|
|
|
&DelayedVestingAccount{},
|
|
|
|
&ContinuousVestingAccount{},
|
|
|
|
&PeriodicVestingAccount{},
|
2021-04-21 09:18:28 -07:00
|
|
|
&PermanentLockedAccount{},
|
2020-08-11 07:22:30 -07:00
|
|
|
)
|
2020-09-08 09:09:50 -07:00
|
|
|
|
|
|
|
registry.RegisterImplementations(
|
|
|
|
(*sdk.Msg)(nil),
|
|
|
|
&MsgCreateVestingAccount{},
|
|
|
|
)
|
2020-10-28 12:20:45 -07:00
|
|
|
|
|
|
|
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
2020-05-20 12:21:00 -07:00
|
|
|
}
|
|
|
|
|
2020-09-07 07:47:12 -07:00
|
|
|
var amino = codec.NewLegacyAmino()
|
2020-05-20 12:21:00 -07:00
|
|
|
|
|
|
|
func init() {
|
2020-09-07 07:47:12 -07:00
|
|
|
RegisterLegacyAminoCodec(amino)
|
2020-05-20 12:21:00 -07:00
|
|
|
amino.Seal()
|
|
|
|
}
|