From bb4642ad0d151b1d8dd78d3df8cb633fea54878b Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Wed, 15 Apr 2020 17:55:02 -0400 Subject: [PATCH] Decouple client/tx from x/auth (#5992) As part of #5864 part 2), this PR decouples the new client/tx package from x/auth (as an incremental step to deprecating all the tx logic in x/auth) and adds StdFee, StdSignature, StdSignMsgBase and StdTxBase to codec/std, while deprecating the corresponding types in x/auth. --- client/tx/tx.go | 56 +- client/tx/tx_test.go | 3 +- codec/std/codec.pb.go | 1310 +++++++++++++++++++++++++++++++++++--- codec/std/codec.proto | 46 +- codec/std/tx.go | 113 +++- codec/std/tx_test.go | 3 +- types/errors/errors.go | 6 + x/auth/alias.go | 4 - x/auth/client/rest.go | 3 +- x/auth/client/tx.go | 5 +- x/auth/types/errors.go | 10 - x/auth/types/stdtx.go | 35 +- x/auth/types/types.pb.go | 1186 ++-------------------------------- x/auth/types/types.proto | 43 +- 14 files changed, 1470 insertions(+), 1353 deletions(-) delete mode 100644 x/auth/types/errors.go diff --git a/client/tx/tx.go b/client/tx/tx.go index 0cd4e71f3..391a2c536 100644 --- a/client/tx/tx.go +++ b/client/tx/tx.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/gogo/protobuf/jsonpb" + "github.com/tendermint/tendermint/crypto" "github.com/cosmos/cosmos-sdk/client/context" "github.com/cosmos/cosmos-sdk/client/flags" @@ -16,9 +17,8 @@ import ( clientkeys "github.com/cosmos/cosmos-sdk/client/keys" "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/types/rest" - "github.com/cosmos/cosmos-sdk/x/auth" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) type ( @@ -27,6 +27,20 @@ type ( // implement ClientTx. Generator interface { NewTx() ClientTx + NewFee() ClientFee + NewSignature() ClientSignature + } + + ClientFee interface { + sdk.Fee + SetGas(uint64) + SetAmount(sdk.Coins) + } + + ClientSignature interface { + sdk.Signature + SetPubKey(crypto.PubKey) error + SetSignature([]byte) } // ClientTx defines an interface which an application-defined concrete transaction @@ -39,9 +53,9 @@ type ( SetMsgs(...sdk.Msg) error GetSignatures() []sdk.Signature - SetSignatures(...sdk.Signature) + SetSignatures(...ClientSignature) error GetFee() sdk.Fee - SetFee(sdk.Fee) + SetFee(ClientFee) error GetMemo() string SetMemo(string) @@ -176,7 +190,7 @@ func WriteGeneratedTxResponse( if br.Simulate || simAndExec { if gasAdj < 0 { - rest.WriteErrorResponse(w, http.StatusBadRequest, types.ErrorInvalidGasAdjustment.Error()) + rest.WriteErrorResponse(w, http.StatusBadRequest, sdkerrors.ErrorInvalidGasAdjustment.Error()) return } @@ -233,10 +247,20 @@ func BuildUnsignedTx(txf Factory, msgs ...sdk.Msg) (ClientTx, error) { } } + clientFee := txf.txGenerator.NewFee() + clientFee.SetAmount(fees) + clientFee.SetGas(txf.gas) + tx := txf.txGenerator.NewTx() - tx.SetFee(auth.NewStdFee(txf.gas, fees)) tx.SetMemo(txf.memo) - tx.SetSignatures() + + if err := tx.SetFee(clientFee); err != nil { + return nil, err + } + + if err := tx.SetSignatures(); err != nil { + return nil, err + } if err := tx.SetMsgs(msgs...); err != nil { return nil, err @@ -256,7 +280,11 @@ func BuildSimTx(txf Factory, msgs ...sdk.Msg) ([]byte, error) { // Create an empty signature literal as the ante handler will populate with a // sentinel pubkey. - tx.SetSignatures(auth.NewStdSignature(nil, nil)) + sig := txf.txGenerator.NewSignature() + + if err := tx.SetSignatures(sig); err != nil { + return nil, err + } return tx.Marshal() } @@ -337,7 +365,17 @@ func Sign(txf Factory, name, passphrase string, tx ClientTx) ([]byte, error) { return nil, err } - tx.SetSignatures(auth.NewStdSignature(pubkey, sigBytes)) + sig := txf.txGenerator.NewSignature() + sig.SetSignature(sigBytes) + + if err := sig.SetPubKey(pubkey); err != nil { + return nil, err + } + + if err := tx.SetSignatures(sig); err != nil { + return nil, err + } + return tx.Marshal() } diff --git a/client/tx/tx_test.go b/client/tx/tx_test.go index 13e94f819..55758a0f1 100644 --- a/client/tx/tx_test.go +++ b/client/tx/tx_test.go @@ -10,7 +10,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/std" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/bank" ) @@ -87,7 +86,7 @@ func TestBuildSimTx(t *testing.T) { tx := &std.Transaction{} require.NoError(t, tx.Unmarshal(bz)) - require.Equal(t, []sdk.Signature{sdk.Signature(auth.StdSignature{})}, tx.GetSignatures()) + require.Equal(t, []sdk.Signature{sdk.Signature(std.StdSignature{})}, tx.GetSignatures()) } func TestBuildUnsignedTx(t *testing.T) { diff --git a/codec/std/codec.pb.go b/codec/std/codec.pb.go index a5231fa6c..b13798e47 100644 --- a/codec/std/codec.pb.go +++ b/codec/std/codec.pb.go @@ -6,6 +6,7 @@ package std import ( fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types11 "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" @@ -581,8 +582,8 @@ func (*Content) XXX_OneofWrappers() []interface{} { // processed by the state-machine. It contains a base of common fields and // repeated set of Message types. type Transaction struct { - types.StdTxBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:""` - Msgs []Message `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs"` + 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{} } @@ -905,8 +906,8 @@ func (*Message) XXX_OneofWrappers() []interface{} { // SignDoc defines a standard application-level signing document to compose // signatures for a Transaction. type SignDoc struct { - types.StdSignDocBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:""` - Msgs []Message `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs"` + 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{} } @@ -949,6 +950,227 @@ func (m *SignDoc) GetMsgs() []Message { 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_daf09dc2dfa19bb4, []int{10} +} +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_daf09dc2dfa19bb4, []int{11} +} +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_daf09dc2dfa19bb4, []int{12} +} +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_daf09dc2dfa19bb4, []int{13} +} +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.codec.std.v1.Account") proto.RegisterType((*Supply)(nil), "cosmos_sdk.codec.std.v1.Supply") @@ -960,105 +1182,127 @@ func init() { proto.RegisterType((*Transaction)(nil), "cosmos_sdk.codec.std.v1.Transaction") proto.RegisterType((*Message)(nil), "cosmos_sdk.codec.std.v1.Message") proto.RegisterType((*SignDoc)(nil), "cosmos_sdk.codec.std.v1.SignDoc") + proto.RegisterType((*StdFee)(nil), "cosmos_sdk.codec.std.v1.StdFee") + proto.RegisterType((*StdSignature)(nil), "cosmos_sdk.codec.std.v1.StdSignature") + proto.RegisterType((*StdTxBase)(nil), "cosmos_sdk.codec.std.v1.StdTxBase") + proto.RegisterType((*StdSignDocBase)(nil), "cosmos_sdk.codec.std.v1.StdSignDocBase") } func init() { proto.RegisterFile("codec/std/codec.proto", fileDescriptor_daf09dc2dfa19bb4) } var fileDescriptor_daf09dc2dfa19bb4 = []byte{ - // 1477 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4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0xc6, 0x0a, 0x1b, - 0x60, 0xca, 0xe7, 0x9e, 0xc3, 0xe5, 0x21, 0x6a, 0x51, 0xa7, 0xf3, 0xa2, 0xe4, 0x57, 0x56, 0x52, - 0xef, 0x24, 0xc0, 0x2d, 0xcb, 0x9e, 0xf4, 0xf5, 0x23, 0xfc, 0x00, 0x1c, 0x95, 0x58, 0x3f, 0xee, - 0x08, 0xaa, 0x19, 0x74, 0xe6, 0x2e, 0x8d, 0x64, 0xd8, 0x90, 0xae, 0x86, 0x66, 0xc6, 0xcf, 0xac, - 0xe1, 0x17, 0xe0, 0x84, 0xe4, 0xea, 0x92, 0x88, 0x3e, 0xd8, 0x73, 0x68, 0xd0, 0x45, 0x11, 0x45, - 0xe9, 0x60, 0x1f, 0x68, 0x41, 0xfa, 0xfb, 0xce, 0x70, 0x6e, 0x29, 0xc8, 0xed, 0x04, 0x21, 0xaf, - 0xd2, 0x1f, 0xda, 0x85, 0x01, 0xa8, 0xe8, 0xf7, 0x14, 0xce, 0x2e, 0x15, 0xdb, 0x38, 0x42, 0xbb, - 0x0e, 0xc2, 0x38, 0x22, 0x9c, 0x9b, 0x5c, 0xbd, 0x32, 0x3e, 0x79, 0xd4, 0xfb, 0x8b, 0x4f, 0x0c, - 0x76, 0x55, 0x43, 0x65, 0xa2, 0xfa, 0x45, 0x06, 0xf8, 0x35, 0x38, 0x2d, 0xe3, 0xa5, 0xb1, 0x30, - 0xe9, 0x10, 0x0f, 0x09, 0x16, 0x39, 0x11, 0xd9, 0x45, 0xd1, 0x4b, 0x66, 0xec, 0x06, 0xf7, 0x12, - 0xe2, 0xf5, 0x84, 0xc0, 0x56, 0xf8, 0x96, 0x65, 0xcf, 0xfb, 0x23, 0xad, 0xf0, 0xdb, 0x12, 0x38, - 0x93, 0x8b, 0xdf, 0x45, 0x1d, 0x8a, 0x55, 0x7c, 0x99, 0xe7, 0x94, 0x73, 0x39, 0x33, 0x27, 0x94, - 0x86, 0xf7, 0x5e, 0x5a, 0xc3, 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, 0x20, 0x11, 0x00, 0x00, + // 1764 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4d, 0x70, 0x1b, 0x49, + 0x15, 0x96, 0x62, 0xc5, 0x92, 0xdb, 0x8a, 0x63, 0xf7, 0x26, 0x58, 0x98, 0xac, 0x94, 0x68, 0xd9, + 0xb0, 0x64, 0xb1, 0xb4, 0xd9, 0x00, 0xd9, 0xa8, 0xa0, 0x36, 0x91, 0x1d, 0x97, 0xcc, 0xe2, 0x25, + 0x35, 0x4e, 0x42, 0x41, 0x2d, 0x4c, 0xb5, 0x66, 0x3a, 0xe3, 0xc6, 0xea, 0xe9, 0xd9, 0xe9, 0x1e, + 0x45, 0xa2, 0x8a, 0x13, 0x17, 0xe0, 0xb4, 0x55, 0x14, 0xf7, 0x05, 0x8a, 0x0b, 0x5c, 0x73, 0xe4, + 0x4c, 0x6d, 0xe5, 0x94, 0x23, 0x27, 0x43, 0x25, 0x17, 0x6a, 0x8f, 0x39, 0x70, 0xa6, 0xfa, 0x67, + 0x46, 0x33, 0xd2, 0x48, 0x4e, 0x0e, 0x5c, 0x5c, 0xd3, 0xfd, 0xde, 0xf7, 0xbd, 0xaf, 0xbb, 0xdf, + 0xeb, 0xd7, 0x32, 0xb8, 0xe8, 0x30, 0x17, 0x3b, 0x6d, 0x2e, 0xdc, 0xb6, 0xfa, 0x6a, 0x05, 0x21, + 0x13, 0x0c, 0x6e, 0x3a, 0x8c, 0x53, 0xc6, 0x6d, 0xee, 0x1e, 0xb7, 0xf4, 0x3c, 0x17, 0x6e, 0x6b, + 0x78, 0x7d, 0xeb, 0x5d, 0x71, 0x44, 0x42, 0xd7, 0x0e, 0x50, 0x28, 0xc6, 0x6d, 0xe5, 0xdb, 0xd6, + 0xae, 0xdb, 0xe9, 0x81, 0x66, 0xd9, 0xba, 0x3a, 0xeb, 0xec, 0x31, 0x8f, 0x4d, 0xb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14, 0x20, 0xfc, 0x21, 0xa8, 0xe2, + 0x4f, 0x23, 0x32, 0x64, 0x0e, 0x92, 0xa5, 0x6c, 0x44, 0x5d, 0xcd, 0x8a, 0x8a, 0xcb, 0x55, 0xca, + 0xba, 0x9b, 0xf2, 0xee, 0x15, 0xac, 0x0c, 0xba, 0x73, 0xc7, 0x48, 0xbc, 0x75, 0x8a, 0xc2, 0xa4, + 0xfe, 0x13, 0x8d, 0xb1, 0xa0, 0x58, 0xe4, 0xdf, 0x8a, 0x60, 0xe3, 0x80, 0x7b, 0x87, 0x51, 0x9f, + 0x12, 0x91, 0xa8, 0x3d, 0x00, 0x25, 0x59, 0x41, 0x46, 0x65, 0x7b, 0xbe, 0xca, 0x19, 0xa8, 0xac, + 0xc3, 0x6e, 0xe5, 0x8b, 0x93, 0x46, 0xe1, 0xd9, 0x49, 0xa3, 0x68, 0x29, 0x1a, 0xf8, 0x7d, 0x50, + 0x89, 0x41, 0xa6, 0xde, 0x32, 0x55, 0x9c, 0xbe, 0xcd, 0x13, 0x81, 0x56, 0x02, 0xe9, 0x54, 0x7e, + 0xf3, 0x79, 0xa3, 0x20, 0x57, 0xdc, 0xfc, 0x73, 0x5a, 0xed, 0x3d, 0x73, 0xbb, 0xc0, 0x5e, 0x46, + 0xed, 0xb5, 0xac, 0x5a, 0x8f, 0x0d, 0x33, 0x42, 0x63, 0x54, 0xae, 0xd0, 0x0e, 0x28, 0xcb, 0x72, + 0xc6, 0xc9, 0xbd, 0x70, 0x79, 0xae, 0xce, 0x1d, 0xed, 0x67, 0xc5, 0x80, 0x94, 0xca, 0xdf, 0x17, + 0x41, 0x25, 0x11, 0xf7, 0x61, 0x46, 0xdc, 0x95, 0x5c, 0x71, 0x0b, 0x35, 0xdd, 0x7e, 0x6d, 0x4d, + 0xdd, 0x92, 0xa4, 0x98, 0x28, 0x2b, 0x29, 0x55, 0x7f, 0x2c, 0x81, 0xb2, 0x71, 0x80, 0x37, 0x41, + 0x49, 0xe0, 0x91, 0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0xde, 0x91, 0x73, 0xfb, 0xbb, 0x2f, 0x4f, 0x1a, 0xe7, 0xf5, 0xd6, 0xc4, + 0x4e, 0x4d, 0xab, 0xac, 0x3e, 0xf7, 0x5d, 0x78, 0x1b, 0xac, 0x99, 0x9f, 0xcd, 0xb6, 0x1f, 0xd1, + 0x3e, 0x0e, 0xf5, 0xc1, 0x74, 0xbf, 0xfa, 0xf2, 0xa4, 0x71, 0x51, 0xa3, 0xb2, 0xf6, 0xa6, 0x75, + 0xce, 0x4c, 0x7c, 0xac, 0xc6, 0x70, 0x0b, 0x54, 0x38, 0xfe, 0x34, 0x52, 0xed, 0x62, 0x49, 0x1d, + 0x6a, 0x32, 0x4e, 0xf4, 0x97, 0x26, 0xfa, 0xe3, 0x9d, 0x3d, 0xfb, 0xba, 0x3b, 0xdb, 0xbd, 0xfd, + 0xc5, 0xf3, 0x7a, 0xf1, 0xd9, 0xf3, 0x7a, 0xf1, 0xdf, 0xcf, 0xeb, 0xc5, 0xcf, 0x5e, 0xd4, 0x0b, + 0xcf, 0x5e, 0xd4, 0x0b, 0xff, 0x7c, 0x51, 0x2f, 0xfc, 0x74, 0x71, 0xf9, 0x25, 0xff, 0xc8, 0xeb, + 0x2f, 0xab, 0x7f, 0xef, 0xdc, 0xf8, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x89, 0xf5, 0x71, 0xb9, + 0xdc, 0x13, 0x00, 0x00, } func (this *Supply) Equal(that interface{}) bool { @@ -1400,6 +1644,38 @@ func (this *Content_CommunityPoolSpend) Equal(that interface{}) bool { } return true } +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 @@ -2698,6 +2974,196 @@ func (m *SignDoc) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 @@ -3194,6 +3660,87 @@ func (m *SignDoc) Size() (n int) { 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 } @@ -5083,6 +5630,573 @@ func (m *SignDoc) Unmarshal(dAtA []byte) error { } 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, types11.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 diff --git a/codec/std/codec.proto b/codec/std/codec.proto index cf8e62865..c1006e577 100644 --- a/codec/std/codec.proto +++ b/codec/std/codec.proto @@ -3,6 +3,7 @@ package cosmos_sdk.codec.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"; @@ -106,8 +107,7 @@ message Content { message Transaction { option (gogoproto.goproto_getters) = false; - cosmos_sdk.x.auth.v1.StdTxBase base = 1 - [(gogoproto.jsontag) = "", (gogoproto.embed) = true, (gogoproto.nullable) = false]; + StdTxBase base = 1 [(gogoproto.jsontag) = "", (gogoproto.embed) = true, (gogoproto.nullable) = false]; repeated Message msgs = 2 [(gogoproto.nullable) = false]; } @@ -141,7 +141,45 @@ message Message { // SignDoc defines a standard application-level signing document to compose // signatures for a Transaction. message SignDoc { - cosmos_sdk.x.auth.v1.StdSignDocBase base = 1 - [(gogoproto.jsontag) = "", (gogoproto.embed) = true, (gogoproto.nullable) = false]; + StdSignDocBase base = 1 [(gogoproto.jsontag) = "", (gogoproto.embed) = true, (gogoproto.nullable) = false]; repeated Message msgs = 2 [(gogoproto.nullable) = false]; } + +// 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. +message StdFee { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + repeated cosmos_sdk.v1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + uint64 gas = 2; +} + +// StdSignature defines a signature structure that contains the signature of a +// transaction and an optional public key. +message StdSignature { + option (gogoproto.goproto_getters) = false; + + bytes pub_key = 1 [(gogoproto.jsontag) = "public_key,omitempty", (gogoproto.moretags) = "yaml:\"public_key\""]; + bytes signature = 2; +} + +// StdTxBase defines a transaction base which application-level concrete transaction +// types can extend. +message StdTxBase { + StdFee fee = 1 [(gogoproto.nullable) = false]; + repeated StdSignature signatures = 2 [(gogoproto.nullable) = false]; + string memo = 3; +} + +// StdSignDocBase defines the base structure for which applications can extend +// to define the concrete structure that signers sign over. +message StdSignDocBase { + string chain_id = 1 [(gogoproto.customname) = "ChainID", (gogoproto.moretags) = "yaml:\"chain_id\""]; + uint64 account_number = 2 [(gogoproto.moretags) = "yaml:\"account_number\""]; + uint64 sequence = 3; + string memo = 4; + StdFee fee = 5 [(gogoproto.nullable) = false]; +} diff --git a/codec/std/tx.go b/codec/std/tx.go index 8305c7517..8b922f637 100644 --- a/codec/std/tx.go +++ b/codec/std/tx.go @@ -1,6 +1,9 @@ package std import ( + "github.com/tendermint/go-amino" + "github.com/tendermint/tendermint/crypto" + clientx "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -8,23 +11,33 @@ import ( ) var ( - _ sdk.Tx = (*Transaction)(nil) - _ clientx.ClientTx = (*Transaction)(nil) - _ clientx.Generator = TxGenerator{} + _ sdk.Tx = (*Transaction)(nil) + _ clientx.ClientTx = (*Transaction)(nil) + _ clientx.Generator = TxGenerator{} + _ clientx.ClientFee = &StdFee{} + _ clientx.ClientSignature = &StdSignature{} ) // TxGenerator defines a transaction generator that allows clients to construct // transactions. type TxGenerator struct{} +func (g TxGenerator) NewFee() clientx.ClientFee { + return &StdFee{} +} + +func (g TxGenerator) NewSignature() clientx.ClientSignature { + return &StdSignature{} +} + // NewTx returns a reference to an empty Transaction type. func (TxGenerator) NewTx() clientx.ClientTx { return &Transaction{} } -func NewTransaction(fee auth.StdFee, memo string, sdkMsgs []sdk.Msg) (*Transaction, error) { +func NewTransaction(fee StdFee, memo string, sdkMsgs []sdk.Msg) (*Transaction, error) { tx := &Transaction{ - StdTxBase: auth.NewStdTxBase(fee, nil, memo), + StdTxBase: NewStdTxBase(fee, nil, memo), } if err := tx.SetMsgs(sdkMsgs...); err != nil { @@ -121,15 +134,16 @@ func (tx Transaction) GetSignatures() []sdk.Signature { // SetSignatures sets the transaction's signatures. It will overwrite any // existing signatures set. -func (tx *Transaction) SetSignatures(sdkSigs ...sdk.Signature) { - sigs := make([]auth.StdSignature, len(sdkSigs)) +func (tx *Transaction) SetSignatures(sdkSigs ...clientx.ClientSignature) error { + sigs := make([]StdSignature, len(sdkSigs)) for i, sig := range sdkSigs { if sig != nil { - sigs[i] = auth.NewStdSignature(sig.GetPubKey(), sig.GetSignature()) + sigs[i] = NewStdSignature(sig.GetPubKey(), sig.GetSignature()) } } tx.Signatures = sigs + return nil } // GetFee returns the transaction's fee. @@ -138,8 +152,9 @@ func (tx Transaction) GetFee() sdk.Fee { } // SetFee sets the transaction's fee. It will overwrite any existing fee set. -func (tx *Transaction) SetFee(fee sdk.Fee) { - tx.Fee = auth.NewStdFee(fee.GetGas(), fee.GetAmount()) +func (tx *Transaction) SetFee(fee clientx.ClientFee) error { + tx.Fee = NewStdFee(fee.GetGas(), fee.GetAmount()) + return nil } // GetMemo returns the transaction's memo. @@ -160,9 +175,9 @@ func (tx Transaction) CanonicalSignBytes(cid string, num, seq uint64) ([]byte, e return NewSignDoc(num, seq, cid, tx.Memo, tx.Fee, tx.Msgs...).CanonicalSignBytes() } -func NewSignDoc(num, seq uint64, cid, memo string, fee auth.StdFee, msgs ...Message) *SignDoc { +func NewSignDoc(num, seq uint64, cid, memo string, fee StdFee, msgs ...Message) *SignDoc { return &SignDoc{ - StdSignDocBase: auth.NewStdSignDocBase(num, seq, cid, memo, fee), + StdSignDocBase: NewStdSignDocBase(num, seq, cid, memo, fee), Msgs: msgs, } } @@ -174,3 +189,77 @@ func NewSignDoc(num, seq uint64, cid, memo string, fee auth.StdFee, msgs ...Mess func (sd *SignDoc) CanonicalSignBytes() ([]byte, error) { return sdk.CanonicalSignBytes(sd) } + +// NewStdFee returns a new instance of StdFee +func NewStdFee(gas uint64, amount sdk.Coins) StdFee { + return StdFee{ + Amount: amount, + Gas: gas, + } +} + +func NewStdSignature(pk crypto.PubKey, sig []byte) StdSignature { + var pkBz []byte + if pk != nil { + pkBz = pk.Bytes() + } + + return StdSignature{PubKey: pkBz, Signature: sig} +} + +func NewStdTxBase(fee StdFee, sigs []StdSignature, memo string) StdTxBase { + return StdTxBase{ + Fee: fee, + Signatures: sigs, + Memo: memo, + } +} + +func NewStdSignDocBase(num, seq uint64, cid, memo string, fee StdFee) StdSignDocBase { + return StdSignDocBase{ + ChainID: cid, + AccountNumber: num, + Sequence: seq, + Memo: memo, + Fee: fee, + } +} + +func (m StdFee) GetGas() uint64 { + return m.Gas +} + +func (m StdFee) GetAmount() sdk.Coins { + return m.Amount +} + +func (m *StdFee) SetGas(gas uint64) { + m.Gas = gas +} + +func (m *StdFee) SetAmount(amount sdk.Coins) { + m.Amount = amount +} + +func (m StdSignature) GetPubKey() crypto.PubKey { + var pk crypto.PubKey + if len(m.PubKey) == 0 { + return nil + } + + amino.MustUnmarshalBinaryBare(m.PubKey, &pk) + return pk +} + +func (m StdSignature) GetSignature() []byte { + return m.Signature +} + +func (m *StdSignature) SetPubKey(pk crypto.PubKey) error { + m.PubKey = pk.Bytes() + return nil +} + +func (m *StdSignature) SetSignature(signature []byte) { + m.Signature = signature +} diff --git a/codec/std/tx_test.go b/codec/std/tx_test.go index 5fce75a67..78d6eed85 100644 --- a/codec/std/tx_test.go +++ b/codec/std/tx_test.go @@ -7,12 +7,11 @@ import ( "github.com/cosmos/cosmos-sdk/codec/std" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/bank" ) func TestTransaction(t *testing.T) { - f := auth.NewStdFee(100, sdk.NewCoins(sdk.NewInt64Coin("stake", 50))) + f := std.NewStdFee(100, sdk.NewCoins(sdk.NewInt64Coin("stake", 50))) m := "hello world" acc1 := sdk.AccAddress("from") acc2 := sdk.AccAddress("to") diff --git a/types/errors/errors.go b/types/errors/errors.go index f881a2827..54d29ddfb 100644 --- a/types/errors/errors.go +++ b/types/errors/errors.go @@ -88,6 +88,12 @@ var ( // ErrWrongPassword defines an error when the key password is invalid. ErrWrongPassword = Register(RootCodespace, 23, "invalid account password") + // ErrorInvalidSigner defines an error when the tx intended signer does not match the given signer. + ErrorInvalidSigner = Register(RootCodespace, 24, "tx intended signer does not match the given signer") + + // ErrorInvalidGasAdjustment defines an error for an invalid gas adjustment + ErrorInvalidGasAdjustment = Register(RootCodespace, 25, "invalid gas adjustment") + // ErrPanic is only set when we recover from a panic, so we know to // redact potentially sensitive system info ErrPanic = Register(UndefinedCodespace, 111222, "panic") diff --git a/x/auth/alias.go b/x/auth/alias.go index e34b9ec68..1ff692c74 100644 --- a/x/auth/alias.go +++ b/x/auth/alias.go @@ -60,8 +60,6 @@ var ( ValidateGenAccounts = types.ValidateGenAccounts GetGenesisStateFromAppState = types.GetGenesisStateFromAppState NewStdSignature = types.NewStdSignature - NewStdTxBase = types.NewStdTxBase - NewStdSignDocBase = types.NewStdSignDocBase // variable aliases ModuleCdc = types.ModuleCdc @@ -91,6 +89,4 @@ type ( TxBuilder = types.TxBuilder GenesisAccountIterator = types.GenesisAccountIterator Codec = types.Codec - StdSignDocBase = types.StdSignDocBase - StdTxBase = types.StdTxBase ) diff --git a/x/auth/client/rest.go b/x/auth/client/rest.go index aba689f75..e451e121b 100644 --- a/x/auth/client/rest.go +++ b/x/auth/client/rest.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/context" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/rest" "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -30,7 +31,7 @@ func WriteGenerateStdTxResponse(w http.ResponseWriter, cliCtx context.CLIContext if br.Simulate || simAndExec { if gasAdj < 0 { - rest.WriteErrorResponse(w, http.StatusBadRequest, types.ErrorInvalidGasAdjustment.Error()) + rest.WriteErrorResponse(w, http.StatusBadRequest, errors.ErrorInvalidGasAdjustment.Error()) return } diff --git a/x/auth/client/tx.go b/x/auth/client/tx.go index cc04cd730..c06acf736 100644 --- a/x/auth/client/tx.go +++ b/x/auth/client/tx.go @@ -18,6 +18,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/keys" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -193,7 +194,7 @@ func SignStdTx( // check whether the address is a signer if !isTxSigner(sdk.AccAddress(addr), stdTx.GetSigners()) { - return signedStdTx, fmt.Errorf("%s: %s", authtypes.ErrorInvalidSigner, name) + return signedStdTx, fmt.Errorf("%s: %s", sdkerrors.ErrorInvalidSigner, name) } if !offline { @@ -216,7 +217,7 @@ func SignStdTxWithSignerAddress( // check whether the address is a signer if !isTxSigner(addr, stdTx.GetSigners()) { - return signedStdTx, fmt.Errorf("%s: %s", authtypes.ErrorInvalidSigner, name) + return signedStdTx, fmt.Errorf("%s: %s", sdkerrors.ErrorInvalidSigner, name) } if !offline { diff --git a/x/auth/types/errors.go b/x/auth/types/errors.go deleted file mode 100644 index 8e765ceb9..000000000 --- a/x/auth/types/errors.go +++ /dev/null @@ -1,10 +0,0 @@ -package types - -import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -var ( - ErrorInvalidSigner = sdkerrors.Register(ModuleName, 2, "tx intended signer does not match the given signer") - ErrorInvalidGasAdjustment = sdkerrors.Register(ModuleName, 3, "invalid gas adjustment") -) diff --git a/x/auth/types/stdtx.go b/x/auth/types/stdtx.go index 786d8ffde..16d7f3194 100644 --- a/x/auth/types/stdtx.go +++ b/x/auth/types/stdtx.go @@ -17,7 +17,15 @@ import ( // MaxGasWanted defines the max gas allowed. const MaxGasWanted = uint64((1 << 63) - 1) -// NewStdFee returns a new instance of StdFee +// Deprecated: 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 sdk.Coins `json:"amount" yaml:"amount"` + Gas uint64 `json:"gas" yaml:"gas"` +} + +// Deprecated: NewStdFee returns a new instance of StdFee func NewStdFee(gas uint64, amount sdk.Coins) StdFee { return StdFee{ Amount: amount, @@ -58,6 +66,7 @@ func (fee StdFee) GasPrices() sdk.DecCoins { return sdk.NewDecCoinsFromCoins(fee.Amount...).QuoDec(sdk.NewDec(int64(fee.Gas))) } +// Deprecated func NewStdSignature(pk crypto.PubKey, sig []byte) StdSignature { var pkBz []byte if pk != nil { @@ -112,24 +121,6 @@ func (ss StdSignature) MarshalYAML() (interface{}, error) { return string(bz), err } -func NewStdTxBase(fee StdFee, sigs []StdSignature, memo string) StdTxBase { - return StdTxBase{ - Fee: fee, - Signatures: sigs, - Memo: memo, - } -} - -func NewStdSignDocBase(num, seq uint64, cid, memo string, fee StdFee) StdSignDocBase { - return StdSignDocBase{ - ChainID: cid, - AccountNumber: num, - Sequence: seq, - Memo: memo, - Fee: fee, - } -} - // CountSubKeys counts the total number of keys for a multi-sig public key. func CountSubKeys(pub crypto.PubKey) int { v, ok := pub.(multisig.PubKeyMultisigThreshold) @@ -320,6 +311,12 @@ func StdSignBytes(chainID string, accnum uint64, sequence uint64, fee StdFee, ms return sdk.MustSortJSON(bz) } +// Deprecated: StdSignature represents a sig +type StdSignature struct { + PubKey []byte `json:"pub_key" yaml:"pub_key"` // optional + Signature []byte `json:"signature" yaml:"signature"` +} + // DefaultTxDecoder logic for standard transaction decoding func DefaultTxDecoder(cdc *codec.Codec) sdk.TxDecoder { return func(txBytes []byte) (sdk.Tx, error) { diff --git a/x/auth/types/types.pb.go b/x/auth/types/types.pb.go index 69e8d5a86..ea6e34deb 100644 --- a/x/auth/types/types.pb.go +++ b/x/auth/types/types.pb.go @@ -6,7 +6,6 @@ package types import ( fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" @@ -67,87 +66,6 @@ func (m *BaseAccount) XXX_DiscardUnknown() { var xxx_messageInfo_BaseAccount proto.InternalMessageInfo -// 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_2d526fa662daab74, []int{1} -} -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_2d526fa662daab74, []int{2} -} -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 - // Params defines the parameters for the auth module. type Params struct { MaxMemoCharacters uint64 `protobuf:"varint,1,opt,name=max_memo_characters,json=maxMemoCharacters,proto3" json:"max_memo_characters,omitempty" yaml:"max_memo_characters"` @@ -160,7 +78,7 @@ type Params struct { func (m *Params) Reset() { *m = Params{} } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_2d526fa662daab74, []int{3} + return fileDescriptor_2d526fa662daab74, []int{1} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -224,244 +142,52 @@ func (m *Params) GetSigVerifyCostSecp256k1() uint64 { return 0 } -// 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_2d526fa662daab74, []int{4} -} -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_2d526fa662daab74, []int{5} -} -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((*BaseAccount)(nil), "cosmos_sdk.x.auth.v1.BaseAccount") - proto.RegisterType((*StdFee)(nil), "cosmos_sdk.x.auth.v1.StdFee") - proto.RegisterType((*StdSignature)(nil), "cosmos_sdk.x.auth.v1.StdSignature") proto.RegisterType((*Params)(nil), "cosmos_sdk.x.auth.v1.Params") - proto.RegisterType((*StdTxBase)(nil), "cosmos_sdk.x.auth.v1.StdTxBase") - proto.RegisterType((*StdSignDocBase)(nil), "cosmos_sdk.x.auth.v1.StdSignDocBase") } func init() { proto.RegisterFile("x/auth/types/types.proto", fileDescriptor_2d526fa662daab74) } var fileDescriptor_2d526fa662daab74 = []byte{ - // 803 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x8f, 0xdb, 0x44, - 0x14, 0x8e, 0x37, 0x6e, 0x36, 0x99, 0x5d, 0x0a, 0x99, 0x4d, 0xdb, 0x34, 0x5a, 0x79, 0x22, 0x1f, - 0x50, 0x90, 0x58, 0x87, 0x04, 0x16, 0x69, 0x73, 0x40, 0xac, 0xb3, 0x54, 0x54, 0x85, 0xaa, 0x9a, - 0x20, 0x0e, 0x48, 0xc8, 0x9a, 0xd8, 0x53, 0xc7, 0xca, 0x3a, 0x76, 0x3d, 0xe3, 0x55, 0xbc, 0x57, - 0x2e, 0x88, 0x13, 0xc7, 0xde, 0xd8, 0x33, 0x7f, 0x49, 0x8f, 0x3d, 0x72, 0x72, 0x51, 0xf6, 0x82, - 0x38, 0x9a, 0x1b, 0x27, 0x34, 0x9e, 0xfc, 0x2c, 0x29, 0xa2, 0xda, 0x4b, 0x32, 0xf3, 0xe6, 0xfb, - 0xbe, 0xf7, 0xf2, 0xe6, 0x9b, 0x17, 0x50, 0x9f, 0xb6, 0x49, 0xcc, 0x47, 0x6d, 0x9e, 0x84, 0x94, - 0xc9, 0x4f, 0x23, 0x8c, 0x02, 0x1e, 0xc0, 0x9a, 0x1d, 0x30, 0x3f, 0x60, 0x16, 0x73, 0xc6, 0xc6, - 0xd4, 0x10, 0x20, 0xe3, 0xa2, 0xd3, 0x78, 0x9f, 0x8f, 0xbc, 0xc8, 0xb1, 0x42, 0x12, 0xf1, 0xa4, - 0x9d, 0x03, 0xdb, 0x6e, 0xe0, 0x06, 0xab, 0x95, 0x64, 0x37, 0xaa, 0xff, 0x12, 0xd4, 0x7f, 0xda, - 0x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2, 0x5a, 0x2b, 0xa6, 0x36, 0x4b, 0xd1, 0x6e, 0x5f, 0xc4, 0x1e, 0x9e, 0x65, 0x29, 0x7a, 0x57, - 0x76, 0x66, 0x01, 0xd2, 0xf1, 0x6e, 0xbe, 0x7c, 0xe8, 0x6c, 0x99, 0x1d, 0x3b, 0x37, 0x98, 0x1d, - 0xc5, 0xcd, 0xd9, 0xb1, 0xac, 0x5f, 0x5d, 0xd5, 0xbf, 0xe8, 0xe9, 0xad, 0xb7, 0xea, 0xa9, 0xd9, - 0x7f, 0x31, 0xd3, 0x94, 0x97, 0x33, 0x4d, 0xf9, 0x7d, 0xa6, 0x29, 0x3f, 0x5f, 0x6b, 0x85, 0x97, - 0xd7, 0x5a, 0xe1, 0xb7, 0x6b, 0xad, 0xf0, 0xdd, 0x07, 0xff, 0x39, 0x5d, 0xd6, 0xff, 0x2a, 0x86, - 0xa5, 0x7c, 0xa8, 0x7f, 0xfc, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc0, 0xb1, 0x78, 0x7e, 0x41, - 0x06, 0x00, 0x00, + // 558 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0x3f, 0x6f, 0xd3, 0x40, + 0x14, 0x8f, 0xdb, 0xd0, 0x56, 0x47, 0x41, 0xaa, 0x9b, 0xb6, 0x6e, 0x85, 0x7c, 0x91, 0x07, 0x54, + 0x24, 0x9a, 0x28, 0x45, 0x41, 0x6a, 0x06, 0x44, 0x1c, 0x60, 0x29, 0x54, 0x95, 0x23, 0x31, 0xb0, + 0x58, 0xe7, 0xf3, 0xe1, 0x58, 0xc9, 0xe5, 0x5c, 0xdf, 0xb9, 0xb2, 0xfb, 0x09, 0x10, 0x13, 0x23, + 0x63, 0x3e, 0x0e, 0x63, 0x47, 0x26, 0x83, 0x92, 0x05, 0x31, 0x7a, 0x64, 0x42, 0xf6, 0xa5, 0x69, + 0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0xaf, 0x5f, + 0x15, 0x78, 0x96, 0x42, 0x5d, 0xa6, 0xfd, 0xc3, 0xc0, 0xb0, 0x2a, 0x7c, 0x41, 0x27, 0xdb, 0x6a, + 0x02, 0xf6, 0xef, 0x2a, 0x38, 0xc1, 0xc1, 0x71, 0xf3, 0x79, 0xbf, 0xa1, 0xdd, 0x2b, 0x42, 0x5f, + 0x8c, 0x53, 0xb8, 0xbb, 0x10, 0xda, 0xbd, 0x61, 0x64, 0x29, 0xac, 0x2e, 0x8f, 0x9d, 0x99, 0x18, + 0xd6, 0x2e, 0x5f, 0xaa, 0x6d, 0x6d, 0xe4, 0x7f, 0xf7, 0xd7, 0x08, 0x2a, 0x66, 0xe7, 0xdb, 0x58, + 0x57, 0xae, 0xc7, 0xba, 0xf2, 0x73, 0xac, 0x2b, 0x5f, 0x26, 0x7a, 0xe9, 0x7a, 0xa2, 0x97, 0xbe, + 0x4f, 0xf4, 0xd2, 0x87, 0x27, 0xff, 0xbd, 0xe3, 0xf3, 0xdb, 0xe7, 0xac, 0x15, 0xab, 0xf3, 0xec, + 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc4, 0x8c, 0x0a, 0xa8, 0x94, 0x03, 0x00, 0x00, } -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 *Params) Equal(that interface{}) bool { if that == nil { return this == nil @@ -545,85 +271,6 @@ func (m *BaseAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 = encodeVarintTypes(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 = encodeVarintTypes(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 = encodeVarintTypes(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 = encodeVarintTypes(dAtA, i, uint64(len(m.PubKey))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *Params) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -672,117 +319,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 = encodeVarintTypes(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 = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Fee.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 (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 = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.Memo) > 0 { - i -= len(m.Memo) - copy(dAtA[i:], m.Memo) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Memo))) - i-- - dAtA[i] = 0x22 - } - if m.Sequence != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Sequence)) - i-- - dAtA[i] = 0x18 - } - if m.AccountNumber != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.AccountNumber)) - i-- - dAtA[i] = 0x10 - } - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -817,41 +353,6 @@ func (m *BaseAccount) Size() (n int) { 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 + sovTypes(uint64(l)) - } - } - if m.Gas != 0 { - n += 1 + sovTypes(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 + sovTypes(uint64(l)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - func (m *Params) Size() (n int) { if m == nil { return 0 @@ -876,52 +377,6 @@ func (m *Params) Size() (n int) { return n } -func (m *StdTxBase) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Fee.Size() - n += 1 + l + sovTypes(uint64(l)) - if len(m.Signatures) > 0 { - for _, e := range m.Signatures { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - l = len(m.Memo) - if l > 0 { - n += 1 + l + sovTypes(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 + sovTypes(uint64(l)) - } - if m.AccountNumber != 0 { - n += 1 + sovTypes(uint64(m.AccountNumber)) - } - if m.Sequence != 0 { - n += 1 + sovTypes(uint64(m.Sequence)) - } - l = len(m.Memo) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = m.Fee.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1087,233 +542,6 @@ func (m *BaseAccount) Unmarshal(dAtA []byte) error { } 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 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: 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 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 - } - m.Amount = append(m.Amount, types.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 ErrIntOverflowTypes - } - 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 := 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 (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 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: 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - 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 := 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 (m *Params) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1462,346 +690,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } 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 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: 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 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 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 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 - } - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Memo = string(dAtA[iNdEx:postIndex]) - 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 (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 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: 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - 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 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 err := m.Fee.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 305b5368f..f18fce96b 100644 --- a/x/auth/types/types.proto +++ b/x/auth/types/types.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package cosmos_sdk.x.auth.v1; import "third_party/proto/gogoproto/gogo.proto"; -import "types/types.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; @@ -19,27 +18,6 @@ message BaseAccount { uint64 sequence = 4; } -// 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. -message StdFee { - option (gogoproto.goproto_getters) = false; - option (gogoproto.equal) = true; - - repeated cosmos_sdk.v1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - uint64 gas = 2; -} - -// StdSignature defines a signature structure that contains the signature of a -// transaction and an optional public key. -message StdSignature { - option (gogoproto.goproto_getters) = false; - - bytes pub_key = 1 [(gogoproto.jsontag) = "public_key,omitempty", (gogoproto.moretags) = "yaml:\"public_key\""]; - bytes signature = 2; -} - // Params defines the parameters for the auth module. message Params { option (gogoproto.equal) = true; @@ -49,25 +27,8 @@ message Params { uint64 tx_sig_limit = 2 [(gogoproto.moretags) = "yaml:\"tx_sig_limit\""]; uint64 tx_size_cost_per_byte = 3 [(gogoproto.moretags) = "yaml:\"tx_size_cost_per_byte\""]; uint64 sig_verify_cost_ed25519 = 4 - [(gogoproto.customname) = "SigVerifyCostED25519", (gogoproto.moretags) = "yaml:\"sig_verify_cost_ed25519\""]; + [(gogoproto.customname) = "SigVerifyCostED25519", (gogoproto.moretags) = "yaml:\"sig_verify_cost_ed25519\""]; uint64 sig_verify_cost_secp256k1 = 5 - [(gogoproto.customname) = "SigVerifyCostSecp256k1", (gogoproto.moretags) = "yaml:\"sig_verify_cost_secp256k1\""]; + [(gogoproto.customname) = "SigVerifyCostSecp256k1", (gogoproto.moretags) = "yaml:\"sig_verify_cost_secp256k1\""]; } -// StdTxBase defines a transaction base which application-level concrete transaction -// types can extend. -message StdTxBase { - StdFee fee = 1 [(gogoproto.nullable) = false]; - repeated StdSignature signatures = 2 [(gogoproto.nullable) = false]; - string memo = 3; -} - -// StdSignDocBase defines the base structure for which applications can extend -// to define the concrete structure that signers sign over. -message StdSignDocBase { - string chain_id = 1 [(gogoproto.customname) = "ChainID", (gogoproto.moretags) = "yaml:\"chain_id\""]; - uint64 account_number = 2 [(gogoproto.moretags) = "yaml:\"account_number\""]; - uint64 sequence = 3; - string memo = 4; - StdFee fee = 5 [(gogoproto.nullable) = false]; -}