github.com/cosmos/cosmos-sdk@v0.50.10/x/gov/types/v1beta1/codec.go (about)

     1  package v1beta1
     2  
     3  import (
     4  	"github.com/cosmos/cosmos-sdk/codec"
     5  	"github.com/cosmos/cosmos-sdk/codec/legacy"
     6  	codectypes "github.com/cosmos/cosmos-sdk/codec/types"
     7  	sdk "github.com/cosmos/cosmos-sdk/types"
     8  	"github.com/cosmos/cosmos-sdk/types/msgservice"
     9  )
    10  
    11  // RegisterLegacyAminoCodec registers all the necessary types and interfaces for the
    12  // governance module.
    13  func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
    14  	cdc.RegisterInterface((*Content)(nil), nil)
    15  	legacy.RegisterAminoMsg(cdc, &MsgSubmitProposal{}, "cosmos-sdk/MsgSubmitProposal")
    16  	legacy.RegisterAminoMsg(cdc, &MsgDeposit{}, "cosmos-sdk/MsgDeposit")
    17  	legacy.RegisterAminoMsg(cdc, &MsgVote{}, "cosmos-sdk/MsgVote")
    18  	legacy.RegisterAminoMsg(cdc, &MsgVoteWeighted{}, "cosmos-sdk/MsgVoteWeighted")
    19  	cdc.RegisterConcrete(&TextProposal{}, "cosmos-sdk/TextProposal", nil)
    20  }
    21  
    22  // RegisterInterfaces registers the interfaces types with the Interface Registry.
    23  func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
    24  	registry.RegisterImplementations((*sdk.Msg)(nil),
    25  		&MsgSubmitProposal{},
    26  		&MsgVote{},
    27  		&MsgVoteWeighted{},
    28  		&MsgDeposit{},
    29  	)
    30  	registry.RegisterInterface(
    31  		"cosmos.gov.v1beta1.Content",
    32  		(*Content)(nil),
    33  		&TextProposal{},
    34  	)
    35  
    36  	msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
    37  }