cosmos-sdk/testutil/testdata/proto.pb.go

2819 lines
66 KiB
Go
Raw Normal View History

// Code generated by protoc-gen-gogo. DO NOT EDIT.
2020-07-01 08:26:29 -07:00
// source: proto.proto
package testdata
import (
2020-06-03 06:33:51 -07:00
context "context"
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/codec/types"
Add support for protobuf TxGenerator and SIGN_MODE_DIRECT (#6385) * Add TxWrapper, encoder, decoder and DirectModeHandler * fix pkg name * Update API and leave test TODO's * Update TxWrapper API * tests for tx wrapper (#6410) * WIP: added test for direct mode handler * updated code * Add msg * Update TxWrapper API * Fix pubkey declaration * Add pubkey for tests * Fix SetFee * Remove logs * Avoid global var declaration for tests * Add test for GetPubKeys * Fix direct signing tests * Add more test cases for GetSignBytes * Revert SetFee API * Remove logs * Refactor tests Co-authored-by: anilCSE <anil@vitwit.com> Co-authored-by: sahith-narahari <sahithnarahari@gmail.com> * Refactoring * Refactoring * Integrate SignatureV2 API * Fix wrapper tests * Fix tests * Linting and API tweaks * Update API * WIP on updating API * Fix tests * Update to new SigVerifiableTx * Rename * Update docs to reflect ADR 020 * proto-gen * proto docs * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * Add tests * Refactor and improving test coverage * WIP on test coverage * WIP on test coverage * proto-gen * Fix CompactBitArray.Size() bug * Rename * Remove Builder interface * Address review comments * Update x/auth/tx/sigs.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/auth/tx/encoder.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/auth/tx/encoder.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Address review feedback * Fix build issues * Resolve conflicts * Fix ValidateBasic test coverage * Add test for malicious multisig Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com> Co-authored-by: anilCSE <anil@vitwit.com> Co-authored-by: sahith-narahari <sahithnarahari@gmail.com> Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-06 10:03:45 -07:00
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
_ "github.com/gogo/protobuf/gogoproto"
2020-06-03 06:33:51 -07:00
grpc1 "github.com/gogo/protobuf/grpc"
proto "github.com/gogo/protobuf/proto"
2020-06-03 06:33:51 -07:00
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
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
type Dog struct {
Size_ string `protobuf:"bytes,1,opt,name=size,proto3" json:"size,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
}
func (m *Dog) Reset() { *m = Dog{} }
func (m *Dog) String() string { return proto.CompactTextString(m) }
func (*Dog) ProtoMessage() {}
func (*Dog) Descriptor() ([]byte, []int) {
2020-07-01 08:26:29 -07:00
return fileDescriptor_2fcc84b9998d60d8, []int{0}
}
func (m *Dog) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Dog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Dog.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 *Dog) XXX_Merge(src proto.Message) {
xxx_messageInfo_Dog.Merge(m, src)
}
func (m *Dog) XXX_Size() int {
return m.Size()
}
func (m *Dog) XXX_DiscardUnknown() {
xxx_messageInfo_Dog.DiscardUnknown(m)
}
var xxx_messageInfo_Dog proto.InternalMessageInfo
func (m *Dog) GetSize_() string {
if m != nil {
return m.Size_
}
return ""
}
func (m *Dog) GetName() string {
if m != nil {
return m.Name
}
return ""
}
type Cat struct {
Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"`
Lives int32 `protobuf:"varint,2,opt,name=lives,proto3" json:"lives,omitempty"`
}
func (m *Cat) Reset() { *m = Cat{} }
func (m *Cat) String() string { return proto.CompactTextString(m) }
func (*Cat) ProtoMessage() {}
func (*Cat) Descriptor() ([]byte, []int) {
2020-07-01 08:26:29 -07:00
return fileDescriptor_2fcc84b9998d60d8, []int{1}
}
func (m *Cat) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Cat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Cat.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 *Cat) XXX_Merge(src proto.Message) {
xxx_messageInfo_Cat.Merge(m, src)
}
func (m *Cat) XXX_Size() int {
return m.Size()
}
func (m *Cat) XXX_DiscardUnknown() {
xxx_messageInfo_Cat.DiscardUnknown(m)
}
var xxx_messageInfo_Cat proto.InternalMessageInfo
func (m *Cat) GetMoniker() string {
if m != nil {
return m.Moniker
}
return ""
}
func (m *Cat) GetLives() int32 {
if m != nil {
return m.Lives
}
return 0
}
type HasAnimal struct {
Animal *types.Any `protobuf:"bytes,1,opt,name=animal,proto3" json:"animal,omitempty"`
X int64 `protobuf:"varint,2,opt,name=x,proto3" json:"x,omitempty"`
}
func (m *HasAnimal) Reset() { *m = HasAnimal{} }
func (m *HasAnimal) String() string { return proto.CompactTextString(m) }
func (*HasAnimal) ProtoMessage() {}
func (*HasAnimal) Descriptor() ([]byte, []int) {
2020-07-01 08:26:29 -07:00
return fileDescriptor_2fcc84b9998d60d8, []int{2}
}
func (m *HasAnimal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *HasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_HasAnimal.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 *HasAnimal) XXX_Merge(src proto.Message) {
xxx_messageInfo_HasAnimal.Merge(m, src)
}
func (m *HasAnimal) XXX_Size() int {
return m.Size()
}
func (m *HasAnimal) XXX_DiscardUnknown() {
xxx_messageInfo_HasAnimal.DiscardUnknown(m)
}
var xxx_messageInfo_HasAnimal proto.InternalMessageInfo
func (m *HasAnimal) GetAnimal() *types.Any {
if m != nil {
return m.Animal
}
return nil
}
func (m *HasAnimal) GetX() int64 {
if m != nil {
return m.X
}
return 0
}
type HasHasAnimal struct {
HasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"`
}
func (m *HasHasAnimal) Reset() { *m = HasHasAnimal{} }
func (m *HasHasAnimal) String() string { return proto.CompactTextString(m) }
func (*HasHasAnimal) ProtoMessage() {}
func (*HasHasAnimal) Descriptor() ([]byte, []int) {
2020-07-01 08:26:29 -07:00
return fileDescriptor_2fcc84b9998d60d8, []int{3}
}
func (m *HasHasAnimal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *HasHasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_HasHasAnimal.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 *HasHasAnimal) XXX_Merge(src proto.Message) {
xxx_messageInfo_HasHasAnimal.Merge(m, src)
}
func (m *HasHasAnimal) XXX_Size() int {
return m.Size()
}
func (m *HasHasAnimal) XXX_DiscardUnknown() {
xxx_messageInfo_HasHasAnimal.DiscardUnknown(m)
}
var xxx_messageInfo_HasHasAnimal proto.InternalMessageInfo
func (m *HasHasAnimal) GetHasAnimal() *types.Any {
if m != nil {
return m.HasAnimal
}
return nil
}
type HasHasHasAnimal struct {
HasHasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_has_animal,json=hasHasAnimal,proto3" json:"has_has_animal,omitempty"`
}
func (m *HasHasHasAnimal) Reset() { *m = HasHasHasAnimal{} }
func (m *HasHasHasAnimal) String() string { return proto.CompactTextString(m) }
func (*HasHasHasAnimal) ProtoMessage() {}
func (*HasHasHasAnimal) Descriptor() ([]byte, []int) {
2020-07-01 08:26:29 -07:00
return fileDescriptor_2fcc84b9998d60d8, []int{4}
}
func (m *HasHasHasAnimal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *HasHasHasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_HasHasHasAnimal.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 *HasHasHasAnimal) XXX_Merge(src proto.Message) {
xxx_messageInfo_HasHasHasAnimal.Merge(m, src)
}
func (m *HasHasHasAnimal) XXX_Size() int {
return m.Size()
}
func (m *HasHasHasAnimal) XXX_DiscardUnknown() {
xxx_messageInfo_HasHasHasAnimal.DiscardUnknown(m)
}
var xxx_messageInfo_HasHasHasAnimal proto.InternalMessageInfo
func (m *HasHasHasAnimal) GetHasHasAnimal() *types.Any {
if m != nil {
return m.HasHasAnimal
}
return nil
}
2020-06-03 06:33:51 -07:00
type EchoRequest struct {
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
}
func (m *EchoRequest) Reset() { *m = EchoRequest{} }
func (m *EchoRequest) String() string { return proto.CompactTextString(m) }
func (*EchoRequest) ProtoMessage() {}
func (*EchoRequest) Descriptor() ([]byte, []int) {
2020-07-01 08:26:29 -07:00
return fileDescriptor_2fcc84b9998d60d8, []int{5}
2020-06-03 06:33:51 -07:00
}
func (m *EchoRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *EchoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_EchoRequest.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 *EchoRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_EchoRequest.Merge(m, src)
}
func (m *EchoRequest) XXX_Size() int {
return m.Size()
}
func (m *EchoRequest) XXX_DiscardUnknown() {
xxx_messageInfo_EchoRequest.DiscardUnknown(m)
}
var xxx_messageInfo_EchoRequest proto.InternalMessageInfo
func (m *EchoRequest) GetMessage() string {
if m != nil {
return m.Message
}
return ""
}
type EchoResponse struct {
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
}
func (m *EchoResponse) Reset() { *m = EchoResponse{} }
func (m *EchoResponse) String() string { return proto.CompactTextString(m) }
func (*EchoResponse) ProtoMessage() {}
func (*EchoResponse) Descriptor() ([]byte, []int) {
2020-07-01 08:26:29 -07:00
return fileDescriptor_2fcc84b9998d60d8, []int{6}
2020-06-03 06:33:51 -07:00
}
func (m *EchoResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *EchoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_EchoResponse.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 *EchoResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_EchoResponse.Merge(m, src)
}
func (m *EchoResponse) XXX_Size() int {
return m.Size()
}
func (m *EchoResponse) XXX_DiscardUnknown() {
xxx_messageInfo_EchoResponse.DiscardUnknown(m)
}
var xxx_messageInfo_EchoResponse proto.InternalMessageInfo
func (m *EchoResponse) GetMessage() string {
if m != nil {
return m.Message
}
return ""
}
type SayHelloRequest struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (m *SayHelloRequest) Reset() { *m = SayHelloRequest{} }
func (m *SayHelloRequest) String() string { return proto.CompactTextString(m) }
func (*SayHelloRequest) ProtoMessage() {}
func (*SayHelloRequest) Descriptor() ([]byte, []int) {
2020-07-01 08:26:29 -07:00
return fileDescriptor_2fcc84b9998d60d8, []int{7}
2020-06-03 06:33:51 -07:00
}
func (m *SayHelloRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SayHelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SayHelloRequest.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 *SayHelloRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SayHelloRequest.Merge(m, src)
}
func (m *SayHelloRequest) XXX_Size() int {
return m.Size()
}
func (m *SayHelloRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SayHelloRequest.DiscardUnknown(m)
}
var xxx_messageInfo_SayHelloRequest proto.InternalMessageInfo
func (m *SayHelloRequest) GetName() string {
if m != nil {
return m.Name
}
return ""
}
type SayHelloResponse struct {
Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"`
}
func (m *SayHelloResponse) Reset() { *m = SayHelloResponse{} }
func (m *SayHelloResponse) String() string { return proto.CompactTextString(m) }
func (*SayHelloResponse) ProtoMessage() {}
func (*SayHelloResponse) Descriptor() ([]byte, []int) {
2020-07-01 08:26:29 -07:00
return fileDescriptor_2fcc84b9998d60d8, []int{8}
2020-06-03 06:33:51 -07:00
}
func (m *SayHelloResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SayHelloResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SayHelloResponse.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 *SayHelloResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_SayHelloResponse.Merge(m, src)
}
func (m *SayHelloResponse) XXX_Size() int {
return m.Size()
}
func (m *SayHelloResponse) XXX_DiscardUnknown() {
xxx_messageInfo_SayHelloResponse.DiscardUnknown(m)
}
var xxx_messageInfo_SayHelloResponse proto.InternalMessageInfo
func (m *SayHelloResponse) GetGreeting() string {
if m != nil {
return m.Greeting
}
return ""
}
type TestAnyRequest struct {
AnyAnimal *types.Any `protobuf:"bytes,1,opt,name=any_animal,json=anyAnimal,proto3" json:"any_animal,omitempty"`
}
func (m *TestAnyRequest) Reset() { *m = TestAnyRequest{} }
func (m *TestAnyRequest) String() string { return proto.CompactTextString(m) }
func (*TestAnyRequest) ProtoMessage() {}
func (*TestAnyRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_2fcc84b9998d60d8, []int{9}
}
func (m *TestAnyRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *TestAnyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_TestAnyRequest.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 *TestAnyRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_TestAnyRequest.Merge(m, src)
}
func (m *TestAnyRequest) XXX_Size() int {
return m.Size()
}
func (m *TestAnyRequest) XXX_DiscardUnknown() {
xxx_messageInfo_TestAnyRequest.DiscardUnknown(m)
}
var xxx_messageInfo_TestAnyRequest proto.InternalMessageInfo
func (m *TestAnyRequest) GetAnyAnimal() *types.Any {
if m != nil {
return m.AnyAnimal
}
return nil
}
type TestAnyResponse struct {
HasAnimal *HasAnimal `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"`
}
func (m *TestAnyResponse) Reset() { *m = TestAnyResponse{} }
func (m *TestAnyResponse) String() string { return proto.CompactTextString(m) }
func (*TestAnyResponse) ProtoMessage() {}
func (*TestAnyResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_2fcc84b9998d60d8, []int{10}
}
func (m *TestAnyResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *TestAnyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_TestAnyResponse.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 *TestAnyResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_TestAnyResponse.Merge(m, src)
}
func (m *TestAnyResponse) XXX_Size() int {
return m.Size()
}
func (m *TestAnyResponse) XXX_DiscardUnknown() {
xxx_messageInfo_TestAnyResponse.DiscardUnknown(m)
}
var xxx_messageInfo_TestAnyResponse proto.InternalMessageInfo
func (m *TestAnyResponse) GetHasAnimal() *HasAnimal {
if m != nil {
return m.HasAnimal
}
return nil
}
Add support for protobuf TxGenerator and SIGN_MODE_DIRECT (#6385) * Add TxWrapper, encoder, decoder and DirectModeHandler * fix pkg name * Update API and leave test TODO's * Update TxWrapper API * tests for tx wrapper (#6410) * WIP: added test for direct mode handler * updated code * Add msg * Update TxWrapper API * Fix pubkey declaration * Add pubkey for tests * Fix SetFee * Remove logs * Avoid global var declaration for tests * Add test for GetPubKeys * Fix direct signing tests * Add more test cases for GetSignBytes * Revert SetFee API * Remove logs * Refactor tests Co-authored-by: anilCSE <anil@vitwit.com> Co-authored-by: sahith-narahari <sahithnarahari@gmail.com> * Refactoring * Refactoring * Integrate SignatureV2 API * Fix wrapper tests * Fix tests * Linting and API tweaks * Update API * WIP on updating API * Fix tests * Update to new SigVerifiableTx * Rename * Update docs to reflect ADR 020 * proto-gen * proto docs * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * Add tests * Refactor and improving test coverage * WIP on test coverage * WIP on test coverage * proto-gen * Fix CompactBitArray.Size() bug * Rename * Remove Builder interface * Address review comments * Update x/auth/tx/sigs.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/auth/tx/encoder.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/auth/tx/encoder.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Address review feedback * Fix build issues * Resolve conflicts * Fix ValidateBasic test coverage * Add test for malicious multisig Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com> Co-authored-by: anilCSE <anil@vitwit.com> Co-authored-by: sahith-narahari <sahithnarahari@gmail.com> Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-06 10:03:45 -07:00
// msg type for testing
type TestMsg struct {
Signers []github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,rep,name=signers,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"signers,omitempty"`
}
func (m *TestMsg) Reset() { *m = TestMsg{} }
func (m *TestMsg) String() string { return proto.CompactTextString(m) }
func (*TestMsg) ProtoMessage() {}
func (*TestMsg) Descriptor() ([]byte, []int) {
return fileDescriptor_2fcc84b9998d60d8, []int{11}
}
func (m *TestMsg) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *TestMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_TestMsg.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 *TestMsg) XXX_Merge(src proto.Message) {
xxx_messageInfo_TestMsg.Merge(m, src)
}
func (m *TestMsg) XXX_Size() int {
return m.Size()
}
func (m *TestMsg) XXX_DiscardUnknown() {
xxx_messageInfo_TestMsg.DiscardUnknown(m)
}
var xxx_messageInfo_TestMsg proto.InternalMessageInfo
func (m *TestMsg) GetSigners() []github_com_cosmos_cosmos_sdk_types.AccAddress {
if m != nil {
return m.Signers
}
return nil
}
// bad MultiSignature with extra fields
type BadMultiSignature struct {
Signatures [][]byte `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"`
MaliciousField []byte `protobuf:"bytes,5,opt,name=malicious_field,json=maliciousField,proto3" json:"malicious_field,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *BadMultiSignature) Reset() { *m = BadMultiSignature{} }
func (m *BadMultiSignature) String() string { return proto.CompactTextString(m) }
func (*BadMultiSignature) ProtoMessage() {}
func (*BadMultiSignature) Descriptor() ([]byte, []int) {
return fileDescriptor_2fcc84b9998d60d8, []int{12}
}
func (m *BadMultiSignature) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *BadMultiSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_BadMultiSignature.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 *BadMultiSignature) XXX_Merge(src proto.Message) {
xxx_messageInfo_BadMultiSignature.Merge(m, src)
}
func (m *BadMultiSignature) XXX_Size() int {
return m.Size()
}
func (m *BadMultiSignature) XXX_DiscardUnknown() {
xxx_messageInfo_BadMultiSignature.DiscardUnknown(m)
}
var xxx_messageInfo_BadMultiSignature proto.InternalMessageInfo
func (m *BadMultiSignature) GetSignatures() [][]byte {
if m != nil {
return m.Signatures
}
return nil
}
func (m *BadMultiSignature) GetMaliciousField() []byte {
if m != nil {
return m.MaliciousField
}
return nil
}
func init() {
2020-07-01 08:26:29 -07:00
proto.RegisterType((*Dog)(nil), "testdata.Dog")
proto.RegisterType((*Cat)(nil), "testdata.Cat")
proto.RegisterType((*HasAnimal)(nil), "testdata.HasAnimal")
proto.RegisterType((*HasHasAnimal)(nil), "testdata.HasHasAnimal")
proto.RegisterType((*HasHasHasAnimal)(nil), "testdata.HasHasHasAnimal")
proto.RegisterType((*EchoRequest)(nil), "testdata.EchoRequest")
proto.RegisterType((*EchoResponse)(nil), "testdata.EchoResponse")
proto.RegisterType((*SayHelloRequest)(nil), "testdata.SayHelloRequest")
proto.RegisterType((*SayHelloResponse)(nil), "testdata.SayHelloResponse")
proto.RegisterType((*TestAnyRequest)(nil), "testdata.TestAnyRequest")
proto.RegisterType((*TestAnyResponse)(nil), "testdata.TestAnyResponse")
Add support for protobuf TxGenerator and SIGN_MODE_DIRECT (#6385) * Add TxWrapper, encoder, decoder and DirectModeHandler * fix pkg name * Update API and leave test TODO's * Update TxWrapper API * tests for tx wrapper (#6410) * WIP: added test for direct mode handler * updated code * Add msg * Update TxWrapper API * Fix pubkey declaration * Add pubkey for tests * Fix SetFee * Remove logs * Avoid global var declaration for tests * Add test for GetPubKeys * Fix direct signing tests * Add more test cases for GetSignBytes * Revert SetFee API * Remove logs * Refactor tests Co-authored-by: anilCSE <anil@vitwit.com> Co-authored-by: sahith-narahari <sahithnarahari@gmail.com> * Refactoring * Refactoring * Integrate SignatureV2 API * Fix wrapper tests * Fix tests * Linting and API tweaks * Update API * WIP on updating API * Fix tests * Update to new SigVerifiableTx * Rename * Update docs to reflect ADR 020 * proto-gen * proto docs * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * Add tests * Refactor and improving test coverage * WIP on test coverage * WIP on test coverage * proto-gen * Fix CompactBitArray.Size() bug * Rename * Remove Builder interface * Address review comments * Update x/auth/tx/sigs.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/auth/tx/encoder.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/auth/tx/encoder.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Address review feedback * Fix build issues * Resolve conflicts * Fix ValidateBasic test coverage * Add test for malicious multisig Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com> Co-authored-by: anilCSE <anil@vitwit.com> Co-authored-by: sahith-narahari <sahithnarahari@gmail.com> Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-06 10:03:45 -07:00
proto.RegisterType((*TestMsg)(nil), "testdata.TestMsg")
proto.RegisterType((*BadMultiSignature)(nil), "testdata.BadMultiSignature")
2020-07-01 08:26:29 -07:00
}
func init() { proto.RegisterFile("proto.proto", fileDescriptor_2fcc84b9998d60d8) }
var fileDescriptor_2fcc84b9998d60d8 = []byte{
// 585 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcf, 0x4e, 0xdc, 0x3e,
0x10, 0xc7, 0xf1, 0x6f, 0xf9, 0x3b, 0xbb, 0x62, 0x7f, 0x75, 0x69, 0xb5, 0xe4, 0x10, 0x50, 0xa4,
0x8a, 0x3d, 0x94, 0xac, 0x0a, 0xe2, 0xc2, 0xa1, 0x52, 0xa0, 0xb4, 0x2b, 0x55, 0x5c, 0x42, 0xd5,
0x43, 0x2f, 0xc8, 0x9b, 0x18, 0xaf, 0x45, 0x62, 0xd3, 0x8c, 0x83, 0x48, 0x9f, 0xa2, 0xaf, 0xd0,
0xa7, 0x69, 0x8f, 0x1c, 0x7b, 0xaa, 0x2a, 0x78, 0x8b, 0x9e, 0xaa, 0xfc, 0xdf, 0x22, 0x84, 0xb8,
0x24, 0x33, 0xe3, 0xef, 0x7c, 0x6c, 0xcf, 0xd7, 0xd0, 0xbd, 0x48, 0xb4, 0xd1, 0x6e, 0xf1, 0xa5,
0xcb, 0x86, 0xa3, 0x09, 0x99, 0x61, 0xd6, 0xba, 0xd0, 0x5a, 0x44, 0x7c, 0x54, 0xd4, 0x27, 0xe9,
0xd9, 0x88, 0xa9, 0xac, 0x14, 0x59, 0x6b, 0x42, 0x0b, 0x5d, 0x84, 0xa3, 0x3c, 0x2a, 0xab, 0xce,
0x36, 0x74, 0xde, 0x68, 0x41, 0x29, 0xcc, 0xa3, 0xfc, 0xc2, 0x07, 0x64, 0x93, 0x0c, 0x57, 0xfc,
0x22, 0xce, 0x6b, 0x8a, 0xc5, 0x7c, 0xf0, 0x5f, 0x59, 0xcb, 0x63, 0x67, 0x0f, 0x3a, 0x87, 0xcc,
0xd0, 0x01, 0x2c, 0xc5, 0x5a, 0xc9, 0x73, 0x9e, 0x54, 0x1d, 0x75, 0x4a, 0xd7, 0x60, 0x21, 0x92,
0x97, 0x1c, 0x8b, 0xae, 0x05, 0xbf, 0x4c, 0x9c, 0x77, 0xb0, 0x32, 0x66, 0xe8, 0x29, 0x19, 0xb3,
0x88, 0xbe, 0x84, 0x45, 0x56, 0x44, 0x45, 0x6f, 0x77, 0x67, 0xcd, 0x2d, 0x0f, 0xed, 0xd6, 0x87,
0x76, 0x3d, 0x95, 0xf9, 0x95, 0x86, 0xf6, 0x80, 0x5c, 0x15, 0xb0, 0x8e, 0x4f, 0xae, 0x9c, 0x43,
0xe8, 0x8d, 0x19, 0xb6, 0xac, 0x5d, 0x80, 0x29, 0xc3, 0xd3, 0x47, 0xf0, 0x56, 0xa6, 0x75, 0x93,
0x73, 0x0c, 0xfd, 0x12, 0xd2, 0x72, 0xf6, 0x61, 0x35, 0xe7, 0x3c, 0x92, 0xd5, 0x9b, 0xce, 0xf4,
0x3a, 0x5b, 0xd0, 0x3d, 0x0a, 0xa6, 0xda, 0xe7, 0x9f, 0x53, 0x8e, 0xe5, 0x6c, 0x38, 0x22, 0x13,
0xbc, 0x99, 0x4d, 0x99, 0x3a, 0x43, 0xe8, 0x95, 0x42, 0xbc, 0xd0, 0x0a, 0xf9, 0x03, 0xca, 0x17,
0xd0, 0x3f, 0x61, 0xd9, 0x98, 0x47, 0x51, 0x83, 0xad, 0xdd, 0x20, 0x33, 0x6e, 0xb8, 0xf0, 0x7f,
0x2b, 0xab, 0xa0, 0x16, 0x2c, 0x8b, 0x84, 0x73, 0x23, 0x95, 0xa8, 0xb4, 0x4d, 0xee, 0x1c, 0xc1,
0xea, 0x07, 0x8e, 0x26, 0xbf, 0x42, 0x45, 0xdd, 0x05, 0x60, 0x2a, 0x7b, 0xd4, 0xfc, 0x98, 0xca,
0xaa, 0x0b, 0x1f, 0x41, 0xbf, 0xc1, 0x54, 0xbb, 0xee, 0xdc, 0xe3, 0xc3, 0x53, 0xb7, 0x7e, 0x96,
0x6e, 0x33, 0xac, 0x59, 0x1b, 0x3e, 0xc2, 0x52, 0x8e, 0x39, 0x46, 0x41, 0xdf, 0xc3, 0x12, 0x4a,
0xa1, 0x78, 0x82, 0x03, 0xb2, 0xd9, 0x19, 0xf6, 0x0e, 0x5e, 0xfd, 0xf9, 0xb5, 0xb1, 0x2d, 0xa4,
0x99, 0xa6, 0x13, 0x37, 0xd0, 0xf1, 0x28, 0xd0, 0x18, 0x6b, 0xac, 0x7e, 0xdb, 0x18, 0x9e, 0x8f,
0x4c, 0x76, 0xc1, 0xd1, 0xf5, 0x82, 0xc0, 0x0b, 0xc3, 0x84, 0x23, 0xfa, 0x35, 0xc1, 0x99, 0xc0,
0x93, 0x03, 0x16, 0x1e, 0xa7, 0x91, 0x91, 0x27, 0x52, 0x28, 0x66, 0xd2, 0x84, 0x53, 0x1b, 0x00,
0xeb, 0xa4, 0xda, 0xc4, 0x9f, 0xa9, 0xd0, 0x2d, 0xe8, 0xc7, 0x2c, 0x92, 0x81, 0xd4, 0x29, 0x9e,
0x9e, 0x49, 0x1e, 0x85, 0x83, 0x85, 0x4d, 0x32, 0xec, 0xf9, 0xab, 0x4d, 0xf9, 0x6d, 0x5e, 0xdd,
0x9f, 0xbf, 0xfe, 0xb6, 0x41, 0x76, 0xbe, 0x13, 0xe8, 0xe6, 0x87, 0x3f, 0xe1, 0xc9, 0xa5, 0x0c,
0x38, 0xdd, 0x83, 0xf9, 0xdc, 0x5a, 0xfa, 0xac, 0xbd, 0xf3, 0xcc, 0x9b, 0xb0, 0x9e, 0xdf, 0x2d,
0x57, 0x63, 0xf3, 0x60, 0xb9, 0x36, 0x90, 0xae, 0xb7, 0x9a, 0x3b, 0xde, 0x5b, 0xd6, 0x7d, 0x4b,
0x15, 0xe2, 0x75, 0x39, 0x45, 0x4f, 0x65, 0x74, 0xd0, 0xca, 0xfe, 0xb5, 0xd9, 0x5a, 0xbf, 0x67,
0xa5, 0xec, 0x3f, 0x18, 0xff, 0xb8, 0xb1, 0xc9, 0xf5, 0x8d, 0x4d, 0x7e, 0xdf, 0xd8, 0xe4, 0xeb,
0xad, 0x3d, 0x77, 0x7d, 0x6b, 0xcf, 0xfd, 0xbc, 0xb5, 0xe7, 0x3e, 0xb9, 0x0f, 0xcf, 0x9f, 0xa3,
0x49, 0x8d, 0x8c, 0x46, 0x35, 0x79, 0xb2, 0x58, 0xbc, 0x97, 0xdd, 0xbf, 0x01, 0x00, 0x00, 0xff,
0xff, 0x5b, 0x22, 0x19, 0xf5, 0x9b, 0x04, 0x00, 0x00,
2020-06-03 06:33:51 -07:00
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// TestServiceClient is the client API for TestService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type TestServiceClient interface {
Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error)
TestAny(ctx context.Context, in *TestAnyRequest, opts ...grpc.CallOption) (*TestAnyResponse, error)
2020-06-03 06:33:51 -07:00
}
type testServiceClient struct {
cc grpc1.ClientConn
}
func NewTestServiceClient(cc grpc1.ClientConn) TestServiceClient {
return &testServiceClient{cc}
}
func (c *testServiceClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) {
out := new(EchoResponse)
2020-07-01 08:26:29 -07:00
err := c.cc.Invoke(ctx, "/testdata.TestService/Echo", in, out, opts...)
2020-06-03 06:33:51 -07:00
if err != nil {
return nil, err
}
return out, nil
}
func (c *testServiceClient) SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) {
out := new(SayHelloResponse)
2020-07-01 08:26:29 -07:00
err := c.cc.Invoke(ctx, "/testdata.TestService/SayHello", in, out, opts...)
2020-06-03 06:33:51 -07:00
if err != nil {
return nil, err
}
return out, nil
}
func (c *testServiceClient) TestAny(ctx context.Context, in *TestAnyRequest, opts ...grpc.CallOption) (*TestAnyResponse, error) {
out := new(TestAnyResponse)
err := c.cc.Invoke(ctx, "/testdata.TestService/TestAny", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
2020-06-03 06:33:51 -07:00
// TestServiceServer is the server API for TestService service.
type TestServiceServer interface {
Echo(context.Context, *EchoRequest) (*EchoResponse, error)
SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error)
TestAny(context.Context, *TestAnyRequest) (*TestAnyResponse, error)
2020-06-03 06:33:51 -07:00
}
// UnimplementedTestServiceServer can be embedded to have forward compatible implementations.
type UnimplementedTestServiceServer struct {
}
func (*UnimplementedTestServiceServer) Echo(ctx context.Context, req *EchoRequest) (*EchoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented")
}
func (*UnimplementedTestServiceServer) SayHello(ctx context.Context, req *SayHelloRequest) (*SayHelloResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented")
}
func (*UnimplementedTestServiceServer) TestAny(ctx context.Context, req *TestAnyRequest) (*TestAnyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method TestAny not implemented")
}
2020-06-03 06:33:51 -07:00
func RegisterTestServiceServer(s grpc1.Server, srv TestServiceServer) {
s.RegisterService(&_TestService_serviceDesc, srv)
}
func _TestService_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EchoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestServiceServer).Echo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
2020-07-01 08:26:29 -07:00
FullMethod: "/testdata.TestService/Echo",
2020-06-03 06:33:51 -07:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestServiceServer).Echo(ctx, req.(*EchoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TestService_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SayHelloRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestServiceServer).SayHello(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
2020-07-01 08:26:29 -07:00
FullMethod: "/testdata.TestService/SayHello",
2020-06-03 06:33:51 -07:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestServiceServer).SayHello(ctx, req.(*SayHelloRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TestService_TestAny_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(TestAnyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestServiceServer).TestAny(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testdata.TestService/TestAny",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestServiceServer).TestAny(ctx, req.(*TestAnyRequest))
}
return interceptor(ctx, in, info, handler)
}
2020-06-03 06:33:51 -07:00
var _TestService_serviceDesc = grpc.ServiceDesc{
2020-07-01 08:26:29 -07:00
ServiceName: "testdata.TestService",
2020-06-03 06:33:51 -07:00
HandlerType: (*TestServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Echo",
Handler: _TestService_Echo_Handler,
},
{
MethodName: "SayHello",
Handler: _TestService_SayHello_Handler,
},
{
MethodName: "TestAny",
Handler: _TestService_TestAny_Handler,
},
2020-06-03 06:33:51 -07:00
},
Streams: []grpc.StreamDesc{},
2020-07-01 08:26:29 -07:00
Metadata: "proto.proto",
}
func (m *Dog) 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 *Dog) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Dog) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Name) > 0 {
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintProto(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0x12
}
if len(m.Size_) > 0 {
i -= len(m.Size_)
copy(dAtA[i:], m.Size_)
i = encodeVarintProto(dAtA, i, uint64(len(m.Size_)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *Cat) 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 *Cat) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Cat) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Lives != 0 {
i = encodeVarintProto(dAtA, i, uint64(m.Lives))
i--
dAtA[i] = 0x10
}
if len(m.Moniker) > 0 {
i -= len(m.Moniker)
copy(dAtA[i:], m.Moniker)
i = encodeVarintProto(dAtA, i, uint64(len(m.Moniker)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *HasAnimal) 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 *HasAnimal) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *HasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.X != 0 {
i = encodeVarintProto(dAtA, i, uint64(m.X))
i--
dAtA[i] = 0x10
}
if m.Animal != nil {
{
size, err := m.Animal.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintProto(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *HasHasAnimal) 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 *HasHasAnimal) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *HasHasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.HasAnimal != nil {
{
size, err := m.HasAnimal.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintProto(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *HasHasHasAnimal) 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 *HasHasHasAnimal) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *HasHasHasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.HasHasAnimal != nil {
{
size, err := m.HasHasAnimal.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintProto(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
2020-06-03 06:33:51 -07:00
func (m *EchoRequest) 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 *EchoRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *EchoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Message) > 0 {
i -= len(m.Message)
copy(dAtA[i:], m.Message)
i = encodeVarintProto(dAtA, i, uint64(len(m.Message)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *EchoResponse) 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 *EchoResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *EchoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Message) > 0 {
i -= len(m.Message)
copy(dAtA[i:], m.Message)
i = encodeVarintProto(dAtA, i, uint64(len(m.Message)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *SayHelloRequest) 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 *SayHelloRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *SayHelloRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Name) > 0 {
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintProto(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *SayHelloResponse) 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 *SayHelloResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *SayHelloResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Greeting) > 0 {
i -= len(m.Greeting)
copy(dAtA[i:], m.Greeting)
i = encodeVarintProto(dAtA, i, uint64(len(m.Greeting)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *TestAnyRequest) 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 *TestAnyRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TestAnyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.AnyAnimal != nil {
{
size, err := m.AnyAnimal.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintProto(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *TestAnyResponse) 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 *TestAnyResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TestAnyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.HasAnimal != nil {
{
size, err := m.HasAnimal.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintProto(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
Add support for protobuf TxGenerator and SIGN_MODE_DIRECT (#6385) * Add TxWrapper, encoder, decoder and DirectModeHandler * fix pkg name * Update API and leave test TODO's * Update TxWrapper API * tests for tx wrapper (#6410) * WIP: added test for direct mode handler * updated code * Add msg * Update TxWrapper API * Fix pubkey declaration * Add pubkey for tests * Fix SetFee * Remove logs * Avoid global var declaration for tests * Add test for GetPubKeys * Fix direct signing tests * Add more test cases for GetSignBytes * Revert SetFee API * Remove logs * Refactor tests Co-authored-by: anilCSE <anil@vitwit.com> Co-authored-by: sahith-narahari <sahithnarahari@gmail.com> * Refactoring * Refactoring * Integrate SignatureV2 API * Fix wrapper tests * Fix tests * Linting and API tweaks * Update API * WIP on updating API * Fix tests * Update to new SigVerifiableTx * Rename * Update docs to reflect ADR 020 * proto-gen * proto docs * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * Add tests * Refactor and improving test coverage * WIP on test coverage * WIP on test coverage * proto-gen * Fix CompactBitArray.Size() bug * Rename * Remove Builder interface * Address review comments * Update x/auth/tx/sigs.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/auth/tx/encoder.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/auth/tx/encoder.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Address review feedback * Fix build issues * Resolve conflicts * Fix ValidateBasic test coverage * Add test for malicious multisig Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com> Co-authored-by: anilCSE <anil@vitwit.com> Co-authored-by: sahith-narahari <sahithnarahari@gmail.com> Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-06 10:03:45 -07:00
func (m *TestMsg) 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 *TestMsg) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TestMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Signers) > 0 {
for iNdEx := len(m.Signers) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Signers[iNdEx])
copy(dAtA[i:], m.Signers[iNdEx])
i = encodeVarintProto(dAtA, i, uint64(len(m.Signers[iNdEx])))
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func (m *BadMultiSignature) 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 *BadMultiSignature) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *BadMultiSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.MaliciousField) > 0 {
i -= len(m.MaliciousField)
copy(dAtA[i:], m.MaliciousField)
i = encodeVarintProto(dAtA, i, uint64(len(m.MaliciousField)))
i--
dAtA[i] = 0x2a
}
if len(m.Signatures) > 0 {
for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Signatures[iNdEx])
copy(dAtA[i:], m.Signatures[iNdEx])
i = encodeVarintProto(dAtA, i, uint64(len(m.Signatures[iNdEx])))
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func encodeVarintProto(dAtA []byte, offset int, v uint64) int {
offset -= sovProto(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *Dog) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Size_)
if l > 0 {
n += 1 + l + sovProto(uint64(l))
}
l = len(m.Name)
if l > 0 {
n += 1 + l + sovProto(uint64(l))
}
return n
}
func (m *Cat) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Moniker)
if l > 0 {
n += 1 + l + sovProto(uint64(l))
}
if m.Lives != 0 {
n += 1 + sovProto(uint64(m.Lives))
}
return n
}
func (m *HasAnimal) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Animal != nil {
l = m.Animal.Size()
n += 1 + l + sovProto(uint64(l))
}
if m.X != 0 {
n += 1 + sovProto(uint64(m.X))
}
return n
}
func (m *HasHasAnimal) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.HasAnimal != nil {
l = m.HasAnimal.Size()
n += 1 + l + sovProto(uint64(l))
}
2020-06-03 06:33:51 -07:00
return n
}
func (m *HasHasHasAnimal) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.HasHasAnimal != nil {
l = m.HasHasAnimal.Size()
n += 1 + l + sovProto(uint64(l))
}
return n
}
func (m *EchoRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Message)
if l > 0 {
n += 1 + l + sovProto(uint64(l))
}
return n
}
func (m *EchoResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Message)
if l > 0 {
n += 1 + l + sovProto(uint64(l))
}
return n
}
func (m *SayHelloRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Name)
if l > 0 {
n += 1 + l + sovProto(uint64(l))
}
return n
}
func (m *SayHelloResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Greeting)
if l > 0 {
n += 1 + l + sovProto(uint64(l))
}
return n
}
func (m *TestAnyRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.AnyAnimal != nil {
l = m.AnyAnimal.Size()
n += 1 + l + sovProto(uint64(l))
}
return n
}
func (m *TestAnyResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.HasAnimal != nil {
l = m.HasAnimal.Size()
n += 1 + l + sovProto(uint64(l))
}
return n
}
Add support for protobuf TxGenerator and SIGN_MODE_DIRECT (#6385) * Add TxWrapper, encoder, decoder and DirectModeHandler * fix pkg name * Update API and leave test TODO's * Update TxWrapper API * tests for tx wrapper (#6410) * WIP: added test for direct mode handler * updated code * Add msg * Update TxWrapper API * Fix pubkey declaration * Add pubkey for tests * Fix SetFee * Remove logs * Avoid global var declaration for tests * Add test for GetPubKeys * Fix direct signing tests * Add more test cases for GetSignBytes * Revert SetFee API * Remove logs * Refactor tests Co-authored-by: anilCSE <anil@vitwit.com> Co-authored-by: sahith-narahari <sahithnarahari@gmail.com> * Refactoring * Refactoring * Integrate SignatureV2 API * Fix wrapper tests * Fix tests * Linting and API tweaks * Update API * WIP on updating API * Fix tests * Update to new SigVerifiableTx * Rename * Update docs to reflect ADR 020 * proto-gen * proto docs * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * Add tests * Refactor and improving test coverage * WIP on test coverage * WIP on test coverage * proto-gen * Fix CompactBitArray.Size() bug * Rename * Remove Builder interface * Address review comments * Update x/auth/tx/sigs.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/auth/tx/encoder.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/auth/tx/encoder.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Address review feedback * Fix build issues * Resolve conflicts * Fix ValidateBasic test coverage * Add test for malicious multisig Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com> Co-authored-by: anilCSE <anil@vitwit.com> Co-authored-by: sahith-narahari <sahithnarahari@gmail.com> Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-06 10:03:45 -07:00
func (m *TestMsg) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Signers) > 0 {
for _, b := range m.Signers {
l = len(b)
n += 1 + l + sovProto(uint64(l))
}
}
return n
}
func (m *BadMultiSignature) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Signatures) > 0 {
for _, b := range m.Signatures {
l = len(b)
n += 1 + l + sovProto(uint64(l))
}
}
l = len(m.MaliciousField)
if l > 0 {
n += 1 + l + sovProto(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
2020-06-03 06:33:51 -07:00
func sovProto(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozProto(x uint64) (n int) {
return sovProto(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Dog) 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 ErrIntOverflowProto
}
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: Dog: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Dog: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
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 ErrInvalidLengthProto
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Size_ = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
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 ErrInvalidLengthProto
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipProto(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *Cat) 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 ErrIntOverflowProto
}
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: Cat: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Cat: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
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 ErrInvalidLengthProto
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Moniker = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Lives", wireType)
}
m.Lives = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Lives |= int32(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipProto(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *HasAnimal) 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 ErrIntOverflowProto
}
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: HasAnimal: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: HasAnimal: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Animal", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthProto
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Animal == nil {
m.Animal = &types.Any{}
}
if err := m.Animal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field X", wireType)
}
m.X = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.X |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipProto(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
2020-06-03 06:33:51 -07:00
if iNdEx > l {
return io.ErrUnexpectedEOF
}
2020-06-03 06:33:51 -07:00
return nil
}
2020-06-03 06:33:51 -07:00
func (m *HasHasAnimal) 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 ErrIntOverflowProto
}
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 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: HasHasAnimal: wiretype end group for non-group")
}
if fieldNum <= 0 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: HasHasAnimal: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: wrong wireType = %d for field HasAnimal", wireType)
}
2020-06-03 06:33:51 -07:00
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
2020-06-03 06:33:51 -07:00
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
2020-06-03 06:33:51 -07:00
if msglen < 0 {
return ErrInvalidLengthProto
}
2020-06-03 06:33:51 -07:00
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
2020-06-03 06:33:51 -07:00
if m.HasAnimal == nil {
m.HasAnimal = &types.Any{}
}
if err := m.HasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
2020-06-03 06:33:51 -07:00
default:
iNdEx = preIndex
skippy, err := skipProto(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *HasHasHasAnimal) 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 ErrIntOverflowProto
}
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: HasHasHasAnimal: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: HasHasHasAnimal: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: wrong wireType = %d for field HasHasAnimal", wireType)
}
2020-06-03 06:33:51 -07:00
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
2020-06-03 06:33:51 -07:00
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
2020-06-03 06:33:51 -07:00
if msglen < 0 {
return ErrInvalidLengthProto
}
2020-06-03 06:33:51 -07:00
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
2020-06-03 06:33:51 -07:00
if m.HasHasAnimal == nil {
m.HasHasAnimal = &types.Any{}
}
if err := m.HasHasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipProto(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
2020-06-03 06:33:51 -07:00
func (m *EchoRequest) 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 ErrIntOverflowProto
}
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 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: EchoRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: EchoRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
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 ErrInvalidLengthProto
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
2020-06-03 06:33:51 -07:00
m.Message = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipProto(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
2020-06-03 06:33:51 -07:00
func (m *EchoResponse) 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 ErrIntOverflowProto
}
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 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: EchoResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: EchoResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType)
}
2020-06-03 06:33:51 -07:00
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
2020-06-03 06:33:51 -07:00
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
2020-06-03 06:33:51 -07:00
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthProto
}
2020-06-03 06:33:51 -07:00
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
2020-06-03 06:33:51 -07:00
m.Message = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipProto(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
2020-06-03 06:33:51 -07:00
func (m *SayHelloRequest) 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 ErrIntOverflowProto
}
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 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: SayHelloRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: SayHelloRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
}
2020-06-03 06:33:51 -07:00
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
2020-06-03 06:33:51 -07:00
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
2020-06-03 06:33:51 -07:00
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthProto
}
2020-06-03 06:33:51 -07:00
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
2020-06-03 06:33:51 -07:00
m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipProto(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
2020-06-03 06:33:51 -07:00
func (m *SayHelloResponse) 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 ErrIntOverflowProto
}
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 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: SayHelloResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: SayHelloResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
2020-06-03 06:33:51 -07:00
return fmt.Errorf("proto: wrong wireType = %d for field Greeting", wireType)
}
2020-06-03 06:33:51 -07:00
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
2020-06-03 06:33:51 -07:00
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
2020-06-03 06:33:51 -07:00
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthProto
}
2020-06-03 06:33:51 -07:00
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
2020-06-03 06:33:51 -07:00
m.Greeting = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipProto(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *TestAnyRequest) 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 ErrIntOverflowProto
}
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: TestAnyRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: TestAnyRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field AnyAnimal", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthProto
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.AnyAnimal == nil {
m.AnyAnimal = &types.Any{}
}
if err := m.AnyAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipProto(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *TestAnyResponse) 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 ErrIntOverflowProto
}
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: TestAnyResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: TestAnyResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field HasAnimal", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthProto
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.HasAnimal == nil {
m.HasAnimal = &HasAnimal{}
}
if err := m.HasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipProto(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
Add support for protobuf TxGenerator and SIGN_MODE_DIRECT (#6385) * Add TxWrapper, encoder, decoder and DirectModeHandler * fix pkg name * Update API and leave test TODO's * Update TxWrapper API * tests for tx wrapper (#6410) * WIP: added test for direct mode handler * updated code * Add msg * Update TxWrapper API * Fix pubkey declaration * Add pubkey for tests * Fix SetFee * Remove logs * Avoid global var declaration for tests * Add test for GetPubKeys * Fix direct signing tests * Add more test cases for GetSignBytes * Revert SetFee API * Remove logs * Refactor tests Co-authored-by: anilCSE <anil@vitwit.com> Co-authored-by: sahith-narahari <sahithnarahari@gmail.com> * Refactoring * Refactoring * Integrate SignatureV2 API * Fix wrapper tests * Fix tests * Linting and API tweaks * Update API * WIP on updating API * Fix tests * Update to new SigVerifiableTx * Rename * Update docs to reflect ADR 020 * proto-gen * proto docs * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * Add tests * Refactor and improving test coverage * WIP on test coverage * WIP on test coverage * proto-gen * Fix CompactBitArray.Size() bug * Rename * Remove Builder interface * Address review comments * Update x/auth/tx/sigs.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/auth/tx/encoder.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/auth/tx/encoder.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Address review feedback * Fix build issues * Resolve conflicts * Fix ValidateBasic test coverage * Add test for malicious multisig Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com> Co-authored-by: anilCSE <anil@vitwit.com> Co-authored-by: sahith-narahari <sahithnarahari@gmail.com> Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-07-06 10:03:45 -07:00
func (m *TestMsg) 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 ErrIntOverflowProto
}
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: TestMsg: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: TestMsg: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Signers", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthProto
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Signers = append(m.Signers, make([]byte, postIndex-iNdEx))
copy(m.Signers[len(m.Signers)-1], dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipProto(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *BadMultiSignature) 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 ErrIntOverflowProto
}
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: BadMultiSignature: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: BadMultiSignature: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthProto
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Signatures = append(m.Signatures, make([]byte, postIndex-iNdEx))
copy(m.Signatures[len(m.Signatures)-1], dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field MaliciousField", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowProto
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthProto
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthProto
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.MaliciousField = append(m.MaliciousField[:0], dAtA[iNdEx:postIndex]...)
if m.MaliciousField == nil {
m.MaliciousField = []byte{}
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipProto(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthProto
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipProto(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, ErrIntOverflowProto
}
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, ErrIntOverflowProto
}
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, ErrIntOverflowProto
}
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, ErrInvalidLengthProto
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupProto
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthProto
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthProto = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowProto = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupProto = fmt.Errorf("proto: unexpected end of group")
)