From 8c284bfea9aaf6429e7cb6d74482ef9fec258de9 Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Thu, 7 May 2020 21:17:38 +0530 Subject: [PATCH 01/18] Migrate keeper codec to use marshaler --- third_party/proto/cosmos-proto/cosmos.proto | 7 + x/auth/keeper/account.go | 2 +- x/auth/keeper/keeper.go | 26 +- x/auth/types/account.go | 33 +++ x/auth/types/types.pb.go | 296 +++++++++++++++++--- x/auth/types/types.proto | 4 + 6 files changed, 323 insertions(+), 45 deletions(-) diff --git a/third_party/proto/cosmos-proto/cosmos.proto b/third_party/proto/cosmos-proto/cosmos.proto index a59821d4f6b4..1440b98c55f9 100644 --- a/third_party/proto/cosmos-proto/cosmos.proto +++ b/third_party/proto/cosmos-proto/cosmos.proto @@ -7,4 +7,11 @@ option go_package = "github.com/regen-network/cosmos-proto"; extend google.protobuf.MessageOptions { string interface_type = 93001; + + string implements_interface = 93002; +} + +extend google.protobuf.FieldOptions { + string accepts_interface = 93001; + } diff --git a/x/auth/keeper/account.go b/x/auth/keeper/account.go index f2e9292b47c1..cd82894b4aba 100644 --- a/x/auth/keeper/account.go +++ b/x/auth/keeper/account.go @@ -52,7 +52,7 @@ func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc exported.Account) { addr := acc.GetAddress() store := ctx.KVStore(ak.key) - bz, err := ak.cdc.MarshalAccount(acc) + bz, err := ak.MarshalAccount(acc) if err != nil { panic(err) } diff --git a/x/auth/keeper/keeper.go b/x/auth/keeper/keeper.go index 2db0dec2e464..fa9a4e4ca82c 100644 --- a/x/auth/keeper/keeper.go +++ b/x/auth/keeper/keeper.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + "github.com/cosmos/cosmos-sdk/codec" gogotypes "github.com/gogo/protobuf/types" "github.com/tendermint/tendermint/crypto" @@ -18,7 +19,7 @@ import ( // encoding/decoding library. type AccountKeeper struct { key sdk.StoreKey - cdc types.Codec + cdc codec.Marshaler paramSubspace paramtypes.Subspace permAddrs map[string]types.PermissionsForAddress @@ -29,7 +30,7 @@ type AccountKeeper struct { // NewAccountKeeper returns a new sdk.AccountKeeper that uses go-amino to // (binary) encode and decode concrete sdk.Accounts. func NewAccountKeeper( - cdc types.Codec, key sdk.StoreKey, paramstore paramtypes.Subspace, proto func() exported.Account, + cdc codec.Marshaler, key sdk.StoreKey, paramstore paramtypes.Subspace, proto func() exported.Account, maccPerms map[string][]string, ) AccountKeeper { @@ -175,10 +176,29 @@ func (ak AccountKeeper) SetModuleAccount(ctx sdk.Context, macc exported.ModuleAc } func (ak AccountKeeper) decodeAccount(bz []byte) exported.Account { - acc, err := ak.cdc.UnmarshalAccount(bz) + acc, err := ak.UnmarshalAccount(bz) if err != nil { panic(err) } return acc } + +// MarshalEvidence marshals an Evidence interface. If the given type implements +// the Marshaler interface, it is treated as a Proto-defined message and +// serialized that way. Otherwise, it falls back on the internal Amino codec. +func (ak AccountKeeper) MarshalAccount(accountI types.AccountI) ([]byte, error) { + return codec.MarshalAny(ak.cdc, accountI) +} + +// UnmarshalEvidence returns an Evidence interface from raw encoded evidence +// bytes of a Proto-based Evidence type. An error is returned upon decoding +// failure. +func (ak AccountKeeper) UnmarshalAccount(bz []byte) (types.AccountI, error) { + var evi types.AccountI + if err := codec.UnmarshalAny(ak.cdc, &evi, bz); err != nil { + return nil, err + } + + return evi, nil +} diff --git a/x/auth/types/account.go b/x/auth/types/account.go index a01d622fb20f..5588e2ba02d4 100644 --- a/x/auth/types/account.go +++ b/x/auth/types/account.go @@ -285,3 +285,36 @@ func (ma *ModuleAccount) UnmarshalJSON(bz []byte) error { return nil } + +// Account is an interface used to store coins at a given address within state. +// It presumes a notion of sequence numbers for replay protection, +// a notion of account numbers for replay protection for previously pruned accounts, +// and a pubkey for authentication purposes. +// +// Many complex conditions can be used in the concrete struct which implements Account. +type AccountI interface { + GetAddress() sdk.AccAddress + SetAddress(sdk.AccAddress) error // errors if already set. + + GetPubKey() crypto.PubKey // can return nil. + SetPubKey(crypto.PubKey) error + + GetAccountNumber() uint64 + SetAccountNumber(uint64) error + + GetSequence() uint64 + SetSequence(uint64) error + + // Ensure that account implements stringer + String() string +} + +// ModuleAccountI defines an account interface for modules that hold tokens in +// an escrow. +type ModuleAccountI interface { + AccountI + + GetName() string + GetPermissions() []string + HasPermission(string) bool +} diff --git a/x/auth/types/types.pb.go b/x/auth/types/types.pb.go index ad102a4ce8e7..6d6351dade97 100644 --- a/x/auth/types/types.pb.go +++ b/x/auth/types/types.pb.go @@ -5,9 +5,11 @@ package types import ( fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + _ "github.com/regen-network/cosmos-proto" io "io" math "math" math_bits "math/bits" @@ -181,56 +183,107 @@ func (m *Params) GetSigVerifyCostSecp256k1() uint64 { return 0 } +// Account defines the application-level Account type. +type Account struct { + Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` +} + +func (m *Account) Reset() { *m = Account{} } +func (m *Account) String() string { return proto.CompactTextString(m) } +func (*Account) ProtoMessage() {} +func (*Account) Descriptor() ([]byte, []int) { + return fileDescriptor_2d526fa662daab74, []int{3} +} +func (m *Account) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Account.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Account) XXX_Merge(src proto.Message) { + xxx_messageInfo_Account.Merge(m, src) +} +func (m *Account) XXX_Size() int { + return m.Size() +} +func (m *Account) XXX_DiscardUnknown() { + xxx_messageInfo_Account.DiscardUnknown(m) +} + +var xxx_messageInfo_Account proto.InternalMessageInfo + +func (m *Account) GetAccount() *types.Any { + if m != nil { + return m.Account + } + return nil +} + func init() { proto.RegisterType((*BaseAccount)(nil), "cosmos_sdk.x.auth.v1.BaseAccount") proto.RegisterType((*ModuleAccount)(nil), "cosmos_sdk.x.auth.v1.ModuleAccount") proto.RegisterType((*Params)(nil), "cosmos_sdk.x.auth.v1.Params") + proto.RegisterType((*Account)(nil), "cosmos_sdk.x.auth.v1.Account") } func init() { proto.RegisterFile("x/auth/types/types.proto", fileDescriptor_2d526fa662daab74) } var fileDescriptor_2d526fa662daab74 = []byte{ - // 640 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xbf, 0x6f, 0xd3, 0x40, - 0x14, 0x8e, 0x9b, 0xd0, 0x1f, 0x97, 0x16, 0xa9, 0x6e, 0xda, 0xba, 0x05, 0xf9, 0x82, 0x07, 0x54, - 0x24, 0xea, 0x28, 0x45, 0x45, 0x6a, 0x06, 0x44, 0x5d, 0x60, 0x29, 0xad, 0xaa, 0xab, 0xc4, 0xc0, - 0x62, 0x9d, 0xed, 0x23, 0xb1, 0x92, 0xcb, 0xb9, 0xbe, 0x73, 0x15, 0xf7, 0x2f, 0x40, 0x4c, 0x8c, - 0x8c, 0xfd, 0x1b, 0xf8, 0x2b, 0x18, 0x3b, 0x32, 0x19, 0x94, 0x2e, 0x88, 0xd1, 0x23, 0x13, 0xb2, - 0x2f, 0x4d, 0x9d, 0x2a, 0xb0, 0xd8, 0xf7, 0xde, 0xfb, 0xbe, 0xef, 0x3d, 0x7f, 0x4f, 0x67, 0xa0, - 0x0d, 0x1a, 0x38, 0x12, 0x9d, 0x86, 0x88, 0x03, 0xc2, 0xe5, 0xd3, 0x0c, 0x42, 0x26, 0x98, 0x5a, - 0x73, 0x19, 0xa7, 0x8c, 0xdb, 0xdc, 0xeb, 0x9a, 0x03, 0x33, 0x03, 0x99, 0xe7, 0xcd, 0xcd, 0xc7, - 0xa2, 0xe3, 0x87, 0x9e, 0x1d, 0xe0, 0x50, 0xc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0xec, 0x91, - 0x5a, 0xee, 0x49, 0x75, 0xe7, 0x91, 0x39, 0xcd, 0x73, 0xb3, 0xe0, 0xa3, 0xf5, 0xe0, 0x2a, 0x81, - 0x4a, 0x9a, 0xc0, 0x15, 0x39, 0x5e, 0x51, 0xc4, 0x40, 0x55, 0xa7, 0xe0, 0xb8, 0x0a, 0x2a, 0x7d, - 0x4c, 0x49, 0xee, 0xd0, 0x02, 0xca, 0xcf, 0x6a, 0x1d, 0x54, 0x03, 0x12, 0x52, 0x9f, 0x73, 0x9f, - 0xf5, 0xb9, 0x56, 0xae, 0x97, 0xb7, 0x16, 0x50, 0x31, 0x55, 0x18, 0xfa, 0x47, 0x19, 0xcc, 0x9e, - 0xe0, 0x10, 0x53, 0xae, 0x1e, 0x83, 0x15, 0x8a, 0x07, 0x36, 0x25, 0x94, 0xd9, 0x6e, 0x07, 0x87, - 0xd8, 0x15, 0x24, 0x94, 0x8b, 0xac, 0x58, 0x7a, 0x9a, 0xc0, 0x4d, 0x39, 0xcd, 0x14, 0x90, 0x81, - 0x96, 0x29, 0x1e, 0x1c, 0x11, 0xca, 0x0e, 0xc6, 0x39, 0x75, 0x0f, 0x2c, 0x8a, 0x81, 0xcd, 0xfd, - 0xb6, 0xdd, 0xf3, 0xa9, 0x2f, 0xf2, 0x11, 0x2b, 0xd6, 0xfa, 0xed, 0x67, 0x15, 0xab, 0x06, 0x02, - 0x62, 0x70, 0xea, 0xb7, 0xdf, 0x66, 0x81, 0x8a, 0xc0, 0x6a, 0x5e, 0xbc, 0x20, 0xb6, 0xcb, 0xb8, - 0xb0, 0x03, 0x12, 0xda, 0x4e, 0x2c, 0xc8, 0x68, 0x73, 0xf5, 0x34, 0x81, 0x0f, 0x0b, 0x1a, 0x77, - 0x61, 0x06, 0x5a, 0xce, 0xc4, 0x2e, 0xc8, 0x01, 0xe3, 0xe2, 0x84, 0x84, 0x56, 0x2c, 0x88, 0x7a, - 0x06, 0xd6, 0xb3, 0x6e, 0xe7, 0x24, 0xf4, 0x3f, 0xc4, 0x12, 0x4f, 0xbc, 0x9d, 0xdd, 0xdd, 0xe6, - 0x9e, 0xdc, 0xa9, 0xd5, 0x1a, 0x26, 0xb0, 0x76, 0xea, 0xb7, 0xdf, 0xe5, 0x88, 0x8c, 0xfa, 0xfa, - 0x55, 0x5e, 0x4f, 0x13, 0xa8, 0xcb, 0x6e, 0xff, 0x10, 0x30, 0x50, 0x8d, 0x4f, 0xf0, 0x64, 0x5a, - 0x8d, 0xc1, 0xc6, 0x5d, 0x06, 0x27, 0x6e, 0xb0, 0xb3, 0xfb, 0xbc, 0xdb, 0xd4, 0xee, 0xe5, 0x4d, - 0x5f, 0x0c, 0x13, 0xb8, 0x36, 0xd1, 0xf4, 0xf4, 0x06, 0x91, 0x26, 0xb0, 0x3e, 0xbd, 0xed, 0x58, - 0xc4, 0x40, 0x6b, 0x7c, 0x2a, 0xb7, 0x35, 0x9f, 0x6d, 0xf7, 0xd7, 0x25, 0x54, 0xac, 0x83, 0x6f, - 0x43, 0x5d, 0xb9, 0x1a, 0xea, 0xca, 0xcf, 0xa1, 0xae, 0x7c, 0xbe, 0xd6, 0x4b, 0x57, 0xd7, 0x7a, - 0xe9, 0xfb, 0xb5, 0x5e, 0x7a, 0xff, 0xe4, 0xbf, 0x17, 0xb3, 0xf8, 0xcb, 0x70, 0x66, 0xf3, 0xfb, - 0xfe, 0xec, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc6, 0x00, 0xf0, 0x01, 0x49, 0x04, 0x00, 0x00, + // 719 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0x41, 0x4f, 0xdb, 0x48, + 0x14, 0x8e, 0x49, 0x96, 0xc0, 0x24, 0x20, 0x61, 0x02, 0x84, 0xec, 0xca, 0x93, 0xf5, 0x61, 0xc5, + 0x6a, 0x37, 0x8e, 0xc2, 0x8a, 0x95, 0x88, 0x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51, 0x62, 0x33, 0x3c, 0x91, 0x96, 0x43, 0xb0, + 0x7d, 0x9f, 0xc1, 0xb0, 0xed, 0xed, 0xee, 0xfd, 0xdb, 0x6d, 0x94, 0x7f, 0x49, 0x9a, 0xfe, 0x3f, + 0x8c, 0xe0, 0xe6, 0x4c, 0xd3, 0xb3, 0x09, 0x62, 0x14, 0xc1, 0xea, 0xfc, 0xb6, 0x53, 0x11, 0xd5, + 0xd8, 0x64, 0x73, 0xb9, 0xcd, 0xa5, 0x78, 0xdf, 0x9f, 0xaf, 0xa1, 0xa4, 0x1e, 0x83, 0xfc, 0xe4, + 0xfa, 0xfc, 0x07, 0xf2, 0xb3, 0x97, 0xb3, 0xa4, 0x89, 0x2f, 0x5f, 0x9b, 0x7c, 0xf9, 0x5a, 0xab, + 0x1f, 0xea, 0xc5, 0x77, 0xa9, 0x8b, 0x6e, 0x4c, 0x28, 0xcd, 0x5c, 0x2c, 0xa7, 0x1f, 0xbc, 0x1d, + 0x2a, 0xd2, 0xcd, 0x50, 0x91, 0x3e, 0x0d, 0x15, 0xe9, 0xc5, 0xad, 0x92, 0xb9, 0xb9, 0x55, 0x32, + 0x1f, 0x6e, 0x95, 0xcc, 0xb3, 0x3f, 0x7f, 0xfa, 0x17, 0x48, 0xff, 0xe7, 0xac, 0xc5, 0xa4, 0xdf, + 0x3f, 0xdf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x80, 0xee, 0x62, 0xfe, 0x04, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -269,6 +322,30 @@ func (this *Params) Equal(that interface{}) bool { } return true } +func (this *Account) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Account) + if !ok { + that2, ok := that.(Account) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Account.Equal(that1.Account) { + return false + } + return true +} func (m *BaseAccount) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -415,6 +492,41 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Account) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Account) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Account != nil { + { + size, err := m.Account.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -496,6 +608,19 @@ func (m *Params) Size() (n int) { return n } +func (m *Account) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Account != nil { + l = m.Account.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -962,6 +1087,95 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } +func (m *Account) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Account: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Account: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Account == nil { + m.Account = &types.Any{} + } + if err := m.Account.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auth/types/types.proto b/x/auth/types/types.proto index 49185dbb16d4..892f57022ce1 100644 --- a/x/auth/types/types.proto +++ b/x/auth/types/types.proto @@ -1,7 +1,9 @@ syntax = "proto3"; package cosmos_sdk.x.auth.v1; +import "third_party/proto/cosmos-proto/cosmos.proto"; import "third_party/proto/gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; @@ -11,6 +13,7 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; message BaseAccount { option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "AccountI"; bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; bytes pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty", (gogoproto.moretags) = "yaml:\"public_key\""]; @@ -22,6 +25,7 @@ message BaseAccount { message ModuleAccount { option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "ModuleAccountI"; BaseAccount base_account = 1 [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_account\""]; string name = 2; From ffa0627b88cfb4dc9661088767d265771c6cc4f5 Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Sun, 10 May 2020 16:07:09 +0530 Subject: [PATCH 02/18] Migrate AccountI to types --- simapp/cmd/simd/genaccounts.go | 4 +- simapp/genesis_account.go | 3 +- simapp/test_helpers.go | 3 +- std/codec.go | 20 ++-- std/codec.pb.go | 17 ++- x/auth/alias.go | 2 + x/auth/ante/expected_keepers.go | 5 +- x/auth/ante/fee.go | 3 +- x/auth/ante/sigverify.go | 7 +- x/auth/exported/exported.go | 62 ---------- x/auth/exported/exported_test.go | 3 +- x/auth/genesis.go | 8 +- x/auth/keeper/account.go | 17 ++- x/auth/keeper/keeper.go | 21 ++-- x/auth/keeper/querier_test.go | 120 +++++++++---------- x/auth/legacy/v0_38/types.go | 2 +- x/auth/legacy/v0_39/migrate_test.go | 2 +- x/auth/module.go | 42 ++++--- x/auth/simulation/decoder.go | 10 +- x/auth/simulation/genesis.go | 5 +- x/auth/types/account.go | 57 ++++++--- x/auth/types/account_retriever.go | 7 +- x/auth/types/account_test.go | 17 ++- x/auth/types/codec.go | 29 +++-- x/auth/types/genesis.go | 16 ++- x/auth/types/genesis_test.go | 9 +- x/auth/types/stdtx.go | 3 +- x/auth/types/types.pb.go | 10 +- x/auth/vesting/exported/exported.go | 4 +- x/auth/vesting/types/genesis_test.go | 3 +- x/auth/vesting/types/vesting_account.go | 17 ++- x/auth/vesting/types/vesting_account_test.go | 3 +- x/bank/app_test.go | 14 +-- x/bank/bench_test.go | 6 +- x/bank/types/expected_keepers.go | 22 ++-- x/distribution/keeper/alias_functions.go | 4 +- x/distribution/keeper/delegation.go | 2 +- x/distribution/types/expected_keepers.go | 8 +- x/genutil/types/expected_keepers.go | 10 +- x/gov/keeper/keeper.go | 4 +- x/gov/types/expected_keepers.go | 8 +- x/ibc/20-transfer/keeper/keeper.go | 4 +- x/ibc/20-transfer/types/expected_keepers.go | 4 +- x/mint/types/expected_keepers.go | 6 +- x/slashing/app_test.go | 4 +- x/slashing/types/expected_keepers.go | 6 +- x/staking/app_test.go | 3 +- x/staking/keeper/pool.go | 6 +- x/staking/types/expected_keepers.go | 10 +- 49 files changed, 314 insertions(+), 338 deletions(-) delete mode 100644 x/auth/exported/exported.go diff --git a/simapp/cmd/simd/genaccounts.go b/simapp/cmd/simd/genaccounts.go index 98efeedc7e72..bb57676fdcb4 100644 --- a/simapp/cmd/simd/genaccounts.go +++ b/simapp/cmd/simd/genaccounts.go @@ -18,7 +18,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + "github.com/cosmos/cosmos-sdk/x/auth/types" authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting" "github.com/cosmos/cosmos-sdk/x/bank" "github.com/cosmos/cosmos-sdk/x/genutil" @@ -84,7 +84,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa } // create concrete account type based on input parameters - var genAccount authexported.GenesisAccount + var genAccount types.GenesisAccount balances := bank.Balance{Address: addr, Coins: coins.Sort()} baseAccount := auth.NewBaseAccount(addr, nil, 0, 0) diff --git a/simapp/genesis_account.go b/simapp/genesis_account.go index 1725b6982fd8..860370057a92 100644 --- a/simapp/genesis_account.go +++ b/simapp/genesis_account.go @@ -5,11 +5,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) -var _ authexported.GenesisAccount = (*SimGenesisAccount)(nil) +var _ authtypes.GenesisAccount = (*SimGenesisAccount)(nil) // SimGenesisAccount defines a type that implements the GenesisAccount interface // to be used for simulation accounts in the genesis state. diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index f5e5b523ae92..7b17fe743044 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -20,7 +20,6 @@ import ( "github.com/cosmos/cosmos-sdk/simapp/helpers" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" "github.com/cosmos/cosmos-sdk/x/bank" ) @@ -70,7 +69,7 @@ func Setup(isCheckTx bool) *SimApp { // SetupWithGenesisAccounts initializes a new SimApp with the provided genesis // accounts and possible balances. -func SetupWithGenesisAccounts(genAccs []authexported.GenesisAccount, balances ...bank.Balance) *SimApp { +func SetupWithGenesisAccounts(genAccs []auth.GenesisAccount, balances ...bank.Balance) *SimApp { db := dbm.NewMemDB() app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0) diff --git a/std/codec.go b/std/codec.go index 5557363f5153..e973e9284f57 100644 --- a/std/codec.go +++ b/std/codec.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" "github.com/cosmos/cosmos-sdk/x/bank" bankexported "github.com/cosmos/cosmos-sdk/x/bank/exported" @@ -35,10 +35,10 @@ func NewAppCodec(amino *codec.Codec, anyUnpacker types.AnyUnpacker) *Codec { return &Codec{Marshaler: codec.NewHybridCodec(amino, anyUnpacker), amino: amino, anyUnpacker: anyUnpacker} } -// MarshalAccount marshals an Account interface. If the given type implements +// MarshalAccount marshals an AccountI interface. If the given type implements // the Marshaler interface, it is treated as a Proto-defined message and // serialized that way. Otherwise, it falls back on the internal Amino codec. -func (c *Codec) MarshalAccount(accI authexported.Account) ([]byte, error) { +func (c *Codec) MarshalAccount(accI authtypes.AccountI) ([]byte, error) { acc := &Account{} if err := acc.SetAccount(accI); err != nil { return nil, err @@ -47,9 +47,9 @@ func (c *Codec) MarshalAccount(accI authexported.Account) ([]byte, error) { return c.Marshaler.MarshalBinaryBare(acc) } -// UnmarshalAccount returns an Account interface from raw encoded account bytes -// of a Proto-based Account type. An error is returned upon decoding failure. -func (c *Codec) UnmarshalAccount(bz []byte) (authexported.Account, error) { +// UnmarshalAccount returns an AccountI interface from raw encoded account bytes +// of a Proto-based AccountI type. An error is returned upon decoding failure. +func (c *Codec) UnmarshalAccount(bz []byte) (authtypes.AccountI, error) { acc := &Account{} if err := c.Marshaler.UnmarshalBinaryBare(bz, acc); err != nil { return nil, err @@ -58,14 +58,14 @@ func (c *Codec) UnmarshalAccount(bz []byte) (authexported.Account, error) { return acc.GetAccount(), nil } -// MarshalAccountJSON JSON encodes an account object implementing the Account +// MarshalAccountJSON JSON encodes an account object implementing the AccountI // interface. -func (c *Codec) MarshalAccountJSON(acc authexported.Account) ([]byte, error) { +func (c *Codec) MarshalAccountJSON(acc authtypes.AccountI) ([]byte, error) { return c.Marshaler.MarshalJSON(acc) } -// UnmarshalAccountJSON returns an Account from JSON encoded bytes. -func (c *Codec) UnmarshalAccountJSON(bz []byte) (authexported.Account, error) { +// UnmarshalAccountJSON returns an AccountI from JSON encoded bytes. +func (c *Codec) UnmarshalAccountJSON(bz []byte) (authtypes.AccountI, error) { acc := &Account{} if err := c.Marshaler.UnmarshalJSON(bz, acc); err != nil { return nil, err diff --git a/std/codec.pb.go b/std/codec.pb.go index f05db8eed67a..ebd08808e7b9 100644 --- a/std/codec.pb.go +++ b/std/codec.pb.go @@ -7,7 +7,6 @@ import ( fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types9 "github.com/cosmos/cosmos-sdk/types" - github_com_cosmos_cosmos_sdk_x_auth_exported "github.com/cosmos/cosmos-sdk/x/auth/exported" types "github.com/cosmos/cosmos-sdk/x/auth/types" types1 "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" github_com_cosmos_cosmos_sdk_x_bank_exported "github.com/cosmos/cosmos-sdk/x/bank/exported" @@ -39,9 +38,9 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Account defines the application-level Account type. +// AccountI defines the application-level AccountI type. type Account struct { - // sum defines a list of all acceptable concrete Account implementations. + // sum defines a list of all acceptable concrete AccountI implementations. // // Types that are valid to be assigned to Sum: // *Account_BaseAccount @@ -1040,7 +1039,7 @@ func (m *StdSignDocBase) GetFee() StdFee { } func init() { - proto.RegisterType((*Account)(nil), "cosmos_sdk.std.v1.Account") + proto.RegisterType((*Account)(nil), "cosmos_sdk.std.v1.AccountI") proto.RegisterType((*Supply)(nil), "cosmos_sdk.std.v1.Supply") proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos_sdk.std.v1.MsgSubmitProposal") proto.RegisterType((*Proposal)(nil), "cosmos_sdk.std.v1.Proposal") @@ -1453,7 +1452,7 @@ func (this *StdFee) Equal(that interface{}) bool { } return true } -func (this *Account) GetAccount() github_com_cosmos_cosmos_sdk_x_auth_exported.Account { +func (this *Account) GetAccount() types.AccountI { if x := this.GetBaseAccount(); x != nil { return x } @@ -1472,7 +1471,7 @@ func (this *Account) GetAccount() github_com_cosmos_cosmos_sdk_x_auth_exported.A return nil } -func (this *Account) SetAccount(value github_com_cosmos_cosmos_sdk_x_auth_exported.Account) error { +func (this *Account) SetAccount(value types.AccountI) error { if value == nil { this.Sum = nil return nil @@ -1494,7 +1493,7 @@ func (this *Account) SetAccount(value github_com_cosmos_cosmos_sdk_x_auth_export this.Sum = &Account_ModuleAccount{vt} return nil } - return fmt.Errorf("can't encode value of type %T as message Account", value) + return fmt.Errorf("can't encode value of type %T as message AccountI", value) } func (this *Supply) GetSupplyI() github_com_cosmos_cosmos_sdk_x_bank_exported.SupplyI { @@ -3345,10 +3344,10 @@ func (m *Account) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Account: wiretype end group for non-group") + return fmt.Errorf("proto: AccountI: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Account: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AccountI: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/auth/alias.go b/x/auth/alias.go index f8ffe899c0d0..af5452706046 100644 --- a/x/auth/alias.go +++ b/x/auth/alias.go @@ -95,4 +95,6 @@ type ( GenesisAccountIterator = types.GenesisAccountIterator Codec = types.Codec ModuleAccount = types.ModuleAccount + GenesisAccounts = types.GenesisAccounts + GenesisAccount = types.GenesisAccount ) diff --git a/x/auth/ante/expected_keepers.go b/x/auth/ante/expected_keepers.go index ed93b907b9c8..d8be4312e5cf 100644 --- a/x/auth/ante/expected_keepers.go +++ b/x/auth/ante/expected_keepers.go @@ -2,7 +2,6 @@ package ante import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/exported" "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -10,7 +9,7 @@ import ( // Interface provides support to use non-sdk AccountKeeper for AnteHandler's decorators. type AccountKeeper interface { GetParams(ctx sdk.Context) (params types.Params) - GetAccount(ctx sdk.Context, addr sdk.AccAddress) exported.Account - SetAccount(ctx sdk.Context, acc exported.Account) + GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + SetAccount(ctx sdk.Context, acc types.AccountI) GetModuleAddress(moduleName string) sdk.AccAddress } diff --git a/x/auth/ante/fee.go b/x/auth/ante/fee.go index 5b1044c58664..900caf18d578 100644 --- a/x/auth/ante/fee.go +++ b/x/auth/ante/fee.go @@ -5,7 +5,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/auth/exported" "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -111,7 +110,7 @@ func (dfd DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bo } // DeductFees deducts fees from the given account. -func DeductFees(bankKeeper types.BankKeeper, ctx sdk.Context, acc exported.Account, fees sdk.Coins) error { +func DeductFees(bankKeeper types.BankKeeper, ctx sdk.Context, acc types.AccountI, fees sdk.Coins) error { if !fees.IsValid() { return sdkerrors.Wrapf(sdkerrors.ErrInsufficientFee, "invalid fee amount: %s", fees) } diff --git a/x/auth/ante/sigverify.go b/x/auth/ante/sigverify.go index 93ae0f3b4ae4..0b17b05bc446 100644 --- a/x/auth/ante/sigverify.go +++ b/x/auth/ante/sigverify.go @@ -12,7 +12,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/auth/exported" "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -41,7 +40,7 @@ type SigVerifiableTx interface { GetSignatures() [][]byte GetSigners() []sdk.AccAddress GetPubKeys() []crypto.PubKey // If signer already has pubkey in context, this list will have nil in its place - GetSignBytes(ctx sdk.Context, acc exported.Account) []byte + GetSignBytes(ctx sdk.Context, acc types.AccountI) []byte } // SetPubKeyDecorator sets PubKeys in context for any signer which does not already have pubkey set @@ -184,7 +183,7 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul // stdSigs contains the sequence number, account number, and signatures. // When simulating, this would just be a 0-length slice. signerAddrs := sigTx.GetSigners() - signerAccs := make([]exported.Account, len(signerAddrs)) + signerAccs := make([]types.AccountI, len(signerAddrs)) // check that signer length and signature length are the same if len(sigs) != len(signerAddrs) { @@ -339,7 +338,7 @@ func ConsumeMultisignatureVerificationGas( // GetSignerAcc returns an account for a given address that is expected to sign // a transaction. -func GetSignerAcc(ctx sdk.Context, ak AccountKeeper, addr sdk.AccAddress) (exported.Account, error) { +func GetSignerAcc(ctx sdk.Context, ak AccountKeeper, addr sdk.AccAddress) (types.AccountI, error) { if acc := ak.GetAccount(ctx, addr); acc != nil { return acc, nil } diff --git a/x/auth/exported/exported.go b/x/auth/exported/exported.go deleted file mode 100644 index 1974ff9ae4dc..000000000000 --- a/x/auth/exported/exported.go +++ /dev/null @@ -1,62 +0,0 @@ -package exported - -import ( - "github.com/tendermint/tendermint/crypto" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// Account is an interface used to store coins at a given address within state. -// It presumes a notion of sequence numbers for replay protection, -// a notion of account numbers for replay protection for previously pruned accounts, -// and a pubkey for authentication purposes. -// -// Many complex conditions can be used in the concrete struct which implements Account. -type Account interface { - GetAddress() sdk.AccAddress - SetAddress(sdk.AccAddress) error // errors if already set. - - GetPubKey() crypto.PubKey // can return nil. - SetPubKey(crypto.PubKey) error - - GetAccountNumber() uint64 - SetAccountNumber(uint64) error - - GetSequence() uint64 - SetSequence(uint64) error - - // Ensure that account implements stringer - String() string -} - -// ModuleAccountI defines an account interface for modules that hold tokens in -// an escrow. -type ModuleAccountI interface { - Account - - GetName() string - GetPermissions() []string - HasPermission(string) bool -} - -// GenesisAccounts defines a slice of GenesisAccount objects -type GenesisAccounts []GenesisAccount - -// Contains returns true if the given address exists in a slice of GenesisAccount -// objects. -func (ga GenesisAccounts) Contains(addr sdk.Address) bool { - for _, acc := range ga { - if acc.GetAddress().Equals(addr) { - return true - } - } - - return false -} - -// GenesisAccount defines a genesis account that embeds an Account with validation capabilities. -type GenesisAccount interface { - Account - - Validate() error -} diff --git a/x/auth/exported/exported_test.go b/x/auth/exported/exported_test.go index 23de4f777e72..4ff38cd87747 100644 --- a/x/auth/exported/exported_test.go +++ b/x/auth/exported/exported_test.go @@ -7,7 +7,6 @@ import ( "github.com/tendermint/tendermint/crypto/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/exported" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -16,7 +15,7 @@ func TestGenesisAccountsContains(t *testing.T) { addr := sdk.AccAddress(pubkey.Address()) acc := authtypes.NewBaseAccount(addr, secp256k1.GenPrivKey().PubKey(), 0, 0) - genAccounts := exported.GenesisAccounts{} + genAccounts := authtypes.GenesisAccounts{} require.False(t, genAccounts.Contains(acc.GetAddress())) genAccounts = append(genAccounts, acc) diff --git a/x/auth/genesis.go b/x/auth/genesis.go index 606e4f410d5c..93f7688a1541 100644 --- a/x/auth/genesis.go +++ b/x/auth/genesis.go @@ -2,7 +2,7 @@ package auth import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/exported" + "github.com/cosmos/cosmos-sdk/x/auth/types" ) // InitGenesis - Init store state from genesis data @@ -25,9 +25,9 @@ func InitGenesis(ctx sdk.Context, ak AccountKeeper, data GenesisState) { func ExportGenesis(ctx sdk.Context, ak AccountKeeper) GenesisState { params := ak.GetParams(ctx) - var genAccounts exported.GenesisAccounts - ak.IterateAccounts(ctx, func(account exported.Account) bool { - genAccount := account.(exported.GenesisAccount) + var genAccounts types.GenesisAccounts + ak.IterateAccounts(ctx, func(account types.AccountI) bool { + genAccount := account.(types.GenesisAccount) genAccounts = append(genAccounts, genAccount) return false }) diff --git a/x/auth/keeper/account.go b/x/auth/keeper/account.go index cd82894b4aba..e39c98ac52e7 100644 --- a/x/auth/keeper/account.go +++ b/x/auth/keeper/account.go @@ -2,12 +2,11 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/exported" "github.com/cosmos/cosmos-sdk/x/auth/types" ) // NewAccountWithAddress implements sdk.AccountKeeper. -func (ak AccountKeeper) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) exported.Account { +func (ak AccountKeeper) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) types.AccountI { acc := ak.proto() err := acc.SetAddress(addr) if err != nil { @@ -18,7 +17,7 @@ func (ak AccountKeeper) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddre } // NewAccount sets the next account number to a given account interface -func (ak AccountKeeper) NewAccount(ctx sdk.Context, acc exported.Account) exported.Account { +func (ak AccountKeeper) NewAccount(ctx sdk.Context, acc types.AccountI) types.AccountI { if err := acc.SetAccountNumber(ak.GetNextAccountNumber(ctx)); err != nil { panic(err) } @@ -27,7 +26,7 @@ func (ak AccountKeeper) NewAccount(ctx sdk.Context, acc exported.Account) export } // GetAccount implements sdk.AccountKeeper. -func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) exported.Account { +func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI { store := ctx.KVStore(ak.key) bz := store.Get(types.AddressStoreKey(addr)) if bz == nil { @@ -38,8 +37,8 @@ func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) exporte } // GetAllAccounts returns all accounts in the accountKeeper. -func (ak AccountKeeper) GetAllAccounts(ctx sdk.Context) (accounts []exported.Account) { - ak.IterateAccounts(ctx, func(acc exported.Account) (stop bool) { +func (ak AccountKeeper) GetAllAccounts(ctx sdk.Context) (accounts []types.AccountI) { + ak.IterateAccounts(ctx, func(acc types.AccountI) (stop bool) { accounts = append(accounts, acc) return false }) @@ -48,7 +47,7 @@ func (ak AccountKeeper) GetAllAccounts(ctx sdk.Context) (accounts []exported.Acc } // SetAccount implements sdk.AccountKeeper. -func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc exported.Account) { +func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc types.AccountI) { addr := acc.GetAddress() store := ctx.KVStore(ak.key) @@ -62,14 +61,14 @@ func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc exported.Account) { // RemoveAccount removes an account for the account mapper store. // NOTE: this will cause supply invariant violation if called -func (ak AccountKeeper) RemoveAccount(ctx sdk.Context, acc exported.Account) { +func (ak AccountKeeper) RemoveAccount(ctx sdk.Context, acc types.AccountI) { addr := acc.GetAddress() store := ctx.KVStore(ak.key) store.Delete(types.AddressStoreKey(addr)) } // IterateAccounts iterates over all the stored accounts and performs a callback function -func (ak AccountKeeper) IterateAccounts(ctx sdk.Context, cb func(account exported.Account) (stop bool)) { +func (ak AccountKeeper) IterateAccounts(ctx sdk.Context, cb func(account types.AccountI) (stop bool)) { store := ctx.KVStore(ak.key) iterator := sdk.KVStorePrefixIterator(store, types.AddressStoreKeyPrefix) diff --git a/x/auth/keeper/keeper.go b/x/auth/keeper/keeper.go index fa9a4e4ca82c..206f31c78d6b 100644 --- a/x/auth/keeper/keeper.go +++ b/x/auth/keeper/keeper.go @@ -10,7 +10,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/auth/exported" "github.com/cosmos/cosmos-sdk/x/auth/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) @@ -23,14 +22,14 @@ type AccountKeeper struct { paramSubspace paramtypes.Subspace permAddrs map[string]types.PermissionsForAddress - // The prototypical Account constructor. - proto func() exported.Account + // The prototypical AccountI constructor. + proto func() types.AccountI } // NewAccountKeeper returns a new sdk.AccountKeeper that uses go-amino to // (binary) encode and decode concrete sdk.Accounts. func NewAccountKeeper( - cdc codec.Marshaler, key sdk.StoreKey, paramstore paramtypes.Subspace, proto func() exported.Account, + cdc codec.Marshaler, key sdk.StoreKey, paramstore paramtypes.Subspace, proto func() types.AccountI, maccPerms map[string][]string, ) AccountKeeper { @@ -107,7 +106,7 @@ func (ak AccountKeeper) GetNextAccountNumber(ctx sdk.Context) uint64 { // ValidatePermissions validates that the module account has been granted // permissions within its set of allowed permissions. -func (ak AccountKeeper) ValidatePermissions(macc exported.ModuleAccountI) error { +func (ak AccountKeeper) ValidatePermissions(macc types.ModuleAccountI) error { permAddr := ak.permAddrs[macc.GetName()] for _, perm := range macc.GetPermissions() { if !permAddr.HasPermission(perm) { @@ -140,7 +139,7 @@ func (ak AccountKeeper) GetModuleAddressAndPermissions(moduleName string) (addr // GetModuleAccountAndPermissions gets the module account from the auth account store and its // registered permissions -func (ak AccountKeeper) GetModuleAccountAndPermissions(ctx sdk.Context, moduleName string) (exported.ModuleAccountI, []string) { +func (ak AccountKeeper) GetModuleAccountAndPermissions(ctx sdk.Context, moduleName string) (types.ModuleAccountI, []string) { addr, perms := ak.GetModuleAddressAndPermissions(moduleName) if addr == nil { return nil, []string{} @@ -148,7 +147,7 @@ func (ak AccountKeeper) GetModuleAccountAndPermissions(ctx sdk.Context, moduleNa acc := ak.GetAccount(ctx, addr) if acc != nil { - macc, ok := acc.(exported.ModuleAccountI) + macc, ok := acc.(types.ModuleAccountI) if !ok { panic("account is not a module account") } @@ -157,7 +156,7 @@ func (ak AccountKeeper) GetModuleAccountAndPermissions(ctx sdk.Context, moduleNa // create a new module account macc := types.NewEmptyModuleAccount(moduleName, perms...) - maccI := (ak.NewAccount(ctx, macc)).(exported.ModuleAccountI) // set the account number + maccI := (ak.NewAccount(ctx, macc)).(types.ModuleAccountI) // set the account number ak.SetModuleAccount(ctx, maccI) return maccI, perms @@ -165,17 +164,17 @@ func (ak AccountKeeper) GetModuleAccountAndPermissions(ctx sdk.Context, moduleNa // GetModuleAccount gets the module account from the auth account store, if the account does not // exist in the AccountKeeper, then it is created. -func (ak AccountKeeper) GetModuleAccount(ctx sdk.Context, moduleName string) exported.ModuleAccountI { +func (ak AccountKeeper) GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI { acc, _ := ak.GetModuleAccountAndPermissions(ctx, moduleName) return acc } // SetModuleAccount sets the module account to the auth account store -func (ak AccountKeeper) SetModuleAccount(ctx sdk.Context, macc exported.ModuleAccountI) { //nolint:interfacer +func (ak AccountKeeper) SetModuleAccount(ctx sdk.Context, macc types.ModuleAccountI) { //nolint:interfacer ak.SetAccount(ctx, macc) } -func (ak AccountKeeper) decodeAccount(bz []byte) exported.Account { +func (ak AccountKeeper) decodeAccount(bz []byte) types.AccountI { acc, err := ak.UnmarshalAccount(bz) if err != nil { panic(err) diff --git a/x/auth/keeper/querier_test.go b/x/auth/keeper/querier_test.go index 0306965c8a63..118cb32de2ab 100644 --- a/x/auth/keeper/querier_test.go +++ b/x/auth/keeper/querier_test.go @@ -1,63 +1,61 @@ package keeper_test -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/require" - - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/cosmos/cosmos-sdk/x/auth/exported" - keep "github.com/cosmos/cosmos-sdk/x/auth/keeper" - "github.com/cosmos/cosmos-sdk/x/auth/types" -) - -func TestQueryAccount(t *testing.T) { - app, ctx := createTestApp(true) - cdc := app.Codec() - - req := abci.RequestQuery{ - Path: "", - Data: []byte{}, - } - - path := []string{types.QueryAccount} - querier := keep.NewQuerier(app.AccountKeeper) - - bz, err := querier(ctx, []string{"other"}, req) - require.Error(t, err) - require.Nil(t, bz) - - req = abci.RequestQuery{ - Path: fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryAccount), - Data: []byte{}, - } - res, err := querier(ctx, path, req) - require.Error(t, err) - require.Nil(t, res) - - req.Data = cdc.MustMarshalJSON(types.NewQueryAccountParams([]byte(""))) - res, err = querier(ctx, path, req) - require.Error(t, err) - require.Nil(t, res) - - _, _, addr := types.KeyTestPubAddr() - req.Data = cdc.MustMarshalJSON(types.NewQueryAccountParams(addr)) - res, err = querier(ctx, path, req) - require.Error(t, err) - require.Nil(t, res) - - app.AccountKeeper.SetAccount(ctx, app.AccountKeeper.NewAccountWithAddress(ctx, addr)) - res, err = querier(ctx, path, req) - require.NoError(t, err) - require.NotNil(t, res) - - res, err = querier(ctx, path, req) - require.NoError(t, err) - require.NotNil(t, res) - - var account exported.Account - err2 := cdc.UnmarshalJSON(res, &account) - require.Nil(t, err2) -} +//import ( +// "fmt" +// "testing" +// +// "github.com/stretchr/testify/require" +// +// abci "github.com/tendermint/tendermint/abci/types" +// +// keep "github.com/cosmos/cosmos-sdk/x/auth/keeper" +// "github.com/cosmos/cosmos-sdk/x/auth/types" +//) +// +//func TestQueryAccount(t *testing.T) { +// app, ctx := createTestApp(true) +// cdc := app.Codec() +// +// req := abci.RequestQuery{ +// Path: "", +// Data: []byte{}, +// } +// +// path := []string{types.QueryAccount} +// querier := keep.NewQuerier(app.AccountKeeper) +// +// bz, err := querier(ctx, []string{"other"}, req) +// require.Error(t, err) +// require.Nil(t, bz) +// +// req = abci.RequestQuery{ +// Path: fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryAccount), +// Data: []byte{}, +// } +// res, err := querier(ctx, path, req) +// require.Error(t, err) +// require.Nil(t, res) +// +// req.Data = cdc.MustMarshalJSON(types.NewQueryAccountParams([]byte(""))) +// res, err = querier(ctx, path, req) +// require.Error(t, err) +// require.Nil(t, res) +// +// _, _, addr := types.KeyTestPubAddr() +// req.Data = cdc.MustMarshalJSON(types.NewQueryAccountParams(addr)) +// res, err = querier(ctx, path, req) +// require.Error(t, err) +// require.Nil(t, res) +// +// app.AccountKeeper.SetAccount(ctx, app.AccountKeeper.NewAccountWithAddress(ctx, addr)) +// res, err = querier(ctx, path, req) +// require.NoError(t, err) +// require.NotNil(t, res) +// +// res, err = querier(ctx, path, req) +// require.NoError(t, err) +// require.NotNil(t, res) +// +// _, err2 := app.AccountKeeper.UnmarshalAccount(res) +// require.Nil(t, err2) +//} diff --git a/x/auth/legacy/v0_38/types.go b/x/auth/legacy/v0_38/types.go index 1502fb27dbf0..b39a7a581666 100644 --- a/x/auth/legacy/v0_38/types.go +++ b/x/auth/legacy/v0_38/types.go @@ -524,7 +524,7 @@ func ValidateGenAccounts(genAccounts GenesisAccounts) error { func RegisterCodec(cdc *codec.Codec) { cdc.RegisterInterface((*GenesisAccount)(nil), nil) cdc.RegisterInterface((*Account)(nil), nil) - cdc.RegisterConcrete(&BaseAccount{}, "cosmos-sdk/Account", nil) + cdc.RegisterConcrete(&BaseAccount{}, "cosmos-sdk/AccountI", nil) cdc.RegisterConcrete(&BaseVestingAccount{}, "cosmos-sdk/BaseVestingAccount", nil) cdc.RegisterConcrete(&ContinuousVestingAccount{}, "cosmos-sdk/ContinuousVestingAccount", nil) cdc.RegisterConcrete(&DelayedVestingAccount{}, "cosmos-sdk/DelayedVestingAccount", nil) diff --git a/x/auth/legacy/v0_39/migrate_test.go b/x/auth/legacy/v0_39/migrate_test.go index 5f9cee0d257c..88dd4bd0e6df 100644 --- a/x/auth/legacy/v0_39/migrate_test.go +++ b/x/auth/legacy/v0_39/migrate_test.go @@ -51,7 +51,7 @@ func TestMigrate(t *testing.T) { }, "accounts": [ { - "type": "cosmos-sdk/Account", + "type": "cosmos-sdk/AccountI", "value": { "address": "cosmos1xxkueklal9vejv9unqu80w9vptyepfa95pd53u", "public_key": "", diff --git a/x/auth/module.go b/x/auth/module.go index 2f425d645956..d747f005ea5e 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -11,55 +11,55 @@ import ( "github.com/cosmos/cosmos-sdk/client/context" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "github.com/cosmos/cosmos-sdk/x/auth/client/rest" "github.com/cosmos/cosmos-sdk/x/auth/simulation" - "github.com/cosmos/cosmos-sdk/x/auth/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} _ module.AppModuleSimulation = AppModule{} + _ module.InterfaceModule = AppModuleBasic{} ) // AppModuleBasic defines the basic application module used by the auth module. -type AppModuleBasic struct { - cdc Codec -} +type AppModuleBasic struct{} // Name returns the auth module's name. func (AppModuleBasic) Name() string { - return types.ModuleName + return authtypes.ModuleName } // RegisterCodec registers the auth module's types for the given codec. func (AppModuleBasic) RegisterCodec(cdc *codec.Codec) { - types.RegisterCodec(cdc) + authtypes.RegisterCodec(cdc) } // DefaultGenesis returns default genesis state as raw bytes for the auth // module. func (AppModuleBasic) DefaultGenesis(cdc codec.JSONMarshaler) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesisState()) + return cdc.MustMarshalJSON(authtypes.DefaultGenesisState()) } // ValidateGenesis performs genesis state validation for the auth module. func (AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, bz json.RawMessage) error { - var data types.GenesisState + var data authtypes.GenesisState if err := cdc.UnmarshalJSON(bz, &data); err != nil { - return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + return fmt.Errorf("failed to unmarshal %s genesis state: %w", authtypes.ModuleName, err) } - return types.ValidateGenesis(data) + return authtypes.ValidateGenesis(data) } // RegisterRESTRoutes registers the REST routes for the auth module. func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router) { - rest.RegisterRoutes(ctx, rtr, types.StoreKey) + rest.RegisterRoutes(ctx, rtr, authtypes.StoreKey) } // GetTxCmd returns the root tx command for the auth module. @@ -72,6 +72,10 @@ func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { return cli.GetQueryCmd(cdc) } +func (AppModuleBasic) RegisterInterfaceTypes(registry types.InterfaceRegistry) { + authtypes.RegisterInterfaces(registry) +} + //____________________________________________________________________________ // AppModule implements an application module for the auth module. @@ -82,16 +86,16 @@ type AppModule struct { } // NewAppModule creates a new AppModule object -func NewAppModule(cdc Codec, accountKeeper AccountKeeper) AppModule { +func NewAppModule(cdc codec.Marshaler, accountKeeper AccountKeeper) AppModule { return AppModule{ - AppModuleBasic: AppModuleBasic{cdc: cdc}, + AppModuleBasic: AppModuleBasic{}, accountKeeper: accountKeeper, } } // Name returns the auth module's name. func (AppModule) Name() string { - return types.ModuleName + return authtypes.ModuleName } // RegisterInvariants performs a no-op. @@ -105,7 +109,7 @@ func (AppModule) NewHandler() sdk.Handler { return nil } // QuerierRoute returns the auth module's querier route name. func (AppModule) QuerierRoute() string { - return types.QuerierRoute + return authtypes.QuerierRoute } // NewQuerierHandler returns the auth module sdk.Querier. @@ -159,10 +163,16 @@ func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { // RegisterStoreDecoder registers a decoder for auth module's types func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { - sdr[StoreKey] = simulation.NewDecodeStore(am.cdc) + sdr[StoreKey] = simulation.NewDecodeStore(am.accountKeeper) } // WeightedOperations doesn't return any auth module operation. func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { return nil } + +// InterfaceModule is an interface that modules can implement in order to +// register their interfaces and implementations in an InterfaceRegistry +type InterfaceModule interface { + RegisterInterfaceTypes(registry types.InterfaceRegistry) +} diff --git a/x/auth/simulation/decoder.go b/x/auth/simulation/decoder.go index e14670a36dc1..495174c2a46b 100644 --- a/x/auth/simulation/decoder.go +++ b/x/auth/simulation/decoder.go @@ -10,9 +10,13 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/types" ) +type AccountUnmarshaler interface { + UnmarshalAccount([]byte) (types.AccountI, error) +} + // NewDecodeStore returns a decoder function closure that unmarshals the KVPair's // Value to the corresponding auth type. -func NewDecodeStore(cdc types.Codec) func(kvA, kvB tmkv.Pair) string { +func NewDecodeStore(cdc AccountUnmarshaler) func(kvA, kvB tmkv.Pair) string { return func(kvA, kvB tmkv.Pair) string { switch { case bytes.Equal(kvA.Key[:1], types.AddressStoreKeyPrefix): @@ -30,8 +34,8 @@ func NewDecodeStore(cdc types.Codec) func(kvA, kvB tmkv.Pair) string { case bytes.Equal(kvA.Key, types.GlobalAccountNumberKey): var globalAccNumberA, globalAccNumberB gogotypes.UInt64Value - cdc.MustUnmarshalBinaryBare(kvA.Value, &globalAccNumberA) - cdc.MustUnmarshalBinaryBare(kvB.Value, &globalAccNumberB) + //cdc.MustUnmarshalBinaryBare(kvA.Value, &globalAccNumberA) + //cdc.MustUnmarshalBinaryBare(kvB.Value, &globalAccNumberB) return fmt.Sprintf("GlobalAccNumberA: %d\nGlobalAccNumberB: %d", globalAccNumberA, globalAccNumberB) diff --git a/x/auth/simulation/genesis.go b/x/auth/simulation/genesis.go index 5309baf34917..b35f43f31049 100644 --- a/x/auth/simulation/genesis.go +++ b/x/auth/simulation/genesis.go @@ -10,7 +10,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/auth/exported" "github.com/cosmos/cosmos-sdk/x/auth/types" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" ) @@ -95,10 +94,10 @@ func RandomizedGenState(simState *module.SimulationState) { } // RandomGenesisAccounts returns randomly generated genesis accounts -func RandomGenesisAccounts(simState *module.SimulationState) (genesisAccs exported.GenesisAccounts) { +func RandomGenesisAccounts(simState *module.SimulationState) (genesisAccs types.GenesisAccounts) { for i, acc := range simState.Accounts { bacc := types.NewBaseAccountWithAddress(acc.Address) - var gacc exported.GenesisAccount = bacc + var gacc types.GenesisAccount = bacc // Only consider making a vesting account once the initial bonded validator // set is exhausted due to needing to track DelegatedVesting. diff --git a/x/auth/types/account.go b/x/auth/types/account.go index 5588e2ba02d4..1e85ac8f2049 100644 --- a/x/auth/types/account.go +++ b/x/auth/types/account.go @@ -11,14 +11,13 @@ import ( yaml "gopkg.in/yaml.v2" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/exported" ) var ( - _ exported.Account = (*BaseAccount)(nil) - _ exported.GenesisAccount = (*BaseAccount)(nil) - _ exported.GenesisAccount = (*ModuleAccount)(nil) - _ exported.ModuleAccountI = (*ModuleAccount)(nil) + _ AccountI = (*BaseAccount)(nil) + _ GenesisAccount = (*BaseAccount)(nil) + _ GenesisAccount = (*ModuleAccount)(nil) + _ ModuleAccountI = (*ModuleAccount)(nil) ) // NewBaseAccount creates a new BaseAccount object @@ -35,7 +34,7 @@ func NewBaseAccount(address sdk.AccAddress, pubKey crypto.PubKey, accountNumber, } // ProtoBaseAccount - a prototype function for BaseAccount -func ProtoBaseAccount() exported.Account { +func ProtoBaseAccount() AccountI { return &BaseAccount{} } @@ -46,12 +45,12 @@ func NewBaseAccountWithAddress(addr sdk.AccAddress) *BaseAccount { } } -// GetAddress - Implements sdk.Account. +// GetAddress - Implements sdk.AccountI. func (acc BaseAccount) GetAddress() sdk.AccAddress { return acc.Address } -// SetAddress - Implements sdk.Account. +// SetAddress - Implements sdk.AccountI. func (acc *BaseAccount) SetAddress(addr sdk.AccAddress) error { if len(acc.Address) != 0 { return errors.New("cannot override BaseAccount address") @@ -61,7 +60,7 @@ func (acc *BaseAccount) SetAddress(addr sdk.AccAddress) error { return nil } -// GetPubKey - Implements sdk.Account. +// GetPubKey - Implements sdk.AccountI. func (acc BaseAccount) GetPubKey() (pk crypto.PubKey) { if len(acc.PubKey) == 0 { return nil @@ -71,7 +70,7 @@ func (acc BaseAccount) GetPubKey() (pk crypto.PubKey) { return pk } -// SetPubKey - Implements sdk.Account. +// SetPubKey - Implements sdk.AccountI. func (acc *BaseAccount) SetPubKey(pubKey crypto.PubKey) error { if pubKey == nil { acc.PubKey = nil @@ -82,23 +81,23 @@ func (acc *BaseAccount) SetPubKey(pubKey crypto.PubKey) error { return nil } -// GetAccountNumber - Implements Account +// GetAccountNumber - Implements AccountI func (acc BaseAccount) GetAccountNumber() uint64 { return acc.AccountNumber } -// SetAccountNumber - Implements Account +// SetAccountNumber - Implements AccountI func (acc *BaseAccount) SetAccountNumber(accNumber uint64) error { acc.AccountNumber = accNumber return nil } -// GetSequence - Implements sdk.Account. +// GetSequence - Implements sdk.AccountI. func (acc BaseAccount) GetSequence() uint64 { return acc.Sequence } -// SetSequence - Implements sdk.Account. +// SetSequence - Implements sdk.AccountI. func (acc *BaseAccount) SetSequence(seq uint64) error { acc.Sequence = seq return nil @@ -205,12 +204,12 @@ func (ma ModuleAccount) GetPermissions() []string { return ma.Permissions } -// SetPubKey - Implements Account +// SetPubKey - Implements AccountI func (ma ModuleAccount) SetPubKey(pubKey crypto.PubKey) error { return fmt.Errorf("not supported for module accounts") } -// SetSequence - Implements Account +// SetSequence - Implements AccountI func (ma ModuleAccount) SetSequence(seq uint64) error { return fmt.Errorf("not supported for module accounts") } @@ -286,12 +285,12 @@ func (ma *ModuleAccount) UnmarshalJSON(bz []byte) error { return nil } -// Account is an interface used to store coins at a given address within state. +// AccountI is an interface used to store coins at a given address within state. // It presumes a notion of sequence numbers for replay protection, // a notion of account numbers for replay protection for previously pruned accounts, // and a pubkey for authentication purposes. // -// Many complex conditions can be used in the concrete struct which implements Account. +// Many complex conditions can be used in the concrete struct which implements AccountI. type AccountI interface { GetAddress() sdk.AccAddress SetAddress(sdk.AccAddress) error // errors if already set. @@ -318,3 +317,25 @@ type ModuleAccountI interface { GetPermissions() []string HasPermission(string) bool } + +// GenesisAccounts defines a slice of GenesisAccount objects +type GenesisAccounts []GenesisAccount + +// Contains returns true if the given address exists in a slice of GenesisAccount +// objects. +func (ga GenesisAccounts) Contains(addr sdk.Address) bool { + for _, acc := range ga { + if acc.GetAddress().Equals(addr) { + return true + } + } + + return false +} + +// GenesisAccount defines a genesis account that embeds an AccountI with validation capabilities. +type GenesisAccount interface { + AccountI + + Validate() error +} diff --git a/x/auth/types/account_retriever.go b/x/auth/types/account_retriever.go index bc24b4a9c480..fe7f0fb294cb 100644 --- a/x/auth/types/account_retriever.go +++ b/x/auth/types/account_retriever.go @@ -4,7 +4,6 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/exported" ) // NodeQuerier is an interface that is satisfied by types that provide the QueryWithData method @@ -29,7 +28,7 @@ func NewAccountRetriever(codec Codec, querier NodeQuerier) AccountRetriever { // GetAccount queries for an account given an address and a block height. An // error is returned if the query or decoding fails. -func (ar AccountRetriever) GetAccount(addr sdk.AccAddress) (exported.Account, error) { +func (ar AccountRetriever) GetAccount(addr sdk.AccAddress) (AccountI, error) { account, _, err := ar.GetAccountWithHeight(addr) return account, err } @@ -37,7 +36,7 @@ func (ar AccountRetriever) GetAccount(addr sdk.AccAddress) (exported.Account, er // GetAccountWithHeight queries for an account given an address. Returns the // height of the query with the account. An error is returned if the query // or decoding fails. -func (ar AccountRetriever) GetAccountWithHeight(addr sdk.AccAddress) (exported.Account, int64, error) { +func (ar AccountRetriever) GetAccountWithHeight(addr sdk.AccAddress) (AccountI, int64, error) { bs, err := ar.codec.MarshalJSON(NewQueryAccountParams(addr)) if err != nil { return nil, 0, err @@ -48,7 +47,7 @@ func (ar AccountRetriever) GetAccountWithHeight(addr sdk.AccAddress) (exported.A return nil, height, err } - var account exported.Account + var account AccountI if err := ar.codec.UnmarshalJSON(bz, &account); err != nil { return nil, height, err } diff --git a/x/auth/types/account_test.go b/x/auth/types/account_test.go index 9e156c49da8d..55dc44ab28f4 100644 --- a/x/auth/types/account_test.go +++ b/x/auth/types/account_test.go @@ -11,7 +11,6 @@ import ( yaml "gopkg.in/yaml.v2" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/exported" "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -88,7 +87,7 @@ func TestGenesisAccountValidate(t *testing.T) { tests := []struct { name string - acc exported.GenesisAccount + acc types.GenesisAccount expErr bool }{ { @@ -150,7 +149,7 @@ func TestValidate(t *testing.T) { baseAcc := types.NewBaseAccount(addr, nil, 0, 0) tests := []struct { name string - acc exported.GenesisAccount + acc types.GenesisAccount expErr error }{ { @@ -195,3 +194,15 @@ func TestModuleAccountJSON(t *testing.T) { require.NoError(t, json.Unmarshal(bz, &a)) require.Equal(t, acc.String(), a.String()) } + +func TestGenesisAccountsContains(t *testing.T) { + pubkey := secp256k1.GenPrivKey().PubKey() + addr := sdk.AccAddress(pubkey.Address()) + acc := types.NewBaseAccount(addr, secp256k1.GenPrivKey().PubKey(), 0, 0) + + genAccounts := types.GenesisAccounts{} + require.False(t, genAccounts.Contains(acc.GetAddress())) + + genAccounts = append(genAccounts, acc) + require.True(t, genAccounts.Contains(acc.GetAddress())) +} diff --git a/x/auth/types/codec.go b/x/auth/types/codec.go index c4609d8a40fc..afe49ca998f1 100644 --- a/x/auth/types/codec.go +++ b/x/auth/types/codec.go @@ -2,7 +2,7 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/x/auth/exported" + "github.com/cosmos/cosmos-sdk/codec/types" ) // Codec defines the interface needed to serialize x/auth state. It must be @@ -10,24 +10,33 @@ import ( type Codec interface { codec.Marshaler - MarshalAccount(acc exported.Account) ([]byte, error) - UnmarshalAccount(bz []byte) (exported.Account, error) + MarshalAccount(acc AccountI) ([]byte, error) + UnmarshalAccount(bz []byte) (AccountI, error) - MarshalAccountJSON(acc exported.Account) ([]byte, error) - UnmarshalAccountJSON(bz []byte) (exported.Account, error) + MarshalAccountJSON(acc AccountI) ([]byte, error) + UnmarshalAccountJSON(bz []byte) (AccountI, error) } // RegisterCodec registers the account interfaces and concrete types on the // provided Amino codec. func RegisterCodec(cdc *codec.Codec) { - cdc.RegisterInterface((*exported.ModuleAccountI)(nil), nil) - cdc.RegisterInterface((*exported.GenesisAccount)(nil), nil) - cdc.RegisterInterface((*exported.Account)(nil), nil) - cdc.RegisterConcrete(&BaseAccount{}, "cosmos-sdk/Account", nil) + cdc.RegisterInterface((*ModuleAccountI)(nil), nil) + cdc.RegisterInterface((*GenesisAccount)(nil), nil) + cdc.RegisterInterface((*AccountI)(nil), nil) + cdc.RegisterConcrete(&BaseAccount{}, "cosmos-sdk/AccountI", nil) cdc.RegisterConcrete(&ModuleAccount{}, "cosmos-sdk/ModuleAccount", nil) cdc.RegisterConcrete(StdTx{}, "cosmos-sdk/StdTx", nil) } +func RegisterInterfaces(registry types.InterfaceRegistry) { + registry.RegisterInterface( + "cosmos_sdk.auth.v1.auth", + (*AccountI)(nil), + &BaseAccount{}, + &ModuleAccount{}, + ) +} + // RegisterKeyTypeCodec registers an external concrete type defined in // another module for the internal ModuleCdc. func RegisterKeyTypeCodec(o interface{}, name string) { @@ -36,6 +45,8 @@ func RegisterKeyTypeCodec(o interface{}, name string) { var ( amino = codec.New() + + ModuleCdc = codec.NewHybridCodec(amino, types.NewInterfaceRegistry()) ) func init() { diff --git a/x/auth/types/genesis.go b/x/auth/types/genesis.go index 394d83ad8e78..2814c0ddaee9 100644 --- a/x/auth/types/genesis.go +++ b/x/auth/types/genesis.go @@ -4,18 +4,16 @@ import ( "encoding/json" "fmt" "sort" - - "github.com/cosmos/cosmos-sdk/x/auth/exported" ) // GenesisState - all auth state that must be provided at genesis type GenesisState struct { - Params Params `json:"params" yaml:"params"` - Accounts exported.GenesisAccounts `json:"accounts" yaml:"accounts"` + Params Params `json:"params" yaml:"params"` + Accounts GenesisAccounts `json:"accounts" yaml:"accounts"` } // NewGenesisState - Create a new genesis state -func NewGenesisState(params Params, accounts exported.GenesisAccounts) GenesisState { +func NewGenesisState(params Params, accounts GenesisAccounts) GenesisState { return GenesisState{ Params: params, Accounts: accounts, @@ -24,7 +22,7 @@ func NewGenesisState(params Params, accounts exported.GenesisAccounts) GenesisSt // DefaultGenesisState - Return a default genesis state func DefaultGenesisState() GenesisState { - return NewGenesisState(DefaultParams(), exported.GenesisAccounts{}) + return NewGenesisState(DefaultParams(), GenesisAccounts{}) } // GetGenesisStateFromAppState returns x/auth GenesisState given raw application @@ -50,7 +48,7 @@ func ValidateGenesis(data GenesisState) error { } // SanitizeGenesisAccounts sorts accounts and coin sets. -func SanitizeGenesisAccounts(genAccs exported.GenesisAccounts) exported.GenesisAccounts { +func SanitizeGenesisAccounts(genAccs GenesisAccounts) GenesisAccounts { sort.Slice(genAccs, func(i, j int) bool { return genAccs[i].GetAccountNumber() < genAccs[j].GetAccountNumber() }) @@ -59,7 +57,7 @@ func SanitizeGenesisAccounts(genAccs exported.GenesisAccounts) exported.GenesisA } // ValidateGenAccounts validates an array of GenesisAccounts and checks for duplicates -func ValidateGenAccounts(accounts exported.GenesisAccounts) error { +func ValidateGenAccounts(accounts GenesisAccounts) error { addrMap := make(map[string]bool, len(accounts)) for _, acc := range accounts { @@ -86,7 +84,7 @@ type GenesisAccountIterator struct{} // appGenesis and invokes a callback on each genesis account. If any call // returns true, iteration stops. func (GenesisAccountIterator) IterateGenesisAccounts( - cdc Codec, appGenesis map[string]json.RawMessage, cb func(exported.Account) (stop bool), + cdc Codec, appGenesis map[string]json.RawMessage, cb func(AccountI) (stop bool), ) { for _, genAcc := range GetGenesisStateFromAppState(cdc, appGenesis).Accounts { if cb(genAcc) { diff --git a/x/auth/types/genesis_test.go b/x/auth/types/genesis_test.go index f0733a2af210..d424678574cb 100644 --- a/x/auth/types/genesis_test.go +++ b/x/auth/types/genesis_test.go @@ -8,7 +8,6 @@ import ( "github.com/tendermint/tendermint/crypto/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/exported" "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -21,7 +20,7 @@ func TestSanitize(t *testing.T) { addr2 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address()) authAcc2 := types.NewBaseAccountWithAddress(addr2) - genAccs := exported.GenesisAccounts{authAcc1, authAcc2} + genAccs := types.GenesisAccounts{authAcc1, authAcc2} require.True(t, genAccs[0].GetAccountNumber() > genAccs[1].GetAccountNumber()) require.Equal(t, genAccs[1].GetAddress(), addr2) @@ -42,7 +41,7 @@ var ( func TestValidateGenesisDuplicateAccounts(t *testing.T) { acc1 := types.NewBaseAccountWithAddress(sdk.AccAddress(addr1)) - genAccs := make(exported.GenesisAccounts, 2) + genAccs := make(types.GenesisAccounts, 2) genAccs[0] = acc1 genAccs[1] = acc1 @@ -53,7 +52,7 @@ func TestGenesisAccountIterator(t *testing.T) { acc1 := types.NewBaseAccountWithAddress(sdk.AccAddress(addr1)) acc2 := types.NewBaseAccountWithAddress(sdk.AccAddress(addr2)) - genAccounts := exported.GenesisAccounts{acc1, acc2} + genAccounts := types.GenesisAccounts{acc1, acc2} authGenState := types.DefaultGenesisState() authGenState.Accounts = genAccounts @@ -66,7 +65,7 @@ func TestGenesisAccountIterator(t *testing.T) { var addresses []sdk.AccAddress types.GenesisAccountIterator{}.IterateGenesisAccounts( - appCodec, appGenesis, func(acc exported.Account) (stop bool) { + appCodec, appGenesis, func(acc types.AccountI) (stop bool) { addresses = append(addresses, acc.GetAddress()) return false }, diff --git a/x/auth/types/stdtx.go b/x/auth/types/stdtx.go index 16d7f319408b..b9bdc090ef59 100644 --- a/x/auth/types/stdtx.go +++ b/x/auth/types/stdtx.go @@ -11,7 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/auth/exported" ) // MaxGasWanted defines the max gas allowed. @@ -245,7 +244,7 @@ func (tx StdTx) GetPubKeys() []crypto.PubKey { } // GetSignBytes returns the signBytes of the tx for a given signer -func (tx StdTx) GetSignBytes(ctx sdk.Context, acc exported.Account) []byte { +func (tx StdTx) GetSignBytes(ctx sdk.Context, acc AccountI) []byte { genesis := ctx.BlockHeight() == 0 chainID := ctx.ChainID() var accNum uint64 diff --git a/x/auth/types/types.pb.go b/x/auth/types/types.pb.go index 6d6351dade97..6cfc49977dee 100644 --- a/x/auth/types/types.pb.go +++ b/x/auth/types/types.pb.go @@ -183,7 +183,7 @@ func (m *Params) GetSigVerifyCostSecp256k1() uint64 { return 0 } -// Account defines the application-level Account type. +// AccountI defines the application-level AccountI type. type Account struct { Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` } @@ -232,7 +232,7 @@ func init() { proto.RegisterType((*BaseAccount)(nil), "cosmos_sdk.x.auth.v1.BaseAccount") proto.RegisterType((*ModuleAccount)(nil), "cosmos_sdk.x.auth.v1.ModuleAccount") proto.RegisterType((*Params)(nil), "cosmos_sdk.x.auth.v1.Params") - proto.RegisterType((*Account)(nil), "cosmos_sdk.x.auth.v1.Account") + proto.RegisterType((*Account)(nil), "cosmos_sdk.x.auth.v1.AccountI") } func init() { proto.RegisterFile("x/auth/types/types.proto", fileDescriptor_2d526fa662daab74) } @@ -1110,15 +1110,15 @@ func (m *Account) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Account: wiretype end group for non-group") + return fmt.Errorf("proto: AccountI: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Account: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AccountI: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AccountI", wireType) } var msglen int for shift := uint(0); ; shift += 7 { diff --git a/x/auth/vesting/exported/exported.go b/x/auth/vesting/exported/exported.go index 09caaec4a44b..9cb011c8c791 100644 --- a/x/auth/vesting/exported/exported.go +++ b/x/auth/vesting/exported/exported.go @@ -1,15 +1,15 @@ package exported import ( + "github.com/cosmos/cosmos-sdk/x/auth/types" "time" sdk "github.com/cosmos/cosmos-sdk/types" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" ) // VestingAccount defines an account type that vests coins via a vesting schedule. type VestingAccount interface { - authexported.Account + types.AccountI // LockedCoins returns the set of coins that are not spendable (i.e. locked). // diff --git a/x/auth/vesting/types/genesis_test.go b/x/auth/vesting/types/genesis_test.go index fb3fea0a2fdf..79913adf7de5 100644 --- a/x/auth/vesting/types/genesis_test.go +++ b/x/auth/vesting/types/genesis_test.go @@ -7,7 +7,6 @@ import ( "github.com/tendermint/tendermint/crypto/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/exported" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -30,7 +29,7 @@ func TestValidateGenesisInvalidAccounts(t *testing.T) { acc2 := authtypes.NewBaseAccountWithAddress(sdk.AccAddress(addr2)) // acc2Balance := sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 150)) - genAccs := make([]exported.GenesisAccount, 2) + genAccs := make([]authtypes.GenesisAccount, 2) genAccs[0] = baseVestingAcc genAccs[1] = acc2 diff --git a/x/auth/vesting/types/vesting_account.go b/x/auth/vesting/types/vesting_account.go index d4b6fc6345cf..7922d91899d0 100644 --- a/x/auth/vesting/types/vesting_account.go +++ b/x/auth/vesting/types/vesting_account.go @@ -6,7 +6,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vestexported "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" @@ -16,14 +15,14 @@ import ( // Compile-time type assertions var ( - _ authexported.Account = (*BaseVestingAccount)(nil) + _ authtypes.AccountI = (*BaseVestingAccount)(nil) _ vestexported.VestingAccount = (*ContinuousVestingAccount)(nil) _ vestexported.VestingAccount = (*PeriodicVestingAccount)(nil) _ vestexported.VestingAccount = (*DelayedVestingAccount)(nil) ) //----------------------------------------------------------------------------- -// Base Vesting Account +// Base Vesting AccountI // NewBaseVestingAccount creates a new BaseVestingAccount object. It is the // callers responsibility to ensure the base account has sufficient funds with @@ -262,10 +261,10 @@ func (bva *BaseVestingAccount) UnmarshalJSON(bz []byte) error { } //----------------------------------------------------------------------------- -// Continuous Vesting Account +// Continuous Vesting AccountI var _ vestexported.VestingAccount = (*ContinuousVestingAccount)(nil) -var _ authexported.GenesisAccount = (*ContinuousVestingAccount)(nil) +var _ authtypes.GenesisAccount = (*ContinuousVestingAccount)(nil) // NewContinuousVestingAccountRaw creates a new ContinuousVestingAccount object from BaseVestingAccount func NewContinuousVestingAccountRaw(bva *BaseVestingAccount, startTime int64) *ContinuousVestingAccount { @@ -422,10 +421,10 @@ func (cva *ContinuousVestingAccount) UnmarshalJSON(bz []byte) error { } //----------------------------------------------------------------------------- -// Periodic Vesting Account +// Periodic Vesting AccountI var _ vestexported.VestingAccount = (*PeriodicVestingAccount)(nil) -var _ authexported.GenesisAccount = (*PeriodicVestingAccount)(nil) +var _ authtypes.GenesisAccount = (*PeriodicVestingAccount)(nil) // NewPeriodicVestingAccountRaw creates a new PeriodicVestingAccount object from BaseVestingAccount func NewPeriodicVestingAccountRaw(bva *BaseVestingAccount, startTime int64, periods Periods) *PeriodicVestingAccount { @@ -614,10 +613,10 @@ func (pva *PeriodicVestingAccount) UnmarshalJSON(bz []byte) error { } //----------------------------------------------------------------------------- -// Delayed Vesting Account +// Delayed Vesting AccountI var _ vestexported.VestingAccount = (*DelayedVestingAccount)(nil) -var _ authexported.GenesisAccount = (*DelayedVestingAccount)(nil) +var _ authtypes.GenesisAccount = (*DelayedVestingAccount)(nil) // NewDelayedVestingAccountRaw creates a new DelayedVestingAccount object from BaseVestingAccount func NewDelayedVestingAccountRaw(bva *BaseVestingAccount) *DelayedVestingAccount { diff --git a/x/auth/vesting/types/vesting_account_test.go b/x/auth/vesting/types/vesting_account_test.go index 974a1f3149c2..5fe4d27b84e5 100644 --- a/x/auth/vesting/types/vesting_account_test.go +++ b/x/auth/vesting/types/vesting_account_test.go @@ -10,7 +10,6 @@ import ( tmtime "github.com/tendermint/tendermint/types/time" sdk "github.com/cosmos/cosmos-sdk/types" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" ) @@ -587,7 +586,7 @@ func TestGenesisAccountValidate(t *testing.T) { baseVestingWithCoins := types.NewBaseVestingAccount(baseAcc, initialVesting, 100) tests := []struct { name string - acc authexported.GenesisAccount + acc authtypes.GenesisAccount expErr bool }{ { diff --git a/x/bank/app_test.go b/x/bank/app_test.go index 47bbee7c7221..c30cfc9f1cc2 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -14,7 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/bank/types" ) @@ -93,7 +93,7 @@ func TestSendNotEnoughBalance(t *testing.T) { Address: addr1, } - genAccs := []authexported.GenesisAccount{acc} + genAccs := []authtypes.GenesisAccount{acc} app := simapp.SetupWithGenesisAccounts(genAccs) ctx := app.BaseApp.NewContext(false, abci.Header{}) @@ -161,7 +161,7 @@ func TestSendToModuleAcc(t *testing.T) { Address: test.msg.FromAddress, } - genAccs := []authexported.GenesisAccount{acc} + genAccs := []authtypes.GenesisAccount{acc} app := simapp.SetupWithGenesisAccounts(genAccs) ctx := app.BaseApp.NewContext(false, abci.Header{}) @@ -202,7 +202,7 @@ func TestMsgMultiSendWithAccounts(t *testing.T) { Address: addr1, } - genAccs := []authexported.GenesisAccount{acc} + genAccs := []authtypes.GenesisAccount{acc} app := simapp.SetupWithGenesisAccounts(genAccs) ctx := app.BaseApp.NewContext(false, abci.Header{}) @@ -269,7 +269,7 @@ func TestMsgMultiSendMultipleOut(t *testing.T) { Address: addr2, } - genAccs := []authexported.GenesisAccount{acc1, acc2} + genAccs := []authtypes.GenesisAccount{acc1, acc2} app := simapp.SetupWithGenesisAccounts(genAccs) ctx := app.BaseApp.NewContext(false, abci.Header{}) @@ -319,7 +319,7 @@ func TestMsgMultiSendMultipleInOut(t *testing.T) { Address: addr4, } - genAccs := []authexported.GenesisAccount{acc1, acc2, acc4} + genAccs := []authtypes.GenesisAccount{acc1, acc2, acc4} app := simapp.SetupWithGenesisAccounts(genAccs) ctx := app.BaseApp.NewContext(false, abci.Header{}) @@ -368,7 +368,7 @@ func TestMsgMultiSendDependent(t *testing.T) { err := acc2.SetAccountNumber(1) require.NoError(t, err) - genAccs := []authexported.GenesisAccount{acc1, acc2} + genAccs := []authtypes.GenesisAccount{acc1, acc2} app := simapp.SetupWithGenesisAccounts(genAccs) ctx := app.BaseApp.NewContext(false, abci.Header{}) diff --git a/x/bank/bench_test.go b/x/bank/bench_test.go index 4bc978c3fcdf..a66e8d593d61 100644 --- a/x/bank/bench_test.go +++ b/x/bank/bench_test.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -22,7 +22,7 @@ func BenchmarkOneBankSendTxPerBlock(b *testing.B) { } // construct genesis state - genAccs := []authexported.GenesisAccount{&acc} + genAccs := []types.GenesisAccount{&acc} benchmarkApp := simapp.SetupWithGenesisAccounts(genAccs) ctx := benchmarkApp.BaseApp.NewContext(false, abci.Header{}) @@ -62,7 +62,7 @@ func BenchmarkOneBankMultiSendTxPerBlock(b *testing.B) { } // Construct genesis state - genAccs := []authexported.GenesisAccount{&acc} + genAccs := []types.GenesisAccount{&acc} benchmarkApp := simapp.SetupWithGenesisAccounts(genAccs) ctx := benchmarkApp.BaseApp.NewContext(false, abci.Header{}) diff --git a/x/bank/types/expected_keepers.go b/x/bank/types/expected_keepers.go index 19a266354b5d..7307864b86e6 100644 --- a/x/bank/types/expected_keepers.go +++ b/x/bank/types/expected_keepers.go @@ -2,26 +2,26 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/exported" + "github.com/cosmos/cosmos-sdk/x/auth/types" ) // AccountKeeper defines the account contract that must be fulfilled when // creating a x/bank keeper. type AccountKeeper interface { - NewAccount(sdk.Context, exported.Account) exported.Account - NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) exported.Account + NewAccount(sdk.Context, types.AccountI) types.AccountI + NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) types.AccountI - GetAccount(ctx sdk.Context, addr sdk.AccAddress) exported.Account - GetAllAccounts(ctx sdk.Context) []exported.Account - SetAccount(ctx sdk.Context, acc exported.Account) + GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAllAccounts(ctx sdk.Context) []types.AccountI + SetAccount(ctx sdk.Context, acc types.AccountI) - IterateAccounts(ctx sdk.Context, process func(exported.Account) bool) + IterateAccounts(ctx sdk.Context, process func(types.AccountI) bool) - ValidatePermissions(macc exported.ModuleAccountI) error + ValidatePermissions(macc types.ModuleAccountI) error GetModuleAddress(moduleName string) sdk.AccAddress GetModuleAddressAndPermissions(moduleName string) (addr sdk.AccAddress, permissions []string) - GetModuleAccountAndPermissions(ctx sdk.Context, moduleName string) (exported.ModuleAccountI, []string) - GetModuleAccount(ctx sdk.Context, moduleName string) exported.ModuleAccountI - SetModuleAccount(ctx sdk.Context, macc exported.ModuleAccountI) + GetModuleAccountAndPermissions(ctx sdk.Context, moduleName string) (types.ModuleAccountI, []string) + GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI + SetModuleAccount(ctx sdk.Context, macc types.ModuleAccountI) } diff --git a/x/distribution/keeper/alias_functions.go b/x/distribution/keeper/alias_functions.go index 29406e326c06..5d7f1b97f23c 100644 --- a/x/distribution/keeper/alias_functions.go +++ b/x/distribution/keeper/alias_functions.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" ) @@ -17,6 +17,6 @@ func (k Keeper) GetFeePoolCommunityCoins(ctx sdk.Context) sdk.DecCoins { } // GetDistributionAccount returns the distribution ModuleAccount -func (k Keeper) GetDistributionAccount(ctx sdk.Context) authexported.ModuleAccountI { +func (k Keeper) GetDistributionAccount(ctx sdk.Context) authtypes.ModuleAccountI { return k.authKeeper.GetModuleAccount(ctx, types.ModuleName) } diff --git a/x/distribution/keeper/delegation.go b/x/distribution/keeper/delegation.go index 5604bf92fd85..3febc9861493 100644 --- a/x/distribution/keeper/delegation.go +++ b/x/distribution/keeper/delegation.go @@ -100,7 +100,7 @@ func (k Keeper) CalculateDelegationRewards(ctx sdk.Context, val exported.Validat currentStake := val.TokensFromShares(del.GetShares()) if stake.GT(currentStake) { - // Account for rounding inconsistencies between: + // AccountI for rounding inconsistencies between: // // currentStake: calculated as in staking with a single computation // stake: calculated as an accumulation of stake diff --git a/x/distribution/types/expected_keepers.go b/x/distribution/types/expected_keepers.go index 4e39b3ff3376..7a6d134d0f86 100644 --- a/x/distribution/types/expected_keepers.go +++ b/x/distribution/types/expected_keepers.go @@ -2,20 +2,20 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingexported "github.com/cosmos/cosmos-sdk/x/staking/exported" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account + GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI GetModuleAddress(name string) sdk.AccAddress - GetModuleAccount(ctx sdk.Context, name string) authexported.ModuleAccountI + GetModuleAccount(ctx sdk.Context, name string) types.ModuleAccountI // TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862 - SetModuleAccount(sdk.Context, authexported.ModuleAccountI) + SetModuleAccount(sdk.Context, types.ModuleAccountI) } // BankKeeper defines the expected interface needed to retrieve account balances. diff --git a/x/genutil/types/expected_keepers.go b/x/genutil/types/expected_keepers.go index bd0e750f2f8b..e003610a171b 100644 --- a/x/genutil/types/expected_keepers.go +++ b/x/genutil/types/expected_keepers.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + auth "github.com/cosmos/cosmos-sdk/x/auth/types" bankexported "github.com/cosmos/cosmos-sdk/x/bank/exported" ) @@ -18,9 +18,9 @@ type StakingKeeper interface { // AccountKeeper defines the expected account keeper (noalias) type AccountKeeper interface { - NewAccount(sdk.Context, authexported.Account) authexported.Account - SetAccount(sdk.Context, authexported.Account) - IterateAccounts(ctx sdk.Context, process func(authexported.Account) (stop bool)) + NewAccount(sdk.Context, auth.AccountI) auth.AccountI + SetAccount(sdk.Context, auth.AccountI) + IterateAccounts(ctx sdk.Context, process func(auth.AccountI) (stop bool)) } // GenesisAccountsIterator defines the expected iterating genesis accounts object (noalias) @@ -28,7 +28,7 @@ type GenesisAccountsIterator interface { IterateGenesisAccounts( cdc *codec.Codec, appGenesis map[string]json.RawMessage, - cb func(authexported.Account) (stop bool), + cb func(auth.AccountI) (stop bool), ) } diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 04795c70f67c..3448e5879f81 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -7,7 +7,7 @@ import ( "github.com/tendermint/tendermint/libs/log" sdk "github.com/cosmos/cosmos-sdk/types" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/gov/types" ) @@ -76,7 +76,7 @@ func (keeper Keeper) Router() types.Router { } // GetGovernanceAccount returns the governance ModuleAccount -func (keeper Keeper) GetGovernanceAccount(ctx sdk.Context) authexported.ModuleAccountI { +func (keeper Keeper) GetGovernanceAccount(ctx sdk.Context) authtypes.ModuleAccountI { return keeper.authKeeper.GetModuleAccount(ctx, types.ModuleName) } diff --git a/x/gov/types/expected_keepers.go b/x/gov/types/expected_keepers.go index 2ff31a2612d9..fcaa095369db 100644 --- a/x/gov/types/expected_keepers.go +++ b/x/gov/types/expected_keepers.go @@ -2,7 +2,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + "github.com/cosmos/cosmos-sdk/x/auth/types" stakingexported "github.com/cosmos/cosmos-sdk/x/staking/exported" ) @@ -28,13 +28,13 @@ type StakingKeeper interface { // AccountKeeper defines the expected account keeper (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account + GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI GetModuleAddress(name string) sdk.AccAddress - GetModuleAccount(ctx sdk.Context, name string) authexported.ModuleAccountI + GetModuleAccount(ctx sdk.Context, name string) types.ModuleAccountI // TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862 - SetModuleAccount(sdk.Context, authexported.ModuleAccountI) + SetModuleAccount(sdk.Context, types.ModuleAccountI) } // BankKeeper defines the expected interface needed to retrieve account balances. diff --git a/x/ibc/20-transfer/keeper/keeper.go b/x/ibc/20-transfer/keeper/keeper.go index ce9cc0add178..2d1fefd80d2a 100644 --- a/x/ibc/20-transfer/keeper/keeper.go +++ b/x/ibc/20-transfer/keeper/keeper.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/capability" channel "github.com/cosmos/cosmos-sdk/x/ibc/04-channel" channelexported "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/exported" @@ -67,7 +67,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { } // GetTransferAccount returns the ICS20 - transfers ModuleAccount -func (k Keeper) GetTransferAccount(ctx sdk.Context) authexported.ModuleAccountI { +func (k Keeper) GetTransferAccount(ctx sdk.Context) authtypes.ModuleAccountI { return k.authKeeper.GetModuleAccount(ctx, types.GetModuleAccountName()) } diff --git a/x/ibc/20-transfer/types/expected_keepers.go b/x/ibc/20-transfer/types/expected_keepers.go index a9d96eee8144..f85974c0c10b 100644 --- a/x/ibc/20-transfer/types/expected_keepers.go +++ b/x/ibc/20-transfer/types/expected_keepers.go @@ -2,7 +2,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/capability" clientexported "github.com/cosmos/cosmos-sdk/x/ibc/02-client/exported" connection "github.com/cosmos/cosmos-sdk/x/ibc/03-connection" @@ -13,7 +13,7 @@ import ( // AccountKeeper defines the contract required for account APIs. type AccountKeeper interface { GetModuleAddress(name string) sdk.AccAddress - GetModuleAccount(ctx sdk.Context, name string) authexported.ModuleAccountI + GetModuleAccount(ctx sdk.Context, name string) types.ModuleAccountI } // BankKeeper defines the expected bank keeper diff --git a/x/mint/types/expected_keepers.go b/x/mint/types/expected_keepers.go index 542b293258b8..85b6d776c5c5 100644 --- a/x/mint/types/expected_keepers.go +++ b/x/mint/types/expected_keepers.go @@ -2,7 +2,7 @@ package types // noalias import ( sdk "github.com/cosmos/cosmos-sdk/types" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + "github.com/cosmos/cosmos-sdk/x/auth/types" ) // StakingKeeper defines the expected staking keeper @@ -16,8 +16,8 @@ type AccountKeeper interface { GetModuleAddress(name string) sdk.AccAddress // TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862 - SetModuleAccount(sdk.Context, authexported.ModuleAccountI) - GetModuleAccount(ctx sdk.Context, moduleName string) authexported.ModuleAccountI + SetModuleAccount(sdk.Context, types.ModuleAccountI) + GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI } // BankKeeper defines the contract needed to be fulfilled for banking and supply diff --git a/x/slashing/app_test.go b/x/slashing/app_test.go index 364bb8e51a4f..cc82ebd33996 100644 --- a/x/slashing/app_test.go +++ b/x/slashing/app_test.go @@ -11,7 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/bank" "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/cosmos/cosmos-sdk/x/staking" @@ -45,7 +45,7 @@ func TestSlashingMsgs(t *testing.T) { acc1 := &auth.BaseAccount{ Address: addr1, } - accs := authexported.GenesisAccounts{acc1} + accs := authtypes.GenesisAccounts{acc1} balances := []bank.Balance{ { Address: addr1, diff --git a/x/slashing/types/expected_keepers.go b/x/slashing/types/expected_keepers.go index 50e71cb614e5..4a09ca72988d 100644 --- a/x/slashing/types/expected_keepers.go +++ b/x/slashing/types/expected_keepers.go @@ -4,15 +4,15 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + auth "github.com/cosmos/cosmos-sdk/x/auth/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" stakingexported "github.com/cosmos/cosmos-sdk/x/staking/exported" ) // AccountKeeper expected account keeper type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account - IterateAccounts(ctx sdk.Context, process func(authexported.Account) (stop bool)) + GetAccount(ctx sdk.Context, addr sdk.AccAddress) auth.AccountI + IterateAccounts(ctx sdk.Context, process func(auth.AccountI) (stop bool)) } // BankKeeper defines the expected interface needed to retrieve account balances. diff --git a/x/staking/app_test.go b/x/staking/app_test.go index c3330788409f..635898ee923d 100644 --- a/x/staking/app_test.go +++ b/x/staking/app_test.go @@ -9,7 +9,6 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" "github.com/cosmos/cosmos-sdk/x/bank" "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -47,7 +46,7 @@ func TestStakingMsgs(t *testing.T) { acc1 := &auth.BaseAccount{Address: addr1} acc2 := &auth.BaseAccount{Address: addr2} - accs := authexported.GenesisAccounts{acc1, acc2} + accs := auth.GenesisAccounts{acc1, acc2} balances := []bank.Balance{ { Address: addr1, diff --git a/x/staking/keeper/pool.go b/x/staking/keeper/pool.go index a6fe909864ae..5ced841e2f2f 100644 --- a/x/staking/keeper/pool.go +++ b/x/staking/keeper/pool.go @@ -2,17 +2,17 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/staking/types" ) // GetBondedPool returns the bonded tokens pool's module account -func (k Keeper) GetBondedPool(ctx sdk.Context) (bondedPool authexported.ModuleAccountI) { +func (k Keeper) GetBondedPool(ctx sdk.Context) (bondedPool authtypes.ModuleAccountI) { return k.authKeeper.GetModuleAccount(ctx, types.BondedPoolName) } // GetNotBondedPool returns the not bonded tokens pool's module account -func (k Keeper) GetNotBondedPool(ctx sdk.Context) (notBondedPool authexported.ModuleAccountI) { +func (k Keeper) GetNotBondedPool(ctx sdk.Context) (notBondedPool authtypes.ModuleAccountI) { return k.authKeeper.GetModuleAccount(ctx, types.NotBondedPoolName) } diff --git a/x/staking/types/expected_keepers.go b/x/staking/types/expected_keepers.go index e0f58b86cb4e..9dd80419a4c6 100644 --- a/x/staking/types/expected_keepers.go +++ b/x/staking/types/expected_keepers.go @@ -2,7 +2,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" - authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" bankexported "github.com/cosmos/cosmos-sdk/x/bank/exported" stakingexported "github.com/cosmos/cosmos-sdk/x/staking/exported" ) @@ -15,14 +15,14 @@ type DistributionKeeper interface { // AccountKeeper defines the expected account keeper (noalias) type AccountKeeper interface { - IterateAccounts(ctx sdk.Context, process func(authexported.Account) (stop bool)) - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account // only used for simulation + IterateAccounts(ctx sdk.Context, process func(authtypes.AccountI) (stop bool)) + GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI // only used for simulation GetModuleAddress(name string) sdk.AccAddress - GetModuleAccount(ctx sdk.Context, moduleName string) authexported.ModuleAccountI + GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI // TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862 - SetModuleAccount(sdk.Context, authexported.ModuleAccountI) + SetModuleAccount(sdk.Context, authtypes.ModuleAccountI) } // BankKeeper defines the expected interface needed to retrieve account balances. From e5e9d3f6f60be1e18ef7e54f0d00faeabced5df2 Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Sun, 10 May 2020 16:31:59 +0530 Subject: [PATCH 03/18] Did go imports --- x/auth/vesting/exported/exported.go | 3 ++- x/slashing/client/cli/cli_test.go | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x/auth/vesting/exported/exported.go b/x/auth/vesting/exported/exported.go index 9cb011c8c791..f47d24ae9eb1 100644 --- a/x/auth/vesting/exported/exported.go +++ b/x/auth/vesting/exported/exported.go @@ -1,9 +1,10 @@ package exported import ( - "github.com/cosmos/cosmos-sdk/x/auth/types" "time" + "github.com/cosmos/cosmos-sdk/x/auth/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/slashing/client/cli/cli_test.go b/x/slashing/client/cli/cli_test.go index 326c73d1fb36..4c94b54d158d 100644 --- a/x/slashing/client/cli/cli_test.go +++ b/x/slashing/client/cli/cli_test.go @@ -5,12 +5,11 @@ package cli_test import ( "testing" - "github.com/stretchr/testify/require" - "github.com/cosmos/cosmos-sdk/x/slashing/client/testutil" cli "github.com/cosmos/cosmos-sdk/tests/cli" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/slashing/client/testutil" ) func TestCLISlashingGetParams(t *testing.T) { From 223af596da4ada86ff6d78e5bb987e33516439bb Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Mon, 11 May 2020 02:56:54 +0530 Subject: [PATCH 04/18] Fix tests for x/auth --- std/codec.go | 25 ---- x/auth/alias.go | 2 +- x/auth/client/tx.go | 2 +- x/auth/exported/exported_test.go | 23 ---- x/auth/keeper/keeper.go | 34 ++++-- x/auth/keeper/querier.go | 6 +- x/auth/keeper/querier_test.go | 119 ++++++++++--------- x/auth/module.go | 2 + x/auth/simulation/decoder.go | 15 +-- x/auth/simulation/decoder_test.go | 5 +- x/auth/types/account_retriever.go | 5 +- x/auth/types/account_test.go | 6 +- x/auth/types/codec.go | 13 +- x/auth/types/genesis.go | 6 +- x/auth/vesting/types/codec.go | 26 ++++ x/auth/vesting/types/vesting_account_test.go | 18 +-- 16 files changed, 147 insertions(+), 160 deletions(-) delete mode 100644 x/auth/exported/exported_test.go diff --git a/std/codec.go b/std/codec.go index e973e9284f57..6765c3ed79f0 100644 --- a/std/codec.go +++ b/std/codec.go @@ -5,7 +5,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/x/auth" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" "github.com/cosmos/cosmos-sdk/x/bank" @@ -14,7 +13,6 @@ import ( ) var ( - _ auth.Codec = (*Codec)(nil) _ bank.Codec = (*Codec)(nil) _ gov.Codec = (*Codec)(nil) ) @@ -35,29 +33,6 @@ func NewAppCodec(amino *codec.Codec, anyUnpacker types.AnyUnpacker) *Codec { return &Codec{Marshaler: codec.NewHybridCodec(amino, anyUnpacker), amino: amino, anyUnpacker: anyUnpacker} } -// MarshalAccount marshals an AccountI interface. If the given type implements -// the Marshaler interface, it is treated as a Proto-defined message and -// serialized that way. Otherwise, it falls back on the internal Amino codec. -func (c *Codec) MarshalAccount(accI authtypes.AccountI) ([]byte, error) { - acc := &Account{} - if err := acc.SetAccount(accI); err != nil { - return nil, err - } - - return c.Marshaler.MarshalBinaryBare(acc) -} - -// UnmarshalAccount returns an AccountI interface from raw encoded account bytes -// of a Proto-based AccountI type. An error is returned upon decoding failure. -func (c *Codec) UnmarshalAccount(bz []byte) (authtypes.AccountI, error) { - acc := &Account{} - if err := c.Marshaler.UnmarshalBinaryBare(bz, acc); err != nil { - return nil, err - } - - return acc.GetAccount(), nil -} - // MarshalAccountJSON JSON encodes an account object implementing the AccountI // interface. func (c *Codec) MarshalAccountJSON(acc authtypes.AccountI) ([]byte, error) { diff --git a/x/auth/alias.go b/x/auth/alias.go index af5452706046..d3599225b331 100644 --- a/x/auth/alias.go +++ b/x/auth/alias.go @@ -78,6 +78,7 @@ var ( ) type ( + AccountI = types.AccountI SignatureVerificationGasConsumer = ante.SignatureVerificationGasConsumer AccountKeeper = keeper.AccountKeeper BaseAccount = types.BaseAccount @@ -93,7 +94,6 @@ type ( StdSignature = types.StdSignature TxBuilder = types.TxBuilder GenesisAccountIterator = types.GenesisAccountIterator - Codec = types.Codec ModuleAccount = types.ModuleAccount GenesisAccounts = types.GenesisAccounts GenesisAccount = types.GenesisAccount diff --git a/x/auth/client/tx.go b/x/auth/client/tx.go index c06acf7367a1..90678f32d08d 100644 --- a/x/auth/client/tx.go +++ b/x/auth/client/tx.go @@ -29,7 +29,7 @@ import ( // // TODO:/XXX: Using a package-level global isn't ideal and we should consider // refactoring the module manager to allow passing in the correct module codec. -var Codec authtypes.Codec +var Codec codec.Marshaler // GasEstimateResponse defines a response definition for tx gas estimation. type GasEstimateResponse struct { diff --git a/x/auth/exported/exported_test.go b/x/auth/exported/exported_test.go deleted file mode 100644 index 4ff38cd87747..000000000000 --- a/x/auth/exported/exported_test.go +++ /dev/null @@ -1,23 +0,0 @@ -package exported_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/crypto/secp256k1" - - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" -) - -func TestGenesisAccountsContains(t *testing.T) { - pubkey := secp256k1.GenPrivKey().PubKey() - addr := sdk.AccAddress(pubkey.Address()) - acc := authtypes.NewBaseAccount(addr, secp256k1.GenPrivKey().PubKey(), 0, 0) - - genAccounts := authtypes.GenesisAccounts{} - require.False(t, genAccounts.Contains(acc.GetAddress())) - - genAccounts = append(genAccounts, acc) - require.True(t, genAccounts.Contains(acc.GetAddress())) -} diff --git a/x/auth/keeper/keeper.go b/x/auth/keeper/keeper.go index 206f31c78d6b..48276b5a2941 100644 --- a/x/auth/keeper/keeper.go +++ b/x/auth/keeper/keeper.go @@ -2,12 +2,13 @@ package keeper import ( "fmt" - "github.com/cosmos/cosmos-sdk/codec" gogotypes "github.com/gogo/protobuf/types" "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/libs/log" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -18,7 +19,7 @@ import ( // encoding/decoding library. type AccountKeeper struct { key sdk.StoreKey - cdc codec.Marshaler + Cdc codec.Marshaler paramSubspace paramtypes.Subspace permAddrs map[string]types.PermissionsForAddress @@ -46,7 +47,7 @@ func NewAccountKeeper( return AccountKeeper{ key: key, proto: proto, - cdc: cdc, + Cdc: cdc, paramSubspace: paramstore, permAddrs: permAddrs, } @@ -90,7 +91,7 @@ func (ak AccountKeeper) GetNextAccountNumber(ctx sdk.Context) uint64 { } else { val := gogotypes.UInt64Value{} - err := ak.cdc.UnmarshalBinaryBare(bz, &val) + err := ak.Cdc.UnmarshalBinaryBare(bz, &val) if err != nil { panic(err) } @@ -98,7 +99,7 @@ func (ak AccountKeeper) GetNextAccountNumber(ctx sdk.Context) uint64 { accNumber = val.GetValue() } - bz = ak.cdc.MustMarshalBinaryBare(&gogotypes.UInt64Value{Value: accNumber + 1}) + bz = ak.Cdc.MustMarshalBinaryBare(&gogotypes.UInt64Value{Value: accNumber + 1}) store.Set(types.GlobalAccountNumberKey, bz) return accNumber @@ -187,17 +188,32 @@ func (ak AccountKeeper) decodeAccount(bz []byte) types.AccountI { // the Marshaler interface, it is treated as a Proto-defined message and // serialized that way. Otherwise, it falls back on the internal Amino codec. func (ak AccountKeeper) MarshalAccount(accountI types.AccountI) ([]byte, error) { - return codec.MarshalAny(ak.cdc, accountI) + return codec.MarshalAny(ak.Cdc, accountI) } // UnmarshalEvidence returns an Evidence interface from raw encoded evidence // bytes of a Proto-based Evidence type. An error is returned upon decoding // failure. func (ak AccountKeeper) UnmarshalAccount(bz []byte) (types.AccountI, error) { - var evi types.AccountI - if err := codec.UnmarshalAny(ak.cdc, &evi, bz); err != nil { + var acc types.AccountI + if err := codec.UnmarshalAny(ak.Cdc, &acc, bz); err != nil { + return nil, err + } + + return acc, nil +} + +// UnmarshalAccountJSON returns an AccountI from JSON encoded bytes +func (ak AccountKeeper) UnmarshalAccountJSON(bz []byte) (types.AccountI, error) { + var any codectypes.Any + if err := ak.Cdc.UnmarshalJSON(bz, &any); err != nil { + return nil, err + } + + var acc types.AccountI + if err := ak.Cdc.UnpackAny(&any, &acc); err != nil { return nil, err } - return evi, nil + return acc, nil } diff --git a/x/auth/keeper/querier.go b/x/auth/keeper/querier.go index eab5d3afcaa7..424e3eb21818 100644 --- a/x/auth/keeper/querier.go +++ b/x/auth/keeper/querier.go @@ -27,7 +27,7 @@ func NewQuerier(k AccountKeeper) sdk.Querier { func queryAccount(ctx sdk.Context, req abci.RequestQuery, k AccountKeeper) ([]byte, error) { var params types.QueryAccountParams - if err := k.cdc.UnmarshalJSON(req.Data, ¶ms); err != nil { + if err := k.Cdc.UnmarshalJSON(req.Data, ¶ms); err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) } @@ -36,7 +36,7 @@ func queryAccount(ctx sdk.Context, req abci.RequestQuery, k AccountKeeper) ([]by return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownAddress, "account %s does not exist", params.Address) } - bz, err := codec.MarshalJSONIndent(k.cdc, account) + bz, err := codec.MarshalJSONIndent(k.Cdc, account) if err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } @@ -47,7 +47,7 @@ func queryAccount(ctx sdk.Context, req abci.RequestQuery, k AccountKeeper) ([]by func queryParams(ctx sdk.Context, k AccountKeeper) ([]byte, error) { params := k.GetParams(ctx) - res, err := codec.MarshalJSONIndent(k.cdc, params) + res, err := codec.MarshalJSONIndent(k.Cdc, params) if err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } diff --git a/x/auth/keeper/querier_test.go b/x/auth/keeper/querier_test.go index 118cb32de2ab..50f2630b4d2d 100644 --- a/x/auth/keeper/querier_test.go +++ b/x/auth/keeper/querier_test.go @@ -1,61 +1,62 @@ package keeper_test -//import ( -// "fmt" -// "testing" -// -// "github.com/stretchr/testify/require" -// -// abci "github.com/tendermint/tendermint/abci/types" -// -// keep "github.com/cosmos/cosmos-sdk/x/auth/keeper" -// "github.com/cosmos/cosmos-sdk/x/auth/types" -//) -// -//func TestQueryAccount(t *testing.T) { -// app, ctx := createTestApp(true) -// cdc := app.Codec() -// -// req := abci.RequestQuery{ -// Path: "", -// Data: []byte{}, -// } -// -// path := []string{types.QueryAccount} -// querier := keep.NewQuerier(app.AccountKeeper) -// -// bz, err := querier(ctx, []string{"other"}, req) -// require.Error(t, err) -// require.Nil(t, bz) -// -// req = abci.RequestQuery{ -// Path: fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryAccount), -// Data: []byte{}, -// } -// res, err := querier(ctx, path, req) -// require.Error(t, err) -// require.Nil(t, res) -// -// req.Data = cdc.MustMarshalJSON(types.NewQueryAccountParams([]byte(""))) -// res, err = querier(ctx, path, req) -// require.Error(t, err) -// require.Nil(t, res) -// -// _, _, addr := types.KeyTestPubAddr() -// req.Data = cdc.MustMarshalJSON(types.NewQueryAccountParams(addr)) -// res, err = querier(ctx, path, req) -// require.Error(t, err) -// require.Nil(t, res) -// -// app.AccountKeeper.SetAccount(ctx, app.AccountKeeper.NewAccountWithAddress(ctx, addr)) -// res, err = querier(ctx, path, req) -// require.NoError(t, err) -// require.NotNil(t, res) -// -// res, err = querier(ctx, path, req) -// require.NoError(t, err) -// require.NotNil(t, res) -// -// _, err2 := app.AccountKeeper.UnmarshalAccount(res) -// require.Nil(t, err2) -//} +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" + + abci "github.com/tendermint/tendermint/abci/types" + + keep "github.com/cosmos/cosmos-sdk/x/auth/keeper" + "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +func TestQueryAccount(t *testing.T) { + app, ctx := createTestApp(true) + cdc := app.Codec() + + req := abci.RequestQuery{ + Path: "", + Data: []byte{}, + } + + path := []string{types.QueryAccount} + querier := keep.NewQuerier(app.AccountKeeper) + + bz, err := querier(ctx, []string{"other"}, req) + require.Error(t, err) + require.Nil(t, bz) + + req = abci.RequestQuery{ + Path: fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryAccount), + Data: []byte{}, + } + res, err := querier(ctx, path, req) + require.Error(t, err) + require.Nil(t, res) + + req.Data = cdc.MustMarshalJSON(types.NewQueryAccountParams([]byte(""))) + res, err = querier(ctx, path, req) + require.Error(t, err) + require.Nil(t, res) + + _, _, addr := types.KeyTestPubAddr() + req.Data = cdc.MustMarshalJSON(types.NewQueryAccountParams(addr)) + res, err = querier(ctx, path, req) + require.Error(t, err) + require.Nil(t, res) + + app.AccountKeeper.SetAccount(ctx, app.AccountKeeper.NewAccountWithAddress(ctx, addr)) + res, err = querier(ctx, path, req) + require.NoError(t, err) + require.NotNil(t, res) + + res, err = querier(ctx, path, req) + require.NoError(t, err) + require.NotNil(t, res) + + var acc types.AccountI + err2 := cdc.UnmarshalJSON(res, &acc) + require.Nil(t, err2) +} diff --git a/x/auth/module.go b/x/auth/module.go index d747f005ea5e..9b788b6ffb05 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -19,6 +19,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/client/rest" "github.com/cosmos/cosmos-sdk/x/auth/simulation" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" ) var ( @@ -74,6 +75,7 @@ func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { func (AppModuleBasic) RegisterInterfaceTypes(registry types.InterfaceRegistry) { authtypes.RegisterInterfaces(registry) + vestingtypes.RegisterInterfaces(registry) } //____________________________________________________________________________ diff --git a/x/auth/simulation/decoder.go b/x/auth/simulation/decoder.go index 495174c2a46b..6a2541965014 100644 --- a/x/auth/simulation/decoder.go +++ b/x/auth/simulation/decoder.go @@ -3,6 +3,7 @@ package simulation import ( "bytes" "fmt" + "github.com/cosmos/cosmos-sdk/x/auth/keeper" gogotypes "github.com/gogo/protobuf/types" tmkv "github.com/tendermint/tendermint/libs/kv" @@ -10,22 +11,18 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/types" ) -type AccountUnmarshaler interface { - UnmarshalAccount([]byte) (types.AccountI, error) -} - // NewDecodeStore returns a decoder function closure that unmarshals the KVPair's // Value to the corresponding auth type. -func NewDecodeStore(cdc AccountUnmarshaler) func(kvA, kvB tmkv.Pair) string { +func NewDecodeStore(ak keeper.AccountKeeper) func(kvA, kvB tmkv.Pair) string { return func(kvA, kvB tmkv.Pair) string { switch { case bytes.Equal(kvA.Key[:1], types.AddressStoreKeyPrefix): - accA, err := cdc.UnmarshalAccount(kvA.Value) + accA, err := ak.UnmarshalAccount(kvA.Value) if err != nil { panic(err) } - accB, err := cdc.UnmarshalAccount(kvB.Value) + accB, err := ak.UnmarshalAccount(kvB.Value) if err != nil { panic(err) } @@ -34,8 +31,8 @@ func NewDecodeStore(cdc AccountUnmarshaler) func(kvA, kvB tmkv.Pair) string { case bytes.Equal(kvA.Key, types.GlobalAccountNumberKey): var globalAccNumberA, globalAccNumberB gogotypes.UInt64Value - //cdc.MustUnmarshalBinaryBare(kvA.Value, &globalAccNumberA) - //cdc.MustUnmarshalBinaryBare(kvB.Value, &globalAccNumberB) + ak.Cdc.MustUnmarshalBinaryBare(kvA.Value, &globalAccNumberA) + ak.Cdc.MustUnmarshalBinaryBare(kvB.Value, &globalAccNumberB) return fmt.Sprintf("GlobalAccNumberA: %d\nGlobalAccNumberB: %d", globalAccNumberA, globalAccNumberB) diff --git a/x/auth/simulation/decoder_test.go b/x/auth/simulation/decoder_test.go index 829d0d9c2cc5..6603d0083cb9 100644 --- a/x/auth/simulation/decoder_test.go +++ b/x/auth/simulation/decoder_test.go @@ -21,11 +21,12 @@ var ( ) func TestDecodeStore(t *testing.T) { + app := simapp.Setup(false) cdc, _ := simapp.MakeCodecs() acc := types.NewBaseAccountWithAddress(delAddr1) - dec := simulation.NewDecodeStore(cdc) + dec := simulation.NewDecodeStore(app.AccountKeeper) - accBz, err := cdc.MarshalAccount(acc) + accBz, err := app.AccountKeeper.MarshalAccount(acc) require.NoError(t, err) globalAccNumber := gogotypes.UInt64Value{Value: 10} diff --git a/x/auth/types/account_retriever.go b/x/auth/types/account_retriever.go index fe7f0fb294cb..88f15ebc244f 100644 --- a/x/auth/types/account_retriever.go +++ b/x/auth/types/account_retriever.go @@ -3,6 +3,7 @@ package types import ( "fmt" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -17,12 +18,12 @@ type NodeQuerier interface { // AccountRetriever defines the properties of a type that can be used to // retrieve accounts. type AccountRetriever struct { - codec Codec + codec codec.Marshaler querier NodeQuerier } // NewAccountRetriever initialises a new AccountRetriever instance. -func NewAccountRetriever(codec Codec, querier NodeQuerier) AccountRetriever { +func NewAccountRetriever(codec codec.Marshaler, querier NodeQuerier) AccountRetriever { return AccountRetriever{codec: codec, querier: querier} } diff --git a/x/auth/types/account_test.go b/x/auth/types/account_test.go index 55dc44ab28f4..69a3d2e91871 100644 --- a/x/auth/types/account_test.go +++ b/x/auth/types/account_test.go @@ -68,15 +68,15 @@ func TestBaseAccountMarshal(t *testing.T) { err = acc.SetSequence(seq) require.Nil(t, err) - bz, err := appCodec.MarshalAccount(acc) + bz, err := app.AccountKeeper.MarshalAccount(acc) require.Nil(t, err) - acc2, err := appCodec.UnmarshalAccount(bz) + acc2, err := app.AccountKeeper.UnmarshalAccount(bz) require.Nil(t, err) require.Equal(t, acc, acc2) // error on bad bytes - _, err = appCodec.UnmarshalAccount(bz[:len(bz)/2]) + _, err = app.AccountKeeper.UnmarshalAccount(bz[:len(bz)/2]) require.NotNil(t, err) } diff --git a/x/auth/types/codec.go b/x/auth/types/codec.go index afe49ca998f1..da7cda07e44b 100644 --- a/x/auth/types/codec.go +++ b/x/auth/types/codec.go @@ -5,18 +5,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec/types" ) -// Codec defines the interface needed to serialize x/auth state. It must be -// aware of all concrete account types. -type Codec interface { - codec.Marshaler - - MarshalAccount(acc AccountI) ([]byte, error) - UnmarshalAccount(bz []byte) (AccountI, error) - - MarshalAccountJSON(acc AccountI) ([]byte, error) - UnmarshalAccountJSON(bz []byte) (AccountI, error) -} - // RegisterCodec registers the account interfaces and concrete types on the // provided Amino codec. func RegisterCodec(cdc *codec.Codec) { @@ -34,6 +22,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { (*AccountI)(nil), &BaseAccount{}, &ModuleAccount{}, + //&vesting.DelayedVestingAccount{}, ) } diff --git a/x/auth/types/genesis.go b/x/auth/types/genesis.go index 2814c0ddaee9..6e6631e1e8e5 100644 --- a/x/auth/types/genesis.go +++ b/x/auth/types/genesis.go @@ -4,6 +4,8 @@ import ( "encoding/json" "fmt" "sort" + + "github.com/cosmos/cosmos-sdk/codec" ) // GenesisState - all auth state that must be provided at genesis @@ -27,7 +29,7 @@ func DefaultGenesisState() GenesisState { // GetGenesisStateFromAppState returns x/auth GenesisState given raw application // genesis state. -func GetGenesisStateFromAppState(cdc Codec, appState map[string]json.RawMessage) GenesisState { +func GetGenesisStateFromAppState(cdc codec.Marshaler, appState map[string]json.RawMessage) GenesisState { var genesisState GenesisState if appState[ModuleName] != nil { @@ -84,7 +86,7 @@ type GenesisAccountIterator struct{} // appGenesis and invokes a callback on each genesis account. If any call // returns true, iteration stops. func (GenesisAccountIterator) IterateGenesisAccounts( - cdc Codec, appGenesis map[string]json.RawMessage, cb func(AccountI) (stop bool), + cdc codec.Marshaler, appGenesis map[string]json.RawMessage, cb func(AccountI) (stop bool), ) { for _, genAcc := range GetGenesisStateFromAppState(cdc, appGenesis).Accounts { if cb(genAcc) { diff --git a/x/auth/vesting/types/codec.go b/x/auth/vesting/types/codec.go index c0b938e2e1c3..460a651f9127 100644 --- a/x/auth/vesting/types/codec.go +++ b/x/auth/vesting/types/codec.go @@ -2,6 +2,8 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" ) @@ -14,3 +16,27 @@ func RegisterCodec(cdc *codec.Codec) { cdc.RegisterConcrete(&DelayedVestingAccount{}, "cosmos-sdk/DelayedVestingAccount", nil) cdc.RegisterConcrete(&PeriodicVestingAccount{}, "cosmos-sdk/PeriodicVestingAccount", nil) } + +func RegisterInterfaces(registry types.InterfaceRegistry) { + registry.RegisterInterface( + "cosmos_sdk.auth.v1.vesting", + (*exported.VestingAccount)(nil), + &ContinuousVestingAccount{}, + &DelayedVestingAccount{}, + &PeriodicVestingAccount{}, + ) + registry.RegisterInterface( + "cosmos_sdk.auth.v1.vesting", + (*authtypes.AccountI)(nil), + &DelayedVestingAccount{}, + &ContinuousVestingAccount{}, + &PeriodicVestingAccount{}, + ) +} + +var amino = codec.New() + +func init() { + RegisterCodec(amino) + amino.Seal() +} diff --git a/x/auth/vesting/types/vesting_account_test.go b/x/auth/vesting/types/vesting_account_test.go index 5fe4d27b84e5..5f6d8a31cd78 100644 --- a/x/auth/vesting/types/vesting_account_test.go +++ b/x/auth/vesting/types/vesting_account_test.go @@ -673,16 +673,16 @@ func TestContinuousVestingAccountMarshal(t *testing.T) { baseVesting := types.NewBaseVestingAccount(baseAcc, coins, time.Now().Unix()) acc := types.NewContinuousVestingAccountRaw(baseVesting, baseVesting.EndTime) - bz, err := appCodec.MarshalAccount(acc) + bz, err := app.AccountKeeper.MarshalAccount(acc) require.Nil(t, err) - acc2, err := appCodec.UnmarshalAccount(bz) + acc2, err := app.AccountKeeper.UnmarshalAccount(bz) require.Nil(t, err) require.IsType(t, &types.ContinuousVestingAccount{}, acc2) require.Equal(t, acc.String(), acc2.String()) // error on bad bytes - _, err = appCodec.UnmarshalAccount(bz[:len(bz)/2]) + _, err = app.AccountKeeper.UnmarshalAccount(bz[:len(bz)/2]) require.NotNil(t, err) } @@ -715,16 +715,16 @@ func TestPeriodicVestingAccountMarshal(t *testing.T) { acc := types.NewPeriodicVestingAccount(baseAcc, coins, time.Now().Unix(), types.Periods{types.Period{3600, coins}}) - bz, err := appCodec.MarshalAccount(acc) + bz, err := app.AccountKeeper.MarshalAccount(acc) require.Nil(t, err) - acc2, err := appCodec.UnmarshalAccount(bz) + acc2, err := app.AccountKeeper.UnmarshalAccount(bz) require.Nil(t, err) require.IsType(t, &types.PeriodicVestingAccount{}, acc2) require.Equal(t, acc.String(), acc2.String()) // error on bad bytes - _, err = appCodec.UnmarshalAccount(bz[:len(bz)/2]) + _, err = app.AccountKeeper.UnmarshalAccount(bz[:len(bz)/2]) require.NotNil(t, err) } @@ -756,16 +756,16 @@ func TestDelayedVestingAccountMarshal(t *testing.T) { acc := types.NewDelayedVestingAccount(baseAcc, coins, time.Now().Unix()) - bz, err := appCodec.MarshalAccount(acc) + bz, err := app.AccountKeeper.MarshalAccount(acc) require.Nil(t, err) - acc2, err := appCodec.UnmarshalAccount(bz) + acc2, err := app.AccountKeeper.UnmarshalAccount(bz) require.Nil(t, err) require.IsType(t, &types.DelayedVestingAccount{}, acc2) require.Equal(t, acc.String(), acc2.String()) // error on bad bytes - _, err = appCodec.UnmarshalAccount(bz[:len(bz)/2]) + _, err = app.AccountKeeper.UnmarshalAccount(bz[:len(bz)/2]) require.NotNil(t, err) } From f21fb680b5adf5a79fa2ef56977abc048612fb2b Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Mon, 11 May 2020 17:32:17 +0530 Subject: [PATCH 05/18] Cleanup std/codec --- std/codec.go | 17 - std/codec.pb.go | 1043 ++++++++------------------------------ std/codec.proto | 16 - x/auth/types/codec.go | 1 - x/auth/types/types.pb.go | 297 ++--------- x/auth/types/types.proto | 1 - 6 files changed, 254 insertions(+), 1121 deletions(-) diff --git a/std/codec.go b/std/codec.go index 6765c3ed79f0..8ae55ab2a485 100644 --- a/std/codec.go +++ b/std/codec.go @@ -5,7 +5,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" "github.com/cosmos/cosmos-sdk/x/bank" bankexported "github.com/cosmos/cosmos-sdk/x/bank/exported" @@ -33,22 +32,6 @@ func NewAppCodec(amino *codec.Codec, anyUnpacker types.AnyUnpacker) *Codec { return &Codec{Marshaler: codec.NewHybridCodec(amino, anyUnpacker), amino: amino, anyUnpacker: anyUnpacker} } -// MarshalAccountJSON JSON encodes an account object implementing the AccountI -// interface. -func (c *Codec) MarshalAccountJSON(acc authtypes.AccountI) ([]byte, error) { - return c.Marshaler.MarshalJSON(acc) -} - -// UnmarshalAccountJSON returns an AccountI from JSON encoded bytes. -func (c *Codec) UnmarshalAccountJSON(bz []byte) (authtypes.AccountI, error) { - acc := &Account{} - if err := c.Marshaler.UnmarshalJSON(bz, acc); err != nil { - return nil, err - } - - return acc.GetAccount(), nil -} - // MarshalSupply marshals a SupplyI interface. If the given type implements // the Marshaler interface, it is treated as a Proto-defined message and // serialized that way. Otherwise, it falls back on the internal Amino codec. diff --git a/std/codec.pb.go b/std/codec.pb.go index ebd08808e7b9..b1c159b32179 100644 --- a/std/codec.pb.go +++ b/std/codec.pb.go @@ -6,19 +6,17 @@ package std import ( fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types9 "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/x/auth/types" - types1 "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + types7 "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_x_bank_exported "github.com/cosmos/cosmos-sdk/x/bank/exported" - types2 "github.com/cosmos/cosmos-sdk/x/bank/types" - types6 "github.com/cosmos/cosmos-sdk/x/crisis/types" - types5 "github.com/cosmos/cosmos-sdk/x/distribution/types" + types "github.com/cosmos/cosmos-sdk/x/bank/types" + types4 "github.com/cosmos/cosmos-sdk/x/crisis/types" + types3 "github.com/cosmos/cosmos-sdk/x/distribution/types" github_com_cosmos_cosmos_sdk_x_gov_types "github.com/cosmos/cosmos-sdk/x/gov/types" - types3 "github.com/cosmos/cosmos-sdk/x/gov/types" + types1 "github.com/cosmos/cosmos-sdk/x/gov/types" proposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - types7 "github.com/cosmos/cosmos-sdk/x/slashing/types" - types8 "github.com/cosmos/cosmos-sdk/x/staking/types" - types4 "github.com/cosmos/cosmos-sdk/x/upgrade/types" + types5 "github.com/cosmos/cosmos-sdk/x/slashing/types" + types6 "github.com/cosmos/cosmos-sdk/x/staking/types" + types2 "github.com/cosmos/cosmos-sdk/x/upgrade/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" _ "github.com/regen-network/cosmos-proto" @@ -38,133 +36,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// AccountI defines the application-level AccountI type. -type Account struct { - // sum defines a list of all acceptable concrete AccountI implementations. - // - // Types that are valid to be assigned to Sum: - // *Account_BaseAccount - // *Account_ContinuousVestingAccount - // *Account_DelayedVestingAccount - // *Account_PeriodicVestingAccount - // *Account_ModuleAccount - Sum isAccount_Sum `protobuf_oneof:"sum"` -} - -func (m *Account) Reset() { *m = Account{} } -func (m *Account) String() string { return proto.CompactTextString(m) } -func (*Account) ProtoMessage() {} -func (*Account) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{0} -} -func (m *Account) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Account.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Account) XXX_Merge(src proto.Message) { - xxx_messageInfo_Account.Merge(m, src) -} -func (m *Account) XXX_Size() int { - return m.Size() -} -func (m *Account) XXX_DiscardUnknown() { - xxx_messageInfo_Account.DiscardUnknown(m) -} - -var xxx_messageInfo_Account proto.InternalMessageInfo - -type isAccount_Sum interface { - isAccount_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Account_BaseAccount struct { - BaseAccount *types.BaseAccount `protobuf:"bytes,1,opt,name=base_account,json=baseAccount,proto3,oneof" json:"base_account,omitempty"` -} -type Account_ContinuousVestingAccount struct { - ContinuousVestingAccount *types1.ContinuousVestingAccount `protobuf:"bytes,2,opt,name=continuous_vesting_account,json=continuousVestingAccount,proto3,oneof" json:"continuous_vesting_account,omitempty"` -} -type Account_DelayedVestingAccount struct { - DelayedVestingAccount *types1.DelayedVestingAccount `protobuf:"bytes,3,opt,name=delayed_vesting_account,json=delayedVestingAccount,proto3,oneof" json:"delayed_vesting_account,omitempty"` -} -type Account_PeriodicVestingAccount struct { - PeriodicVestingAccount *types1.PeriodicVestingAccount `protobuf:"bytes,4,opt,name=periodic_vesting_account,json=periodicVestingAccount,proto3,oneof" json:"periodic_vesting_account,omitempty"` -} -type Account_ModuleAccount struct { - ModuleAccount *types.ModuleAccount `protobuf:"bytes,5,opt,name=module_account,json=moduleAccount,proto3,oneof" json:"module_account,omitempty"` -} - -func (*Account_BaseAccount) isAccount_Sum() {} -func (*Account_ContinuousVestingAccount) isAccount_Sum() {} -func (*Account_DelayedVestingAccount) isAccount_Sum() {} -func (*Account_PeriodicVestingAccount) isAccount_Sum() {} -func (*Account_ModuleAccount) isAccount_Sum() {} - -func (m *Account) GetSum() isAccount_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Account) GetBaseAccount() *types.BaseAccount { - if x, ok := m.GetSum().(*Account_BaseAccount); ok { - return x.BaseAccount - } - return nil -} - -func (m *Account) GetContinuousVestingAccount() *types1.ContinuousVestingAccount { - if x, ok := m.GetSum().(*Account_ContinuousVestingAccount); ok { - return x.ContinuousVestingAccount - } - return nil -} - -func (m *Account) GetDelayedVestingAccount() *types1.DelayedVestingAccount { - if x, ok := m.GetSum().(*Account_DelayedVestingAccount); ok { - return x.DelayedVestingAccount - } - return nil -} - -func (m *Account) GetPeriodicVestingAccount() *types1.PeriodicVestingAccount { - if x, ok := m.GetSum().(*Account_PeriodicVestingAccount); ok { - return x.PeriodicVestingAccount - } - return nil -} - -func (m *Account) GetModuleAccount() *types.ModuleAccount { - if x, ok := m.GetSum().(*Account_ModuleAccount); ok { - return x.ModuleAccount - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Account) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Account_BaseAccount)(nil), - (*Account_ContinuousVestingAccount)(nil), - (*Account_DelayedVestingAccount)(nil), - (*Account_PeriodicVestingAccount)(nil), - (*Account_ModuleAccount)(nil), - } -} - // Supply defines the application-level Supply type. type Supply struct { // sum defines a set of all acceptable concrete Supply implementations. @@ -178,7 +49,7 @@ func (m *Supply) Reset() { *m = Supply{} } func (m *Supply) String() string { return proto.CompactTextString(m) } func (*Supply) ProtoMessage() {} func (*Supply) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{1} + return fileDescriptor_ff851c3a98ef46f7, []int{0} } func (m *Supply) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -215,7 +86,7 @@ type isSupply_Sum interface { } type Supply_Supply struct { - Supply *types2.Supply `protobuf:"bytes,1,opt,name=supply,proto3,oneof" json:"supply,omitempty"` + Supply *types.Supply `protobuf:"bytes,1,opt,name=supply,proto3,oneof" json:"supply,omitempty"` } func (*Supply_Supply) isSupply_Sum() {} @@ -227,7 +98,7 @@ func (m *Supply) GetSum() isSupply_Sum { return nil } -func (m *Supply) GetSupply() *types2.Supply { +func (m *Supply) GetSupply() *types.Supply { if x, ok := m.GetSum().(*Supply_Supply); ok { return x.Supply } @@ -244,7 +115,7 @@ func (*Supply) XXX_OneofWrappers() []interface{} { // MsgSubmitProposal defines the application-level message type for handling // governance proposals. type MsgSubmitProposal struct { - types3.MsgSubmitProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base"` + types1.MsgSubmitProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base"` Content *Content `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` } @@ -252,7 +123,7 @@ func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } func (m *MsgSubmitProposal) String() string { return proto.CompactTextString(m) } func (*MsgSubmitProposal) ProtoMessage() {} func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{2} + return fileDescriptor_ff851c3a98ef46f7, []int{1} } func (m *MsgSubmitProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -284,7 +155,7 @@ var xxx_messageInfo_MsgSubmitProposal proto.InternalMessageInfo // Proposal defines the application-level concrete proposal type used in // governance proposals. type Proposal struct { - types3.ProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base"` + types1.ProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base"` Content Content `protobuf:"bytes,2,opt,name=content,proto3" json:"content"` } @@ -292,7 +163,7 @@ func (m *Proposal) Reset() { *m = Proposal{} } func (m *Proposal) String() string { return proto.CompactTextString(m) } func (*Proposal) ProtoMessage() {} func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{3} + return fileDescriptor_ff851c3a98ef46f7, []int{2} } func (m *Proposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -347,7 +218,7 @@ func (m *Content) Reset() { *m = Content{} } func (m *Content) String() string { return proto.CompactTextString(m) } func (*Content) ProtoMessage() {} func (*Content) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{4} + return fileDescriptor_ff851c3a98ef46f7, []int{3} } func (m *Content) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -384,19 +255,19 @@ type isContent_Sum interface { } type Content_Text struct { - Text *types3.TextProposal `protobuf:"bytes,1,opt,name=text,proto3,oneof" json:"text,omitempty"` + Text *types1.TextProposal `protobuf:"bytes,1,opt,name=text,proto3,oneof" json:"text,omitempty"` } type Content_ParameterChange struct { ParameterChange *proposal.ParameterChangeProposal `protobuf:"bytes,2,opt,name=parameter_change,json=parameterChange,proto3,oneof" json:"parameter_change,omitempty"` } type Content_SoftwareUpgrade struct { - SoftwareUpgrade *types4.SoftwareUpgradeProposal `protobuf:"bytes,3,opt,name=software_upgrade,json=softwareUpgrade,proto3,oneof" json:"software_upgrade,omitempty"` + SoftwareUpgrade *types2.SoftwareUpgradeProposal `protobuf:"bytes,3,opt,name=software_upgrade,json=softwareUpgrade,proto3,oneof" json:"software_upgrade,omitempty"` } type Content_CancelSoftwareUpgrade struct { - CancelSoftwareUpgrade *types4.CancelSoftwareUpgradeProposal `protobuf:"bytes,4,opt,name=cancel_software_upgrade,json=cancelSoftwareUpgrade,proto3,oneof" json:"cancel_software_upgrade,omitempty"` + CancelSoftwareUpgrade *types2.CancelSoftwareUpgradeProposal `protobuf:"bytes,4,opt,name=cancel_software_upgrade,json=cancelSoftwareUpgrade,proto3,oneof" json:"cancel_software_upgrade,omitempty"` } type Content_CommunityPoolSpend struct { - CommunityPoolSpend *types5.CommunityPoolSpendProposal `protobuf:"bytes,5,opt,name=community_pool_spend,json=communityPoolSpend,proto3,oneof" json:"community_pool_spend,omitempty"` + CommunityPoolSpend *types3.CommunityPoolSpendProposal `protobuf:"bytes,5,opt,name=community_pool_spend,json=communityPoolSpend,proto3,oneof" json:"community_pool_spend,omitempty"` } func (*Content_Text) isContent_Sum() {} @@ -412,7 +283,7 @@ func (m *Content) GetSum() isContent_Sum { return nil } -func (m *Content) GetText() *types3.TextProposal { +func (m *Content) GetText() *types1.TextProposal { if x, ok := m.GetSum().(*Content_Text); ok { return x.Text } @@ -426,21 +297,21 @@ func (m *Content) GetParameterChange() *proposal.ParameterChangeProposal { return nil } -func (m *Content) GetSoftwareUpgrade() *types4.SoftwareUpgradeProposal { +func (m *Content) GetSoftwareUpgrade() *types2.SoftwareUpgradeProposal { if x, ok := m.GetSum().(*Content_SoftwareUpgrade); ok { return x.SoftwareUpgrade } return nil } -func (m *Content) GetCancelSoftwareUpgrade() *types4.CancelSoftwareUpgradeProposal { +func (m *Content) GetCancelSoftwareUpgrade() *types2.CancelSoftwareUpgradeProposal { if x, ok := m.GetSum().(*Content_CancelSoftwareUpgrade); ok { return x.CancelSoftwareUpgrade } return nil } -func (m *Content) GetCommunityPoolSpend() *types5.CommunityPoolSpendProposal { +func (m *Content) GetCommunityPoolSpend() *types3.CommunityPoolSpendProposal { if x, ok := m.GetSum().(*Content_CommunityPoolSpend); ok { return x.CommunityPoolSpend } @@ -470,7 +341,7 @@ func (m *Transaction) Reset() { *m = Transaction{} } func (m *Transaction) String() string { return proto.CompactTextString(m) } func (*Transaction) ProtoMessage() {} func (*Transaction) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{5} + return fileDescriptor_ff851c3a98ef46f7, []int{4} } func (m *Transaction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -528,7 +399,7 @@ func (m *Message) Reset() { *m = Message{} } func (m *Message) String() string { return proto.CompactTextString(m) } func (*Message) ProtoMessage() {} func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{6} + return fileDescriptor_ff851c3a98ef46f7, []int{5} } func (m *Message) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -564,52 +435,52 @@ type isMessage_Sum interface { } type Message_MsgSend struct { - MsgSend *types2.MsgSend `protobuf:"bytes,1,opt,name=msg_send,json=msgSend,proto3,oneof" json:"msg_send,omitempty"` + MsgSend *types.MsgSend `protobuf:"bytes,1,opt,name=msg_send,json=msgSend,proto3,oneof" json:"msg_send,omitempty"` } type Message_MsgMultiSend struct { - MsgMultiSend *types2.MsgMultiSend `protobuf:"bytes,2,opt,name=msg_multi_send,json=msgMultiSend,proto3,oneof" json:"msg_multi_send,omitempty"` + MsgMultiSend *types.MsgMultiSend `protobuf:"bytes,2,opt,name=msg_multi_send,json=msgMultiSend,proto3,oneof" json:"msg_multi_send,omitempty"` } type Message_MsgVerifyInvariant struct { - MsgVerifyInvariant *types6.MsgVerifyInvariant `protobuf:"bytes,3,opt,name=msg_verify_invariant,json=msgVerifyInvariant,proto3,oneof" json:"msg_verify_invariant,omitempty"` + MsgVerifyInvariant *types4.MsgVerifyInvariant `protobuf:"bytes,3,opt,name=msg_verify_invariant,json=msgVerifyInvariant,proto3,oneof" json:"msg_verify_invariant,omitempty"` } type Message_MsgSetWithdrawAddress struct { - MsgSetWithdrawAddress *types5.MsgSetWithdrawAddress `protobuf:"bytes,4,opt,name=msg_set_withdraw_address,json=msgSetWithdrawAddress,proto3,oneof" json:"msg_set_withdraw_address,omitempty"` + MsgSetWithdrawAddress *types3.MsgSetWithdrawAddress `protobuf:"bytes,4,opt,name=msg_set_withdraw_address,json=msgSetWithdrawAddress,proto3,oneof" json:"msg_set_withdraw_address,omitempty"` } type Message_MsgWithdrawDelegatorReward struct { - MsgWithdrawDelegatorReward *types5.MsgWithdrawDelegatorReward `protobuf:"bytes,5,opt,name=msg_withdraw_delegator_reward,json=msgWithdrawDelegatorReward,proto3,oneof" json:"msg_withdraw_delegator_reward,omitempty"` + MsgWithdrawDelegatorReward *types3.MsgWithdrawDelegatorReward `protobuf:"bytes,5,opt,name=msg_withdraw_delegator_reward,json=msgWithdrawDelegatorReward,proto3,oneof" json:"msg_withdraw_delegator_reward,omitempty"` } type Message_MsgWithdrawValidatorCommission struct { - MsgWithdrawValidatorCommission *types5.MsgWithdrawValidatorCommission `protobuf:"bytes,6,opt,name=msg_withdraw_validator_commission,json=msgWithdrawValidatorCommission,proto3,oneof" json:"msg_withdraw_validator_commission,omitempty"` + MsgWithdrawValidatorCommission *types3.MsgWithdrawValidatorCommission `protobuf:"bytes,6,opt,name=msg_withdraw_validator_commission,json=msgWithdrawValidatorCommission,proto3,oneof" json:"msg_withdraw_validator_commission,omitempty"` } type Message_MsgFundCommunityPool struct { - MsgFundCommunityPool *types5.MsgFundCommunityPool `protobuf:"bytes,7,opt,name=msg_fund_community_pool,json=msgFundCommunityPool,proto3,oneof" json:"msg_fund_community_pool,omitempty"` + MsgFundCommunityPool *types3.MsgFundCommunityPool `protobuf:"bytes,7,opt,name=msg_fund_community_pool,json=msgFundCommunityPool,proto3,oneof" json:"msg_fund_community_pool,omitempty"` } type Message_MsgSubmitProposal struct { MsgSubmitProposal *MsgSubmitProposal `protobuf:"bytes,9,opt,name=msg_submit_proposal,json=msgSubmitProposal,proto3,oneof" json:"msg_submit_proposal,omitempty"` } type Message_MsgVote struct { - MsgVote *types3.MsgVote `protobuf:"bytes,10,opt,name=msg_vote,json=msgVote,proto3,oneof" json:"msg_vote,omitempty"` + MsgVote *types1.MsgVote `protobuf:"bytes,10,opt,name=msg_vote,json=msgVote,proto3,oneof" json:"msg_vote,omitempty"` } type Message_MsgDeposit struct { - MsgDeposit *types3.MsgDeposit `protobuf:"bytes,11,opt,name=msg_deposit,json=msgDeposit,proto3,oneof" json:"msg_deposit,omitempty"` + MsgDeposit *types1.MsgDeposit `protobuf:"bytes,11,opt,name=msg_deposit,json=msgDeposit,proto3,oneof" json:"msg_deposit,omitempty"` } type Message_MsgUnjail struct { - MsgUnjail *types7.MsgUnjail `protobuf:"bytes,12,opt,name=msg_unjail,json=msgUnjail,proto3,oneof" json:"msg_unjail,omitempty"` + MsgUnjail *types5.MsgUnjail `protobuf:"bytes,12,opt,name=msg_unjail,json=msgUnjail,proto3,oneof" json:"msg_unjail,omitempty"` } type Message_MsgCreateValidator struct { - MsgCreateValidator *types8.MsgCreateValidator `protobuf:"bytes,13,opt,name=msg_create_validator,json=msgCreateValidator,proto3,oneof" json:"msg_create_validator,omitempty"` + MsgCreateValidator *types6.MsgCreateValidator `protobuf:"bytes,13,opt,name=msg_create_validator,json=msgCreateValidator,proto3,oneof" json:"msg_create_validator,omitempty"` } type Message_MsgEditValidator struct { - MsgEditValidator *types8.MsgEditValidator `protobuf:"bytes,14,opt,name=msg_edit_validator,json=msgEditValidator,proto3,oneof" json:"msg_edit_validator,omitempty"` + MsgEditValidator *types6.MsgEditValidator `protobuf:"bytes,14,opt,name=msg_edit_validator,json=msgEditValidator,proto3,oneof" json:"msg_edit_validator,omitempty"` } type Message_MsgDelegate struct { - MsgDelegate *types8.MsgDelegate `protobuf:"bytes,15,opt,name=msg_delegate,json=msgDelegate,proto3,oneof" json:"msg_delegate,omitempty"` + MsgDelegate *types6.MsgDelegate `protobuf:"bytes,15,opt,name=msg_delegate,json=msgDelegate,proto3,oneof" json:"msg_delegate,omitempty"` } type Message_MsgBeginRedelegate struct { - MsgBeginRedelegate *types8.MsgBeginRedelegate `protobuf:"bytes,16,opt,name=msg_begin_redelegate,json=msgBeginRedelegate,proto3,oneof" json:"msg_begin_redelegate,omitempty"` + MsgBeginRedelegate *types6.MsgBeginRedelegate `protobuf:"bytes,16,opt,name=msg_begin_redelegate,json=msgBeginRedelegate,proto3,oneof" json:"msg_begin_redelegate,omitempty"` } type Message_MsgUndelegate struct { - MsgUndelegate *types8.MsgUndelegate `protobuf:"bytes,17,opt,name=msg_undelegate,json=msgUndelegate,proto3,oneof" json:"msg_undelegate,omitempty"` + MsgUndelegate *types6.MsgUndelegate `protobuf:"bytes,17,opt,name=msg_undelegate,json=msgUndelegate,proto3,oneof" json:"msg_undelegate,omitempty"` } func (*Message_MsgSend) isMessage_Sum() {} @@ -636,49 +507,49 @@ func (m *Message) GetSum() isMessage_Sum { return nil } -func (m *Message) GetMsgSend() *types2.MsgSend { +func (m *Message) GetMsgSend() *types.MsgSend { if x, ok := m.GetSum().(*Message_MsgSend); ok { return x.MsgSend } return nil } -func (m *Message) GetMsgMultiSend() *types2.MsgMultiSend { +func (m *Message) GetMsgMultiSend() *types.MsgMultiSend { if x, ok := m.GetSum().(*Message_MsgMultiSend); ok { return x.MsgMultiSend } return nil } -func (m *Message) GetMsgVerifyInvariant() *types6.MsgVerifyInvariant { +func (m *Message) GetMsgVerifyInvariant() *types4.MsgVerifyInvariant { if x, ok := m.GetSum().(*Message_MsgVerifyInvariant); ok { return x.MsgVerifyInvariant } return nil } -func (m *Message) GetMsgSetWithdrawAddress() *types5.MsgSetWithdrawAddress { +func (m *Message) GetMsgSetWithdrawAddress() *types3.MsgSetWithdrawAddress { if x, ok := m.GetSum().(*Message_MsgSetWithdrawAddress); ok { return x.MsgSetWithdrawAddress } return nil } -func (m *Message) GetMsgWithdrawDelegatorReward() *types5.MsgWithdrawDelegatorReward { +func (m *Message) GetMsgWithdrawDelegatorReward() *types3.MsgWithdrawDelegatorReward { if x, ok := m.GetSum().(*Message_MsgWithdrawDelegatorReward); ok { return x.MsgWithdrawDelegatorReward } return nil } -func (m *Message) GetMsgWithdrawValidatorCommission() *types5.MsgWithdrawValidatorCommission { +func (m *Message) GetMsgWithdrawValidatorCommission() *types3.MsgWithdrawValidatorCommission { if x, ok := m.GetSum().(*Message_MsgWithdrawValidatorCommission); ok { return x.MsgWithdrawValidatorCommission } return nil } -func (m *Message) GetMsgFundCommunityPool() *types5.MsgFundCommunityPool { +func (m *Message) GetMsgFundCommunityPool() *types3.MsgFundCommunityPool { if x, ok := m.GetSum().(*Message_MsgFundCommunityPool); ok { return x.MsgFundCommunityPool } @@ -692,56 +563,56 @@ func (m *Message) GetMsgSubmitProposal() *MsgSubmitProposal { return nil } -func (m *Message) GetMsgVote() *types3.MsgVote { +func (m *Message) GetMsgVote() *types1.MsgVote { if x, ok := m.GetSum().(*Message_MsgVote); ok { return x.MsgVote } return nil } -func (m *Message) GetMsgDeposit() *types3.MsgDeposit { +func (m *Message) GetMsgDeposit() *types1.MsgDeposit { if x, ok := m.GetSum().(*Message_MsgDeposit); ok { return x.MsgDeposit } return nil } -func (m *Message) GetMsgUnjail() *types7.MsgUnjail { +func (m *Message) GetMsgUnjail() *types5.MsgUnjail { if x, ok := m.GetSum().(*Message_MsgUnjail); ok { return x.MsgUnjail } return nil } -func (m *Message) GetMsgCreateValidator() *types8.MsgCreateValidator { +func (m *Message) GetMsgCreateValidator() *types6.MsgCreateValidator { if x, ok := m.GetSum().(*Message_MsgCreateValidator); ok { return x.MsgCreateValidator } return nil } -func (m *Message) GetMsgEditValidator() *types8.MsgEditValidator { +func (m *Message) GetMsgEditValidator() *types6.MsgEditValidator { if x, ok := m.GetSum().(*Message_MsgEditValidator); ok { return x.MsgEditValidator } return nil } -func (m *Message) GetMsgDelegate() *types8.MsgDelegate { +func (m *Message) GetMsgDelegate() *types6.MsgDelegate { if x, ok := m.GetSum().(*Message_MsgDelegate); ok { return x.MsgDelegate } return nil } -func (m *Message) GetMsgBeginRedelegate() *types8.MsgBeginRedelegate { +func (m *Message) GetMsgBeginRedelegate() *types6.MsgBeginRedelegate { if x, ok := m.GetSum().(*Message_MsgBeginRedelegate); ok { return x.MsgBeginRedelegate } return nil } -func (m *Message) GetMsgUndelegate() *types8.MsgUndelegate { +func (m *Message) GetMsgUndelegate() *types6.MsgUndelegate { if x, ok := m.GetSum().(*Message_MsgUndelegate); ok { return x.MsgUndelegate } @@ -781,7 +652,7 @@ func (m *SignDoc) Reset() { *m = SignDoc{} } func (m *SignDoc) String() string { return proto.CompactTextString(m) } func (*SignDoc) ProtoMessage() {} func (*SignDoc) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{7} + return fileDescriptor_ff851c3a98ef46f7, []int{6} } func (m *SignDoc) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -829,7 +700,7 @@ func (m *StdFee) Reset() { *m = StdFee{} } func (m *StdFee) String() string { return proto.CompactTextString(m) } func (*StdFee) ProtoMessage() {} func (*StdFee) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{8} + return fileDescriptor_ff851c3a98ef46f7, []int{7} } func (m *StdFee) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -869,7 +740,7 @@ func (m *StdSignature) Reset() { *m = StdSignature{} } func (m *StdSignature) String() string { return proto.CompactTextString(m) } func (*StdSignature) ProtoMessage() {} func (*StdSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{9} + return fileDescriptor_ff851c3a98ef46f7, []int{8} } func (m *StdSignature) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -910,7 +781,7 @@ func (m *StdTxBase) Reset() { *m = StdTxBase{} } func (m *StdTxBase) String() string { return proto.CompactTextString(m) } func (*StdTxBase) ProtoMessage() {} func (*StdTxBase) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{10} + return fileDescriptor_ff851c3a98ef46f7, []int{9} } func (m *StdTxBase) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -974,7 +845,7 @@ func (m *StdSignDocBase) Reset() { *m = StdSignDocBase{} } func (m *StdSignDocBase) String() string { return proto.CompactTextString(m) } func (*StdSignDocBase) ProtoMessage() {} func (*StdSignDocBase) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{11} + return fileDescriptor_ff851c3a98ef46f7, []int{10} } func (m *StdSignDocBase) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1039,7 +910,6 @@ func (m *StdSignDocBase) GetFee() StdFee { } func init() { - proto.RegisterType((*Account)(nil), "cosmos_sdk.std.v1.AccountI") proto.RegisterType((*Supply)(nil), "cosmos_sdk.std.v1.Supply") proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos_sdk.std.v1.MsgSubmitProposal") proto.RegisterType((*Proposal)(nil), "cosmos_sdk.std.v1.Proposal") @@ -1056,110 +926,100 @@ func init() { func init() { proto.RegisterFile("std/codec.proto", fileDescriptor_ff851c3a98ef46f7) } var fileDescriptor_ff851c3a98ef46f7 = []byte{ - // 1639 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4f, 0x6f, 0x1b, 0xb9, - 0x15, 0x97, 0x62, 0xc5, 0xb2, 0x69, 0xf9, 0x1f, 0x93, 0xd4, 0x8a, 0xeb, 0x48, 0x8e, 0x52, 0x04, - 0x69, 0x52, 0x4b, 0x71, 0x92, 0xa6, 0x8d, 0xd0, 0x7f, 0x91,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0xac, 0x23, 0x44, 0x5c, 0x93, 0x84, - 0x0f, 0x82, 0xd9, 0x46, 0xe9, 0xec, 0xb4, 0x9c, 0xdf, 0x92, 0xb2, 0xdd, 0xed, 0x0f, 0xa7, 0xe5, - 0xc5, 0xf0, 0x38, 0x22, 0xa3, 0x8a, 0x91, 0x57, 0xcb, 0x5d, 0x1b, 0xfe, 0x0c, 0x2c, 0xe8, 0x7f, - 0x52, 0xa6, 0x1b, 0xd0, 0x16, 0xf6, 0xc3, 0x64, 0x34, 0xae, 0x7e, 0x38, 0x2d, 0x5f, 0x09, 0x51, - 0x83, 0xfa, 0x8a, 0x31, 0xaf, 0x05, 0xbf, 0x52, 0x7b, 0xb8, 0x0a, 0x66, 0x38, 0xfe, 0x73, 0x80, - 0x5d, 0x2b, 0x7c, 0x9e, 0xe6, 0x8c, 0x78, 0x1f, 0xc7, 0x9f, 0xeb, 0xc7, 0x1f, 0x9d, 0xe6, 0xc5, - 0xf3, 0x9f, 0x66, 0xa3, 0xfe, 0xfa, 0xac, 0x94, 0x7d, 0x7b, 0x56, 0xca, 0x7e, 0x7e, 0x56, 0xca, - 0xfe, 0xfb, 0x5d, 0x29, 0xf3, 0xf6, 0x5d, 0x29, 0xf3, 0xe9, 0xbb, 0x52, 0xe6, 0x77, 0xeb, 0x13, - 0x4b, 0x8e, 0x0b, 0xbb, 0x35, 0xad, 0xfe, 0xe5, 0xdf, 0xff, 0x2a, 0x00, 0x00, 0xff, 0xff, 0x1a, - 0x12, 0x9f, 0x93, 0x9d, 0x11, 0x00, 0x00, + // 1477 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcd, 0x6f, 0x1b, 0x37, + 0x16, 0xd7, 0xc4, 0x8a, 0x65, 0xd3, 0x8e, 0x3f, 0x98, 0x04, 0x99, 0x78, 0x1d, 0xc9, 0x51, 0x16, + 0x41, 0x36, 0x59, 0x4b, 0x71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x1a, 0xdf, 0x05, 0x84, 0x10, 0x64, 0x29, 0xa6, 0x4c, 0x4d, 0xd4, 0x69, 0x4b, 0x7d, 0x17, 0x7f, + 0x33, 0xc0, 0x5c, 0x6f, 0xea, 0xe5, 0x45, 0xe7, 0xec, 0x23, 0xe2, 0xdb, 0x24, 0x7e, 0x10, 0x4c, + 0x57, 0xf3, 0xc7, 0x47, 0x85, 0xdc, 0xba, 0xdc, 0xdb, 0xda, 0x78, 0x75, 0x54, 0x98, 0x8f, 0xc3, + 0x91, 0x28, 0x15, 0xad, 0x9c, 0xfa, 0xdc, 0x72, 0xe1, 0x1b, 0x60, 0x0e, 0x39, 0x8e, 0x4c, 0x86, + 0xed, 0x47, 0xb4, 0x8e, 0xc3, 0x38, 0x19, 0xd5, 0x8b, 0xaf, 0x8e, 0x0a, 0xe7, 0x63, 0x54, 0xaf, + 0xbc, 0x68, 0x9d, 0xd1, 0x1b, 0xef, 0xa8, 0x35, 0x5c, 0x02, 0x53, 0x1c, 0x7f, 0x1a, 0x61, 0xdf, + 0x89, 0x9f, 0xa7, 0x59, 0x2b, 0x5d, 0xa7, 0xfe, 0x67, 0x3b, 0xfe, 0x27, 0xd1, 0x3c, 0x7d, 0xf2, + 0x68, 0x56, 0x2b, 0x4f, 0x8f, 0xf3, 0xc6, 0xf3, 0xe3, 0xbc, 0xf1, 0xcb, 0x71, 0xde, 0xf8, 0xf6, + 0x45, 0x3e, 0xf3, 0xfc, 0x45, 0x3e, 0xf3, 0xd3, 0x8b, 0x7c, 0xe6, 0x83, 0x95, 0xb1, 0x25, 0xc7, + 0x85, 0x5b, 0x9f, 0x54, 0x7f, 0xd4, 0x6e, 0xff, 0x1e, 0x00, 0x00, 0xff, 0xff, 0x28, 0x7e, 0x3d, + 0xeb, 0x24, 0x0f, 0x00, 0x00, } func (this *Supply) Equal(that interface{}) bool { @@ -1452,50 +1312,6 @@ func (this *StdFee) Equal(that interface{}) bool { } return true } -func (this *Account) GetAccount() types.AccountI { - if x := this.GetBaseAccount(); x != nil { - return x - } - if x := this.GetContinuousVestingAccount(); x != nil { - return x - } - if x := this.GetDelayedVestingAccount(); x != nil { - return x - } - if x := this.GetPeriodicVestingAccount(); x != nil { - return x - } - if x := this.GetModuleAccount(); x != nil { - return x - } - return nil -} - -func (this *Account) SetAccount(value types.AccountI) error { - if value == nil { - this.Sum = nil - return nil - } - switch vt := value.(type) { - case *types.BaseAccount: - this.Sum = &Account_BaseAccount{vt} - return nil - case *types1.ContinuousVestingAccount: - this.Sum = &Account_ContinuousVestingAccount{vt} - return nil - case *types1.DelayedVestingAccount: - this.Sum = &Account_DelayedVestingAccount{vt} - return nil - case *types1.PeriodicVestingAccount: - this.Sum = &Account_PeriodicVestingAccount{vt} - return nil - case *types.ModuleAccount: - this.Sum = &Account_ModuleAccount{vt} - return nil - } - return fmt.Errorf("can't encode value of type %T as message AccountI", value) -} - func (this *Supply) GetSupplyI() github_com_cosmos_cosmos_sdk_x_bank_exported.SupplyI { if x := this.GetSupply(); x != nil { return x @@ -1509,7 +1325,7 @@ func (this *Supply) SetSupplyI(value github_com_cosmos_cosmos_sdk_x_bank_exporte return nil } switch vt := value.(type) { - case *types2.Supply: + case *types.Supply: this.Sum = &Supply_Supply{vt} return nil } @@ -1541,19 +1357,19 @@ func (this *Content) SetContent(value github_com_cosmos_cosmos_sdk_x_gov_types.C return nil } switch vt := value.(type) { - case *types3.TextProposal: + case *types1.TextProposal: this.Sum = &Content_Text{vt} return nil case *proposal.ParameterChangeProposal: this.Sum = &Content_ParameterChange{vt} return nil - case *types4.SoftwareUpgradeProposal: + case *types2.SoftwareUpgradeProposal: this.Sum = &Content_SoftwareUpgrade{vt} return nil - case *types4.CancelSoftwareUpgradeProposal: + case *types2.CancelSoftwareUpgradeProposal: this.Sum = &Content_CancelSoftwareUpgrade{vt} return nil - case *types5.CommunityPoolSpendProposal: + case *types3.CommunityPoolSpendProposal: this.Sum = &Content_CommunityPoolSpend{vt} return nil } @@ -1618,46 +1434,46 @@ func (this *Message) SetMsg(value github_com_cosmos_cosmos_sdk_types.Msg) error return nil } switch vt := value.(type) { - case *types2.MsgSend: + case *types.MsgSend: this.Sum = &Message_MsgSend{vt} return nil - case types2.MsgSend: + case types.MsgSend: this.Sum = &Message_MsgSend{&vt} return nil - case *types2.MsgMultiSend: + case *types.MsgMultiSend: this.Sum = &Message_MsgMultiSend{vt} return nil - case types2.MsgMultiSend: + case types.MsgMultiSend: this.Sum = &Message_MsgMultiSend{&vt} return nil - case *types6.MsgVerifyInvariant: + case *types4.MsgVerifyInvariant: this.Sum = &Message_MsgVerifyInvariant{vt} return nil - case types6.MsgVerifyInvariant: + case types4.MsgVerifyInvariant: this.Sum = &Message_MsgVerifyInvariant{&vt} return nil - case *types5.MsgSetWithdrawAddress: + case *types3.MsgSetWithdrawAddress: this.Sum = &Message_MsgSetWithdrawAddress{vt} return nil - case types5.MsgSetWithdrawAddress: + case types3.MsgSetWithdrawAddress: this.Sum = &Message_MsgSetWithdrawAddress{&vt} return nil - case *types5.MsgWithdrawDelegatorReward: + case *types3.MsgWithdrawDelegatorReward: this.Sum = &Message_MsgWithdrawDelegatorReward{vt} return nil - case types5.MsgWithdrawDelegatorReward: + case types3.MsgWithdrawDelegatorReward: this.Sum = &Message_MsgWithdrawDelegatorReward{&vt} return nil - case *types5.MsgWithdrawValidatorCommission: + case *types3.MsgWithdrawValidatorCommission: this.Sum = &Message_MsgWithdrawValidatorCommission{vt} return nil - case types5.MsgWithdrawValidatorCommission: + case types3.MsgWithdrawValidatorCommission: this.Sum = &Message_MsgWithdrawValidatorCommission{&vt} return nil - case *types5.MsgFundCommunityPool: + case *types3.MsgFundCommunityPool: this.Sum = &Message_MsgFundCommunityPool{vt} return nil - case types5.MsgFundCommunityPool: + case types3.MsgFundCommunityPool: this.Sum = &Message_MsgFundCommunityPool{&vt} return nil case *MsgSubmitProposal: @@ -1666,195 +1482,58 @@ func (this *Message) SetMsg(value github_com_cosmos_cosmos_sdk_types.Msg) error case MsgSubmitProposal: this.Sum = &Message_MsgSubmitProposal{&vt} return nil - case *types3.MsgVote: + case *types1.MsgVote: this.Sum = &Message_MsgVote{vt} return nil - case types3.MsgVote: + case types1.MsgVote: this.Sum = &Message_MsgVote{&vt} return nil - case *types3.MsgDeposit: + case *types1.MsgDeposit: this.Sum = &Message_MsgDeposit{vt} return nil - case types3.MsgDeposit: + case types1.MsgDeposit: this.Sum = &Message_MsgDeposit{&vt} return nil - case *types7.MsgUnjail: + case *types5.MsgUnjail: this.Sum = &Message_MsgUnjail{vt} return nil - case types7.MsgUnjail: + case types5.MsgUnjail: this.Sum = &Message_MsgUnjail{&vt} return nil - case *types8.MsgCreateValidator: + case *types6.MsgCreateValidator: this.Sum = &Message_MsgCreateValidator{vt} return nil - case types8.MsgCreateValidator: + case types6.MsgCreateValidator: this.Sum = &Message_MsgCreateValidator{&vt} return nil - case *types8.MsgEditValidator: + case *types6.MsgEditValidator: this.Sum = &Message_MsgEditValidator{vt} return nil - case types8.MsgEditValidator: + case types6.MsgEditValidator: this.Sum = &Message_MsgEditValidator{&vt} return nil - case *types8.MsgDelegate: + case *types6.MsgDelegate: this.Sum = &Message_MsgDelegate{vt} return nil - case types8.MsgDelegate: + case types6.MsgDelegate: this.Sum = &Message_MsgDelegate{&vt} return nil - case *types8.MsgBeginRedelegate: + case *types6.MsgBeginRedelegate: this.Sum = &Message_MsgBeginRedelegate{vt} return nil - case types8.MsgBeginRedelegate: + case types6.MsgBeginRedelegate: this.Sum = &Message_MsgBeginRedelegate{&vt} return nil - case *types8.MsgUndelegate: + case *types6.MsgUndelegate: this.Sum = &Message_MsgUndelegate{vt} return nil - case types8.MsgUndelegate: + case types6.MsgUndelegate: this.Sum = &Message_MsgUndelegate{&vt} return nil } return fmt.Errorf("can't encode value of type %T as message Message", value) } -func (m *Account) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Account) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Account_BaseAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account_BaseAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.BaseAccount != nil { - { - size, err := m.BaseAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *Account_ContinuousVestingAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account_ContinuousVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ContinuousVestingAccount != nil { - { - size, err := m.ContinuousVestingAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *Account_DelayedVestingAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account_DelayedVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.DelayedVestingAccount != nil { - { - size, err := m.DelayedVestingAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *Account_PeriodicVestingAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account_PeriodicVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PeriodicVestingAccount != nil { - { - size, err := m.PeriodicVestingAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *Account_ModuleAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account_ModuleAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ModuleAccount != nil { - { - size, err := m.ModuleAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} func (m *Supply) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2800,78 +2479,6 @@ func encodeVarintCodec(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Account) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Account_BaseAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BaseAccount != nil { - l = m.BaseAccount.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Account_ContinuousVestingAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ContinuousVestingAccount != nil { - l = m.ContinuousVestingAccount.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Account_DelayedVestingAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.DelayedVestingAccount != nil { - l = m.DelayedVestingAccount.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Account_PeriodicVestingAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PeriodicVestingAccount != nil { - l = m.PeriodicVestingAccount.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Account_ModuleAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ModuleAccount != nil { - l = m.ModuleAccount.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} func (m *Supply) Size() (n int) { if m == nil { return 0 @@ -3321,234 +2928,6 @@ func sovCodec(x uint64) (n int) { func sozCodec(x uint64) (n int) { return sovCodec(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Account) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AccountI: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AccountI: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.BaseAccount{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Account_BaseAccount{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContinuousVestingAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types1.ContinuousVestingAccount{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Account_ContinuousVestingAccount{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelayedVestingAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types1.DelayedVestingAccount{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Account_DelayedVestingAccount{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeriodicVestingAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types1.PeriodicVestingAccount{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Account_PeriodicVestingAccount{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ModuleAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.ModuleAccount{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Account_ModuleAccount{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Supply) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3607,7 +2986,7 @@ func (m *Supply) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types2.Supply{} + v := &types.Supply{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3936,7 +3315,7 @@ func (m *Content) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types3.TextProposal{} + v := &types1.TextProposal{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4006,7 +3385,7 @@ func (m *Content) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types4.SoftwareUpgradeProposal{} + v := &types2.SoftwareUpgradeProposal{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4041,7 +3420,7 @@ func (m *Content) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types4.CancelSoftwareUpgradeProposal{} + v := &types2.CancelSoftwareUpgradeProposal{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4076,7 +3455,7 @@ func (m *Content) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types5.CommunityPoolSpendProposal{} + v := &types3.CommunityPoolSpendProposal{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4284,7 +3663,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types2.MsgSend{} + v := &types.MsgSend{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4319,7 +3698,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types2.MsgMultiSend{} + v := &types.MsgMultiSend{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4354,7 +3733,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types6.MsgVerifyInvariant{} + v := &types4.MsgVerifyInvariant{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4389,7 +3768,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types5.MsgSetWithdrawAddress{} + v := &types3.MsgSetWithdrawAddress{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4424,7 +3803,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types5.MsgWithdrawDelegatorReward{} + v := &types3.MsgWithdrawDelegatorReward{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4459,7 +3838,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types5.MsgWithdrawValidatorCommission{} + v := &types3.MsgWithdrawValidatorCommission{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4494,7 +3873,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types5.MsgFundCommunityPool{} + v := &types3.MsgFundCommunityPool{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4564,7 +3943,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types3.MsgVote{} + v := &types1.MsgVote{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4599,7 +3978,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types3.MsgDeposit{} + v := &types1.MsgDeposit{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4634,7 +4013,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types7.MsgUnjail{} + v := &types5.MsgUnjail{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4669,7 +4048,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types8.MsgCreateValidator{} + v := &types6.MsgCreateValidator{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4704,7 +4083,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types8.MsgEditValidator{} + v := &types6.MsgEditValidator{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4739,7 +4118,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types8.MsgDelegate{} + v := &types6.MsgDelegate{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4774,7 +4153,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types8.MsgBeginRedelegate{} + v := &types6.MsgBeginRedelegate{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4809,7 +4188,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types8.MsgUndelegate{} + v := &types6.MsgUndelegate{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -5017,7 +4396,7 @@ func (m *StdFee) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Amount = append(m.Amount, types9.Coin{}) + m.Amount = append(m.Amount, types7.Coin{}) if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/std/codec.proto b/std/codec.proto index 7e8dfe5812e7..ef752e03b2c7 100644 --- a/std/codec.proto +++ b/std/codec.proto @@ -4,8 +4,6 @@ package cosmos_sdk.std.v1; import "third_party/proto/cosmos-proto/cosmos.proto"; import "third_party/proto/gogoproto/gogo.proto"; import "types/types.proto"; -import "x/auth/types/types.proto"; -import "x/auth/vesting/types/types.proto"; import "x/bank/types/types.proto"; import "x/crisis/types/types.proto"; import "x/distribution/types/types.proto"; @@ -17,20 +15,6 @@ import "x/upgrade/types/types.proto"; option go_package = "github.com/cosmos/cosmos-sdk/std"; -// Account defines the application-level Account type. -message Account { - option (cosmos_proto.interface_type) = "*github.com/cosmos/cosmos-sdk/x/auth/exported.Account"; - - // sum defines a list of all acceptable concrete Account implementations. - oneof sum { - cosmos_sdk.x.auth.v1.BaseAccount base_account = 1; - cosmos_sdk.x.auth.vesting.v1.ContinuousVestingAccount continuous_vesting_account = 2; - cosmos_sdk.x.auth.vesting.v1.DelayedVestingAccount delayed_vesting_account = 3; - cosmos_sdk.x.auth.vesting.v1.PeriodicVestingAccount periodic_vesting_account = 4; - cosmos_sdk.x.auth.v1.ModuleAccount module_account = 5; - } -} - // Supply defines the application-level Supply type. message Supply { option (gogoproto.equal) = true; diff --git a/x/auth/types/codec.go b/x/auth/types/codec.go index da7cda07e44b..3047ecd3e2a7 100644 --- a/x/auth/types/codec.go +++ b/x/auth/types/codec.go @@ -22,7 +22,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { (*AccountI)(nil), &BaseAccount{}, &ModuleAccount{}, - //&vesting.DelayedVestingAccount{}, ) } diff --git a/x/auth/types/types.pb.go b/x/auth/types/types.pb.go index 6cfc49977dee..e90c4f1bf60e 100644 --- a/x/auth/types/types.pb.go +++ b/x/auth/types/types.pb.go @@ -5,7 +5,6 @@ package types import ( fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" @@ -183,107 +182,58 @@ func (m *Params) GetSigVerifyCostSecp256k1() uint64 { return 0 } -// AccountI defines the application-level AccountI type. -type Account struct { - Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` -} - -func (m *Account) Reset() { *m = Account{} } -func (m *Account) String() string { return proto.CompactTextString(m) } -func (*Account) ProtoMessage() {} -func (*Account) Descriptor() ([]byte, []int) { - return fileDescriptor_2d526fa662daab74, []int{3} -} -func (m *Account) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Account.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Account) XXX_Merge(src proto.Message) { - xxx_messageInfo_Account.Merge(m, src) -} -func (m *Account) XXX_Size() int { - return m.Size() -} -func (m *Account) XXX_DiscardUnknown() { - xxx_messageInfo_Account.DiscardUnknown(m) -} - -var xxx_messageInfo_Account proto.InternalMessageInfo - -func (m *Account) GetAccount() *types.Any { - if m != nil { - return m.Account - } - return nil -} - func init() { proto.RegisterType((*BaseAccount)(nil), "cosmos_sdk.x.auth.v1.BaseAccount") proto.RegisterType((*ModuleAccount)(nil), "cosmos_sdk.x.auth.v1.ModuleAccount") proto.RegisterType((*Params)(nil), "cosmos_sdk.x.auth.v1.Params") - proto.RegisterType((*Account)(nil), "cosmos_sdk.x.auth.v1.AccountI") } func init() { proto.RegisterFile("x/auth/types/types.proto", fileDescriptor_2d526fa662daab74) } var fileDescriptor_2d526fa662daab74 = []byte{ - // 719 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0x41, 0x4f, 0xdb, 0x48, - 0x14, 0x8e, 0x49, 0x96, 0xc0, 0x24, 0x20, 0x61, 0x02, 0x84, 0xec, 0xca, 0x93, 0xf5, 0x61, 0xc5, - 0x6a, 0x37, 0x8e, 0xc2, 0x8a, 0x95, 0x88, 0x56, 0xab, 0xc6, 0xb4, 0x95, 0x10, 0x05, 0x21, 0x23, - 0xf5, 0xd0, 0x8b, 0x35, 0x76, 0x06, 0xc7, 0x4a, 0x26, 0x63, 0x3c, 0x63, 0x14, 0xf3, 0x0b, 0x7a, - 0xec, 0xa9, 0xea, 0x91, 0x1f, 0xd1, 0x9f, 0xd0, 0x43, 0xd5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0xea, 0xfc, 0xb6, 0x53, 0x11, 0xd5, - 0xd8, 0x64, 0x73, 0xb9, 0xcd, 0xa5, 0x78, 0xdf, 0x9f, 0xaf, 0xa1, 0xa4, 0x1e, 0x83, 0xfc, 0xe4, - 0xfa, 0xfc, 0x07, 0xf2, 0xb3, 0x97, 0xb3, 0xa4, 0x89, 0x2f, 0x5f, 0x9b, 0x7c, 0xf9, 0x5a, 0xab, - 0x1f, 0xea, 0xc5, 0x77, 0xa9, 0x8b, 0x6e, 0x4c, 0x28, 0xcd, 0x5c, 0x2c, 0xa7, 0x1f, 0xbc, 0x1d, - 0x2a, 0xd2, 0xcd, 0x50, 0x91, 0x3e, 0x0d, 0x15, 0xe9, 0xc5, 0xad, 0x92, 0xb9, 0xb9, 0x55, 0x32, - 0x1f, 0x6e, 0x95, 0xcc, 0xb3, 0x3f, 0x7f, 0xfa, 0x17, 0x48, 0xff, 0xe7, 0xac, 0xc5, 0xa4, 0xdf, - 0x3f, 0xdf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x80, 0xee, 0x62, 0xfe, 0x04, 0x00, 0x00, + // 668 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0x4f, 0x4f, 0xdb, 0x48, + 0x14, 0x8f, 0x49, 0x96, 0x3f, 0x13, 0x40, 0xc2, 0x04, 0x30, 0xd9, 0x95, 0x27, 0xeb, 0xc3, 0x8a, + 0x55, 0x1b, 0x47, 0xa1, 0xa2, 0x12, 0x39, 0x54, 0xc5, 0xb4, 0x95, 0x10, 0x05, 0x21, 0x23, 0xf5, + 0xd0, 0x8b, 0x35, 0xb6, 0xa7, 0x89, 0x95, 0x4c, 0xc6, 0x78, 0xc6, 0x28, 0xe6, 0x13, 0xf4, 0xd8, + 0x53, 0xd5, 0x23, 0x1f, 0xa2, 0x1f, 0xa1, 0x87, 0x1e, 0x51, 0x4f, 0x3d, 0xb9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35, + 0x54, 0xa5, 0xaf, 0x43, 0x55, 0x7a, 0x73, 0xad, 0x16, 0xae, 0xae, 0xd5, 0xc2, 0xe7, 0x6b, 0xb5, + 0xf0, 0xf2, 0xff, 0x3f, 0xfe, 0xb6, 0xf9, 0xd7, 0xc7, 0x9e, 0xcd, 0x5e, 0x83, 0x07, 0x3f, 0x03, + 0x00, 0x00, 0xff, 0xff, 0x11, 0xf8, 0x99, 0x15, 0x94, 0x04, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -322,30 +272,6 @@ func (this *Params) Equal(that interface{}) bool { } return true } -func (this *Account) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Account) - if !ok { - that2, ok := that.(Account) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Account.Equal(that1.Account) { - return false - } - return true -} func (m *BaseAccount) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -492,41 +418,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Account) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Account) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Account != nil { - { - size, err := m.Account.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -608,19 +499,6 @@ func (m *Params) Size() (n int) { return n } -func (m *Account) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Account != nil { - l = m.Account.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1087,95 +965,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } -func (m *Account) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AccountI: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AccountI: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AccountI", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Account == nil { - m.Account = &types.Any{} - } - if err := m.Account.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auth/types/types.proto b/x/auth/types/types.proto index 892f57022ce1..f59bd907b4ac 100644 --- a/x/auth/types/types.proto +++ b/x/auth/types/types.proto @@ -3,7 +3,6 @@ package cosmos_sdk.x.auth.v1; import "third_party/proto/cosmos-proto/cosmos.proto"; import "third_party/proto/gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; From bbd4bab7f9acca2ee2dea9bd24e5997ad4cae786 Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Mon, 11 May 2020 20:16:07 +0530 Subject: [PATCH 06/18] Sort imports --- x/auth/simulation/decoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/auth/simulation/decoder.go b/x/auth/simulation/decoder.go index 6a2541965014..768066f5d9e2 100644 --- a/x/auth/simulation/decoder.go +++ b/x/auth/simulation/decoder.go @@ -3,11 +3,11 @@ package simulation import ( "bytes" "fmt" - "github.com/cosmos/cosmos-sdk/x/auth/keeper" gogotypes "github.com/gogo/protobuf/types" tmkv "github.com/tendermint/tendermint/libs/kv" + "github.com/cosmos/cosmos-sdk/x/auth/keeper" "github.com/cosmos/cosmos-sdk/x/auth/types" ) From ff23efadfd734287a5a1174b9767d6e9a0c0c4ab Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Tue, 12 May 2020 03:31:41 +0530 Subject: [PATCH 07/18] Fix legacy codec --- x/auth/legacy/v0_38/types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/auth/legacy/v0_38/types.go b/x/auth/legacy/v0_38/types.go index b39a7a581666..ac62694e760e 100644 --- a/x/auth/legacy/v0_38/types.go +++ b/x/auth/legacy/v0_38/types.go @@ -524,7 +524,7 @@ func ValidateGenAccounts(genAccounts GenesisAccounts) error { func RegisterCodec(cdc *codec.Codec) { cdc.RegisterInterface((*GenesisAccount)(nil), nil) cdc.RegisterInterface((*Account)(nil), nil) - cdc.RegisterConcrete(&BaseAccount{}, "cosmos-sdk/AccountI", 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) From 83e654d430f19bd3e075c3f29036d7eea3b8b6cf Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Tue, 12 May 2020 04:19:01 +0530 Subject: [PATCH 08/18] Add godoc for RegisterInterfaces --- x/auth/types/codec.go | 2 ++ x/auth/vesting/types/codec.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/x/auth/types/codec.go b/x/auth/types/codec.go index 3047ecd3e2a7..3581627d5513 100644 --- a/x/auth/types/codec.go +++ b/x/auth/types/codec.go @@ -16,6 +16,8 @@ func RegisterCodec(cdc *codec.Codec) { cdc.RegisterConcrete(StdTx{}, "cosmos-sdk/StdTx", nil) } +// RegisterInterface associates protoName with AccountI interface +// and creates a registry of it's concrete implementations func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterInterface( "cosmos_sdk.auth.v1.auth", diff --git a/x/auth/vesting/types/codec.go b/x/auth/vesting/types/codec.go index 460a651f9127..27ff86ff5e88 100644 --- a/x/auth/vesting/types/codec.go +++ b/x/auth/vesting/types/codec.go @@ -17,6 +17,8 @@ func RegisterCodec(cdc *codec.Codec) { cdc.RegisterConcrete(&PeriodicVestingAccount{}, "cosmos-sdk/PeriodicVestingAccount", nil) } +// RegisterInterface associates protoName with AccountI and VestingAccount +// Interfaces and creates a registry of it's concrete implementations func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterInterface( "cosmos_sdk.auth.v1.vesting", From dadd0323f4acd7419e8f5927b10e4ddead258a22 Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Fri, 15 May 2020 18:49:20 +0530 Subject: [PATCH 09/18] Add RegisterInterfaces to std --- simapp/app.go | 2 +- std/codec.go | 6 ++++++ x/auth/vesting/alias.go | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/simapp/app.go b/simapp/app.go index 20bdcd1be0be..69eb71a6969e 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -365,7 +365,7 @@ func NewSimApp( func MakeCodecs() (*std.Codec, *codec.Codec) { cdc := std.MakeCodec(ModuleBasics) interfaceRegistry := types.NewInterfaceRegistry() - sdk.RegisterInterfaces(interfaceRegistry) + std.RegisterInterfaces(interfaceRegistry) ModuleBasics.RegisterInterfaceModules(interfaceRegistry) appCodec := std.NewAppCodec(cdc, interfaceRegistry) return appCodec, cdc diff --git a/std/codec.go b/std/codec.go index 8ae55ab2a485..2657afa841ee 100644 --- a/std/codec.go +++ b/std/codec.go @@ -114,3 +114,9 @@ func MakeCodec(bm module.BasicManager) *codec.Codec { return cdc } + +// RegisterInterfaces registers Interfaces from sdk and vesting +func RegisterInterfaces(interfaceRegistry types.InterfaceRegistry) { + sdk.RegisterInterfaces(interfaceRegistry) + vesting.RegisterInterfaces(interfaceRegistry) +} diff --git a/x/auth/vesting/alias.go b/x/auth/vesting/alias.go index 9591aa12a0d9..256f61265b3f 100644 --- a/x/auth/vesting/alias.go +++ b/x/auth/vesting/alias.go @@ -9,6 +9,7 @@ import ( var ( RegisterCodec = types.RegisterCodec + RegisterInterfaces = types.RegisterInterfaces NewBaseVestingAccount = types.NewBaseVestingAccount NewContinuousVestingAccountRaw = types.NewContinuousVestingAccountRaw NewContinuousVestingAccount = types.NewContinuousVestingAccount From d2a15e6a1b4dc8f45f07fcd2c10bdd61ae5d29d2 Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Fri, 15 May 2020 18:50:20 +0530 Subject: [PATCH 10/18] Fix typo --- std/codec.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/std/codec.go b/std/codec.go index 2657afa841ee..c2460be71ad7 100644 --- a/std/codec.go +++ b/std/codec.go @@ -115,7 +115,7 @@ func MakeCodec(bm module.BasicManager) *codec.Codec { return cdc } -// RegisterInterfaces registers Interfaces from sdk and vesting +// RegisterInterfaces registers Interfaces from sdk/types and vesting func RegisterInterfaces(interfaceRegistry types.InterfaceRegistry) { sdk.RegisterInterfaces(interfaceRegistry) vesting.RegisterInterfaces(interfaceRegistry) From 22e9fc642bd81ce16db1423718678f1fb8aa41c1 Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Fri, 15 May 2020 20:20:38 +0530 Subject: [PATCH 11/18] Fixed merge changes --- scripts/protocgen.sh | 2 +- std/codec.go | 78 ---- std/codec.pb.go | 1031 +++++++++--------------------------------- std/codec.proto | 25 - 4 files changed, 205 insertions(+), 931 deletions(-) diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 707f8eaa96dc..5737b8aa8ac1 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -8,5 +8,5 @@ for dir in $proto_dirs; do -I. \ --gocosmos_out=plugins=interfacetype,paths=source_relative,\ Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. \ - $(find "${dir}" -depth 1 -name '*.proto') + $(find "${dir}" -maxdepth 1 -name '*.proto') done diff --git a/std/codec.go b/std/codec.go index 560962dbdd20..b078f8e17159 100644 --- a/std/codec.go +++ b/std/codec.go @@ -29,84 +29,6 @@ func NewAppCodec(amino *codec.Codec, anyUnpacker types.AnyUnpacker) *Codec { return &Codec{Marshaler: codec.NewHybridCodec(amino, anyUnpacker), amino: amino, anyUnpacker: anyUnpacker} } -// MarshalSupply marshals a SupplyI interface. If the given type implements -// the Marshaler interface, it is treated as a Proto-defined message and -// serialized that way. Otherwise, it falls back on the internal Amino codec. -func (c *Codec) MarshalSupply(supplyI bankexported.SupplyI) ([]byte, error) { - supply := &Supply{} - if err := supply.SetSupplyI(supplyI); err != nil { - return nil, err - } - - return c.Marshaler.MarshalBinaryBare(supply) -} - -// UnmarshalSupply returns a SupplyI interface from raw encoded account bytes -// of a Proto-based SupplyI type. An error is returned upon decoding failure. -func (c *Codec) UnmarshalSupply(bz []byte) (bankexported.SupplyI, error) { - supply := &Supply{} - if err := c.Marshaler.UnmarshalBinaryBare(bz, supply); err != nil { - return nil, err - } - - return supply.GetSupplyI(), nil -} - -// MarshalSupplyJSON JSON encodes a supply object implementing the SupplyI -// interface. -func (c *Codec) MarshalSupplyJSON(supply bankexported.SupplyI) ([]byte, error) { - return c.Marshaler.MarshalJSON(supply) -} - -// UnmarshalSupplyJSON returns a SupplyI from JSON encoded bytes. -func (c *Codec) UnmarshalSupplyJSON(bz []byte) (bankexported.SupplyI, error) { - supply := &Supply{} - if err := c.Marshaler.UnmarshalJSON(bz, supply); err != nil { - return nil, err - } - - return supply.GetSupplyI(), nil -} - -// MarshalAccount marshals an Account interface. If the given type implements -// the Marshaler interface, it is treated as a Proto-defined message and -// serialized that way. Otherwise, it falls back on the internal Amino codec. -func (c *Codec) MarshalAccount(accI authexported.Account) ([]byte, error) { - acc := &Account{} - if err := acc.SetAccount(accI); err != nil { - return nil, err - } - - return c.Marshaler.MarshalBinaryBare(acc) -} - -// UnmarshalAccount returns an Account interface from raw encoded account bytes -// of a Proto-based Account type. An error is returned upon decoding failure. -func (c *Codec) UnmarshalAccount(bz []byte) (authexported.Account, error) { - acc := &Account{} - if err := c.Marshaler.UnmarshalBinaryBare(bz, acc); err != nil { - return nil, err - } - - return acc.GetAccount(), nil -} - -// MarshalAccountJSON JSON encodes an account object implementing the Account -// interface. -func (c *Codec) MarshalAccountJSON(acc authexported.Account) ([]byte, error) { - return c.Marshaler.MarshalJSON(acc) -} - -// UnmarshalAccountJSON returns an Account from JSON encoded bytes. -func (c *Codec) UnmarshalAccountJSON(bz []byte) (authexported.Account, error) { - acc := &Account{} - if err := c.Marshaler.UnmarshalJSON(bz, acc); err != nil { - return nil, err - } - - return acc.GetAccount(), nil -} - // MarshalProposal marshals a Proposal. It accepts a Proposal defined by the x/gov // module and uses the application-level Proposal type which has the concrete // Content implementation to serialize. diff --git a/std/codec.pb.go b/std/codec.pb.go index ba55855d94da..b0b70e9ad33c 100644 --- a/std/codec.pb.go +++ b/std/codec.pb.go @@ -6,19 +6,16 @@ package std import ( fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types9 "github.com/cosmos/cosmos-sdk/types" - github_com_cosmos_cosmos_sdk_x_auth_exported "github.com/cosmos/cosmos-sdk/x/auth/exported" - types "github.com/cosmos/cosmos-sdk/x/auth/types" - types1 "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - types5 "github.com/cosmos/cosmos-sdk/x/bank/types" - types6 "github.com/cosmos/cosmos-sdk/x/crisis/types" - types4 "github.com/cosmos/cosmos-sdk/x/distribution/types" + types7 "github.com/cosmos/cosmos-sdk/types" + types3 "github.com/cosmos/cosmos-sdk/x/bank/types" + types4 "github.com/cosmos/cosmos-sdk/x/crisis/types" + types2 "github.com/cosmos/cosmos-sdk/x/distribution/types" github_com_cosmos_cosmos_sdk_x_gov_types "github.com/cosmos/cosmos-sdk/x/gov/types" - types2 "github.com/cosmos/cosmos-sdk/x/gov/types" + types "github.com/cosmos/cosmos-sdk/x/gov/types" proposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - types7 "github.com/cosmos/cosmos-sdk/x/slashing/types" - types8 "github.com/cosmos/cosmos-sdk/x/staking/types" - types3 "github.com/cosmos/cosmos-sdk/x/upgrade/types" + types5 "github.com/cosmos/cosmos-sdk/x/slashing/types" + types6 "github.com/cosmos/cosmos-sdk/x/staking/types" + types1 "github.com/cosmos/cosmos-sdk/x/upgrade/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" _ "github.com/regen-network/cosmos-proto" @@ -38,145 +35,18 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Account defines the application-level Account type. -type Account struct { - // sum defines a list of all acceptable concrete Account implementations. - // - // Types that are valid to be assigned to Sum: - // *Account_BaseAccount - // *Account_ContinuousVestingAccount - // *Account_DelayedVestingAccount - // *Account_PeriodicVestingAccount - // *Account_ModuleAccount - Sum isAccount_Sum `protobuf_oneof:"sum"` -} - -func (m *Account) Reset() { *m = Account{} } -func (m *Account) String() string { return proto.CompactTextString(m) } -func (*Account) ProtoMessage() {} -func (*Account) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{0} -} -func (m *Account) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Account.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Account) XXX_Merge(src proto.Message) { - xxx_messageInfo_Account.Merge(m, src) -} -func (m *Account) XXX_Size() int { - return m.Size() -} -func (m *Account) XXX_DiscardUnknown() { - xxx_messageInfo_Account.DiscardUnknown(m) -} - -var xxx_messageInfo_Account proto.InternalMessageInfo - -type isAccount_Sum interface { - isAccount_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Account_BaseAccount struct { - BaseAccount *types.BaseAccount `protobuf:"bytes,1,opt,name=base_account,json=baseAccount,proto3,oneof" json:"base_account,omitempty"` -} -type Account_ContinuousVestingAccount struct { - ContinuousVestingAccount *types1.ContinuousVestingAccount `protobuf:"bytes,2,opt,name=continuous_vesting_account,json=continuousVestingAccount,proto3,oneof" json:"continuous_vesting_account,omitempty"` -} -type Account_DelayedVestingAccount struct { - DelayedVestingAccount *types1.DelayedVestingAccount `protobuf:"bytes,3,opt,name=delayed_vesting_account,json=delayedVestingAccount,proto3,oneof" json:"delayed_vesting_account,omitempty"` -} -type Account_PeriodicVestingAccount struct { - PeriodicVestingAccount *types1.PeriodicVestingAccount `protobuf:"bytes,4,opt,name=periodic_vesting_account,json=periodicVestingAccount,proto3,oneof" json:"periodic_vesting_account,omitempty"` -} -type Account_ModuleAccount struct { - ModuleAccount *types.ModuleAccount `protobuf:"bytes,5,opt,name=module_account,json=moduleAccount,proto3,oneof" json:"module_account,omitempty"` -} - -func (*Account_BaseAccount) isAccount_Sum() {} -func (*Account_ContinuousVestingAccount) isAccount_Sum() {} -func (*Account_DelayedVestingAccount) isAccount_Sum() {} -func (*Account_PeriodicVestingAccount) isAccount_Sum() {} -func (*Account_ModuleAccount) isAccount_Sum() {} - -func (m *Account) GetSum() isAccount_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Account) GetBaseAccount() *types.BaseAccount { - if x, ok := m.GetSum().(*Account_BaseAccount); ok { - return x.BaseAccount - } - return nil -} - -func (m *Account) GetContinuousVestingAccount() *types1.ContinuousVestingAccount { - if x, ok := m.GetSum().(*Account_ContinuousVestingAccount); ok { - return x.ContinuousVestingAccount - } - return nil -} - -func (m *Account) GetDelayedVestingAccount() *types1.DelayedVestingAccount { - if x, ok := m.GetSum().(*Account_DelayedVestingAccount); ok { - return x.DelayedVestingAccount - } - return nil -} - -func (m *Account) GetPeriodicVestingAccount() *types1.PeriodicVestingAccount { - if x, ok := m.GetSum().(*Account_PeriodicVestingAccount); ok { - return x.PeriodicVestingAccount - } - return nil -} - -func (m *Account) GetModuleAccount() *types.ModuleAccount { - if x, ok := m.GetSum().(*Account_ModuleAccount); ok { - return x.ModuleAccount - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Account) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Account_BaseAccount)(nil), - (*Account_ContinuousVestingAccount)(nil), - (*Account_DelayedVestingAccount)(nil), - (*Account_PeriodicVestingAccount)(nil), - (*Account_ModuleAccount)(nil), - } -} - // MsgSubmitProposal defines the application-level message type for handling // governance proposals. type MsgSubmitProposal struct { - types2.MsgSubmitProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base"` - Content *Content `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` + types.MsgSubmitProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base"` + Content *Content `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` } func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } func (m *MsgSubmitProposal) String() string { return proto.CompactTextString(m) } func (*MsgSubmitProposal) ProtoMessage() {} func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{1} + return fileDescriptor_ff851c3a98ef46f7, []int{0} } func (m *MsgSubmitProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -208,15 +78,15 @@ var xxx_messageInfo_MsgSubmitProposal proto.InternalMessageInfo // Proposal defines the application-level concrete proposal type used in // governance proposals. type Proposal struct { - types2.ProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base"` - Content Content `protobuf:"bytes,2,opt,name=content,proto3" json:"content"` + types.ProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base"` + Content Content `protobuf:"bytes,2,opt,name=content,proto3" json:"content"` } func (m *Proposal) Reset() { *m = Proposal{} } func (m *Proposal) String() string { return proto.CompactTextString(m) } func (*Proposal) ProtoMessage() {} func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{2} + return fileDescriptor_ff851c3a98ef46f7, []int{1} } func (m *Proposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -271,7 +141,7 @@ func (m *Content) Reset() { *m = Content{} } func (m *Content) String() string { return proto.CompactTextString(m) } func (*Content) ProtoMessage() {} func (*Content) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{3} + return fileDescriptor_ff851c3a98ef46f7, []int{2} } func (m *Content) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -308,19 +178,19 @@ type isContent_Sum interface { } type Content_Text struct { - Text *types2.TextProposal `protobuf:"bytes,1,opt,name=text,proto3,oneof" json:"text,omitempty"` + Text *types.TextProposal `protobuf:"bytes,1,opt,name=text,proto3,oneof" json:"text,omitempty"` } type Content_ParameterChange struct { ParameterChange *proposal.ParameterChangeProposal `protobuf:"bytes,2,opt,name=parameter_change,json=parameterChange,proto3,oneof" json:"parameter_change,omitempty"` } type Content_SoftwareUpgrade struct { - SoftwareUpgrade *types3.SoftwareUpgradeProposal `protobuf:"bytes,3,opt,name=software_upgrade,json=softwareUpgrade,proto3,oneof" json:"software_upgrade,omitempty"` + SoftwareUpgrade *types1.SoftwareUpgradeProposal `protobuf:"bytes,3,opt,name=software_upgrade,json=softwareUpgrade,proto3,oneof" json:"software_upgrade,omitempty"` } type Content_CancelSoftwareUpgrade struct { - CancelSoftwareUpgrade *types3.CancelSoftwareUpgradeProposal `protobuf:"bytes,4,opt,name=cancel_software_upgrade,json=cancelSoftwareUpgrade,proto3,oneof" json:"cancel_software_upgrade,omitempty"` + CancelSoftwareUpgrade *types1.CancelSoftwareUpgradeProposal `protobuf:"bytes,4,opt,name=cancel_software_upgrade,json=cancelSoftwareUpgrade,proto3,oneof" json:"cancel_software_upgrade,omitempty"` } type Content_CommunityPoolSpend struct { - CommunityPoolSpend *types4.CommunityPoolSpendProposal `protobuf:"bytes,5,opt,name=community_pool_spend,json=communityPoolSpend,proto3,oneof" json:"community_pool_spend,omitempty"` + CommunityPoolSpend *types2.CommunityPoolSpendProposal `protobuf:"bytes,5,opt,name=community_pool_spend,json=communityPoolSpend,proto3,oneof" json:"community_pool_spend,omitempty"` } func (*Content_Text) isContent_Sum() {} @@ -336,7 +206,7 @@ func (m *Content) GetSum() isContent_Sum { return nil } -func (m *Content) GetText() *types2.TextProposal { +func (m *Content) GetText() *types.TextProposal { if x, ok := m.GetSum().(*Content_Text); ok { return x.Text } @@ -350,21 +220,21 @@ func (m *Content) GetParameterChange() *proposal.ParameterChangeProposal { return nil } -func (m *Content) GetSoftwareUpgrade() *types3.SoftwareUpgradeProposal { +func (m *Content) GetSoftwareUpgrade() *types1.SoftwareUpgradeProposal { if x, ok := m.GetSum().(*Content_SoftwareUpgrade); ok { return x.SoftwareUpgrade } return nil } -func (m *Content) GetCancelSoftwareUpgrade() *types3.CancelSoftwareUpgradeProposal { +func (m *Content) GetCancelSoftwareUpgrade() *types1.CancelSoftwareUpgradeProposal { if x, ok := m.GetSum().(*Content_CancelSoftwareUpgrade); ok { return x.CancelSoftwareUpgrade } return nil } -func (m *Content) GetCommunityPoolSpend() *types4.CommunityPoolSpendProposal { +func (m *Content) GetCommunityPoolSpend() *types2.CommunityPoolSpendProposal { if x, ok := m.GetSum().(*Content_CommunityPoolSpend); ok { return x.CommunityPoolSpend } @@ -394,7 +264,7 @@ func (m *Transaction) Reset() { *m = Transaction{} } func (m *Transaction) String() string { return proto.CompactTextString(m) } func (*Transaction) ProtoMessage() {} func (*Transaction) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{4} + return fileDescriptor_ff851c3a98ef46f7, []int{3} } func (m *Transaction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -452,7 +322,7 @@ func (m *Message) Reset() { *m = Message{} } func (m *Message) String() string { return proto.CompactTextString(m) } func (*Message) ProtoMessage() {} func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{5} + return fileDescriptor_ff851c3a98ef46f7, []int{4} } func (m *Message) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -488,52 +358,52 @@ type isMessage_Sum interface { } type Message_MsgSend struct { - MsgSend *types5.MsgSend `protobuf:"bytes,1,opt,name=msg_send,json=msgSend,proto3,oneof" json:"msg_send,omitempty"` + MsgSend *types3.MsgSend `protobuf:"bytes,1,opt,name=msg_send,json=msgSend,proto3,oneof" json:"msg_send,omitempty"` } type Message_MsgMultiSend struct { - MsgMultiSend *types5.MsgMultiSend `protobuf:"bytes,2,opt,name=msg_multi_send,json=msgMultiSend,proto3,oneof" json:"msg_multi_send,omitempty"` + MsgMultiSend *types3.MsgMultiSend `protobuf:"bytes,2,opt,name=msg_multi_send,json=msgMultiSend,proto3,oneof" json:"msg_multi_send,omitempty"` } type Message_MsgVerifyInvariant struct { - MsgVerifyInvariant *types6.MsgVerifyInvariant `protobuf:"bytes,3,opt,name=msg_verify_invariant,json=msgVerifyInvariant,proto3,oneof" json:"msg_verify_invariant,omitempty"` + MsgVerifyInvariant *types4.MsgVerifyInvariant `protobuf:"bytes,3,opt,name=msg_verify_invariant,json=msgVerifyInvariant,proto3,oneof" json:"msg_verify_invariant,omitempty"` } type Message_MsgSetWithdrawAddress struct { - MsgSetWithdrawAddress *types4.MsgSetWithdrawAddress `protobuf:"bytes,4,opt,name=msg_set_withdraw_address,json=msgSetWithdrawAddress,proto3,oneof" json:"msg_set_withdraw_address,omitempty"` + MsgSetWithdrawAddress *types2.MsgSetWithdrawAddress `protobuf:"bytes,4,opt,name=msg_set_withdraw_address,json=msgSetWithdrawAddress,proto3,oneof" json:"msg_set_withdraw_address,omitempty"` } type Message_MsgWithdrawDelegatorReward struct { - MsgWithdrawDelegatorReward *types4.MsgWithdrawDelegatorReward `protobuf:"bytes,5,opt,name=msg_withdraw_delegator_reward,json=msgWithdrawDelegatorReward,proto3,oneof" json:"msg_withdraw_delegator_reward,omitempty"` + MsgWithdrawDelegatorReward *types2.MsgWithdrawDelegatorReward `protobuf:"bytes,5,opt,name=msg_withdraw_delegator_reward,json=msgWithdrawDelegatorReward,proto3,oneof" json:"msg_withdraw_delegator_reward,omitempty"` } type Message_MsgWithdrawValidatorCommission struct { - MsgWithdrawValidatorCommission *types4.MsgWithdrawValidatorCommission `protobuf:"bytes,6,opt,name=msg_withdraw_validator_commission,json=msgWithdrawValidatorCommission,proto3,oneof" json:"msg_withdraw_validator_commission,omitempty"` + MsgWithdrawValidatorCommission *types2.MsgWithdrawValidatorCommission `protobuf:"bytes,6,opt,name=msg_withdraw_validator_commission,json=msgWithdrawValidatorCommission,proto3,oneof" json:"msg_withdraw_validator_commission,omitempty"` } type Message_MsgFundCommunityPool struct { - MsgFundCommunityPool *types4.MsgFundCommunityPool `protobuf:"bytes,7,opt,name=msg_fund_community_pool,json=msgFundCommunityPool,proto3,oneof" json:"msg_fund_community_pool,omitempty"` + MsgFundCommunityPool *types2.MsgFundCommunityPool `protobuf:"bytes,7,opt,name=msg_fund_community_pool,json=msgFundCommunityPool,proto3,oneof" json:"msg_fund_community_pool,omitempty"` } type Message_MsgSubmitProposal struct { MsgSubmitProposal *MsgSubmitProposal `protobuf:"bytes,9,opt,name=msg_submit_proposal,json=msgSubmitProposal,proto3,oneof" json:"msg_submit_proposal,omitempty"` } type Message_MsgVote struct { - MsgVote *types2.MsgVote `protobuf:"bytes,10,opt,name=msg_vote,json=msgVote,proto3,oneof" json:"msg_vote,omitempty"` + MsgVote *types.MsgVote `protobuf:"bytes,10,opt,name=msg_vote,json=msgVote,proto3,oneof" json:"msg_vote,omitempty"` } type Message_MsgDeposit struct { - MsgDeposit *types2.MsgDeposit `protobuf:"bytes,11,opt,name=msg_deposit,json=msgDeposit,proto3,oneof" json:"msg_deposit,omitempty"` + MsgDeposit *types.MsgDeposit `protobuf:"bytes,11,opt,name=msg_deposit,json=msgDeposit,proto3,oneof" json:"msg_deposit,omitempty"` } type Message_MsgUnjail struct { - MsgUnjail *types7.MsgUnjail `protobuf:"bytes,12,opt,name=msg_unjail,json=msgUnjail,proto3,oneof" json:"msg_unjail,omitempty"` + MsgUnjail *types5.MsgUnjail `protobuf:"bytes,12,opt,name=msg_unjail,json=msgUnjail,proto3,oneof" json:"msg_unjail,omitempty"` } type Message_MsgCreateValidator struct { - MsgCreateValidator *types8.MsgCreateValidator `protobuf:"bytes,13,opt,name=msg_create_validator,json=msgCreateValidator,proto3,oneof" json:"msg_create_validator,omitempty"` + MsgCreateValidator *types6.MsgCreateValidator `protobuf:"bytes,13,opt,name=msg_create_validator,json=msgCreateValidator,proto3,oneof" json:"msg_create_validator,omitempty"` } type Message_MsgEditValidator struct { - MsgEditValidator *types8.MsgEditValidator `protobuf:"bytes,14,opt,name=msg_edit_validator,json=msgEditValidator,proto3,oneof" json:"msg_edit_validator,omitempty"` + MsgEditValidator *types6.MsgEditValidator `protobuf:"bytes,14,opt,name=msg_edit_validator,json=msgEditValidator,proto3,oneof" json:"msg_edit_validator,omitempty"` } type Message_MsgDelegate struct { - MsgDelegate *types8.MsgDelegate `protobuf:"bytes,15,opt,name=msg_delegate,json=msgDelegate,proto3,oneof" json:"msg_delegate,omitempty"` + MsgDelegate *types6.MsgDelegate `protobuf:"bytes,15,opt,name=msg_delegate,json=msgDelegate,proto3,oneof" json:"msg_delegate,omitempty"` } type Message_MsgBeginRedelegate struct { - MsgBeginRedelegate *types8.MsgBeginRedelegate `protobuf:"bytes,16,opt,name=msg_begin_redelegate,json=msgBeginRedelegate,proto3,oneof" json:"msg_begin_redelegate,omitempty"` + MsgBeginRedelegate *types6.MsgBeginRedelegate `protobuf:"bytes,16,opt,name=msg_begin_redelegate,json=msgBeginRedelegate,proto3,oneof" json:"msg_begin_redelegate,omitempty"` } type Message_MsgUndelegate struct { - MsgUndelegate *types8.MsgUndelegate `protobuf:"bytes,17,opt,name=msg_undelegate,json=msgUndelegate,proto3,oneof" json:"msg_undelegate,omitempty"` + MsgUndelegate *types6.MsgUndelegate `protobuf:"bytes,17,opt,name=msg_undelegate,json=msgUndelegate,proto3,oneof" json:"msg_undelegate,omitempty"` } func (*Message_MsgSend) isMessage_Sum() {} @@ -560,49 +430,49 @@ func (m *Message) GetSum() isMessage_Sum { return nil } -func (m *Message) GetMsgSend() *types5.MsgSend { +func (m *Message) GetMsgSend() *types3.MsgSend { if x, ok := m.GetSum().(*Message_MsgSend); ok { return x.MsgSend } return nil } -func (m *Message) GetMsgMultiSend() *types5.MsgMultiSend { +func (m *Message) GetMsgMultiSend() *types3.MsgMultiSend { if x, ok := m.GetSum().(*Message_MsgMultiSend); ok { return x.MsgMultiSend } return nil } -func (m *Message) GetMsgVerifyInvariant() *types6.MsgVerifyInvariant { +func (m *Message) GetMsgVerifyInvariant() *types4.MsgVerifyInvariant { if x, ok := m.GetSum().(*Message_MsgVerifyInvariant); ok { return x.MsgVerifyInvariant } return nil } -func (m *Message) GetMsgSetWithdrawAddress() *types4.MsgSetWithdrawAddress { +func (m *Message) GetMsgSetWithdrawAddress() *types2.MsgSetWithdrawAddress { if x, ok := m.GetSum().(*Message_MsgSetWithdrawAddress); ok { return x.MsgSetWithdrawAddress } return nil } -func (m *Message) GetMsgWithdrawDelegatorReward() *types4.MsgWithdrawDelegatorReward { +func (m *Message) GetMsgWithdrawDelegatorReward() *types2.MsgWithdrawDelegatorReward { if x, ok := m.GetSum().(*Message_MsgWithdrawDelegatorReward); ok { return x.MsgWithdrawDelegatorReward } return nil } -func (m *Message) GetMsgWithdrawValidatorCommission() *types4.MsgWithdrawValidatorCommission { +func (m *Message) GetMsgWithdrawValidatorCommission() *types2.MsgWithdrawValidatorCommission { if x, ok := m.GetSum().(*Message_MsgWithdrawValidatorCommission); ok { return x.MsgWithdrawValidatorCommission } return nil } -func (m *Message) GetMsgFundCommunityPool() *types4.MsgFundCommunityPool { +func (m *Message) GetMsgFundCommunityPool() *types2.MsgFundCommunityPool { if x, ok := m.GetSum().(*Message_MsgFundCommunityPool); ok { return x.MsgFundCommunityPool } @@ -616,56 +486,56 @@ func (m *Message) GetMsgSubmitProposal() *MsgSubmitProposal { return nil } -func (m *Message) GetMsgVote() *types2.MsgVote { +func (m *Message) GetMsgVote() *types.MsgVote { if x, ok := m.GetSum().(*Message_MsgVote); ok { return x.MsgVote } return nil } -func (m *Message) GetMsgDeposit() *types2.MsgDeposit { +func (m *Message) GetMsgDeposit() *types.MsgDeposit { if x, ok := m.GetSum().(*Message_MsgDeposit); ok { return x.MsgDeposit } return nil } -func (m *Message) GetMsgUnjail() *types7.MsgUnjail { +func (m *Message) GetMsgUnjail() *types5.MsgUnjail { if x, ok := m.GetSum().(*Message_MsgUnjail); ok { return x.MsgUnjail } return nil } -func (m *Message) GetMsgCreateValidator() *types8.MsgCreateValidator { +func (m *Message) GetMsgCreateValidator() *types6.MsgCreateValidator { if x, ok := m.GetSum().(*Message_MsgCreateValidator); ok { return x.MsgCreateValidator } return nil } -func (m *Message) GetMsgEditValidator() *types8.MsgEditValidator { +func (m *Message) GetMsgEditValidator() *types6.MsgEditValidator { if x, ok := m.GetSum().(*Message_MsgEditValidator); ok { return x.MsgEditValidator } return nil } -func (m *Message) GetMsgDelegate() *types8.MsgDelegate { +func (m *Message) GetMsgDelegate() *types6.MsgDelegate { if x, ok := m.GetSum().(*Message_MsgDelegate); ok { return x.MsgDelegate } return nil } -func (m *Message) GetMsgBeginRedelegate() *types8.MsgBeginRedelegate { +func (m *Message) GetMsgBeginRedelegate() *types6.MsgBeginRedelegate { if x, ok := m.GetSum().(*Message_MsgBeginRedelegate); ok { return x.MsgBeginRedelegate } return nil } -func (m *Message) GetMsgUndelegate() *types8.MsgUndelegate { +func (m *Message) GetMsgUndelegate() *types6.MsgUndelegate { if x, ok := m.GetSum().(*Message_MsgUndelegate); ok { return x.MsgUndelegate } @@ -705,7 +575,7 @@ func (m *SignDoc) Reset() { *m = SignDoc{} } func (m *SignDoc) String() string { return proto.CompactTextString(m) } func (*SignDoc) ProtoMessage() {} func (*SignDoc) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{6} + return fileDescriptor_ff851c3a98ef46f7, []int{5} } func (m *SignDoc) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -753,7 +623,7 @@ func (m *StdFee) Reset() { *m = StdFee{} } func (m *StdFee) String() string { return proto.CompactTextString(m) } func (*StdFee) ProtoMessage() {} func (*StdFee) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{7} + return fileDescriptor_ff851c3a98ef46f7, []int{6} } func (m *StdFee) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -793,7 +663,7 @@ func (m *StdSignature) Reset() { *m = StdSignature{} } func (m *StdSignature) String() string { return proto.CompactTextString(m) } func (*StdSignature) ProtoMessage() {} func (*StdSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{8} + return fileDescriptor_ff851c3a98ef46f7, []int{7} } func (m *StdSignature) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -834,7 +704,7 @@ func (m *StdTxBase) Reset() { *m = StdTxBase{} } func (m *StdTxBase) String() string { return proto.CompactTextString(m) } func (*StdTxBase) ProtoMessage() {} func (*StdTxBase) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{9} + return fileDescriptor_ff851c3a98ef46f7, []int{8} } func (m *StdTxBase) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -898,7 +768,7 @@ func (m *StdSignDocBase) Reset() { *m = StdSignDocBase{} } func (m *StdSignDocBase) String() string { return proto.CompactTextString(m) } func (*StdSignDocBase) ProtoMessage() {} func (*StdSignDocBase) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{10} + return fileDescriptor_ff851c3a98ef46f7, []int{9} } func (m *StdSignDocBase) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -963,7 +833,6 @@ func (m *StdSignDocBase) GetFee() StdFee { } func init() { - proto.RegisterType((*Account)(nil), "cosmos_sdk.std.v1.Account") proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos_sdk.std.v1.MsgSubmitProposal") proto.RegisterType((*Proposal)(nil), "cosmos_sdk.std.v1.Proposal") proto.RegisterType((*Content)(nil), "cosmos_sdk.std.v1.Content") @@ -979,107 +848,96 @@ func init() { func init() { proto.RegisterFile("std/codec.proto", fileDescriptor_ff851c3a98ef46f7) } var fileDescriptor_ff851c3a98ef46f7 = []byte{ - // 1600 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcd, 0x6f, 0x1b, 0xc7, - 0x15, 0x27, 0x2d, 0x5a, 0x94, 0x46, 0xd4, 0xd7, 0xd8, 0xae, 0x68, 0xd5, 0x26, 0x65, 0xba, 0x30, - 0x5c, 0xbb, 0x22, 0x2d, 0xdb, 0xfd, 0x30, 0x51, 0xb4, 0x35, 0x25, 0x0b, 0x54, 0x5b, 0xb5, 0xc6, - 0xca, 0x56, 0xd1, 0xa2, 0xed, 0x62, 0xb8, 0x3b, 0x5a, 0x4d, 0xc5, 0xd9, 0xd9, 0xee, 0xcc, 0x52, - 0x64, 0x81, 0x9e, 0x92, 0x43, 0x7c, 0x08, 0x90, 0x6b, 0x0e, 0x01, 0x9c, 0x6b, 0xce, 0x3e, 0xe5, - 0x2f, 0x30, 0x7c, 0xf2, 0x31, 0x27, 0x25, 0x90, 0x2f, 0x81, 0x4f, 0x81, 0xff, 0x82, 0x60, 0x66, - 0x67, 0x97, 0x4b, 0x72, 0x49, 0x2b, 0x40, 0x2e, 0xc2, 0xce, 0x7b, 0xef, 0xf7, 0x7b, 0x8f, 0xef, - 0x63, 0xde, 0x08, 0x2c, 0x72, 0x61, 0xd7, 0x2c, 0x66, 0x63, 0xab, 0xea, 0xf9, 0x4c, 0x30, 0xb8, - 0x6c, 0x31, 0x4e, 0x19, 0x37, 0xb9, 0x7d, 0x54, 0xe5, 0xc2, 0xae, 0x76, 0x36, 0x56, 0x6f, 0x8b, - 0x43, 0xe2, 0xdb, 0xa6, 0x87, 0x7c, 0xd1, 0xab, 0x29, 0xab, 0x5a, 0x68, 0xb4, 0x9e, 0x3c, 0x84, - 0xf8, 0xd5, 0x1b, 0xa3, 0xc6, 0x0e, 0x73, 0x58, 0xff, 0x4b, 0xdb, 0x2d, 0x8b, 0x9e, 0x87, 0x79, - 0x4d, 0xfd, 0xd5, 0xa2, 0x62, 0xb7, 0x86, 0x02, 0x71, 0x58, 0x1b, 0xd5, 0xac, 0x69, 0x4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0x46, 0xe9, 0xf4, 0xa4, - 0x9c, 0xdf, 0x94, 0xb2, 0x9d, 0xad, 0x77, 0x27, 0xe5, 0xc5, 0x30, 0x1d, 0x91, 0x51, 0xc5, 0xc8, - 0xab, 0xcf, 0x1d, 0x1b, 0xfe, 0x01, 0x2c, 0xe8, 0x7f, 0x60, 0x4c, 0x37, 0xa0, 0x2d, 0xec, 0x87, - 0xc5, 0x68, 0x5c, 0x7e, 0x77, 0x52, 0xbe, 0x14, 0xa2, 0x06, 0xf5, 0x15, 0x63, 0x5e, 0x0b, 0xfe, - 0xa2, 0xce, 0x70, 0x15, 0xcc, 0x70, 0xfc, 0xdf, 0x00, 0xbb, 0x56, 0xf8, 0x3c, 0xcd, 0x19, 0xf1, - 0x39, 0x8e, 0x3f, 0xd7, 0x8f, 0x3f, 0xca, 0xe6, 0xf9, 0xb3, 0x67, 0xb3, 0x51, 0x7f, 0x79, 0x5a, - 0xca, 0xbe, 0x3e, 0x2d, 0x65, 0xbf, 0x39, 0x2d, 0x65, 0x3f, 0x79, 0x53, 0xca, 0xbc, 0x7e, 0x53, - 0xca, 0x7c, 0xf5, 0xa6, 0x94, 0xf9, 0xc7, 0xda, 0xc4, 0x96, 0xe3, 0xc2, 0x6e, 0x4d, 0xab, 0x7f, - 0xae, 0xef, 0x7d, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x62, 0xc1, 0x70, 0xf7, 0x14, 0x11, 0x00, 0x00, + // 1424 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0x36, 0x6e, 0x9c, 0x4c, 0xd2, 0x7c, 0x4c, 0x5b, 0x75, 0x1b, 0x5a, 0x3b, 0x75, 0x51, + 0x55, 0x5a, 0x62, 0x37, 0x2d, 0x02, 0x6a, 0x21, 0x3e, 0x9c, 0x34, 0x72, 0x40, 0x81, 0x6a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c7, 0x91, 0xc5, 0xb0, 0xfd, 0x88, 0xd6, 0x71, 0x18, + 0x17, 0xa3, 0x7a, 0xfe, 0xc5, 0x61, 0xe1, 0x6c, 0x8c, 0xea, 0xd5, 0x17, 0xad, 0x53, 0x5a, 0xf0, + 0xb1, 0x3a, 0xc3, 0x25, 0x30, 0xc5, 0xf1, 0x37, 0x11, 0xf6, 0x9d, 0xf8, 0x79, 0x9a, 0xb5, 0x3a, + 0xe7, 0x4e, 0xfc, 0xd9, 0x6e, 0xfc, 0x49, 0x36, 0x4f, 0x1e, 0x3f, 0x9b, 0xd5, 0xca, 0xe3, 0xa3, + 0xbc, 0xf1, 0xf4, 0x28, 0x6f, 0xfc, 0x75, 0x94, 0x37, 0x7e, 0x7e, 0x96, 0xcf, 0x3c, 0x7d, 0x96, + 0xcf, 0xfc, 0xf1, 0x2c, 0x9f, 0xf9, 0x7c, 0x79, 0x6c, 0xcb, 0x71, 0xe1, 0xd6, 0x27, 0xd5, 0xff, + 0x47, 0xb7, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x26, 0x7e, 0x1b, 0xc1, 0x9b, 0x0e, 0x00, 0x00, } func (this *MsgSubmitProposal) Equal(that interface{}) bool { @@ -1318,50 +1176,6 @@ func (this *StdFee) Equal(that interface{}) bool { } return true } -func (this *Account) GetAccount() github_com_cosmos_cosmos_sdk_x_auth_exported.Account { - if x := this.GetBaseAccount(); x != nil { - return x - } - if x := this.GetContinuousVestingAccount(); x != nil { - return x - } - if x := this.GetDelayedVestingAccount(); x != nil { - return x - } - if x := this.GetPeriodicVestingAccount(); x != nil { - return x - } - if x := this.GetModuleAccount(); x != nil { - return x - } - return nil -} - -func (this *Account) SetAccount(value github_com_cosmos_cosmos_sdk_x_auth_exported.Account) error { - if value == nil { - this.Sum = nil - return nil - } - switch vt := value.(type) { - case *types.BaseAccount: - this.Sum = &Account_BaseAccount{vt} - return nil - case *types1.ContinuousVestingAccount: - this.Sum = &Account_ContinuousVestingAccount{vt} - return nil - case *types1.DelayedVestingAccount: - this.Sum = &Account_DelayedVestingAccount{vt} - return nil - case *types1.PeriodicVestingAccount: - this.Sum = &Account_PeriodicVestingAccount{vt} - return nil - case *types.ModuleAccount: - this.Sum = &Account_ModuleAccount{vt} - return nil - } - return fmt.Errorf("can't encode value of type %T as message Account", value) -} - func (this *Content) GetContent() github_com_cosmos_cosmos_sdk_x_gov_types.Content { if x := this.GetText(); x != nil { return x @@ -1387,19 +1201,19 @@ func (this *Content) SetContent(value github_com_cosmos_cosmos_sdk_x_gov_types.C return nil } switch vt := value.(type) { - case *types2.TextProposal: + case *types.TextProposal: this.Sum = &Content_Text{vt} return nil case *proposal.ParameterChangeProposal: this.Sum = &Content_ParameterChange{vt} return nil - case *types3.SoftwareUpgradeProposal: + case *types1.SoftwareUpgradeProposal: this.Sum = &Content_SoftwareUpgrade{vt} return nil - case *types3.CancelSoftwareUpgradeProposal: + case *types1.CancelSoftwareUpgradeProposal: this.Sum = &Content_CancelSoftwareUpgrade{vt} return nil - case *types4.CommunityPoolSpendProposal: + case *types2.CommunityPoolSpendProposal: this.Sum = &Content_CommunityPoolSpend{vt} return nil } @@ -1464,46 +1278,46 @@ func (this *Message) SetMsg(value github_com_cosmos_cosmos_sdk_types.Msg) error return nil } switch vt := value.(type) { - case *types5.MsgSend: + case *types3.MsgSend: this.Sum = &Message_MsgSend{vt} return nil - case types5.MsgSend: + case types3.MsgSend: this.Sum = &Message_MsgSend{&vt} return nil - case *types5.MsgMultiSend: + case *types3.MsgMultiSend: this.Sum = &Message_MsgMultiSend{vt} return nil - case types5.MsgMultiSend: + case types3.MsgMultiSend: this.Sum = &Message_MsgMultiSend{&vt} return nil - case *types6.MsgVerifyInvariant: + case *types4.MsgVerifyInvariant: this.Sum = &Message_MsgVerifyInvariant{vt} return nil - case types6.MsgVerifyInvariant: + case types4.MsgVerifyInvariant: this.Sum = &Message_MsgVerifyInvariant{&vt} return nil - case *types4.MsgSetWithdrawAddress: + case *types2.MsgSetWithdrawAddress: this.Sum = &Message_MsgSetWithdrawAddress{vt} return nil - case types4.MsgSetWithdrawAddress: + case types2.MsgSetWithdrawAddress: this.Sum = &Message_MsgSetWithdrawAddress{&vt} return nil - case *types4.MsgWithdrawDelegatorReward: + case *types2.MsgWithdrawDelegatorReward: this.Sum = &Message_MsgWithdrawDelegatorReward{vt} return nil - case types4.MsgWithdrawDelegatorReward: + case types2.MsgWithdrawDelegatorReward: this.Sum = &Message_MsgWithdrawDelegatorReward{&vt} return nil - case *types4.MsgWithdrawValidatorCommission: + case *types2.MsgWithdrawValidatorCommission: this.Sum = &Message_MsgWithdrawValidatorCommission{vt} return nil - case types4.MsgWithdrawValidatorCommission: + case types2.MsgWithdrawValidatorCommission: this.Sum = &Message_MsgWithdrawValidatorCommission{&vt} return nil - case *types4.MsgFundCommunityPool: + case *types2.MsgFundCommunityPool: this.Sum = &Message_MsgFundCommunityPool{vt} return nil - case types4.MsgFundCommunityPool: + case types2.MsgFundCommunityPool: this.Sum = &Message_MsgFundCommunityPool{&vt} return nil case *MsgSubmitProposal: @@ -1512,195 +1326,58 @@ func (this *Message) SetMsg(value github_com_cosmos_cosmos_sdk_types.Msg) error case MsgSubmitProposal: this.Sum = &Message_MsgSubmitProposal{&vt} return nil - case *types2.MsgVote: + case *types.MsgVote: this.Sum = &Message_MsgVote{vt} return nil - case types2.MsgVote: + case types.MsgVote: this.Sum = &Message_MsgVote{&vt} return nil - case *types2.MsgDeposit: + case *types.MsgDeposit: this.Sum = &Message_MsgDeposit{vt} return nil - case types2.MsgDeposit: + case types.MsgDeposit: this.Sum = &Message_MsgDeposit{&vt} return nil - case *types7.MsgUnjail: + case *types5.MsgUnjail: this.Sum = &Message_MsgUnjail{vt} return nil - case types7.MsgUnjail: + case types5.MsgUnjail: this.Sum = &Message_MsgUnjail{&vt} return nil - case *types8.MsgCreateValidator: + case *types6.MsgCreateValidator: this.Sum = &Message_MsgCreateValidator{vt} return nil - case types8.MsgCreateValidator: + case types6.MsgCreateValidator: this.Sum = &Message_MsgCreateValidator{&vt} return nil - case *types8.MsgEditValidator: + case *types6.MsgEditValidator: this.Sum = &Message_MsgEditValidator{vt} return nil - case types8.MsgEditValidator: + case types6.MsgEditValidator: this.Sum = &Message_MsgEditValidator{&vt} return nil - case *types8.MsgDelegate: + case *types6.MsgDelegate: this.Sum = &Message_MsgDelegate{vt} return nil - case types8.MsgDelegate: + case types6.MsgDelegate: this.Sum = &Message_MsgDelegate{&vt} return nil - case *types8.MsgBeginRedelegate: + case *types6.MsgBeginRedelegate: this.Sum = &Message_MsgBeginRedelegate{vt} return nil - case types8.MsgBeginRedelegate: + case types6.MsgBeginRedelegate: this.Sum = &Message_MsgBeginRedelegate{&vt} return nil - case *types8.MsgUndelegate: + case *types6.MsgUndelegate: this.Sum = &Message_MsgUndelegate{vt} return nil - case types8.MsgUndelegate: + case types6.MsgUndelegate: this.Sum = &Message_MsgUndelegate{&vt} return nil } return fmt.Errorf("can't encode value of type %T as message Message", value) } -func (m *Account) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Account) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Account_BaseAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account_BaseAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.BaseAccount != nil { - { - size, err := m.BaseAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *Account_ContinuousVestingAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account_ContinuousVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ContinuousVestingAccount != nil { - { - size, err := m.ContinuousVestingAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *Account_DelayedVestingAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account_DelayedVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.DelayedVestingAccount != nil { - { - size, err := m.DelayedVestingAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *Account_PeriodicVestingAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account_PeriodicVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PeriodicVestingAccount != nil { - { - size, err := m.PeriodicVestingAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *Account_ModuleAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account_ModuleAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ModuleAccount != nil { - { - size, err := m.ModuleAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} func (m *MsgSubmitProposal) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2593,78 +2270,6 @@ func encodeVarintCodec(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Account) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Account_BaseAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BaseAccount != nil { - l = m.BaseAccount.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Account_ContinuousVestingAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ContinuousVestingAccount != nil { - l = m.ContinuousVestingAccount.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Account_DelayedVestingAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.DelayedVestingAccount != nil { - l = m.DelayedVestingAccount.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Account_PeriodicVestingAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PeriodicVestingAccount != nil { - l = m.PeriodicVestingAccount.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Account_ModuleAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ModuleAccount != nil { - l = m.ModuleAccount.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} func (m *MsgSubmitProposal) Size() (n int) { if m == nil { return 0 @@ -3090,234 +2695,6 @@ func sovCodec(x uint64) (n int) { func sozCodec(x uint64) (n int) { return sovCodec(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Account) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Account: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Account: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.BaseAccount{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Account_BaseAccount{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContinuousVestingAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types1.ContinuousVestingAccount{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Account_ContinuousVestingAccount{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelayedVestingAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types1.DelayedVestingAccount{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Account_DelayedVestingAccount{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeriodicVestingAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types1.PeriodicVestingAccount{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Account_PeriodicVestingAccount{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ModuleAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.ModuleAccount{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Account_ModuleAccount{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3617,7 +2994,7 @@ func (m *Content) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types2.TextProposal{} + v := &types.TextProposal{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3687,7 +3064,7 @@ func (m *Content) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types3.SoftwareUpgradeProposal{} + v := &types1.SoftwareUpgradeProposal{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3722,7 +3099,7 @@ func (m *Content) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types3.CancelSoftwareUpgradeProposal{} + v := &types1.CancelSoftwareUpgradeProposal{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3757,7 +3134,7 @@ func (m *Content) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types4.CommunityPoolSpendProposal{} + v := &types2.CommunityPoolSpendProposal{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3965,7 +3342,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types5.MsgSend{} + v := &types3.MsgSend{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4000,7 +3377,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types5.MsgMultiSend{} + v := &types3.MsgMultiSend{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4035,7 +3412,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types6.MsgVerifyInvariant{} + v := &types4.MsgVerifyInvariant{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4070,7 +3447,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types4.MsgSetWithdrawAddress{} + v := &types2.MsgSetWithdrawAddress{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4105,7 +3482,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types4.MsgWithdrawDelegatorReward{} + v := &types2.MsgWithdrawDelegatorReward{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4140,7 +3517,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types4.MsgWithdrawValidatorCommission{} + v := &types2.MsgWithdrawValidatorCommission{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4175,7 +3552,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types4.MsgFundCommunityPool{} + v := &types2.MsgFundCommunityPool{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4245,7 +3622,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types2.MsgVote{} + v := &types.MsgVote{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4280,7 +3657,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types2.MsgDeposit{} + v := &types.MsgDeposit{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4315,7 +3692,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types7.MsgUnjail{} + v := &types5.MsgUnjail{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4350,7 +3727,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types8.MsgCreateValidator{} + v := &types6.MsgCreateValidator{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4385,7 +3762,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types8.MsgEditValidator{} + v := &types6.MsgEditValidator{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4420,7 +3797,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types8.MsgDelegate{} + v := &types6.MsgDelegate{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4455,7 +3832,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types8.MsgBeginRedelegate{} + v := &types6.MsgBeginRedelegate{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4490,7 +3867,7 @@ func (m *Message) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &types8.MsgUndelegate{} + v := &types6.MsgUndelegate{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4698,7 +4075,7 @@ func (m *StdFee) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Amount = append(m.Amount, types9.Coin{}) + m.Amount = append(m.Amount, types7.Coin{}) if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/std/codec.proto b/std/codec.proto index 695195e7fd05..c7f0d8354fde 100644 --- a/std/codec.proto +++ b/std/codec.proto @@ -15,31 +15,6 @@ import "x/upgrade/types/types.proto"; option go_package = "github.com/cosmos/cosmos-sdk/std"; -// Account defines the application-level Account type. -message Account { - option (cosmos_proto.interface_type) = "*github.com/cosmos/cosmos-sdk/x/auth/exported.Account"; - - // sum defines a list of all acceptable concrete Account implementations. - oneof sum { - cosmos_sdk.x.auth.v1.BaseAccount base_account = 1; - cosmos_sdk.x.auth.vesting.v1.ContinuousVestingAccount continuous_vesting_account = 2; - cosmos_sdk.x.auth.vesting.v1.DelayedVestingAccount delayed_vesting_account = 3; - cosmos_sdk.x.auth.vesting.v1.PeriodicVestingAccount periodic_vesting_account = 4; - cosmos_sdk.x.auth.v1.ModuleAccount module_account = 5; - } -} - -// Supply defines the application-level Supply type. -message Supply { - option (gogoproto.equal) = true; - option (cosmos_proto.interface_type) = "*github.com/cosmos/cosmos-sdk/x/bank/exported.SupplyI"; - - // sum defines a set of all acceptable concrete Supply implementations. - oneof sum { - cosmos_sdk.x.bank.v1.Supply supply = 1; - } -} - // MsgSubmitProposal defines the application-level message type for handling // governance proposals. message MsgSubmitProposal { From 4488b7299dbd3c6569aeed78a9ae4567e204872d Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Fri, 15 May 2020 22:21:28 +0530 Subject: [PATCH 12/18] Eliminate vesting import in auth --- x/auth/module.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/x/auth/module.go b/x/auth/module.go index 9b788b6ffb05..d747f005ea5e 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -19,7 +19,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/client/rest" "github.com/cosmos/cosmos-sdk/x/auth/simulation" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" ) var ( @@ -75,7 +74,6 @@ func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { func (AppModuleBasic) RegisterInterfaceTypes(registry types.InterfaceRegistry) { authtypes.RegisterInterfaces(registry) - vestingtypes.RegisterInterfaces(registry) } //____________________________________________________________________________ From 9ff8d9cd06f80c3313b899e17444aa9422d231b9 Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Fri, 15 May 2020 22:37:31 +0530 Subject: [PATCH 13/18] Fix lint issues --- x/ibc/client/cli/cli.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/ibc/client/cli/cli.go b/x/ibc/client/cli/cli.go index 84ed0740be85..94b6c216f5d3 100644 --- a/x/ibc/client/cli/cli.go +++ b/x/ibc/client/cli/cli.go @@ -21,7 +21,7 @@ func GetTxCmd(storeKey string, cdc *codec.Codec) *cobra.Command { Short: "IBC transaction subcommands", DisableFlagParsing: true, SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, + RunE: client.ValidateCmd, } ibcTxCmd.AddCommand(flags.PostCommands( @@ -41,7 +41,7 @@ func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command { Short: "Querying commands for the IBC module", DisableFlagParsing: true, SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, + RunE: client.ValidateCmd, } ibcQueryCmd.AddCommand(flags.GetCommands( From 6d586213afdf5b7653ba8e28107e2c171689a140 Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Mon, 18 May 2020 22:52:00 +0530 Subject: [PATCH 14/18] Fix tests --- x/auth/legacy/v0_39/migrate_test.go | 2 +- x/ibc-transfer/keeper/keeper.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x/auth/legacy/v0_39/migrate_test.go b/x/auth/legacy/v0_39/migrate_test.go index 88dd4bd0e6df..027db2e89602 100644 --- a/x/auth/legacy/v0_39/migrate_test.go +++ b/x/auth/legacy/v0_39/migrate_test.go @@ -51,7 +51,7 @@ func TestMigrate(t *testing.T) { }, "accounts": [ { - "type": "cosmos-sdk/AccountI", + "type": "cosmos-sdk/BaseAccount", "value": { "address": "cosmos1xxkueklal9vejv9unqu80w9vptyepfa95pd53u", "public_key": "", diff --git a/x/ibc-transfer/keeper/keeper.go b/x/ibc-transfer/keeper/keeper.go index 0c27f2825fda..1202f1a7d12c 100644 --- a/x/ibc-transfer/keeper/keeper.go +++ b/x/ibc-transfer/keeper/keeper.go @@ -68,7 +68,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { // GetTransferAccount returns the ICS20 - transfers ModuleAccount func (k Keeper) GetTransferAccount(ctx sdk.Context) authtypes.ModuleAccountI { - return k.authKeeper.GetModuleAccount(ctx, types.GetModuleAccountName()) + return k.authKeeper.GetModuleAccount(ctx, types.ModuleName) } // PacketExecuted defines a wrapper function for the channel Keeper's function From 067df5026d6910804281f02d4459a41fc7f86a8e Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Tue, 19 May 2020 00:00:02 +0530 Subject: [PATCH 15/18] Addressed comments --- x/auth/keeper/keeper.go | 2 ++ x/auth/module.go | 7 +------ x/auth/simulation/decoder.go | 13 +++++++++---- x/auth/vesting/types/vesting_account.go | 8 ++++---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/x/auth/keeper/keeper.go b/x/auth/keeper/keeper.go index 48276b5a2941..a770053997e7 100644 --- a/x/auth/keeper/keeper.go +++ b/x/auth/keeper/keeper.go @@ -217,3 +217,5 @@ func (ak AccountKeeper) UnmarshalAccountJSON(bz []byte) (types.AccountI, error) return acc, nil } + +func (ak AccountKeeper) GetCodec() codec.Marshaler { return ak.Cdc } diff --git a/x/auth/module.go b/x/auth/module.go index d747f005ea5e..11875b6356ec 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -72,6 +72,7 @@ func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { return cli.GetQueryCmd(cdc) } +// RegisterInterfaceTypes registers interfaces and implementations of the auth module. func (AppModuleBasic) RegisterInterfaceTypes(registry types.InterfaceRegistry) { authtypes.RegisterInterfaces(registry) } @@ -170,9 +171,3 @@ func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { return nil } - -// InterfaceModule is an interface that modules can implement in order to -// register their interfaces and implementations in an InterfaceRegistry -type InterfaceModule interface { - RegisterInterfaceTypes(registry types.InterfaceRegistry) -} diff --git a/x/auth/simulation/decoder.go b/x/auth/simulation/decoder.go index 768066f5d9e2..19126c1719a6 100644 --- a/x/auth/simulation/decoder.go +++ b/x/auth/simulation/decoder.go @@ -3,17 +3,22 @@ package simulation import ( "bytes" "fmt" + "github.com/cosmos/cosmos-sdk/codec" gogotypes "github.com/gogo/protobuf/types" tmkv "github.com/tendermint/tendermint/libs/kv" - "github.com/cosmos/cosmos-sdk/x/auth/keeper" "github.com/cosmos/cosmos-sdk/x/auth/types" ) +type AuthUnmarshaler interface { + UnmarshalAccount([]byte) (types.AccountI, error) + GetCodec() codec.Marshaler +} + // NewDecodeStore returns a decoder function closure that unmarshals the KVPair's // Value to the corresponding auth type. -func NewDecodeStore(ak keeper.AccountKeeper) func(kvA, kvB tmkv.Pair) string { +func NewDecodeStore(ak AuthUnmarshaler) func(kvA, kvB tmkv.Pair) string { return func(kvA, kvB tmkv.Pair) string { switch { case bytes.Equal(kvA.Key[:1], types.AddressStoreKeyPrefix): @@ -31,8 +36,8 @@ func NewDecodeStore(ak keeper.AccountKeeper) func(kvA, kvB tmkv.Pair) string { case bytes.Equal(kvA.Key, types.GlobalAccountNumberKey): var globalAccNumberA, globalAccNumberB gogotypes.UInt64Value - ak.Cdc.MustUnmarshalBinaryBare(kvA.Value, &globalAccNumberA) - ak.Cdc.MustUnmarshalBinaryBare(kvB.Value, &globalAccNumberB) + ak.GetCodec().MustUnmarshalBinaryBare(kvA.Value, &globalAccNumberA) + ak.GetCodec().MustUnmarshalBinaryBare(kvB.Value, &globalAccNumberB) return fmt.Sprintf("GlobalAccNumberA: %d\nGlobalAccNumberB: %d", globalAccNumberA, globalAccNumberB) diff --git a/x/auth/vesting/types/vesting_account.go b/x/auth/vesting/types/vesting_account.go index 7922d91899d0..b032499b3492 100644 --- a/x/auth/vesting/types/vesting_account.go +++ b/x/auth/vesting/types/vesting_account.go @@ -22,7 +22,7 @@ var ( ) //----------------------------------------------------------------------------- -// Base Vesting AccountI +// Base Vesting Account // NewBaseVestingAccount creates a new BaseVestingAccount object. It is the // callers responsibility to ensure the base account has sufficient funds with @@ -261,7 +261,7 @@ func (bva *BaseVestingAccount) UnmarshalJSON(bz []byte) error { } //----------------------------------------------------------------------------- -// Continuous Vesting AccountI +// Continuous Vesting Account var _ vestexported.VestingAccount = (*ContinuousVestingAccount)(nil) var _ authtypes.GenesisAccount = (*ContinuousVestingAccount)(nil) @@ -421,7 +421,7 @@ func (cva *ContinuousVestingAccount) UnmarshalJSON(bz []byte) error { } //----------------------------------------------------------------------------- -// Periodic Vesting AccountI +// Periodic Vesting Account var _ vestexported.VestingAccount = (*PeriodicVestingAccount)(nil) var _ authtypes.GenesisAccount = (*PeriodicVestingAccount)(nil) @@ -613,7 +613,7 @@ func (pva *PeriodicVestingAccount) UnmarshalJSON(bz []byte) error { } //----------------------------------------------------------------------------- -// Delayed Vesting AccountI +// Delayed Vesting Account var _ vestexported.VestingAccount = (*DelayedVestingAccount)(nil) var _ authtypes.GenesisAccount = (*DelayedVestingAccount)(nil) From cf2dd94fc1c2966a551e7a9977b92038972063a1 Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Tue, 19 May 2020 14:02:53 +0530 Subject: [PATCH 16/18] Rename interfaces in RegisterInterfaces --- x/auth/simulation/decoder.go | 2 +- x/auth/types/codec.go | 4 ++-- x/auth/vesting/types/codec.go | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/x/auth/simulation/decoder.go b/x/auth/simulation/decoder.go index 19126c1719a6..3df011342df5 100644 --- a/x/auth/simulation/decoder.go +++ b/x/auth/simulation/decoder.go @@ -3,11 +3,11 @@ package simulation import ( "bytes" "fmt" - "github.com/cosmos/cosmos-sdk/codec" gogotypes "github.com/gogo/protobuf/types" tmkv "github.com/tendermint/tendermint/libs/kv" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/x/auth/types" ) diff --git a/x/auth/types/codec.go b/x/auth/types/codec.go index 3581627d5513..071ef3249504 100644 --- a/x/auth/types/codec.go +++ b/x/auth/types/codec.go @@ -11,7 +11,7 @@ func RegisterCodec(cdc *codec.Codec) { cdc.RegisterInterface((*ModuleAccountI)(nil), nil) cdc.RegisterInterface((*GenesisAccount)(nil), nil) cdc.RegisterInterface((*AccountI)(nil), nil) - cdc.RegisterConcrete(&BaseAccount{}, "cosmos-sdk/AccountI", nil) + cdc.RegisterConcrete(&BaseAccount{}, "cosmos-sdk/BaseAccount", nil) cdc.RegisterConcrete(&ModuleAccount{}, "cosmos-sdk/ModuleAccount", nil) cdc.RegisterConcrete(StdTx{}, "cosmos-sdk/StdTx", nil) } @@ -20,7 +20,7 @@ func RegisterCodec(cdc *codec.Codec) { // and creates a registry of it's concrete implementations func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterInterface( - "cosmos_sdk.auth.v1.auth", + "cosmos_sdk.auth.v1.AccountI", (*AccountI)(nil), &BaseAccount{}, &ModuleAccount{}, diff --git a/x/auth/vesting/types/codec.go b/x/auth/vesting/types/codec.go index 27ff86ff5e88..ac94ba2b6777 100644 --- a/x/auth/vesting/types/codec.go +++ b/x/auth/vesting/types/codec.go @@ -21,14 +21,13 @@ func RegisterCodec(cdc *codec.Codec) { // Interfaces and creates a registry of it's concrete implementations func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterInterface( - "cosmos_sdk.auth.v1.vesting", + "cosmos_sdk.auth.vesting.v1.VestingAccount", (*exported.VestingAccount)(nil), &ContinuousVestingAccount{}, &DelayedVestingAccount{}, &PeriodicVestingAccount{}, ) - registry.RegisterInterface( - "cosmos_sdk.auth.v1.vesting", + registry.RegisterImplementations( (*authtypes.AccountI)(nil), &DelayedVestingAccount{}, &ContinuousVestingAccount{}, From 078b16c039e02e31f5ac698293c961123f69e0ac Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Wed, 20 May 2020 20:31:51 +0530 Subject: [PATCH 17/18] Removed codec.proto from std --- std/codec.go | 68 - std/codec.pb.go | 3921 ----------------------------------------------- std/codec.proto | 28 - 3 files changed, 4017 deletions(-) delete mode 100644 std/codec.pb.go delete mode 100644 std/codec.proto diff --git a/std/codec.go b/std/codec.go index 3614bcaa7484..eeb8f038c9e0 100644 --- a/std/codec.go +++ b/std/codec.go @@ -1,8 +1,6 @@ package std import ( - "github.com/iov-one/weave/x/gov" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -26,72 +24,6 @@ func NewAppCodec(amino *codec.Codec, anyUnpacker types.AnyUnpacker) *Codec { return &Codec{Marshaler: codec.NewHybridCodec(amino, anyUnpacker), amino: amino, anyUnpacker: anyUnpacker} } -// MarshalAccount marshals an Account interface. If the given type implements -// the Marshaler interface, it is treated as a Proto-defined message and -// serialized that way. Otherwise, it falls back on the internal Amino codec. -func (c *Codec) MarshalAccount(accI authexported.Account) ([]byte, error) { - acc := &Account{} - if err := acc.SetAccount(accI); err != nil { - return nil, err - } - - return c.Marshaler.MarshalBinaryBare(acc) -} - -// UnmarshalAccount returns an Account interface from raw encoded account bytes -// of a Proto-based Account type. An error is returned upon decoding failure. -func (c *Codec) UnmarshalAccount(bz []byte) (authexported.Account, error) { - acc := &Account{} - if err := c.Marshaler.UnmarshalBinaryBare(bz, acc); err != nil { - return nil, err - } - - return acc.GetAccount(), nil -} - -// MarshalAccountJSON JSON encodes an account object implementing the Account -// interface. -func (c *Codec) MarshalAccountJSON(acc authexported.Account) ([]byte, error) { - return c.Marshaler.MarshalJSON(acc) -} - -// UnmarshalAccountJSON returns an Account from JSON encoded bytes. -func (c *Codec) UnmarshalAccountJSON(bz []byte) (authexported.Account, error) { - acc := &Account{} - if err := c.Marshaler.UnmarshalJSON(bz, acc); err != nil { - return nil, err - } - - return acc.GetAccount(), nil -} - -// MarshalProposal marshals a Proposal. It accepts a Proposal defined by the x/gov -// module and uses the application-level Proposal type which has the concrete -// Content implementation to serialize. -func (c *Codec) MarshalProposal(p gov.Proposal) ([]byte, error) { - proposal := &Proposal{ProposalBase: p.ProposalBase} - if err := proposal.Content.SetContent(p.Content); err != nil { - return nil, err - } - - return c.Marshaler.MarshalBinaryBare(proposal) -} - -// UnmarshalProposal decodes a Proposal defined by the x/gov module and uses the -// application-level Proposal type which has the concrete Content implementation -// to deserialize. -func (c *Codec) UnmarshalProposal(bz []byte) (gov.Proposal, error) { - proposal := &Proposal{} - if err := c.Marshaler.UnmarshalBinaryBare(bz, proposal); err != nil { - return gov.Proposal{}, err - } - - return gov.Proposal{ - Content: proposal.Content.GetContent(), - ProposalBase: proposal.ProposalBase, - }, nil -} - // ---------------------------------------------------------------------------- // necessary types and interfaces registered. This codec is provided to all the // modules the application depends on. diff --git a/std/codec.pb.go b/std/codec.pb.go deleted file mode 100644 index 4b5f1c09329f..000000000000 --- a/std/codec.pb.go +++ /dev/null @@ -1,3921 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: std/codec.proto - -package std - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types8 "github.com/cosmos/cosmos-sdk/types" - github_com_cosmos_cosmos_sdk_x_auth_exported "github.com/cosmos/cosmos-sdk/x/auth/exported" - types "github.com/cosmos/cosmos-sdk/x/auth/types" - types1 "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - types2 "github.com/cosmos/cosmos-sdk/x/bank/types" - types3 "github.com/cosmos/cosmos-sdk/x/crisis/types" - types4 "github.com/cosmos/cosmos-sdk/x/distribution/types" - types5 "github.com/cosmos/cosmos-sdk/x/gov/types" - types6 "github.com/cosmos/cosmos-sdk/x/slashing/types" - types7 "github.com/cosmos/cosmos-sdk/x/staking/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/regen-network/cosmos-proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Account defines the application-level Account type. -type Account struct { - // sum defines a list of all acceptable concrete Account implementations. - // - // Types that are valid to be assigned to Sum: - // *Account_BaseAccount - // *Account_ContinuousVestingAccount - // *Account_DelayedVestingAccount - // *Account_PeriodicVestingAccount - // *Account_ModuleAccount - Sum isAccount_Sum `protobuf_oneof:"sum"` -} - -func (m *Account) Reset() { *m = Account{} } -func (m *Account) String() string { return proto.CompactTextString(m) } -func (*Account) ProtoMessage() {} -func (*Account) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{0} -} -func (m *Account) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Account.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Account) XXX_Merge(src proto.Message) { - xxx_messageInfo_Account.Merge(m, src) -} -func (m *Account) XXX_Size() int { - return m.Size() -} -func (m *Account) XXX_DiscardUnknown() { - xxx_messageInfo_Account.DiscardUnknown(m) -} - -var xxx_messageInfo_Account proto.InternalMessageInfo - -type isAccount_Sum interface { - isAccount_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Account_BaseAccount struct { - BaseAccount *types.BaseAccount `protobuf:"bytes,1,opt,name=base_account,json=baseAccount,proto3,oneof" json:"base_account,omitempty"` -} -type Account_ContinuousVestingAccount struct { - ContinuousVestingAccount *types1.ContinuousVestingAccount `protobuf:"bytes,2,opt,name=continuous_vesting_account,json=continuousVestingAccount,proto3,oneof" json:"continuous_vesting_account,omitempty"` -} -type Account_DelayedVestingAccount struct { - DelayedVestingAccount *types1.DelayedVestingAccount `protobuf:"bytes,3,opt,name=delayed_vesting_account,json=delayedVestingAccount,proto3,oneof" json:"delayed_vesting_account,omitempty"` -} -type Account_PeriodicVestingAccount struct { - PeriodicVestingAccount *types1.PeriodicVestingAccount `protobuf:"bytes,4,opt,name=periodic_vesting_account,json=periodicVestingAccount,proto3,oneof" json:"periodic_vesting_account,omitempty"` -} -type Account_ModuleAccount struct { - ModuleAccount *types.ModuleAccount `protobuf:"bytes,5,opt,name=module_account,json=moduleAccount,proto3,oneof" json:"module_account,omitempty"` -} - -func (*Account_BaseAccount) isAccount_Sum() {} -func (*Account_ContinuousVestingAccount) isAccount_Sum() {} -func (*Account_DelayedVestingAccount) isAccount_Sum() {} -func (*Account_PeriodicVestingAccount) isAccount_Sum() {} -func (*Account_ModuleAccount) isAccount_Sum() {} - -func (m *Account) GetSum() isAccount_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Account) GetBaseAccount() *types.BaseAccount { - if x, ok := m.GetSum().(*Account_BaseAccount); ok { - return x.BaseAccount - } - return nil -} - -func (m *Account) GetContinuousVestingAccount() *types1.ContinuousVestingAccount { - if x, ok := m.GetSum().(*Account_ContinuousVestingAccount); ok { - return x.ContinuousVestingAccount - } - return nil -} - -func (m *Account) GetDelayedVestingAccount() *types1.DelayedVestingAccount { - if x, ok := m.GetSum().(*Account_DelayedVestingAccount); ok { - return x.DelayedVestingAccount - } - return nil -} - -func (m *Account) GetPeriodicVestingAccount() *types1.PeriodicVestingAccount { - if x, ok := m.GetSum().(*Account_PeriodicVestingAccount); ok { - return x.PeriodicVestingAccount - } - return nil -} - -func (m *Account) GetModuleAccount() *types.ModuleAccount { - if x, ok := m.GetSum().(*Account_ModuleAccount); ok { - return x.ModuleAccount - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Account) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Account_BaseAccount)(nil), - (*Account_ContinuousVestingAccount)(nil), - (*Account_DelayedVestingAccount)(nil), - (*Account_PeriodicVestingAccount)(nil), - (*Account_ModuleAccount)(nil), - } -} - -// Transaction defines the application-level transaction that can be signed and -// processed by the state-machine. It contains a base of common fields and -// repeated set of Message types. -type Transaction struct { - StdTxBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:""` - Msgs []Message `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs"` -} - -func (m *Transaction) Reset() { *m = Transaction{} } -func (m *Transaction) String() string { return proto.CompactTextString(m) } -func (*Transaction) ProtoMessage() {} -func (*Transaction) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{1} -} -func (m *Transaction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Transaction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Transaction) XXX_Merge(src proto.Message) { - xxx_messageInfo_Transaction.Merge(m, src) -} -func (m *Transaction) XXX_Size() int { - return m.Size() -} -func (m *Transaction) XXX_DiscardUnknown() { - xxx_messageInfo_Transaction.DiscardUnknown(m) -} - -var xxx_messageInfo_Transaction proto.InternalMessageInfo - -// Message defines the set of valid concrete message types that can be used to -// construct a transaction. -type Message struct { - // sum defines the set of all allowed valid messages defined in modules. - // - // Types that are valid to be assigned to Sum: - // *Message_MsgSend - // *Message_MsgMultiSend - // *Message_MsgVerifyInvariant - // *Message_MsgSetWithdrawAddress - // *Message_MsgWithdrawDelegatorReward - // *Message_MsgWithdrawValidatorCommission - // *Message_MsgFundCommunityPool - // *Message_MsgVote - // *Message_MsgDeposit - // *Message_MsgUnjail - // *Message_MsgCreateValidator - // *Message_MsgEditValidator - // *Message_MsgDelegate - // *Message_MsgBeginRedelegate - // *Message_MsgUndelegate - Sum isMessage_Sum `protobuf_oneof:"sum"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{2} -} -func (m *Message) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(m, src) -} -func (m *Message) XXX_Size() int { - return m.Size() -} -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_Message proto.InternalMessageInfo - -type isMessage_Sum interface { - isMessage_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Message_MsgSend struct { - MsgSend *types2.MsgSend `protobuf:"bytes,1,opt,name=msg_send,json=msgSend,proto3,oneof" json:"msg_send,omitempty"` -} -type Message_MsgMultiSend struct { - MsgMultiSend *types2.MsgMultiSend `protobuf:"bytes,2,opt,name=msg_multi_send,json=msgMultiSend,proto3,oneof" json:"msg_multi_send,omitempty"` -} -type Message_MsgVerifyInvariant struct { - MsgVerifyInvariant *types3.MsgVerifyInvariant `protobuf:"bytes,3,opt,name=msg_verify_invariant,json=msgVerifyInvariant,proto3,oneof" json:"msg_verify_invariant,omitempty"` -} -type Message_MsgSetWithdrawAddress struct { - MsgSetWithdrawAddress *types4.MsgSetWithdrawAddress `protobuf:"bytes,4,opt,name=msg_set_withdraw_address,json=msgSetWithdrawAddress,proto3,oneof" json:"msg_set_withdraw_address,omitempty"` -} -type Message_MsgWithdrawDelegatorReward struct { - MsgWithdrawDelegatorReward *types4.MsgWithdrawDelegatorReward `protobuf:"bytes,5,opt,name=msg_withdraw_delegator_reward,json=msgWithdrawDelegatorReward,proto3,oneof" json:"msg_withdraw_delegator_reward,omitempty"` -} -type Message_MsgWithdrawValidatorCommission struct { - MsgWithdrawValidatorCommission *types4.MsgWithdrawValidatorCommission `protobuf:"bytes,6,opt,name=msg_withdraw_validator_commission,json=msgWithdrawValidatorCommission,proto3,oneof" json:"msg_withdraw_validator_commission,omitempty"` -} -type Message_MsgFundCommunityPool struct { - MsgFundCommunityPool *types4.MsgFundCommunityPool `protobuf:"bytes,7,opt,name=msg_fund_community_pool,json=msgFundCommunityPool,proto3,oneof" json:"msg_fund_community_pool,omitempty"` -} -type Message_MsgVote struct { - MsgVote *types5.MsgVote `protobuf:"bytes,10,opt,name=msg_vote,json=msgVote,proto3,oneof" json:"msg_vote,omitempty"` -} -type Message_MsgDeposit struct { - MsgDeposit *types5.MsgDeposit `protobuf:"bytes,11,opt,name=msg_deposit,json=msgDeposit,proto3,oneof" json:"msg_deposit,omitempty"` -} -type Message_MsgUnjail struct { - MsgUnjail *types6.MsgUnjail `protobuf:"bytes,12,opt,name=msg_unjail,json=msgUnjail,proto3,oneof" json:"msg_unjail,omitempty"` -} -type Message_MsgCreateValidator struct { - MsgCreateValidator *types7.MsgCreateValidator `protobuf:"bytes,13,opt,name=msg_create_validator,json=msgCreateValidator,proto3,oneof" json:"msg_create_validator,omitempty"` -} -type Message_MsgEditValidator struct { - MsgEditValidator *types7.MsgEditValidator `protobuf:"bytes,14,opt,name=msg_edit_validator,json=msgEditValidator,proto3,oneof" json:"msg_edit_validator,omitempty"` -} -type Message_MsgDelegate struct { - MsgDelegate *types7.MsgDelegate `protobuf:"bytes,15,opt,name=msg_delegate,json=msgDelegate,proto3,oneof" json:"msg_delegate,omitempty"` -} -type Message_MsgBeginRedelegate struct { - MsgBeginRedelegate *types7.MsgBeginRedelegate `protobuf:"bytes,16,opt,name=msg_begin_redelegate,json=msgBeginRedelegate,proto3,oneof" json:"msg_begin_redelegate,omitempty"` -} -type Message_MsgUndelegate struct { - MsgUndelegate *types7.MsgUndelegate `protobuf:"bytes,17,opt,name=msg_undelegate,json=msgUndelegate,proto3,oneof" json:"msg_undelegate,omitempty"` -} - -func (*Message_MsgSend) isMessage_Sum() {} -func (*Message_MsgMultiSend) isMessage_Sum() {} -func (*Message_MsgVerifyInvariant) isMessage_Sum() {} -func (*Message_MsgSetWithdrawAddress) isMessage_Sum() {} -func (*Message_MsgWithdrawDelegatorReward) isMessage_Sum() {} -func (*Message_MsgWithdrawValidatorCommission) isMessage_Sum() {} -func (*Message_MsgFundCommunityPool) isMessage_Sum() {} -func (*Message_MsgVote) isMessage_Sum() {} -func (*Message_MsgDeposit) isMessage_Sum() {} -func (*Message_MsgUnjail) isMessage_Sum() {} -func (*Message_MsgCreateValidator) isMessage_Sum() {} -func (*Message_MsgEditValidator) isMessage_Sum() {} -func (*Message_MsgDelegate) isMessage_Sum() {} -func (*Message_MsgBeginRedelegate) isMessage_Sum() {} -func (*Message_MsgUndelegate) isMessage_Sum() {} - -func (m *Message) GetSum() isMessage_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Message) GetMsgSend() *types2.MsgSend { - if x, ok := m.GetSum().(*Message_MsgSend); ok { - return x.MsgSend - } - return nil -} - -func (m *Message) GetMsgMultiSend() *types2.MsgMultiSend { - if x, ok := m.GetSum().(*Message_MsgMultiSend); ok { - return x.MsgMultiSend - } - return nil -} - -func (m *Message) GetMsgVerifyInvariant() *types3.MsgVerifyInvariant { - if x, ok := m.GetSum().(*Message_MsgVerifyInvariant); ok { - return x.MsgVerifyInvariant - } - return nil -} - -func (m *Message) GetMsgSetWithdrawAddress() *types4.MsgSetWithdrawAddress { - if x, ok := m.GetSum().(*Message_MsgSetWithdrawAddress); ok { - return x.MsgSetWithdrawAddress - } - return nil -} - -func (m *Message) GetMsgWithdrawDelegatorReward() *types4.MsgWithdrawDelegatorReward { - if x, ok := m.GetSum().(*Message_MsgWithdrawDelegatorReward); ok { - return x.MsgWithdrawDelegatorReward - } - return nil -} - -func (m *Message) GetMsgWithdrawValidatorCommission() *types4.MsgWithdrawValidatorCommission { - if x, ok := m.GetSum().(*Message_MsgWithdrawValidatorCommission); ok { - return x.MsgWithdrawValidatorCommission - } - return nil -} - -func (m *Message) GetMsgFundCommunityPool() *types4.MsgFundCommunityPool { - if x, ok := m.GetSum().(*Message_MsgFundCommunityPool); ok { - return x.MsgFundCommunityPool - } - return nil -} - -func (m *Message) GetMsgVote() *types5.MsgVote { - if x, ok := m.GetSum().(*Message_MsgVote); ok { - return x.MsgVote - } - return nil -} - -func (m *Message) GetMsgDeposit() *types5.MsgDeposit { - if x, ok := m.GetSum().(*Message_MsgDeposit); ok { - return x.MsgDeposit - } - return nil -} - -func (m *Message) GetMsgUnjail() *types6.MsgUnjail { - if x, ok := m.GetSum().(*Message_MsgUnjail); ok { - return x.MsgUnjail - } - return nil -} - -func (m *Message) GetMsgCreateValidator() *types7.MsgCreateValidator { - if x, ok := m.GetSum().(*Message_MsgCreateValidator); ok { - return x.MsgCreateValidator - } - return nil -} - -func (m *Message) GetMsgEditValidator() *types7.MsgEditValidator { - if x, ok := m.GetSum().(*Message_MsgEditValidator); ok { - return x.MsgEditValidator - } - return nil -} - -func (m *Message) GetMsgDelegate() *types7.MsgDelegate { - if x, ok := m.GetSum().(*Message_MsgDelegate); ok { - return x.MsgDelegate - } - return nil -} - -func (m *Message) GetMsgBeginRedelegate() *types7.MsgBeginRedelegate { - if x, ok := m.GetSum().(*Message_MsgBeginRedelegate); ok { - return x.MsgBeginRedelegate - } - return nil -} - -func (m *Message) GetMsgUndelegate() *types7.MsgUndelegate { - if x, ok := m.GetSum().(*Message_MsgUndelegate); ok { - return x.MsgUndelegate - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Message) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Message_MsgSend)(nil), - (*Message_MsgMultiSend)(nil), - (*Message_MsgVerifyInvariant)(nil), - (*Message_MsgSetWithdrawAddress)(nil), - (*Message_MsgWithdrawDelegatorReward)(nil), - (*Message_MsgWithdrawValidatorCommission)(nil), - (*Message_MsgFundCommunityPool)(nil), - (*Message_MsgVote)(nil), - (*Message_MsgDeposit)(nil), - (*Message_MsgUnjail)(nil), - (*Message_MsgCreateValidator)(nil), - (*Message_MsgEditValidator)(nil), - (*Message_MsgDelegate)(nil), - (*Message_MsgBeginRedelegate)(nil), - (*Message_MsgUndelegate)(nil), - } -} - -// SignDoc defines a standard application-level signing document to compose -// signatures for a Transaction. -type SignDoc struct { - StdSignDocBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:""` - Msgs []Message `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs"` -} - -func (m *SignDoc) Reset() { *m = SignDoc{} } -func (m *SignDoc) String() string { return proto.CompactTextString(m) } -func (*SignDoc) ProtoMessage() {} -func (*SignDoc) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{3} -} -func (m *SignDoc) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SignDoc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignDoc.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SignDoc) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignDoc.Merge(m, src) -} -func (m *SignDoc) XXX_Size() int { - return m.Size() -} -func (m *SignDoc) XXX_DiscardUnknown() { - xxx_messageInfo_SignDoc.DiscardUnknown(m) -} - -var xxx_messageInfo_SignDoc proto.InternalMessageInfo - -func (m *SignDoc) GetMsgs() []Message { - if m != nil { - return m.Msgs - } - return nil -} - -// StdFee includes the amount of coins paid in fees and the maximum -// gas to be used by the transaction. The ratio yields an effective "gasprice", -// which must be above some miminum to be accepted into the mempool. -type StdFee struct { - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` - Gas uint64 `protobuf:"varint,2,opt,name=gas,proto3" json:"gas,omitempty"` -} - -func (m *StdFee) Reset() { *m = StdFee{} } -func (m *StdFee) String() string { return proto.CompactTextString(m) } -func (*StdFee) ProtoMessage() {} -func (*StdFee) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{4} -} -func (m *StdFee) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StdFee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StdFee.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StdFee) XXX_Merge(src proto.Message) { - xxx_messageInfo_StdFee.Merge(m, src) -} -func (m *StdFee) XXX_Size() int { - return m.Size() -} -func (m *StdFee) XXX_DiscardUnknown() { - xxx_messageInfo_StdFee.DiscardUnknown(m) -} - -var xxx_messageInfo_StdFee proto.InternalMessageInfo - -// StdSignature defines a signature structure that contains the signature of a -// transaction and an optional public key. -type StdSignature struct { - PubKey []byte `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"public_key,omitempty" yaml:"public_key"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (m *StdSignature) Reset() { *m = StdSignature{} } -func (m *StdSignature) String() string { return proto.CompactTextString(m) } -func (*StdSignature) ProtoMessage() {} -func (*StdSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{5} -} -func (m *StdSignature) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StdSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StdSignature.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StdSignature) XXX_Merge(src proto.Message) { - xxx_messageInfo_StdSignature.Merge(m, src) -} -func (m *StdSignature) XXX_Size() int { - return m.Size() -} -func (m *StdSignature) XXX_DiscardUnknown() { - xxx_messageInfo_StdSignature.DiscardUnknown(m) -} - -var xxx_messageInfo_StdSignature proto.InternalMessageInfo - -// StdTxBase defines a transaction base which application-level concrete transaction -// types can extend. -type StdTxBase struct { - Fee StdFee `protobuf:"bytes,1,opt,name=fee,proto3" json:"fee"` - Signatures []StdSignature `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures"` - Memo string `protobuf:"bytes,3,opt,name=memo,proto3" json:"memo,omitempty"` -} - -func (m *StdTxBase) Reset() { *m = StdTxBase{} } -func (m *StdTxBase) String() string { return proto.CompactTextString(m) } -func (*StdTxBase) ProtoMessage() {} -func (*StdTxBase) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{6} -} -func (m *StdTxBase) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StdTxBase) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StdTxBase.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StdTxBase) XXX_Merge(src proto.Message) { - xxx_messageInfo_StdTxBase.Merge(m, src) -} -func (m *StdTxBase) XXX_Size() int { - return m.Size() -} -func (m *StdTxBase) XXX_DiscardUnknown() { - xxx_messageInfo_StdTxBase.DiscardUnknown(m) -} - -var xxx_messageInfo_StdTxBase proto.InternalMessageInfo - -func (m *StdTxBase) GetFee() StdFee { - if m != nil { - return m.Fee - } - return StdFee{} -} - -func (m *StdTxBase) GetSignatures() []StdSignature { - if m != nil { - return m.Signatures - } - return nil -} - -func (m *StdTxBase) GetMemo() string { - if m != nil { - return m.Memo - } - return "" -} - -// StdSignDocBase defines the base structure for which applications can extend -// to define the concrete structure that signers sign over. -type StdSignDocBase struct { - ChainID string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty" yaml:"chain_id"` - AccountNumber uint64 `protobuf:"varint,2,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty" yaml:"account_number"` - Sequence uint64 `protobuf:"varint,3,opt,name=sequence,proto3" json:"sequence,omitempty"` - Memo string `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"` - Fee StdFee `protobuf:"bytes,5,opt,name=fee,proto3" json:"fee"` -} - -func (m *StdSignDocBase) Reset() { *m = StdSignDocBase{} } -func (m *StdSignDocBase) String() string { return proto.CompactTextString(m) } -func (*StdSignDocBase) ProtoMessage() {} -func (*StdSignDocBase) Descriptor() ([]byte, []int) { - return fileDescriptor_ff851c3a98ef46f7, []int{7} -} -func (m *StdSignDocBase) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StdSignDocBase) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StdSignDocBase.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StdSignDocBase) XXX_Merge(src proto.Message) { - xxx_messageInfo_StdSignDocBase.Merge(m, src) -} -func (m *StdSignDocBase) XXX_Size() int { - return m.Size() -} -func (m *StdSignDocBase) XXX_DiscardUnknown() { - xxx_messageInfo_StdSignDocBase.DiscardUnknown(m) -} - -var xxx_messageInfo_StdSignDocBase proto.InternalMessageInfo - -func (m *StdSignDocBase) GetChainID() string { - if m != nil { - return m.ChainID - } - return "" -} - -func (m *StdSignDocBase) GetAccountNumber() uint64 { - if m != nil { - return m.AccountNumber - } - return 0 -} - -func (m *StdSignDocBase) GetSequence() uint64 { - if m != nil { - return m.Sequence - } - return 0 -} - -func (m *StdSignDocBase) GetMemo() string { - if m != nil { - return m.Memo - } - return "" -} - -func (m *StdSignDocBase) GetFee() StdFee { - if m != nil { - return m.Fee - } - return StdFee{} -} - -func init() { - proto.RegisterType((*Account)(nil), "cosmos_sdk.std.v1.Account") - proto.RegisterType((*Transaction)(nil), "cosmos_sdk.std.v1.Transaction") - proto.RegisterType((*Message)(nil), "cosmos_sdk.std.v1.Message") - proto.RegisterType((*SignDoc)(nil), "cosmos_sdk.std.v1.SignDoc") - proto.RegisterType((*StdFee)(nil), "cosmos_sdk.std.v1.StdFee") - proto.RegisterType((*StdSignature)(nil), "cosmos_sdk.std.v1.StdSignature") - proto.RegisterType((*StdTxBase)(nil), "cosmos_sdk.std.v1.StdTxBase") - proto.RegisterType((*StdSignDocBase)(nil), "cosmos_sdk.std.v1.StdSignDocBase") -} - -func init() { proto.RegisterFile("std/codec.proto", fileDescriptor_ff851c3a98ef46f7) } - -var fileDescriptor_ff851c3a98ef46f7 = []byte{ - // 1317 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0x5f, 0x37, 0x6e, 0xdc, 0x8c, 0x9d, 0xb4, 0x99, 0x6f, 0xfb, 0xad, 0x6b, 0x5a, 0x3b, 0x35, - 0xa8, 0x2a, 0x2d, 0xb1, 0xe9, 0x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0x30, 0x9c, 0x1e, - 0x34, 0x45, 0x0f, 0x89, 0xed, 0xec, 0x74, 0x5e, 0x1b, 0x34, 0x85, 0x44, 0x3b, 0x99, 0xc6, 0xfa, - 0xef, 0x79, 0x50, 0xb8, 0xee, 0xba, 0x3c, 0xf2, 0x25, 0xdc, 0x00, 0xa5, 0x2e, 0x12, 0xc4, 0x41, - 0xb1, 0x5c, 0xce, 0xad, 0xe4, 0xce, 0x17, 0x2f, 0x9f, 0x6d, 0x4c, 0x74, 0x61, 0xd0, 0x50, 0xef, - 0xde, 0xe8, 0x5f, 0x6a, 0xb4, 0x91, 0x20, 0x06, 0xd8, 0xb1, 0xec, 0x62, 0x77, 0x2c, 0xc2, 0x3e, - 0xa8, 0xb8, 0xdc, 0x97, 0xd4, 0x8f, 0x78, 0x24, 0x1c, 0x53, 0xa7, 0x94, 0xf5, 0x90, 0x66, 0x7d, - 0x37, 0x8b, 0x35, 0xf6, 0x54, 0xec, 0x6b, 0x29, 0xfe, 0x6e, 0xac, 0x1c, 0x87, 0x2a, 0xbb, 0x07, - 0xd8, 0x20, 0x03, 0x27, 0x31, 0xe9, 0xa1, 0x21, 0xc1, 0x53, 0x41, 0xe7, 0x74, 0xd0, 0x2b, 0xb3, - 0x83, 0xae, 0xc7, 0xe0, 0xa9, 0x88, 0x27, 0x70, 0x96, 0x01, 0x06, 0xa0, 0x1c, 0x90, 0x90, 0x72, - 0x4c, 0xdd, 0xa9, 0x78, 0x79, 0x1d, 0xef, 0xea, 0xec, 0x78, 0xb7, 0x0c, 0x7a, 0x2a, 0xe0, 0xff, - 0x83, 0x4c, 0x0b, 0xfc, 0x04, 0x2c, 0x31, 0x8e, 0xa3, 0xde, 0xb8, 0x45, 0x87, 0x75, 0x9c, 0xd7, - 0xb3, 0x5b, 0x74, 0x53, 0xfb, 0x8e, 0x69, 0x17, 0xd9, 0xa4, 0xa2, 0x75, 0xed, 0xc9, 0xa3, 0xd5, - 0x77, 0x2e, 0x78, 0x54, 0x6e, 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 0xba, 0xf0, 0xe4, 0xd1, 0xea, 0xb9, 0x99, 0x6b, 0x22, - 0xfe, 0xa1, 0x50, 0x19, 0x9a, 0xc5, 0xf0, 0x63, 0x0e, 0x14, 0xb6, 0xa8, 0xe7, 0xaf, 0x73, 0x17, - 0xae, 0xed, 0x59, 0x0a, 0x67, 0xb3, 0x97, 0x82, 0x71, 0xfe, 0x6f, 0x37, 0x43, 0xfd, 0x87, 0x1c, - 0x98, 0xdf, 0x92, 0x78, 0x83, 0x10, 0xf8, 0x15, 0x98, 0x47, 0xcc, 0xfc, 0xd5, 0x28, 0x8a, 0xff, - 0x4d, 0x52, 0xe8, 0x1f, 0x0e, 0xea, 0xb7, 0xdf, 0x56, 0xd8, 0xdf, 0xfe, 0xac, 0x9d, 0x7f, 0x85, - 0xb7, 0x55, 0x00, 0x61, 0x1b, 0x52, 0x78, 0x0c, 0xcc, 0x79, 0x48, 0xe8, 0x55, 0x91, 0xb7, 0xd5, - 0xb1, 0x75, 0x44, 0x6d, 0xa5, 0xbf, 0x1f, 0xd6, 0x72, 0xf5, 0xef, 0x40, 0xc9, 0xbc, 0x21, 0x92, - 0x51, 0x48, 0xe0, 0x06, 0x28, 0x04, 0x51, 0xd7, 0xd9, 0x21, 0x43, 0x5d, 0x93, 0x52, 0x7b, 0xf5, - 0xf9, 0xa8, 0x76, 0x3c, 0x88, 0xba, 0x3d, 0xea, 0x2a, 0xed, 0x5b, 0x9c, 0x51, 0x49, 0x58, 0x20, - 0x87, 0x2f, 0x46, 0xb5, 0xe5, 0x21, 0x62, 0xbd, 0x56, 0x7d, 0x6c, 0xad, 0xdb, 0xf3, 0x41, 0xd4, - 0xfd, 0x98, 0x0c, 0xe1, 0x69, 0xb0, 0x20, 0x12, 0x52, 0x1d, 0xb9, 0x64, 0x8f, 0x15, 0x66, 0x2b, - 0xfe, 0x9a, 0x03, 0x0b, 0xe9, 0xce, 0x85, 0x97, 0xc0, 0xdc, 0x3d, 0x92, 0x74, 0xe2, 0x54, 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, -} - -func (this *StdFee) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*StdFee) - if !ok { - that2, ok := that.(StdFee) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Amount) != len(that1.Amount) { - return false - } - for i := range this.Amount { - if !this.Amount[i].Equal(&that1.Amount[i]) { - return false - } - } - if this.Gas != that1.Gas { - return false - } - return true -} -func (this *Account) GetAccount() github_com_cosmos_cosmos_sdk_x_auth_exported.Account { - if x := this.GetBaseAccount(); x != nil { - return x - } - if x := this.GetContinuousVestingAccount(); x != nil { - return x - } - if x := this.GetDelayedVestingAccount(); x != nil { - return x - } - if x := this.GetPeriodicVestingAccount(); x != nil { - return x - } - if x := this.GetModuleAccount(); x != nil { - return x - } - return nil -} - -func (this *Account) SetAccount(value github_com_cosmos_cosmos_sdk_x_auth_exported.Account) error { - if value == nil { - this.Sum = nil - return nil - } - switch vt := value.(type) { - case *types.BaseAccount: - this.Sum = &Account_BaseAccount{vt} - return nil - case *types1.ContinuousVestingAccount: - this.Sum = &Account_ContinuousVestingAccount{vt} - return nil - case *types1.DelayedVestingAccount: - this.Sum = &Account_DelayedVestingAccount{vt} - return nil - case *types1.PeriodicVestingAccount: - this.Sum = &Account_PeriodicVestingAccount{vt} - return nil - case *types.ModuleAccount: - this.Sum = &Account_ModuleAccount{vt} - return nil - } - return fmt.Errorf("can't encode value of type %T as message Account", value) -} - -func (this *Message) GetMsg() github_com_cosmos_cosmos_sdk_types.Msg { - if x := this.GetMsgSend(); x != nil { - return x - } - if x := this.GetMsgMultiSend(); x != nil { - return x - } - if x := this.GetMsgVerifyInvariant(); x != nil { - return x - } - if x := this.GetMsgSetWithdrawAddress(); x != nil { - return x - } - if x := this.GetMsgWithdrawDelegatorReward(); x != nil { - return x - } - if x := this.GetMsgWithdrawValidatorCommission(); x != nil { - return x - } - if x := this.GetMsgFundCommunityPool(); x != nil { - return x - } - if x := this.GetMsgVote(); x != nil { - return x - } - if x := this.GetMsgDeposit(); x != nil { - return x - } - if x := this.GetMsgUnjail(); x != nil { - return x - } - if x := this.GetMsgCreateValidator(); x != nil { - return x - } - if x := this.GetMsgEditValidator(); x != nil { - return x - } - if x := this.GetMsgDelegate(); x != nil { - return x - } - if x := this.GetMsgBeginRedelegate(); x != nil { - return x - } - if x := this.GetMsgUndelegate(); x != nil { - return x - } - return nil -} - -func (this *Message) SetMsg(value github_com_cosmos_cosmos_sdk_types.Msg) error { - if value == nil { - this.Sum = nil - return nil - } - switch vt := value.(type) { - case *types2.MsgSend: - this.Sum = &Message_MsgSend{vt} - return nil - case types2.MsgSend: - this.Sum = &Message_MsgSend{&vt} - return nil - case *types2.MsgMultiSend: - this.Sum = &Message_MsgMultiSend{vt} - return nil - case types2.MsgMultiSend: - this.Sum = &Message_MsgMultiSend{&vt} - return nil - case *types3.MsgVerifyInvariant: - this.Sum = &Message_MsgVerifyInvariant{vt} - return nil - case types3.MsgVerifyInvariant: - this.Sum = &Message_MsgVerifyInvariant{&vt} - return nil - case *types4.MsgSetWithdrawAddress: - this.Sum = &Message_MsgSetWithdrawAddress{vt} - return nil - case types4.MsgSetWithdrawAddress: - this.Sum = &Message_MsgSetWithdrawAddress{&vt} - return nil - case *types4.MsgWithdrawDelegatorReward: - this.Sum = &Message_MsgWithdrawDelegatorReward{vt} - return nil - case types4.MsgWithdrawDelegatorReward: - this.Sum = &Message_MsgWithdrawDelegatorReward{&vt} - return nil - case *types4.MsgWithdrawValidatorCommission: - this.Sum = &Message_MsgWithdrawValidatorCommission{vt} - return nil - case types4.MsgWithdrawValidatorCommission: - this.Sum = &Message_MsgWithdrawValidatorCommission{&vt} - return nil - case *types4.MsgFundCommunityPool: - this.Sum = &Message_MsgFundCommunityPool{vt} - return nil - case types4.MsgFundCommunityPool: - this.Sum = &Message_MsgFundCommunityPool{&vt} - return nil - case *types5.MsgVote: - this.Sum = &Message_MsgVote{vt} - return nil - case types5.MsgVote: - this.Sum = &Message_MsgVote{&vt} - return nil - case *types5.MsgDeposit: - this.Sum = &Message_MsgDeposit{vt} - return nil - case types5.MsgDeposit: - this.Sum = &Message_MsgDeposit{&vt} - return nil - case *types6.MsgUnjail: - this.Sum = &Message_MsgUnjail{vt} - return nil - case types6.MsgUnjail: - this.Sum = &Message_MsgUnjail{&vt} - return nil - case *types7.MsgCreateValidator: - this.Sum = &Message_MsgCreateValidator{vt} - return nil - case types7.MsgCreateValidator: - this.Sum = &Message_MsgCreateValidator{&vt} - return nil - case *types7.MsgEditValidator: - this.Sum = &Message_MsgEditValidator{vt} - return nil - case types7.MsgEditValidator: - this.Sum = &Message_MsgEditValidator{&vt} - return nil - case *types7.MsgDelegate: - this.Sum = &Message_MsgDelegate{vt} - return nil - case types7.MsgDelegate: - this.Sum = &Message_MsgDelegate{&vt} - return nil - case *types7.MsgBeginRedelegate: - this.Sum = &Message_MsgBeginRedelegate{vt} - return nil - case types7.MsgBeginRedelegate: - this.Sum = &Message_MsgBeginRedelegate{&vt} - return nil - case *types7.MsgUndelegate: - this.Sum = &Message_MsgUndelegate{vt} - return nil - case types7.MsgUndelegate: - this.Sum = &Message_MsgUndelegate{&vt} - return nil - } - return fmt.Errorf("can't encode value of type %T as message Message", value) -} - -func (m *Account) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Account) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Account_BaseAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account_BaseAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.BaseAccount != nil { - { - size, err := m.BaseAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *Account_ContinuousVestingAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account_ContinuousVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ContinuousVestingAccount != nil { - { - size, err := m.ContinuousVestingAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *Account_DelayedVestingAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account_DelayedVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.DelayedVestingAccount != nil { - { - size, err := m.DelayedVestingAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *Account_PeriodicVestingAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account_PeriodicVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PeriodicVestingAccount != nil { - { - size, err := m.PeriodicVestingAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *Account_ModuleAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account_ModuleAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ModuleAccount != nil { - { - size, err := m.ModuleAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *Transaction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Transaction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Transaction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Msgs) > 0 { - for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.StdTxBase.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Message) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Message) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Message_MsgSend) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_MsgSend) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgSend != nil { - { - size, err := m.MsgSend.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *Message_MsgMultiSend) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_MsgMultiSend) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgMultiSend != nil { - { - size, err := m.MsgMultiSend.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *Message_MsgVerifyInvariant) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_MsgVerifyInvariant) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgVerifyInvariant != nil { - { - size, err := m.MsgVerifyInvariant.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *Message_MsgSetWithdrawAddress) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_MsgSetWithdrawAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgSetWithdrawAddress != nil { - { - size, err := m.MsgSetWithdrawAddress.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *Message_MsgWithdrawDelegatorReward) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_MsgWithdrawDelegatorReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgWithdrawDelegatorReward != nil { - { - size, err := m.MsgWithdrawDelegatorReward.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *Message_MsgWithdrawValidatorCommission) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_MsgWithdrawValidatorCommission) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgWithdrawValidatorCommission != nil { - { - size, err := m.MsgWithdrawValidatorCommission.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} -func (m *Message_MsgFundCommunityPool) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_MsgFundCommunityPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgFundCommunityPool != nil { - { - size, err := m.MsgFundCommunityPool.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *Message_MsgVote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_MsgVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgVote != nil { - { - size, err := m.MsgVote.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - return len(dAtA) - i, nil -} -func (m *Message_MsgDeposit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_MsgDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgDeposit != nil { - { - size, err := m.MsgDeposit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - } - return len(dAtA) - i, nil -} -func (m *Message_MsgUnjail) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_MsgUnjail) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgUnjail != nil { - { - size, err := m.MsgUnjail.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - } - return len(dAtA) - i, nil -} -func (m *Message_MsgCreateValidator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_MsgCreateValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgCreateValidator != nil { - { - size, err := m.MsgCreateValidator.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - } - return len(dAtA) - i, nil -} -func (m *Message_MsgEditValidator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_MsgEditValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgEditValidator != nil { - { - size, err := m.MsgEditValidator.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 - } - return len(dAtA) - i, nil -} -func (m *Message_MsgDelegate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_MsgDelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgDelegate != nil { - { - size, err := m.MsgDelegate.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x7a - } - return len(dAtA) - i, nil -} -func (m *Message_MsgBeginRedelegate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_MsgBeginRedelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgBeginRedelegate != nil { - { - size, err := m.MsgBeginRedelegate.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - return len(dAtA) - i, nil -} -func (m *Message_MsgUndelegate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_MsgUndelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgUndelegate != nil { - { - size, err := m.MsgUndelegate.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } - return len(dAtA) - i, nil -} -func (m *SignDoc) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SignDoc) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SignDoc) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Msgs) > 0 { - for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.StdSignDocBase.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *StdFee) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StdFee) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StdFee) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Gas != 0 { - i = encodeVarintCodec(dAtA, i, uint64(m.Gas)) - i-- - dAtA[i] = 0x10 - } - if len(m.Amount) > 0 { - for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *StdSignature) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StdSignature) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StdSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintCodec(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x12 - } - if len(m.PubKey) > 0 { - i -= len(m.PubKey) - copy(dAtA[i:], m.PubKey) - i = encodeVarintCodec(dAtA, i, uint64(len(m.PubKey))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *StdTxBase) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StdTxBase) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StdTxBase) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Memo) > 0 { - i -= len(m.Memo) - copy(dAtA[i:], m.Memo) - i = encodeVarintCodec(dAtA, i, uint64(len(m.Memo))) - i-- - dAtA[i] = 0x1a - } - if len(m.Signatures) > 0 { - for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Signatures[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *StdSignDocBase) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StdSignDocBase) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StdSignDocBase) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.Memo) > 0 { - i -= len(m.Memo) - copy(dAtA[i:], m.Memo) - i = encodeVarintCodec(dAtA, i, uint64(len(m.Memo))) - i-- - dAtA[i] = 0x22 - } - if m.Sequence != 0 { - i = encodeVarintCodec(dAtA, i, uint64(m.Sequence)) - i-- - dAtA[i] = 0x18 - } - if m.AccountNumber != 0 { - i = encodeVarintCodec(dAtA, i, uint64(m.AccountNumber)) - i-- - dAtA[i] = 0x10 - } - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintCodec(dAtA, i, uint64(len(m.ChainID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintCodec(dAtA []byte, offset int, v uint64) int { - offset -= sovCodec(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Account) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Account_BaseAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BaseAccount != nil { - l = m.BaseAccount.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Account_ContinuousVestingAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ContinuousVestingAccount != nil { - l = m.ContinuousVestingAccount.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Account_DelayedVestingAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.DelayedVestingAccount != nil { - l = m.DelayedVestingAccount.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Account_PeriodicVestingAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PeriodicVestingAccount != nil { - l = m.PeriodicVestingAccount.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Account_ModuleAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ModuleAccount != nil { - l = m.ModuleAccount.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Transaction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.StdTxBase.Size() - n += 1 + l + sovCodec(uint64(l)) - if len(m.Msgs) > 0 { - for _, e := range m.Msgs { - l = e.Size() - n += 1 + l + sovCodec(uint64(l)) - } - } - return n -} - -func (m *Message) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Message_MsgSend) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgSend != nil { - l = m.MsgSend.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Message_MsgMultiSend) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgMultiSend != nil { - l = m.MsgMultiSend.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Message_MsgVerifyInvariant) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgVerifyInvariant != nil { - l = m.MsgVerifyInvariant.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Message_MsgSetWithdrawAddress) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgSetWithdrawAddress != nil { - l = m.MsgSetWithdrawAddress.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Message_MsgWithdrawDelegatorReward) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgWithdrawDelegatorReward != nil { - l = m.MsgWithdrawDelegatorReward.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Message_MsgWithdrawValidatorCommission) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgWithdrawValidatorCommission != nil { - l = m.MsgWithdrawValidatorCommission.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Message_MsgFundCommunityPool) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgFundCommunityPool != nil { - l = m.MsgFundCommunityPool.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Message_MsgVote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgVote != nil { - l = m.MsgVote.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Message_MsgDeposit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgDeposit != nil { - l = m.MsgDeposit.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Message_MsgUnjail) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgUnjail != nil { - l = m.MsgUnjail.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Message_MsgCreateValidator) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgCreateValidator != nil { - l = m.MsgCreateValidator.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Message_MsgEditValidator) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgEditValidator != nil { - l = m.MsgEditValidator.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Message_MsgDelegate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgDelegate != nil { - l = m.MsgDelegate.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Message_MsgBeginRedelegate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgBeginRedelegate != nil { - l = m.MsgBeginRedelegate.Size() - n += 2 + l + sovCodec(uint64(l)) - } - return n -} -func (m *Message_MsgUndelegate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgUndelegate != nil { - l = m.MsgUndelegate.Size() - n += 2 + l + sovCodec(uint64(l)) - } - return n -} -func (m *SignDoc) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.StdSignDocBase.Size() - n += 1 + l + sovCodec(uint64(l)) - if len(m.Msgs) > 0 { - for _, e := range m.Msgs { - l = e.Size() - n += 1 + l + sovCodec(uint64(l)) - } - } - return n -} - -func (m *StdFee) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovCodec(uint64(l)) - } - } - if m.Gas != 0 { - n += 1 + sovCodec(uint64(m.Gas)) - } - return n -} - -func (m *StdSignature) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PubKey) - if l > 0 { - n += 1 + l + sovCodec(uint64(l)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovCodec(uint64(l)) - } - return n -} - -func (m *StdTxBase) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Fee.Size() - n += 1 + l + sovCodec(uint64(l)) - if len(m.Signatures) > 0 { - for _, e := range m.Signatures { - l = e.Size() - n += 1 + l + sovCodec(uint64(l)) - } - } - l = len(m.Memo) - if l > 0 { - n += 1 + l + sovCodec(uint64(l)) - } - return n -} - -func (m *StdSignDocBase) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainID) - if l > 0 { - n += 1 + l + sovCodec(uint64(l)) - } - if m.AccountNumber != 0 { - n += 1 + sovCodec(uint64(m.AccountNumber)) - } - if m.Sequence != 0 { - n += 1 + sovCodec(uint64(m.Sequence)) - } - l = len(m.Memo) - if l > 0 { - n += 1 + l + sovCodec(uint64(l)) - } - l = m.Fee.Size() - n += 1 + l + sovCodec(uint64(l)) - return n -} - -func sovCodec(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozCodec(x uint64) (n int) { - return sovCodec(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Account) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Account: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Account: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.BaseAccount{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Account_BaseAccount{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContinuousVestingAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types1.ContinuousVestingAccount{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Account_ContinuousVestingAccount{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelayedVestingAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types1.DelayedVestingAccount{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Account_DelayedVestingAccount{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeriodicVestingAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types1.PeriodicVestingAccount{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Account_PeriodicVestingAccount{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ModuleAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.ModuleAccount{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Account_ModuleAccount{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Transaction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Transaction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Transaction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StdTxBase", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StdTxBase.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msgs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msgs = append(m.Msgs, Message{}) - if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Message) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Message: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgSend", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types2.MsgSend{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_MsgSend{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgMultiSend", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types2.MsgMultiSend{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_MsgMultiSend{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgVerifyInvariant", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types3.MsgVerifyInvariant{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_MsgVerifyInvariant{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgSetWithdrawAddress", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types4.MsgSetWithdrawAddress{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_MsgSetWithdrawAddress{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgWithdrawDelegatorReward", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types4.MsgWithdrawDelegatorReward{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_MsgWithdrawDelegatorReward{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgWithdrawValidatorCommission", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types4.MsgWithdrawValidatorCommission{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_MsgWithdrawValidatorCommission{v} - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgFundCommunityPool", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types4.MsgFundCommunityPool{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_MsgFundCommunityPool{v} - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgVote", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types5.MsgVote{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_MsgVote{v} - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgDeposit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types5.MsgDeposit{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_MsgDeposit{v} - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgUnjail", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types6.MsgUnjail{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_MsgUnjail{v} - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgCreateValidator", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types7.MsgCreateValidator{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_MsgCreateValidator{v} - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgEditValidator", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types7.MsgEditValidator{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_MsgEditValidator{v} - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgDelegate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types7.MsgDelegate{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_MsgDelegate{v} - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgBeginRedelegate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types7.MsgBeginRedelegate{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_MsgBeginRedelegate{v} - iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgUndelegate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types7.MsgUndelegate{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_MsgUndelegate{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SignDoc) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SignDoc: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignDoc: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StdSignDocBase", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StdSignDocBase.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msgs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msgs = append(m.Msgs, Message{}) - if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StdFee) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StdFee: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StdFee: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Amount = append(m.Amount, types8.Coin{}) - if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Gas", wireType) - } - m.Gas = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Gas |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StdSignature) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StdSignature: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StdSignature: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PubKey = append(m.PubKey[:0], dAtA[iNdEx:postIndex]...) - if m.PubKey == nil { - m.PubKey = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StdTxBase) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StdTxBase: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StdTxBase: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signatures = append(m.Signatures, StdSignature{}) - if err := m.Signatures[len(m.Signatures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Memo", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Memo = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StdSignDocBase) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StdSignDocBase: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StdSignDocBase: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AccountNumber", wireType) - } - m.AccountNumber = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AccountNumber |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) - } - m.Sequence = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Sequence |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Memo", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Memo = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipCodec(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCodec - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCodec - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCodec - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthCodec - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupCodec - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthCodec - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCodec = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupCodec = fmt.Errorf("proto: unexpected end of group") -) diff --git a/std/codec.proto b/std/codec.proto deleted file mode 100644 index 351fe62d1a15..000000000000 --- a/std/codec.proto +++ /dev/null @@ -1,28 +0,0 @@ -syntax = "proto3"; -package cosmos_sdk.std.v1; - -import "third_party/proto/cosmos-proto/cosmos.proto"; -import "third_party/proto/gogoproto/gogo.proto"; -import "types/types.proto"; -import "x/bank/types/types.proto"; -import "x/crisis/types/types.proto"; -import "x/distribution/types/types.proto"; -import "x/gov/types/types.proto"; -import "x/slashing/types/types.proto"; -import "x/staking/types/types.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/std"; - -// Account defines the application-level Account type. -message Account { - option (cosmos_proto.interface_type) = "*github.com/cosmos/cosmos-sdk/x/auth/exported.Account"; - - // sum defines a list of all acceptable concrete Account implementations. - oneof sum { - cosmos_sdk.x.auth.v1.BaseAccount base_account = 1; - cosmos_sdk.x.auth.vesting.v1.ContinuousVestingAccount continuous_vesting_account = 2; - cosmos_sdk.x.auth.vesting.v1.DelayedVestingAccount delayed_vesting_account = 3; - cosmos_sdk.x.auth.vesting.v1.PeriodicVestingAccount periodic_vesting_account = 4; - cosmos_sdk.x.auth.v1.ModuleAccount module_account = 5; - } -} From 2e5e9f2ac0b01afa35b054a050ee6543c1b5b501 Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Wed, 20 May 2020 21:09:00 +0530 Subject: [PATCH 18/18] Minor code cleanup --- simapp/cmd/simcli/main.go | 4 ++-- third_party/proto/cosmos-proto/cosmos.proto | 1 - x/auth/keeper/keeper.go | 18 +++++++++--------- x/auth/keeper/querier.go | 6 +++--- x/auth/keeper/querier_test.go | 4 ++-- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/simapp/cmd/simcli/main.go b/simapp/cmd/simcli/main.go index 5cd329ba0b11..d2207f31dd74 100644 --- a/simapp/cmd/simcli/main.go +++ b/simapp/cmd/simcli/main.go @@ -89,7 +89,7 @@ func queryCmd(cdc *codec.Codec) *cobra.Command { Short: "Querying subcommands", DisableFlagParsing: true, SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, + RunE: client.ValidateCmd, } queryCmd.AddCommand( @@ -114,7 +114,7 @@ func txCmd(cdc *codec.Codec) *cobra.Command { Short: "Transactions subcommands", DisableFlagParsing: true, SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, + RunE: client.ValidateCmd, } txCmd.AddCommand( diff --git a/third_party/proto/cosmos-proto/cosmos.proto b/third_party/proto/cosmos-proto/cosmos.proto index 1440b98c55f9..167b170757bc 100644 --- a/third_party/proto/cosmos-proto/cosmos.proto +++ b/third_party/proto/cosmos-proto/cosmos.proto @@ -13,5 +13,4 @@ extend google.protobuf.MessageOptions { extend google.protobuf.FieldOptions { string accepts_interface = 93001; - } diff --git a/x/auth/keeper/keeper.go b/x/auth/keeper/keeper.go index a770053997e7..13018004cc24 100644 --- a/x/auth/keeper/keeper.go +++ b/x/auth/keeper/keeper.go @@ -19,7 +19,7 @@ import ( // encoding/decoding library. type AccountKeeper struct { key sdk.StoreKey - Cdc codec.Marshaler + cdc codec.Marshaler paramSubspace paramtypes.Subspace permAddrs map[string]types.PermissionsForAddress @@ -47,7 +47,7 @@ func NewAccountKeeper( return AccountKeeper{ key: key, proto: proto, - Cdc: cdc, + cdc: cdc, paramSubspace: paramstore, permAddrs: permAddrs, } @@ -91,7 +91,7 @@ func (ak AccountKeeper) GetNextAccountNumber(ctx sdk.Context) uint64 { } else { val := gogotypes.UInt64Value{} - err := ak.Cdc.UnmarshalBinaryBare(bz, &val) + err := ak.cdc.UnmarshalBinaryBare(bz, &val) if err != nil { panic(err) } @@ -99,7 +99,7 @@ func (ak AccountKeeper) GetNextAccountNumber(ctx sdk.Context) uint64 { accNumber = val.GetValue() } - bz = ak.Cdc.MustMarshalBinaryBare(&gogotypes.UInt64Value{Value: accNumber + 1}) + bz = ak.cdc.MustMarshalBinaryBare(&gogotypes.UInt64Value{Value: accNumber + 1}) store.Set(types.GlobalAccountNumberKey, bz) return accNumber @@ -188,7 +188,7 @@ func (ak AccountKeeper) decodeAccount(bz []byte) types.AccountI { // the Marshaler interface, it is treated as a Proto-defined message and // serialized that way. Otherwise, it falls back on the internal Amino codec. func (ak AccountKeeper) MarshalAccount(accountI types.AccountI) ([]byte, error) { - return codec.MarshalAny(ak.Cdc, accountI) + return codec.MarshalAny(ak.cdc, accountI) } // UnmarshalEvidence returns an Evidence interface from raw encoded evidence @@ -196,7 +196,7 @@ func (ak AccountKeeper) MarshalAccount(accountI types.AccountI) ([]byte, error) // failure. func (ak AccountKeeper) UnmarshalAccount(bz []byte) (types.AccountI, error) { var acc types.AccountI - if err := codec.UnmarshalAny(ak.Cdc, &acc, bz); err != nil { + if err := codec.UnmarshalAny(ak.cdc, &acc, bz); err != nil { return nil, err } @@ -206,16 +206,16 @@ func (ak AccountKeeper) UnmarshalAccount(bz []byte) (types.AccountI, error) { // UnmarshalAccountJSON returns an AccountI from JSON encoded bytes func (ak AccountKeeper) UnmarshalAccountJSON(bz []byte) (types.AccountI, error) { var any codectypes.Any - if err := ak.Cdc.UnmarshalJSON(bz, &any); err != nil { + if err := ak.cdc.UnmarshalJSON(bz, &any); err != nil { return nil, err } var acc types.AccountI - if err := ak.Cdc.UnpackAny(&any, &acc); err != nil { + if err := ak.cdc.UnpackAny(&any, &acc); err != nil { return nil, err } return acc, nil } -func (ak AccountKeeper) GetCodec() codec.Marshaler { return ak.Cdc } +func (ak AccountKeeper) GetCodec() codec.Marshaler { return ak.cdc } diff --git a/x/auth/keeper/querier.go b/x/auth/keeper/querier.go index 424e3eb21818..eab5d3afcaa7 100644 --- a/x/auth/keeper/querier.go +++ b/x/auth/keeper/querier.go @@ -27,7 +27,7 @@ func NewQuerier(k AccountKeeper) sdk.Querier { func queryAccount(ctx sdk.Context, req abci.RequestQuery, k AccountKeeper) ([]byte, error) { var params types.QueryAccountParams - if err := k.Cdc.UnmarshalJSON(req.Data, ¶ms); err != nil { + if err := k.cdc.UnmarshalJSON(req.Data, ¶ms); err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) } @@ -36,7 +36,7 @@ func queryAccount(ctx sdk.Context, req abci.RequestQuery, k AccountKeeper) ([]by return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownAddress, "account %s does not exist", params.Address) } - bz, err := codec.MarshalJSONIndent(k.Cdc, account) + bz, err := codec.MarshalJSONIndent(k.cdc, account) if err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } @@ -47,7 +47,7 @@ func queryAccount(ctx sdk.Context, req abci.RequestQuery, k AccountKeeper) ([]by func queryParams(ctx sdk.Context, k AccountKeeper) ([]byte, error) { params := k.GetParams(ctx) - res, err := codec.MarshalJSONIndent(k.Cdc, params) + res, err := codec.MarshalJSONIndent(k.cdc, params) if err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) } diff --git a/x/auth/keeper/querier_test.go b/x/auth/keeper/querier_test.go index 50f2630b4d2d..749c512ecf29 100644 --- a/x/auth/keeper/querier_test.go +++ b/x/auth/keeper/querier_test.go @@ -56,7 +56,7 @@ func TestQueryAccount(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - var acc types.AccountI - err2 := cdc.UnmarshalJSON(res, &acc) + var account types.AccountI + err2 := cdc.UnmarshalJSON(res, &account) require.Nil(t, err2) }