2018-09-13 11:17:32 -07:00
|
|
|
package auth
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
|
|
)
|
|
|
|
|
2019-02-08 13:35:19 -08:00
|
|
|
// RegisterCodec registers concrete types on the codec
|
2018-09-13 11:17:32 -07:00
|
|
|
func RegisterCodec(cdc *codec.Codec) {
|
|
|
|
cdc.RegisterInterface((*Account)(nil), nil)
|
|
|
|
cdc.RegisterConcrete(&BaseAccount{}, "auth/Account", nil)
|
2019-01-17 08:15:13 -08:00
|
|
|
cdc.RegisterInterface((*VestingAccount)(nil), nil)
|
|
|
|
cdc.RegisterConcrete(&BaseVestingAccount{}, "auth/BaseVestingAccount", nil)
|
|
|
|
cdc.RegisterConcrete(&ContinuousVestingAccount{}, "auth/ContinuousVestingAccount", nil)
|
|
|
|
cdc.RegisterConcrete(&DelayedVestingAccount{}, "auth/DelayedVestingAccount", nil)
|
2018-09-13 11:17:32 -07:00
|
|
|
cdc.RegisterConcrete(StdTx{}, "auth/StdTx", nil)
|
|
|
|
}
|
|
|
|
|
2019-02-08 13:35:19 -08:00
|
|
|
// RegisterBaseAccount most users shouldn't use this, but this comes in handy for tests.
|
|
|
|
func RegisterBaseAccount(cdc *codec.Codec) {
|
|
|
|
cdc.RegisterInterface((*Account)(nil), nil)
|
|
|
|
cdc.RegisterInterface((*VestingAccount)(nil), nil)
|
|
|
|
cdc.RegisterConcrete(&BaseAccount{}, "cosmos-sdk/BaseAccount", nil)
|
|
|
|
cdc.RegisterConcrete(&BaseVestingAccount{}, "cosmos-sdk/BaseVestingAccount", nil)
|
|
|
|
cdc.RegisterConcrete(&ContinuousVestingAccount{}, "cosmos-sdk/ContinuousVestingAccount", nil)
|
|
|
|
cdc.RegisterConcrete(&DelayedVestingAccount{}, "cosmos-sdk/DelayedVestingAccount", nil)
|
|
|
|
codec.RegisterCrypto(cdc)
|
|
|
|
}
|
|
|
|
|
2018-09-13 11:17:32 -07:00
|
|
|
var msgCdc = codec.New()
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
RegisterCodec(msgCdc)
|
|
|
|
codec.RegisterCrypto(msgCdc)
|
|
|
|
}
|