Rename GovCodec to gov.Codec

This commit is contained in:
Aaron Craelius 2020-02-17 14:21:07 -05:00
parent e8155d67d0
commit 3919645e8b
3 changed files with 11 additions and 18 deletions

View File

@ -26,7 +26,7 @@ type Keeper struct {
storeKey sdk.StoreKey
// The codec codec for binary encoding/decoding.
cdc types.GovCodec
cdc types.Codec
// Proposal router
router types.Router
@ -40,7 +40,7 @@ type Keeper struct {
//
// CONTRACT: the parameter Subspace must have the param key table already initialized
func NewKeeper(
cdc types.GovCodec, key sdk.StoreKey, paramSpace types.ParamSubspace,
cdc types.Codec, key sdk.StoreKey, paramSpace types.ParamSubspace,
supplyKeeper types.SupplyKeeper, sk types.StakingKeeper, rtr types.Router,
) Keeper {

View File

@ -4,6 +4,14 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
)
type Codec interface {
codec.Marshaler
MarshalProposal(p Proposal) ([]byte, error)
UnmarshalProposal(bz []byte, ptr *Proposal) error
}
// module codec
var ModuleCdc = codec.New()
@ -31,12 +39,6 @@ func init() {
RegisterCodec(ModuleCdc)
}
type GovCodec interface {
codec.Marshaler
MarshalProposal(p Proposal) ([]byte, error)
UnmarshalProposal(bz []byte, ptr *Proposal) error
}
type AminoGovCodec struct {
codec.Marshaler
amino *codec.Codec
@ -54,4 +56,4 @@ func (a AminoGovCodec) UnmarshalProposal(bz []byte, ptr *Proposal) error {
return a.amino.UnmarshalBinaryBare(bz, ptr)
}
var _ GovCodec = AminoGovCodec{}
var _ Codec = AminoGovCodec{}

View File

@ -11,15 +11,6 @@ option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = false;
option (gogoproto.goproto_getters_all) = false;
message MsgCommon {
option (cosmos_proto.interface_type) = "github.com/cosmos/cosmos-sdk/types.Msg";
option (gogoproto.stringer) = true;
oneof sum {
MsgDeposit gov_deposit = 1;
MsgVote gov_vote = 2;
}
}
message MsgSubmitProposalBase {
option (gogoproto.stringer) = true;
repeated cosmos_sdk.v1.Coin intial_deposit = 1 [(gogoproto.nullable) = false