2018-10-05 03:41:38 -07:00
|
|
|
package types
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
2020-05-05 07:28:20 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/codec/types"
|
2020-06-04 03:38:24 -07:00
|
|
|
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
2020-05-19 13:17:29 -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-06-13 02:07:51 -07:00
|
|
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
2018-10-05 03:41:38 -07:00
|
|
|
)
|
|
|
|
|
2020-09-07 07:47:12 -07:00
|
|
|
// RegisterLegacyAminoCodec registers the necessary x/distribution 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(&MsgWithdrawDelegatorReward{}, "cosmos-sdk/MsgWithdrawDelegationReward", nil)
|
|
|
|
cdc.RegisterConcrete(&MsgWithdrawValidatorCommission{}, "cosmos-sdk/MsgWithdrawValidatorCommission", nil)
|
|
|
|
cdc.RegisterConcrete(&MsgSetWithdrawAddress{}, "cosmos-sdk/MsgModifyWithdrawAddress", nil)
|
|
|
|
cdc.RegisterConcrete(&MsgFundCommunityPool{}, "cosmos-sdk/MsgFundCommunityPool", nil)
|
2020-04-14 12:05:14 -07:00
|
|
|
cdc.RegisterConcrete(&CommunityPoolSpendProposal{}, "cosmos-sdk/CommunityPoolSpendProposal", nil)
|
2018-10-05 03:41:38 -07:00
|
|
|
}
|
|
|
|
|
2020-05-19 13:17:29 -07:00
|
|
|
func RegisterInterfaces(registry types.InterfaceRegistry) {
|
|
|
|
registry.RegisterImplementations(
|
|
|
|
(*sdk.Msg)(nil),
|
|
|
|
&MsgWithdrawDelegatorReward{},
|
|
|
|
&MsgWithdrawValidatorCommission{},
|
|
|
|
&MsgSetWithdrawAddress{},
|
2020-07-30 11:58:26 -07:00
|
|
|
&MsgFundCommunityPool{},
|
2020-05-19 13:17:29 -07:00
|
|
|
)
|
|
|
|
registry.RegisterImplementations(
|
2020-06-13 02:07:51 -07:00
|
|
|
(*govtypes.Content)(nil),
|
2020-05-19 13:17:29 -07:00
|
|
|
&CommunityPoolSpendProposal{},
|
|
|
|
)
|
2020-10-28 12:20:45 -07:00
|
|
|
|
|
|
|
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
2020-05-19 13:17:29 -07:00
|
|
|
}
|
|
|
|
|
2020-02-18 04:50:13 -08:00
|
|
|
var (
|
2020-09-07 07:47:12 -07:00
|
|
|
amino = codec.NewLegacyAmino()
|
2020-02-18 04:50:13 -08:00
|
|
|
|
|
|
|
// ModuleCdc references the global x/distribution module codec. Note, the codec
|
|
|
|
// should ONLY be used in certain instances of tests and for JSON encoding as Amino
|
|
|
|
// is still used for that purpose.
|
|
|
|
//
|
|
|
|
// The actual codec used for serialization should be provided to x/distribution and
|
|
|
|
// defined at the application level.
|
2020-08-13 06:20:02 -07:00
|
|
|
ModuleCdc = codec.NewAminoCodec(amino)
|
2020-02-18 04:50:13 -08:00
|
|
|
)
|
2018-10-05 03:41:38 -07:00
|
|
|
|
|
|
|
func init() {
|
2020-09-07 07:47:12 -07:00
|
|
|
RegisterLegacyAminoCodec(amino)
|
2020-06-04 03:38:24 -07:00
|
|
|
cryptocodec.RegisterCrypto(amino)
|
2020-02-18 04:50:13 -08:00
|
|
|
amino.Seal()
|
2018-10-05 03:41:38 -07:00
|
|
|
}
|