github.com/cosmos/cosmos-sdk@v0.50.10/x/distribution/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  	govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
    10  )
    11  
    12  // RegisterLegacyAminoCodec registers the necessary x/distribution interfaces
    13  // and concrete types on the provided LegacyAmino codec. These types are used
    14  // for Amino JSON serialization.
    15  func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
    16  	legacy.RegisterAminoMsg(cdc, &MsgWithdrawDelegatorReward{}, "cosmos-sdk/MsgWithdrawDelegationReward")
    17  	legacy.RegisterAminoMsg(cdc, &MsgWithdrawValidatorCommission{}, "cosmos-sdk/MsgWithdrawValCommission")
    18  	legacy.RegisterAminoMsg(cdc, &MsgSetWithdrawAddress{}, "cosmos-sdk/MsgModifyWithdrawAddress")
    19  	legacy.RegisterAminoMsg(cdc, &MsgFundCommunityPool{}, "cosmos-sdk/MsgFundCommunityPool")
    20  	legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/distribution/MsgUpdateParams")
    21  	legacy.RegisterAminoMsg(cdc, &MsgCommunityPoolSpend{}, "cosmos-sdk/distr/MsgCommunityPoolSpend")
    22  	legacy.RegisterAminoMsg(cdc, &MsgDepositValidatorRewardsPool{}, "cosmos-sdk/distr/MsgDepositValRewards")
    23  
    24  	cdc.RegisterConcrete(Params{}, "cosmos-sdk/x/distribution/Params", nil)
    25  }
    26  
    27  func RegisterInterfaces(registry types.InterfaceRegistry) {
    28  	registry.RegisterImplementations(
    29  		(*sdk.Msg)(nil),
    30  		&MsgWithdrawDelegatorReward{},
    31  		&MsgWithdrawValidatorCommission{},
    32  		&MsgSetWithdrawAddress{},
    33  		&MsgFundCommunityPool{},
    34  		&MsgUpdateParams{},
    35  		&MsgCommunityPoolSpend{},
    36  		&MsgDepositValidatorRewardsPool{},
    37  	)
    38  
    39  	registry.RegisterImplementations(
    40  		(*govtypes.Content)(nil),
    41  		&CommunityPoolSpendProposal{},
    42  	)
    43  
    44  	msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
    45  }