From 116d9c599bc71817405e16de04bdb08e3130aadd Mon Sep 17 00:00:00 2001 From: HuangYi Date: Wed, 10 Apr 2024 11:17:05 +0800 Subject: [PATCH 1/2] Problem: x/tx not up to date to the released version Solution: - reset to the x/tx/0.13.1 --- x/tx/CHANGELOG.md | 57 + x/tx/decode/adr027.go | 8 + x/tx/decode/decode.go | 32 +- x/tx/decode/decode_test.go | 33 +- x/tx/decode/fuzz_test.go | 140 + x/tx/decode/unknown.go | 9 + x/tx/go.mod | 33 +- x/tx/go.sum | 60 +- x/tx/internal/testpb/signers.proto | 35 + x/tx/internal/testpb/signers.pulsar.go | 4240 +++++++++++++++-- x/tx/signing/aminojson/aminojson.go | 6 +- x/tx/signing/aminojson/any.go | 22 +- x/tx/signing/aminojson/bench_test.go | 2 + x/tx/signing/aminojson/encoder.go | 13 +- x/tx/signing/aminojson/fuzz_test.go | 75 + .../internal/aminojsonpb/aminojson.proto | 5 +- .../internal/aminojsonpb/aminojson.pulsar.go | 187 +- x/tx/signing/aminojson/internal/buf.lock | 4 +- .../aminojson/internal/testpb/test.proto | 5 + .../aminojson/internal/testpb/test.pulsar.go | 656 ++- x/tx/signing/aminojson/json_marshal.go | 178 +- x/tx/signing/aminojson/json_marshal_test.go | 159 +- x/tx/signing/aminojson/options.go | 33 +- x/tx/signing/aminojson/options_test.go | 30 + x/tx/signing/aminojson/time.go | 16 +- x/tx/signing/context.go | 146 +- x/tx/signing/context_test.go | 76 +- x/tx/signing/direct/direct.go | 9 +- x/tx/signing/directaux/direct_aux.go | 10 +- x/tx/signing/directaux/direct_aux_test.go | 4 - x/tx/signing/testutil/util.go | 8 +- x/tx/signing/textual/any.go | 5 +- x/tx/signing/textual/coin_test.go | 3 +- x/tx/signing/textual/coins.go | 100 +- x/tx/signing/textual/coins_test.go | 67 +- x/tx/signing/textual/dec_test.go | 1 + x/tx/signing/textual/e2e_test.go | 4 + x/tx/signing/textual/fuzz_test.go | 198 + x/tx/signing/textual/handler.go | 5 +- x/tx/signing/textual/int_test.go | 1 + .../textual/internal/testdata/coin.json | 7 +- .../textual/internal/testdata/e2e.json | 13 +- .../signing/textual/internal/testdata/tx.json | 11 +- .../textual/internal/textualpb/textual.proto | 2 - .../FuzzCoinsJSONTestcases/4d81af7cc74558bf | 2 + x/tx/signing/textual/timestamp_test.go | 1 + x/tx/signing/textual/tx.go | 16 +- x/tx/signing/textual/tx_test.go | 1 + 48 files changed, 5953 insertions(+), 775 deletions(-) create mode 100644 x/tx/decode/fuzz_test.go create mode 100644 x/tx/signing/aminojson/fuzz_test.go create mode 100644 x/tx/signing/aminojson/options_test.go create mode 100644 x/tx/signing/textual/testdata/fuzz/FuzzCoinsJSONTestcases/4d81af7cc74558bf diff --git a/x/tx/CHANGELOG.md b/x/tx/CHANGELOG.md index 742122009eb3..4d475d2c64d0 100644 --- a/x/tx/CHANGELOG.md +++ b/x/tx/CHANGELOG.md @@ -31,6 +31,63 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## v0.13.1 + +### Features + +* [#19618](https://github.com/cosmos/cosmos-sdk/pull/19618) Add enum as string option to encoder. + +### Improvements + +* [#18857](https://github.com/cosmos/cosmos-sdk/pull/18857) Moved `FormatCoins` from `core/coins` to this package under `signing/textual`. + +### Bug Fixes + +* [#19265](https://github.com/cosmos/cosmos-sdk/pull/19265) Reject denoms that contain a comma. + +## v0.13.0 + +### Improvements + +* [#18740](https://github.com/cosmos/cosmos-sdk/pull/18740) Support nested messages when fetching signers up to a default depth of 32. + +## v0.12.0 + +### Improvements + +* [#18309](https://github.com/cosmos/cosmos-sdk/pull/18309) Update encoder so that amino types default to msg type url. + +## v0.11.0 + +### Improvements + +* [#17787](https://github.com/cosmos/cosmos-sdk/pull/17787) Drop tip support. + +## v0.10.0 + +### Features + +* [#17681](https://github.com/cosmos/cosmos-sdk/pull/17681) Add encoder `DefineTypeEncoding` method for defining custom type encodings. +* [#17600](https://github.com/cosmos/cosmos-sdk/pull/17600) Add encoder `DefineScalarEncoding` method for defining custom scalar encodings. +* [#17600](https://github.com/cosmos/cosmos-sdk/pull/17600) Add indent option to encoder. + +## v0.9.1 + +### Improvements + +* [#16936](https://github.com/cosmos/cosmos-sdk/pull/16936) Remove extra whitespace when marshalling module accounts. + +## v0.9.0 + +### Bug Fixes + +* [#16681](https://github.com/cosmos/cosmos-sdk/pull/16681): Catch and fix `(*Decoder).Decode` crash from invalid length prefix in Tx bytes. + +### Improvements + +* [#16846](https://github.com/cosmos/cosmos-sdk/pull/16846): Harmonize interface `signing.TypeResolver` with the rest of the codebase (orm and client/v2). +* [#16684](https://github.com/cosmos/cosmos-sdk/pull/16684): Use `io.WriteString`+`fmt.Fprintf` to remove unnecessary `string`->`[]byte` roundtrip. + ## v0.8.0 ### Improvements diff --git a/x/tx/decode/adr027.go b/x/tx/decode/adr027.go index 0588acbaa9fd..f6d46c223be7 100644 --- a/x/tx/decode/adr027.go +++ b/x/tx/decode/adr027.go @@ -24,6 +24,14 @@ func rejectNonADR027TxRaw(txBytes []byte) error { if m < 0 { return fmt.Errorf("invalid length; %w", protowire.ParseError(m)) } + + // Paranoia from possible varint decoding which can trivially + // be wrong due to the precarious nature of the format being tricked: + // https://cyber.orijtech.com/advisory/varint-decode-limitless + if m > len(txBytes) { + return fmt.Errorf("invalid length from decoding (%d) > len(txBytes) (%d)", m, len(txBytes)) + } + // TxRaw only has bytes fields. if wireType != protowire.BytesType { return fmt.Errorf("expected %d wire type, got %d", protowire.BytesType, wireType) diff --git a/x/tx/decode/decode.go b/x/tx/decode/decode.go index ba1414ece7f4..4dafe9549af4 100644 --- a/x/tx/decode/decode.go +++ b/x/tx/decode/decode.go @@ -1,13 +1,13 @@ package decode import ( - "fmt" + "errors" "github.com/cosmos/cosmos-proto/anyutil" "google.golang.org/protobuf/proto" v1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" - "cosmossdk.io/errors" + errorsmod "cosmossdk.io/errors" "cosmossdk.io/x/tx/signing" ) @@ -33,7 +33,7 @@ type Options struct { // NewDecoder creates a new Decoder for decoding transactions. func NewDecoder(options Options) (*Decoder, error) { if options.SigningContext == nil { - return nil, fmt.Errorf("signing context is required") + return nil, errors.New("signing context is required") } return &Decoder{ @@ -46,7 +46,7 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) { // Make sure txBytes follow ADR-027. err := rejectNonADR027TxRaw(txBytes) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } var raw v1beta1.TxRaw @@ -55,7 +55,7 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) { fileResolver := d.signingCtx.FileResolver() err = RejectUnknownFieldsStrict(txBytes, raw.ProtoReflect().Descriptor(), fileResolver) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } err = proto.Unmarshal(txBytes, &raw) @@ -68,12 +68,12 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) { // allow non-critical unknown fields in TxBody txBodyHasUnknownNonCriticals, err := RejectUnknownFields(raw.BodyBytes, body.ProtoReflect().Descriptor(), true, fileResolver) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } err = proto.Unmarshal(raw.BodyBytes, &body) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } var authInfo v1beta1.AuthInfo @@ -81,12 +81,12 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) { // reject all unknown proto fields in AuthInfo err = RejectUnknownFieldsStrict(raw.AuthInfoBytes, authInfo.ProtoReflect().Descriptor(), fileResolver) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } err = proto.Unmarshal(raw.AuthInfoBytes, &authInfo) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } theTx := &v1beta1.Tx{ @@ -97,17 +97,25 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) { var signers [][]byte var msgs []proto.Message + seenSigners := map[string]struct{}{} for _, anyMsg := range body.Messages { msg, signerErr := anyutil.Unpack(anyMsg, fileResolver, d.signingCtx.TypeResolver()) if signerErr != nil { - return nil, errors.Wrap(ErrTxDecode, signerErr.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, signerErr.Error()) } msgs = append(msgs, msg) ss, signerErr := d.signingCtx.GetSigners(msg) if signerErr != nil { - return nil, errors.Wrap(ErrTxDecode, signerErr.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, signerErr.Error()) + } + for _, s := range ss { + _, seen := seenSigners[string(s)] + if seen { + continue + } + signers = append(signers, s) + seenSigners[string(s)] = struct{}{} } - signers = append(signers, ss...) } return &DecodedTx{ diff --git a/x/tx/decode/decode_test.go b/x/tx/decode/decode_test.go index c4bb10ffeed4..a54702cbe9df 100644 --- a/x/tx/decode/decode_test.go +++ b/x/tx/decode/decode_test.go @@ -3,6 +3,7 @@ package decode_test import ( "encoding/hex" "fmt" + "strings" "testing" "github.com/cosmos/cosmos-proto/anyutil" @@ -85,10 +86,6 @@ func TestDecode(t *testing.T) { Payer: "payer", Granter: "", }, - Tip: &txv1beta1.Tip{ //nolint:staticcheck // we still need this deprecated struct - Amount: []*basev1beta1.Coin{{Amount: "100", Denom: "denom"}}, - Tipper: "tipper", - }, }, Signatures: nil, } @@ -118,3 +115,31 @@ func (d dummyAddressCodec) StringToBytes(text string) ([]byte, error) { func (d dummyAddressCodec) BytesToString(bz []byte) (string, error) { return hex.EncodeToString(bz), nil } + +func TestDecodeTxBodyPanic(t *testing.T) { + crashVector := []byte{ + 0x0a, 0x0a, 0x09, 0xe7, 0xbf, 0xba, 0xe6, 0x82, 0x9a, 0xe6, 0xaa, 0x30, + } + + cdc := new(dummyAddressCodec) + signingCtx, err := signing.NewContext(signing.Options{ + AddressCodec: cdc, + ValidatorAddressCodec: cdc, + }) + if err != nil { + t.Fatal(err) + } + dec, err := decode.NewDecoder(decode.Options{ + SigningContext: signingCtx, + }) + if err != nil { + t.Fatal(err) + } + _, err = dec.Decode(crashVector) + if err == nil { + t.Fatal("expected a non-nil error") + } + if g, w := err.Error(), "could not consume length prefix"; !strings.Contains(g, w) { + t.Fatalf("error mismatch\n%s\nodes not contain\n\t%q", g, w) + } +} diff --git a/x/tx/decode/fuzz_test.go b/x/tx/decode/fuzz_test.go new file mode 100644 index 000000000000..38262a20070f --- /dev/null +++ b/x/tx/decode/fuzz_test.go @@ -0,0 +1,140 @@ +package decode + +import ( + "encoding/hex" + "testing" + + "github.com/cosmos/cosmos-proto/anyutil" + fuzz "github.com/google/gofuzz" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" + + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + "cosmossdk.io/api/cosmos/crypto/secp256k1" + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" + "cosmossdk.io/x/tx/signing" +) + +var ( + accSeq = uint64(2) + + signerInfo = []*txv1beta1.SignerInfo{ + { + PublicKey: pkAny, + ModeInfo: &txv1beta1.ModeInfo{ + Sum: &txv1beta1.ModeInfo_Single_{ + Single: &txv1beta1.ModeInfo_Single{ + Mode: signingv1beta1.SignMode_SIGN_MODE_DIRECT, + }, + }, + }, + Sequence: accSeq, + }, + } + + anyMsg, _ = anyutil.New(&bankv1beta1.MsgSend{}) + + pkAny, _ = anyutil.New(&secp256k1.PubKey{Key: []byte("foo")}) +) + +func generateAndAddSeedsFromTx(f *testing.F) { + f.Helper() + // 1. Add some seeds. + tx := &txv1beta1.Tx{ + Body: &txv1beta1.TxBody{ + Messages: []*anypb.Any{anyMsg}, + Memo: "memo", + TimeoutHeight: 0, + }, + AuthInfo: &txv1beta1.AuthInfo{ + SignerInfos: signerInfo, + Fee: &txv1beta1.Fee{ + Amount: []*basev1beta1.Coin{{Amount: "100", Denom: "denom"}}, + GasLimit: 100, + Payer: "payer", + Granter: "", + }, + }, + Signatures: nil, + } + f.Add(mustMarshal(f, tx)) + fz := fuzz.New() + // 1.1. Mutate tx as much and add those as seeds. + for i := 0; i < 1e4; i++ { + func() { + defer func() { + _ = recover() // Catch any panics and continue + }() + fz.Fuzz(tx) + f.Add(mustMarshal(f, tx)) + }() + } +} + +func FuzzInternal_rejectNonADR027TxRaw(f *testing.F) { + if testing.Short() { + f.Skip("Skipping in -short mode") + } + + // 1. Add some seeds. + generateAndAddSeedsFromTx(f) + + // 2. Now run the fuzzer. + f.Fuzz(func(t *testing.T, in []byte) { + // Just ensure it doesn't crash. + _ = rejectNonADR027TxRaw(in) + }) +} + +func FuzzDecode(f *testing.F) { + if testing.Short() { + f.Skip("Skipping in -short mode") + } + + // 1. Add some seeds. + generateAndAddSeedsFromTx(f) + + // 2. Now fuzz it. + cdc := new(asHexCodec) + signingCtx, err := signing.NewContext(signing.Options{ + AddressCodec: cdc, + ValidatorAddressCodec: cdc, + }) + if err != nil { + return + } + dec, err := NewDecoder(Options{ + SigningContext: signingCtx, + }) + if err != nil { + return + } + + f.Fuzz(func(t *testing.T, in []byte) { + txr, err := dec.Decode(in) + if err == nil && txr == nil { + t.Fatal("inconsistency: err==nil yet tx==nil") + } + }) +} + +func mustMarshal(f *testing.F, m proto.Message) []byte { + f.Helper() + blob, err := proto.Marshal(m) + if err != nil { + f.Fatal(err) + } + return blob +} + +type asHexCodec int + +func (d asHexCodec) StringToBytes(text string) ([]byte, error) { + return hex.DecodeString(text) +} + +func (d asHexCodec) BytesToString(bz []byte) (string, error) { + return hex.EncodeToString(bz), nil +} diff --git a/x/tx/decode/unknown.go b/x/tx/decode/unknown.go index ed6c56400b9a..fed2c1be8ff8 100644 --- a/x/tx/decode/unknown.go +++ b/x/tx/decode/unknown.go @@ -85,6 +85,15 @@ func RejectUnknownFields(bz []byte, desc protoreflect.MessageDescriptor, allowUn // consume length prefix of nested message _, o := protowire.ConsumeVarint(fieldBytes) + if o < 0 { + err = fmt.Errorf("could not consume length prefix fieldBytes for nested message: %v: %w", + fieldMessage, protowire.ParseError(o)) + return hasUnknownNonCriticals, err + } else if o > len(fieldBytes) { + err = fmt.Errorf("length prefix > len(fieldBytes) for nested message: %v", fieldMessage) + return hasUnknownNonCriticals, err + } + fieldBytes = fieldBytes[o:] var err error diff --git a/x/tx/go.mod b/x/tx/go.mod index 10d989a41b68..b6841dc64c4c 100644 --- a/x/tx/go.mod +++ b/x/tx/go.mod @@ -3,33 +3,38 @@ module cosmossdk.io/x/tx go 1.21 require ( - cosmossdk.io/api v0.7.2 + cosmossdk.io/api v0.7.3 cosmossdk.io/core v0.11.0 - cosmossdk.io/errors v1.0.0-beta.7 + cosmossdk.io/errors v1.0.1 cosmossdk.io/math v1.3.0 github.com/cosmos/cosmos-proto v1.0.0-beta.4 + github.com/cosmos/gogoproto v1.4.11 github.com/google/go-cmp v0.6.0 - github.com/iancoleman/strcase v0.2.0 + github.com/google/gofuzz v1.2.0 + github.com/iancoleman/strcase v0.3.0 github.com/pkg/errors v0.9.1 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 github.com/tendermint/go-amino v0.16.0 - google.golang.org/protobuf v1.33.0 + google.golang.org/protobuf v1.32.0 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 ) require ( - github.com/cosmos/gogoproto v1.4.11 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/golang/protobuf v1.5.4 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect - google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c // indirect - google.golang.org/grpc v1.58.3 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/sys v0.17.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/grpc v1.62.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +// NOTE: we do not want to replace to the development version of cosmossdk.io/api yet +// Until https://github.com/cosmos/cosmos-sdk/issues/19228 is resolved +// We are tagging x/tx from main and must keep using released versions of x/tx dependencies diff --git a/x/tx/go.sum b/x/tx/go.sum index b8d889462d5b..68c6a1e7ee63 100644 --- a/x/tx/go.sum +++ b/x/tx/go.sum @@ -1,9 +1,9 @@ -cosmossdk.io/api v0.7.2 h1:BO3i5fvKMKvfaUiMkCznxViuBEfyWA/k6w2eAF6q1C4= -cosmossdk.io/api v0.7.2/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= +cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= -cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= @@ -14,14 +14,17 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -34,32 +37,35 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 h1:SeZZZx0cP0fqUyA+oRzP9k7cSwJlvDFiROO72uwD6i0= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqvce95G3hIDCT5FeO3YUc6Q4Oe24L/+rNMxRk= -google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 h1:U7+wNaVuSTaUqNvK2+osJ9ejEZxbjHHk8F2b6Hpx0AE= -google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:RdyHbowztCGQySiCvQPgWQWgWhGnouTdCflKoDBt32U= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c h1:jHkCUWkseRf+W+edG5hMzr/Uh1xkDREY4caybAq4dpY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= -google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= -google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= +google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= +google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= +google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/x/tx/internal/testpb/signers.proto b/x/tx/internal/testpb/signers.proto index 3104bf5d19fe..63eb38cba43b 100644 --- a/x/tx/internal/testpb/signers.proto +++ b/x/tx/internal/testpb/signers.proto @@ -55,6 +55,41 @@ message RepeatedNestedRepeatedSigner { } } +message DeeplyNestedSigner { + option (cosmos.msg.v1.signer) = "inner_one"; + InnerOne inner_one = 1; + + message InnerOne { + option (cosmos.msg.v1.signer) = "inner_two"; + InnerTwo inner_two = 1; + + message InnerTwo { + option (cosmos.msg.v1.signer) = "signer"; + string signer = 1; + } + } +} + +message DeeplyNestedRepeatedSigner { + option (cosmos.msg.v1.signer) = "inner"; + repeated Inner inner = 1; + + message Inner { + option (cosmos.msg.v1.signer) = "inner"; + repeated Inner inner = 1; + + message Inner { + option (cosmos.msg.v1.signer) = "inner"; + repeated Bottom inner = 1; + + message Bottom { + option (cosmos.msg.v1.signer) = "signer"; + repeated string signer = 1; + } + } + } +} + message BadSigner { option (cosmos.msg.v1.signer) = "signer"; bytes signer = 1; diff --git a/x/tx/internal/testpb/signers.pulsar.go b/x/tx/internal/testpb/signers.pulsar.go index 51c8cf163e39..f6e3a3d081c1 100644 --- a/x/tx/internal/testpb/signers.pulsar.go +++ b/x/tx/internal/testpb/signers.pulsar.go @@ -1369,7 +1369,7 @@ func (x *NestedSigner_Inner) ProtoReflect() protoreflect.Message { } func (x *NestedSigner_Inner) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[9] + mi := &file_signers_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2283,7 +2283,7 @@ func (x *RepeatedNestedSigner_Inner) ProtoReflect() protoreflect.Message { } func (x *RepeatedNestedSigner_Inner) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[10] + mi := &file_signers_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3184,7 +3184,7 @@ func (x *NestedRepeatedSigner_Inner) ProtoReflect() protoreflect.Message { } func (x *NestedRepeatedSigner_Inner) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[11] + mi := &file_signers_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4158,7 +4158,7 @@ func (x *RepeatedNestedRepeatedSigner_Inner) ProtoReflect() protoreflect.Message } func (x *RepeatedNestedRepeatedSigner_Inner) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[12] + mi := &file_signers_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4573,25 +4573,25 @@ func (x *fastReflection_RepeatedNestedRepeatedSigner_Inner) ProtoMethods() *prot } var ( - md_BadSigner protoreflect.MessageDescriptor - fd_BadSigner_signer protoreflect.FieldDescriptor + md_DeeplyNestedSigner protoreflect.MessageDescriptor + fd_DeeplyNestedSigner_inner_one protoreflect.FieldDescriptor ) func init() { file_signers_proto_init() - md_BadSigner = File_signers_proto.Messages().ByName("BadSigner") - fd_BadSigner_signer = md_BadSigner.Fields().ByName("signer") + md_DeeplyNestedSigner = File_signers_proto.Messages().ByName("DeeplyNestedSigner") + fd_DeeplyNestedSigner_inner_one = md_DeeplyNestedSigner.Fields().ByName("inner_one") } -var _ protoreflect.Message = (*fastReflection_BadSigner)(nil) +var _ protoreflect.Message = (*fastReflection_DeeplyNestedSigner)(nil) -type fastReflection_BadSigner BadSigner +type fastReflection_DeeplyNestedSigner DeeplyNestedSigner -func (x *BadSigner) ProtoReflect() protoreflect.Message { - return (*fastReflection_BadSigner)(x) +func (x *DeeplyNestedSigner) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner)(x) } -func (x *BadSigner) slowProtoReflect() protoreflect.Message { +func (x *DeeplyNestedSigner) slowProtoReflect() protoreflect.Message { mi := &file_signers_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4603,43 +4603,43 @@ func (x *BadSigner) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_BadSigner_messageType fastReflection_BadSigner_messageType -var _ protoreflect.MessageType = fastReflection_BadSigner_messageType{} +var _fastReflection_DeeplyNestedSigner_messageType fastReflection_DeeplyNestedSigner_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedSigner_messageType{} -type fastReflection_BadSigner_messageType struct{} +type fastReflection_DeeplyNestedSigner_messageType struct{} -func (x fastReflection_BadSigner_messageType) Zero() protoreflect.Message { - return (*fastReflection_BadSigner)(nil) +func (x fastReflection_DeeplyNestedSigner_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner)(nil) } -func (x fastReflection_BadSigner_messageType) New() protoreflect.Message { - return new(fastReflection_BadSigner) +func (x fastReflection_DeeplyNestedSigner_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner) } -func (x fastReflection_BadSigner_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_BadSigner +func (x fastReflection_DeeplyNestedSigner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_BadSigner) Descriptor() protoreflect.MessageDescriptor { - return md_BadSigner +func (x *fastReflection_DeeplyNestedSigner) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_BadSigner) Type() protoreflect.MessageType { - return _fastReflection_BadSigner_messageType +func (x *fastReflection_DeeplyNestedSigner) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedSigner_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_BadSigner) New() protoreflect.Message { - return new(fastReflection_BadSigner) +func (x *fastReflection_DeeplyNestedSigner) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_BadSigner) Interface() protoreflect.ProtoMessage { - return (*BadSigner)(x) +func (x *fastReflection_DeeplyNestedSigner) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedSigner)(x) } // Range iterates over every populated field in an undefined order, @@ -4647,10 +4647,10 @@ func (x *fastReflection_BadSigner) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_BadSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Signer) != 0 { - value := protoreflect.ValueOfBytes(x.Signer) - if !f(fd_BadSigner_signer, value) { +func (x *fastReflection_DeeplyNestedSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.InnerOne != nil { + value := protoreflect.ValueOfMessage(x.InnerOne.ProtoReflect()) + if !f(fd_DeeplyNestedSigner_inner_one, value) { return } } @@ -4667,15 +4667,15 @@ func (x *fastReflection_BadSigner) Range(f func(protoreflect.FieldDescriptor, pr // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_BadSigner) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_DeeplyNestedSigner) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "BadSigner.signer": - return len(x.Signer) != 0 + case "DeeplyNestedSigner.inner_one": + return x.InnerOne != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", fd.FullName())) } } @@ -4685,15 +4685,15 @@ func (x *fastReflection_BadSigner) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BadSigner) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_DeeplyNestedSigner) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "BadSigner.signer": - x.Signer = nil + case "DeeplyNestedSigner.inner_one": + x.InnerOne = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", fd.FullName())) } } @@ -4703,16 +4703,16 @@ func (x *fastReflection_BadSigner) Clear(fd protoreflect.FieldDescriptor) { // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_BadSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "BadSigner.signer": - value := x.Signer - return protoreflect.ValueOfBytes(value) + case "DeeplyNestedSigner.inner_one": + value := x.InnerOne + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", descriptor.FullName())) } } @@ -4726,15 +4726,15 @@ func (x *fastReflection_BadSigner) Get(descriptor protoreflect.FieldDescriptor) // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BadSigner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_DeeplyNestedSigner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "BadSigner.signer": - x.Signer = value.Bytes() + case "DeeplyNestedSigner.inner_one": + x.InnerOne = value.Message().Interface().(*DeeplyNestedSigner_InnerOne) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", fd.FullName())) } } @@ -4748,40 +4748,44 @@ func (x *fastReflection_BadSigner) Set(fd protoreflect.FieldDescriptor, value pr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BadSigner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "BadSigner.signer": - panic(fmt.Errorf("field signer of message BadSigner is not mutable")) + case "DeeplyNestedSigner.inner_one": + if x.InnerOne == nil { + x.InnerOne = new(DeeplyNestedSigner_InnerOne) + } + return protoreflect.ValueOfMessage(x.InnerOne.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_BadSigner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "BadSigner.signer": - return protoreflect.ValueOfBytes(nil) + case "DeeplyNestedSigner.inner_one": + m := new(DeeplyNestedSigner_InnerOne) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_BadSigner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_DeeplyNestedSigner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in BadSigner", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedSigner", d.FullName())) } panic("unreachable") } @@ -4789,7 +4793,7 @@ func (x *fastReflection_BadSigner) WhichOneof(d protoreflect.OneofDescriptor) pr // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_BadSigner) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_DeeplyNestedSigner) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -4800,7 +4804,7 @@ func (x *fastReflection_BadSigner) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BadSigner) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_DeeplyNestedSigner) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -4812,7 +4816,7 @@ func (x *fastReflection_BadSigner) SetUnknown(fields protoreflect.RawFields) { // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_BadSigner) IsValid() bool { +func (x *fastReflection_DeeplyNestedSigner) IsValid() bool { return x != nil } @@ -4822,9 +4826,9 @@ func (x *fastReflection_BadSigner) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_DeeplyNestedSigner) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*BadSigner) + x := input.Message.Interface().(*DeeplyNestedSigner) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4836,8 +4840,8 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Signer) - if l > 0 { + if x.InnerOne != nil { + l = options.Size(x.InnerOne) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -4850,7 +4854,7 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*BadSigner) + x := input.Message.Interface().(*DeeplyNestedSigner) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4869,10 +4873,17 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Signer) > 0 { - i -= len(x.Signer) - copy(dAtA[i:], x.Signer) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + if x.InnerOne != nil { + encoded, err := options.Marshal(x.InnerOne) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0xa } @@ -4887,7 +4898,7 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*BadSigner) + x := input.Message.Interface().(*DeeplyNestedSigner) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4919,17 +4930,17 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BadSigner: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BadSigner: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InnerOne", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -4939,24 +4950,26 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Signer = append(x.Signer[:0], dAtA[iNdEx:postIndex]...) - if x.Signer == nil { - x.Signer = []byte{} + if x.InnerOne == nil { + x.InnerOne = &DeeplyNestedSigner_InnerOne{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.InnerOne); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex default: @@ -4995,26 +5008,26 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { } var ( - md_NoSignerOption protoreflect.MessageDescriptor - fd_NoSignerOption_signer protoreflect.FieldDescriptor + md_DeeplyNestedSigner_InnerOne protoreflect.MessageDescriptor + fd_DeeplyNestedSigner_InnerOne_inner_two protoreflect.FieldDescriptor ) func init() { file_signers_proto_init() - md_NoSignerOption = File_signers_proto.Messages().ByName("NoSignerOption") - fd_NoSignerOption_signer = md_NoSignerOption.Fields().ByName("signer") + md_DeeplyNestedSigner_InnerOne = File_signers_proto.Messages().ByName("DeeplyNestedSigner").Messages().ByName("InnerOne") + fd_DeeplyNestedSigner_InnerOne_inner_two = md_DeeplyNestedSigner_InnerOne.Fields().ByName("inner_two") } -var _ protoreflect.Message = (*fastReflection_NoSignerOption)(nil) +var _ protoreflect.Message = (*fastReflection_DeeplyNestedSigner_InnerOne)(nil) -type fastReflection_NoSignerOption NoSignerOption +type fastReflection_DeeplyNestedSigner_InnerOne DeeplyNestedSigner_InnerOne -func (x *NoSignerOption) ProtoReflect() protoreflect.Message { - return (*fastReflection_NoSignerOption)(x) +func (x *DeeplyNestedSigner_InnerOne) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner_InnerOne)(x) } -func (x *NoSignerOption) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[7] +func (x *DeeplyNestedSigner_InnerOne) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5025,43 +5038,43 @@ func (x *NoSignerOption) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_NoSignerOption_messageType fastReflection_NoSignerOption_messageType -var _ protoreflect.MessageType = fastReflection_NoSignerOption_messageType{} +var _fastReflection_DeeplyNestedSigner_InnerOne_messageType fastReflection_DeeplyNestedSigner_InnerOne_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedSigner_InnerOne_messageType{} -type fastReflection_NoSignerOption_messageType struct{} +type fastReflection_DeeplyNestedSigner_InnerOne_messageType struct{} -func (x fastReflection_NoSignerOption_messageType) Zero() protoreflect.Message { - return (*fastReflection_NoSignerOption)(nil) +func (x fastReflection_DeeplyNestedSigner_InnerOne_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner_InnerOne)(nil) } -func (x fastReflection_NoSignerOption_messageType) New() protoreflect.Message { - return new(fastReflection_NoSignerOption) +func (x fastReflection_DeeplyNestedSigner_InnerOne_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner_InnerOne) } -func (x fastReflection_NoSignerOption_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_NoSignerOption +func (x fastReflection_DeeplyNestedSigner_InnerOne_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner_InnerOne } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_NoSignerOption) Descriptor() protoreflect.MessageDescriptor { - return md_NoSignerOption +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner_InnerOne } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_NoSignerOption) Type() protoreflect.MessageType { - return _fastReflection_NoSignerOption_messageType +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedSigner_InnerOne_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_NoSignerOption) New() protoreflect.Message { - return new(fastReflection_NoSignerOption) +func (x *fastReflection_DeeplyNestedSigner_InnerOne) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner_InnerOne) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_NoSignerOption) Interface() protoreflect.ProtoMessage { - return (*NoSignerOption)(x) +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedSigner_InnerOne)(x) } // Range iterates over every populated field in an undefined order, @@ -5069,10 +5082,10 @@ func (x *fastReflection_NoSignerOption) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_NoSignerOption) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Signer) != 0 { - value := protoreflect.ValueOfBytes(x.Signer) - if !f(fd_NoSignerOption_signer, value) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.InnerTwo != nil { + value := protoreflect.ValueOfMessage(x.InnerTwo.ProtoReflect()) + if !f(fd_DeeplyNestedSigner_InnerOne_inner_two, value) { return } } @@ -5089,15 +5102,15 @@ func (x *fastReflection_NoSignerOption) Range(f func(protoreflect.FieldDescripto // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_NoSignerOption) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "NoSignerOption.signer": - return len(x.Signer) != 0 + case "DeeplyNestedSigner.InnerOne.inner_two": + return x.InnerTwo != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", fd.FullName())) } } @@ -5107,15 +5120,15 @@ func (x *fastReflection_NoSignerOption) Has(fd protoreflect.FieldDescriptor) boo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_NoSignerOption) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "NoSignerOption.signer": - x.Signer = nil + case "DeeplyNestedSigner.InnerOne.inner_two": + x.InnerTwo = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", fd.FullName())) } } @@ -5125,16 +5138,16 @@ func (x *fastReflection_NoSignerOption) Clear(fd protoreflect.FieldDescriptor) { // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_NoSignerOption) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "NoSignerOption.signer": - value := x.Signer - return protoreflect.ValueOfBytes(value) + case "DeeplyNestedSigner.InnerOne.inner_two": + value := x.InnerTwo + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", descriptor.FullName())) } } @@ -5148,15 +5161,15 @@ func (x *fastReflection_NoSignerOption) Get(descriptor protoreflect.FieldDescrip // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_NoSignerOption) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "NoSignerOption.signer": - x.Signer = value.Bytes() + case "DeeplyNestedSigner.InnerOne.inner_two": + x.InnerTwo = value.Message().Interface().(*DeeplyNestedSigner_InnerOne_InnerTwo) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", fd.FullName())) } } @@ -5170,40 +5183,44 @@ func (x *fastReflection_NoSignerOption) Set(fd protoreflect.FieldDescriptor, val // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_NoSignerOption) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "NoSignerOption.signer": - panic(fmt.Errorf("field signer of message NoSignerOption is not mutable")) + case "DeeplyNestedSigner.InnerOne.inner_two": + if x.InnerTwo == nil { + x.InnerTwo = new(DeeplyNestedSigner_InnerOne_InnerTwo) + } + return protoreflect.ValueOfMessage(x.InnerTwo.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_NoSignerOption) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "NoSignerOption.signer": - return protoreflect.ValueOfBytes(nil) + case "DeeplyNestedSigner.InnerOne.inner_two": + m := new(DeeplyNestedSigner_InnerOne_InnerTwo) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_NoSignerOption) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in NoSignerOption", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedSigner.InnerOne", d.FullName())) } panic("unreachable") } @@ -5211,7 +5228,7 @@ func (x *fastReflection_NoSignerOption) WhichOneof(d protoreflect.OneofDescripto // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_NoSignerOption) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -5222,7 +5239,7 @@ func (x *fastReflection_NoSignerOption) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_NoSignerOption) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -5234,7 +5251,7 @@ func (x *fastReflection_NoSignerOption) SetUnknown(fields protoreflect.RawFields // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_NoSignerOption) IsValid() bool { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) IsValid() bool { return x != nil } @@ -5244,9 +5261,9 @@ func (x *fastReflection_NoSignerOption) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*NoSignerOption) + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5258,8 +5275,8 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Signer) - if l > 0 { + if x.InnerTwo != nil { + l = options.Size(x.InnerTwo) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -5272,7 +5289,7 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*NoSignerOption) + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5291,10 +5308,17 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Signer) > 0 { - i -= len(x.Signer) - copy(dAtA[i:], x.Signer) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + if x.InnerTwo != nil { + encoded, err := options.Marshal(x.InnerTwo) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0xa } @@ -5309,7 +5333,7 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*NoSignerOption) + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5341,17 +5365,17 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NoSignerOption: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner_InnerOne: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NoSignerOption: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner_InnerOne: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InnerTwo", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -5361,24 +5385,26 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Signer = append(x.Signer[:0], dAtA[iNdEx:postIndex]...) - if x.Signer == nil { - x.Signer = []byte{} + if x.InnerTwo == nil { + x.InnerTwo = &DeeplyNestedSigner_InnerOne_InnerTwo{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.InnerTwo); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex default: @@ -5417,26 +5443,26 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { } var ( - md_ValidatorSigner protoreflect.MessageDescriptor - fd_ValidatorSigner_signer protoreflect.FieldDescriptor + md_DeeplyNestedSigner_InnerOne_InnerTwo protoreflect.MessageDescriptor + fd_DeeplyNestedSigner_InnerOne_InnerTwo_signer protoreflect.FieldDescriptor ) func init() { file_signers_proto_init() - md_ValidatorSigner = File_signers_proto.Messages().ByName("ValidatorSigner") - fd_ValidatorSigner_signer = md_ValidatorSigner.Fields().ByName("signer") + md_DeeplyNestedSigner_InnerOne_InnerTwo = File_signers_proto.Messages().ByName("DeeplyNestedSigner").Messages().ByName("InnerOne").Messages().ByName("InnerTwo") + fd_DeeplyNestedSigner_InnerOne_InnerTwo_signer = md_DeeplyNestedSigner_InnerOne_InnerTwo.Fields().ByName("signer") } -var _ protoreflect.Message = (*fastReflection_ValidatorSigner)(nil) +var _ protoreflect.Message = (*fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo)(nil) -type fastReflection_ValidatorSigner ValidatorSigner +type fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo DeeplyNestedSigner_InnerOne_InnerTwo -func (x *ValidatorSigner) ProtoReflect() protoreflect.Message { - return (*fastReflection_ValidatorSigner)(x) +func (x *DeeplyNestedSigner_InnerOne_InnerTwo) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo)(x) } -func (x *ValidatorSigner) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[8] +func (x *DeeplyNestedSigner_InnerOne_InnerTwo) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5447,43 +5473,43 @@ func (x *ValidatorSigner) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_ValidatorSigner_messageType fastReflection_ValidatorSigner_messageType -var _ protoreflect.MessageType = fastReflection_ValidatorSigner_messageType{} +var _fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType{} -type fastReflection_ValidatorSigner_messageType struct{} +type fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType struct{} -func (x fastReflection_ValidatorSigner_messageType) Zero() protoreflect.Message { - return (*fastReflection_ValidatorSigner)(nil) +func (x fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo)(nil) } -func (x fastReflection_ValidatorSigner_messageType) New() protoreflect.Message { - return new(fastReflection_ValidatorSigner) +func (x fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) } -func (x fastReflection_ValidatorSigner_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ValidatorSigner +func (x fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner_InnerOne_InnerTwo } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_ValidatorSigner) Descriptor() protoreflect.MessageDescriptor { - return md_ValidatorSigner +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner_InnerOne_InnerTwo } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_ValidatorSigner) Type() protoreflect.MessageType { - return _fastReflection_ValidatorSigner_messageType +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_ValidatorSigner) New() protoreflect.Message { - return new(fastReflection_ValidatorSigner) +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_ValidatorSigner) Interface() protoreflect.ProtoMessage { - return (*ValidatorSigner)(x) +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedSigner_InnerOne_InnerTwo)(x) } // Range iterates over every populated field in an undefined order, @@ -5491,10 +5517,10 @@ func (x *fastReflection_ValidatorSigner) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_ValidatorSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Signer != "" { value := protoreflect.ValueOfString(x.Signer) - if !f(fd_ValidatorSigner_signer, value) { + if !f(fd_DeeplyNestedSigner_InnerOne_InnerTwo_signer, value) { return } } @@ -5511,15 +5537,15 @@ func (x *fastReflection_ValidatorSigner) Range(f func(protoreflect.FieldDescript // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_ValidatorSigner) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "ValidatorSigner.signer": + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": return x.Signer != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) } - panic(fmt.Errorf("message ValidatorSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo does not contain field %s", fd.FullName())) } } @@ -5529,15 +5555,15 @@ func (x *fastReflection_ValidatorSigner) Has(fd protoreflect.FieldDescriptor) bo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ValidatorSigner) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "ValidatorSigner.signer": + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": x.Signer = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) } - panic(fmt.Errorf("message ValidatorSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo does not contain field %s", fd.FullName())) } } @@ -5547,16 +5573,3242 @@ func (x *fastReflection_ValidatorSigner) Clear(fd protoreflect.FieldDescriptor) // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_ValidatorSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "ValidatorSigner.signer": + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": value := x.Signer return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) } - panic(fmt.Errorf("message ValidatorSigner does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": + x.Signer = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) + } + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": + panic(fmt.Errorf("field signer of message DeeplyNestedSigner.InnerOne.InnerTwo is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) + } + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) + } + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedSigner.InnerOne.InnerTwo", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne_InnerTwo) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Signer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne_InnerTwo) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne_InnerTwo) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner_InnerOne_InnerTwo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner_InnerOne_InnerTwo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_DeeplyNestedRepeatedSigner_1_list)(nil) + +type _DeeplyNestedRepeatedSigner_1_list struct { + list *[]*DeeplyNestedRepeatedSigner_Inner +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner) + (*x.list)[i] = concreteValue +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner) + *x.list = append(*x.list, concreteValue) +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) AppendMutable() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) NewElement() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DeeplyNestedRepeatedSigner protoreflect.MessageDescriptor + fd_DeeplyNestedRepeatedSigner_inner protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_DeeplyNestedRepeatedSigner = File_signers_proto.Messages().ByName("DeeplyNestedRepeatedSigner") + fd_DeeplyNestedRepeatedSigner_inner = md_DeeplyNestedRepeatedSigner.Fields().ByName("inner") +} + +var _ protoreflect.Message = (*fastReflection_DeeplyNestedRepeatedSigner)(nil) + +type fastReflection_DeeplyNestedRepeatedSigner DeeplyNestedRepeatedSigner + +func (x *DeeplyNestedRepeatedSigner) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner)(x) +} + +func (x *DeeplyNestedRepeatedSigner) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_DeeplyNestedRepeatedSigner_messageType fastReflection_DeeplyNestedRepeatedSigner_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedRepeatedSigner_messageType{} + +type fastReflection_DeeplyNestedRepeatedSigner_messageType struct{} + +func (x fastReflection_DeeplyNestedRepeatedSigner_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner)(nil) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedRepeatedSigner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DeeplyNestedRepeatedSigner) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedRepeatedSigner)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Inner) != 0 { + value := protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_1_list{list: &x.Inner}) + if !f(fd_DeeplyNestedRepeatedSigner_inner, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + return len(x.Inner) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + x.Inner = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + if len(x.Inner) == 0 { + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_1_list{}) + } + listValue := &_DeeplyNestedRepeatedSigner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + lv := value.List() + clv := lv.(*_DeeplyNestedRepeatedSigner_1_list) + x.Inner = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + if x.Inner == nil { + x.Inner = []*DeeplyNestedRepeatedSigner_Inner{} + } + value := &_DeeplyNestedRepeatedSigner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_DeeplyNestedRepeatedSigner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + list := []*DeeplyNestedRepeatedSigner_Inner{} + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_DeeplyNestedRepeatedSigner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedRepeatedSigner", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_DeeplyNestedRepeatedSigner) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_DeeplyNestedRepeatedSigner) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_DeeplyNestedRepeatedSigner) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Inner) > 0 { + for _, e := range x.Inner { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Inner) > 0 { + for iNdEx := len(x.Inner) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Inner[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Inner = append(x.Inner, &DeeplyNestedRepeatedSigner_Inner{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Inner[len(x.Inner)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_DeeplyNestedRepeatedSigner_Inner_1_list)(nil) + +type _DeeplyNestedRepeatedSigner_Inner_1_list struct { + list *[]*DeeplyNestedRepeatedSigner_Inner_Inner +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner) + (*x.list)[i] = concreteValue +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner) + *x.list = append(*x.list, concreteValue) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) AppendMutable() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner_Inner) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) NewElement() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner_Inner) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DeeplyNestedRepeatedSigner_Inner protoreflect.MessageDescriptor + fd_DeeplyNestedRepeatedSigner_Inner_inner protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_DeeplyNestedRepeatedSigner_Inner = File_signers_proto.Messages().ByName("DeeplyNestedRepeatedSigner").Messages().ByName("Inner") + fd_DeeplyNestedRepeatedSigner_Inner_inner = md_DeeplyNestedRepeatedSigner_Inner.Fields().ByName("inner") +} + +var _ protoreflect.Message = (*fastReflection_DeeplyNestedRepeatedSigner_Inner)(nil) + +type fastReflection_DeeplyNestedRepeatedSigner_Inner DeeplyNestedRepeatedSigner_Inner + +func (x *DeeplyNestedRepeatedSigner_Inner) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner)(x) +} + +func (x *DeeplyNestedRepeatedSigner_Inner) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType{} + +type fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType struct{} + +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner)(nil) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedRepeatedSigner_Inner)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Inner) != 0 { + value := protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_1_list{list: &x.Inner}) + if !f(fd_DeeplyNestedRepeatedSigner_Inner_inner, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + return len(x.Inner) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + x.Inner = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + if len(x.Inner) == 0 { + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_1_list{}) + } + listValue := &_DeeplyNestedRepeatedSigner_Inner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + lv := value.List() + clv := lv.(*_DeeplyNestedRepeatedSigner_Inner_1_list) + x.Inner = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + if x.Inner == nil { + x.Inner = []*DeeplyNestedRepeatedSigner_Inner_Inner{} + } + value := &_DeeplyNestedRepeatedSigner_Inner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + list := []*DeeplyNestedRepeatedSigner_Inner_Inner{} + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedRepeatedSigner.Inner", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Inner) > 0 { + for _, e := range x.Inner { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Inner) > 0 { + for iNdEx := len(x.Inner) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Inner[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner_Inner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner_Inner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Inner = append(x.Inner, &DeeplyNestedRepeatedSigner_Inner_Inner{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Inner[len(x.Inner)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_DeeplyNestedRepeatedSigner_Inner_Inner_1_list)(nil) + +type _DeeplyNestedRepeatedSigner_Inner_Inner_1_list struct { + list *[]*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + (*x.list)[i] = concreteValue +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + *x.list = append(*x.list, concreteValue) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) AppendMutable() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) NewElement() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DeeplyNestedRepeatedSigner_Inner_Inner protoreflect.MessageDescriptor + fd_DeeplyNestedRepeatedSigner_Inner_Inner_inner protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_DeeplyNestedRepeatedSigner_Inner_Inner = File_signers_proto.Messages().ByName("DeeplyNestedRepeatedSigner").Messages().ByName("Inner").Messages().ByName("Inner") + fd_DeeplyNestedRepeatedSigner_Inner_Inner_inner = md_DeeplyNestedRepeatedSigner_Inner_Inner.Fields().ByName("inner") +} + +var _ protoreflect.Message = (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner)(nil) + +type fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner DeeplyNestedRepeatedSigner_Inner_Inner + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner)(x) +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType{} + +type fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType struct{} + +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner)(nil) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner_Inner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner_Inner +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedRepeatedSigner_Inner_Inner)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Inner) != 0 { + value := protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_1_list{list: &x.Inner}) + if !f(fd_DeeplyNestedRepeatedSigner_Inner_Inner_inner, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + return len(x.Inner) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + x.Inner = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + if len(x.Inner) == 0 { + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_1_list{}) + } + listValue := &_DeeplyNestedRepeatedSigner_Inner_Inner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + lv := value.List() + clv := lv.(*_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) + x.Inner = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + if x.Inner == nil { + x.Inner = []*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{} + } + value := &_DeeplyNestedRepeatedSigner_Inner_Inner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + list := []*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{} + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedRepeatedSigner.Inner.Inner", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Inner) > 0 { + for _, e := range x.Inner { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Inner) > 0 { + for iNdEx := len(x.Inner) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Inner[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner_Inner_Inner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner_Inner_Inner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Inner = append(x.Inner, &DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Inner[len(x.Inner)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list)(nil) + +type _DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list struct { + list *[]string +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message DeeplyNestedRepeatedSigner_Inner_Inner_Bottom at list field Signer as it is not of Message kind")) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom protoreflect.MessageDescriptor + fd_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_signer protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom = File_signers_proto.Messages().ByName("DeeplyNestedRepeatedSigner").Messages().ByName("Inner").Messages().ByName("Inner").Messages().ByName("Bottom") + fd_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_signer = md_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom.Fields().ByName("signer") +} + +var _ protoreflect.Message = (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom)(nil) + +type fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom DeeplyNestedRepeatedSigner_Inner_Inner_Bottom + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom)(x) +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType{} + +type fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType struct{} + +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom)(nil) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Signer) != 0 { + value := protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list{list: &x.Signer}) + if !f(fd_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_signer, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + return len(x.Signer) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + x.Signer = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + if len(x.Signer) == 0 { + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list{}) + } + listValue := &_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list{list: &x.Signer} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + lv := value.List() + clv := lv.(*_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) + x.Signer = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + if x.Signer == nil { + x.Signer = []string{} + } + value := &_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list{list: &x.Signer} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + list := []string{} + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedRepeatedSigner.Inner.Inner.Bottom", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Signer) > 0 { + for _, s := range x.Signer { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Signer) > 0 { + for iNdEx := len(x.Signer) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Signer[iNdEx]) + copy(dAtA[i:], x.Signer[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner_Inner_Inner_Bottom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner_Inner_Inner_Bottom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Signer = append(x.Signer, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_BadSigner protoreflect.MessageDescriptor + fd_BadSigner_signer protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_BadSigner = File_signers_proto.Messages().ByName("BadSigner") + fd_BadSigner_signer = md_BadSigner.Fields().ByName("signer") +} + +var _ protoreflect.Message = (*fastReflection_BadSigner)(nil) + +type fastReflection_BadSigner BadSigner + +func (x *BadSigner) ProtoReflect() protoreflect.Message { + return (*fastReflection_BadSigner)(x) +} + +func (x *BadSigner) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_BadSigner_messageType fastReflection_BadSigner_messageType +var _ protoreflect.MessageType = fastReflection_BadSigner_messageType{} + +type fastReflection_BadSigner_messageType struct{} + +func (x fastReflection_BadSigner_messageType) Zero() protoreflect.Message { + return (*fastReflection_BadSigner)(nil) +} +func (x fastReflection_BadSigner_messageType) New() protoreflect.Message { + return new(fastReflection_BadSigner) +} +func (x fastReflection_BadSigner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_BadSigner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_BadSigner) Descriptor() protoreflect.MessageDescriptor { + return md_BadSigner +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_BadSigner) Type() protoreflect.MessageType { + return _fastReflection_BadSigner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_BadSigner) New() protoreflect.Message { + return new(fastReflection_BadSigner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_BadSigner) Interface() protoreflect.ProtoMessage { + return (*BadSigner)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_BadSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Signer) != 0 { + value := protoreflect.ValueOfBytes(x.Signer) + if !f(fd_BadSigner_signer, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_BadSigner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "BadSigner.signer": + return len(x.Signer) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BadSigner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "BadSigner.signer": + x.Signer = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_BadSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "BadSigner.signer": + value := x.Signer + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BadSigner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "BadSigner.signer": + x.Signer = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BadSigner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "BadSigner.signer": + panic(fmt.Errorf("field signer of message BadSigner is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_BadSigner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "BadSigner.signer": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_BadSigner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in BadSigner", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_BadSigner) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BadSigner) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_BadSigner) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*BadSigner) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Signer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*BadSigner) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*BadSigner) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BadSigner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BadSigner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Signer = append(x.Signer[:0], dAtA[iNdEx:postIndex]...) + if x.Signer == nil { + x.Signer = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_NoSignerOption protoreflect.MessageDescriptor + fd_NoSignerOption_signer protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_NoSignerOption = File_signers_proto.Messages().ByName("NoSignerOption") + fd_NoSignerOption_signer = md_NoSignerOption.Fields().ByName("signer") +} + +var _ protoreflect.Message = (*fastReflection_NoSignerOption)(nil) + +type fastReflection_NoSignerOption NoSignerOption + +func (x *NoSignerOption) ProtoReflect() protoreflect.Message { + return (*fastReflection_NoSignerOption)(x) +} + +func (x *NoSignerOption) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_NoSignerOption_messageType fastReflection_NoSignerOption_messageType +var _ protoreflect.MessageType = fastReflection_NoSignerOption_messageType{} + +type fastReflection_NoSignerOption_messageType struct{} + +func (x fastReflection_NoSignerOption_messageType) Zero() protoreflect.Message { + return (*fastReflection_NoSignerOption)(nil) +} +func (x fastReflection_NoSignerOption_messageType) New() protoreflect.Message { + return new(fastReflection_NoSignerOption) +} +func (x fastReflection_NoSignerOption_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_NoSignerOption +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_NoSignerOption) Descriptor() protoreflect.MessageDescriptor { + return md_NoSignerOption +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_NoSignerOption) Type() protoreflect.MessageType { + return _fastReflection_NoSignerOption_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_NoSignerOption) New() protoreflect.Message { + return new(fastReflection_NoSignerOption) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_NoSignerOption) Interface() protoreflect.ProtoMessage { + return (*NoSignerOption)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_NoSignerOption) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Signer) != 0 { + value := protoreflect.ValueOfBytes(x.Signer) + if !f(fd_NoSignerOption_signer, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_NoSignerOption) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "NoSignerOption.signer": + return len(x.Signer) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_NoSignerOption) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "NoSignerOption.signer": + x.Signer = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_NoSignerOption) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "NoSignerOption.signer": + value := x.Signer + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_NoSignerOption) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "NoSignerOption.signer": + x.Signer = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_NoSignerOption) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "NoSignerOption.signer": + panic(fmt.Errorf("field signer of message NoSignerOption is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_NoSignerOption) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "NoSignerOption.signer": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_NoSignerOption) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in NoSignerOption", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_NoSignerOption) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_NoSignerOption) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_NoSignerOption) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*NoSignerOption) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Signer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*NoSignerOption) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*NoSignerOption) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NoSignerOption: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NoSignerOption: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Signer = append(x.Signer[:0], dAtA[iNdEx:postIndex]...) + if x.Signer == nil { + x.Signer = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_ValidatorSigner protoreflect.MessageDescriptor + fd_ValidatorSigner_signer protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_ValidatorSigner = File_signers_proto.Messages().ByName("ValidatorSigner") + fd_ValidatorSigner_signer = md_ValidatorSigner.Fields().ByName("signer") +} + +var _ protoreflect.Message = (*fastReflection_ValidatorSigner)(nil) + +type fastReflection_ValidatorSigner ValidatorSigner + +func (x *ValidatorSigner) ProtoReflect() protoreflect.Message { + return (*fastReflection_ValidatorSigner)(x) +} + +func (x *ValidatorSigner) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ValidatorSigner_messageType fastReflection_ValidatorSigner_messageType +var _ protoreflect.MessageType = fastReflection_ValidatorSigner_messageType{} + +type fastReflection_ValidatorSigner_messageType struct{} + +func (x fastReflection_ValidatorSigner_messageType) Zero() protoreflect.Message { + return (*fastReflection_ValidatorSigner)(nil) +} +func (x fastReflection_ValidatorSigner_messageType) New() protoreflect.Message { + return new(fastReflection_ValidatorSigner) +} +func (x fastReflection_ValidatorSigner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorSigner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ValidatorSigner) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorSigner +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ValidatorSigner) Type() protoreflect.MessageType { + return _fastReflection_ValidatorSigner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ValidatorSigner) New() protoreflect.Message { + return new(fastReflection_ValidatorSigner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ValidatorSigner) Interface() protoreflect.ProtoMessage { + return (*ValidatorSigner)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ValidatorSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Signer != "" { + value := protoreflect.ValueOfString(x.Signer) + if !f(fd_ValidatorSigner_signer, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ValidatorSigner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "ValidatorSigner.signer": + return x.Signer != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + } + panic(fmt.Errorf("message ValidatorSigner does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ValidatorSigner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "ValidatorSigner.signer": + x.Signer = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + } + panic(fmt.Errorf("message ValidatorSigner does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ValidatorSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "ValidatorSigner.signer": + value := x.Signer + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + } + panic(fmt.Errorf("message ValidatorSigner does not contain field %s", descriptor.FullName())) } } @@ -5982,77 +9234,147 @@ func (*RepeatedNestedSigner) Descriptor() ([]byte, []int) { return file_signers_proto_rawDescGZIP(), []int{3} } -func (x *RepeatedNestedSigner) GetInner() []*RepeatedNestedSigner_Inner { +func (x *RepeatedNestedSigner) GetInner() []*RepeatedNestedSigner_Inner { + if x != nil { + return x.Inner + } + return nil +} + +type NestedRepeatedSigner struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Inner *NestedRepeatedSigner_Inner `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (x *NestedRepeatedSigner) Reset() { + *x = NestedRepeatedSigner{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NestedRepeatedSigner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NestedRepeatedSigner) ProtoMessage() {} + +// Deprecated: Use NestedRepeatedSigner.ProtoReflect.Descriptor instead. +func (*NestedRepeatedSigner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{4} +} + +func (x *NestedRepeatedSigner) GetInner() *NestedRepeatedSigner_Inner { + if x != nil { + return x.Inner + } + return nil +} + +type RepeatedNestedRepeatedSigner struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Inner []*RepeatedNestedRepeatedSigner_Inner `protobuf:"bytes,1,rep,name=inner,proto3" json:"inner,omitempty"` +} + +func (x *RepeatedNestedRepeatedSigner) Reset() { + *x = RepeatedNestedRepeatedSigner{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RepeatedNestedRepeatedSigner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RepeatedNestedRepeatedSigner) ProtoMessage() {} + +// Deprecated: Use RepeatedNestedRepeatedSigner.ProtoReflect.Descriptor instead. +func (*RepeatedNestedRepeatedSigner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{5} +} + +func (x *RepeatedNestedRepeatedSigner) GetInner() []*RepeatedNestedRepeatedSigner_Inner { if x != nil { return x.Inner } return nil } -type NestedRepeatedSigner struct { +type DeeplyNestedSigner struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Inner *NestedRepeatedSigner_Inner `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` + InnerOne *DeeplyNestedSigner_InnerOne `protobuf:"bytes,1,opt,name=inner_one,json=innerOne,proto3" json:"inner_one,omitempty"` } -func (x *NestedRepeatedSigner) Reset() { - *x = NestedRepeatedSigner{} +func (x *DeeplyNestedSigner) Reset() { + *x = DeeplyNestedSigner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[4] + mi := &file_signers_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *NestedRepeatedSigner) String() string { +func (x *DeeplyNestedSigner) String() string { return protoimpl.X.MessageStringOf(x) } -func (*NestedRepeatedSigner) ProtoMessage() {} +func (*DeeplyNestedSigner) ProtoMessage() {} -// Deprecated: Use NestedRepeatedSigner.ProtoReflect.Descriptor instead. -func (*NestedRepeatedSigner) Descriptor() ([]byte, []int) { - return file_signers_proto_rawDescGZIP(), []int{4} +// Deprecated: Use DeeplyNestedSigner.ProtoReflect.Descriptor instead. +func (*DeeplyNestedSigner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{6} } -func (x *NestedRepeatedSigner) GetInner() *NestedRepeatedSigner_Inner { +func (x *DeeplyNestedSigner) GetInnerOne() *DeeplyNestedSigner_InnerOne { if x != nil { - return x.Inner + return x.InnerOne } return nil } -type RepeatedNestedRepeatedSigner struct { +type DeeplyNestedRepeatedSigner struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Inner []*RepeatedNestedRepeatedSigner_Inner `protobuf:"bytes,1,rep,name=inner,proto3" json:"inner,omitempty"` + Inner []*DeeplyNestedRepeatedSigner_Inner `protobuf:"bytes,1,rep,name=inner,proto3" json:"inner,omitempty"` } -func (x *RepeatedNestedRepeatedSigner) Reset() { - *x = RepeatedNestedRepeatedSigner{} +func (x *DeeplyNestedRepeatedSigner) Reset() { + *x = DeeplyNestedRepeatedSigner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[5] + mi := &file_signers_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *RepeatedNestedRepeatedSigner) String() string { +func (x *DeeplyNestedRepeatedSigner) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RepeatedNestedRepeatedSigner) ProtoMessage() {} +func (*DeeplyNestedRepeatedSigner) ProtoMessage() {} -// Deprecated: Use RepeatedNestedRepeatedSigner.ProtoReflect.Descriptor instead. -func (*RepeatedNestedRepeatedSigner) Descriptor() ([]byte, []int) { - return file_signers_proto_rawDescGZIP(), []int{5} +// Deprecated: Use DeeplyNestedRepeatedSigner.ProtoReflect.Descriptor instead. +func (*DeeplyNestedRepeatedSigner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{7} } -func (x *RepeatedNestedRepeatedSigner) GetInner() []*RepeatedNestedRepeatedSigner_Inner { +func (x *DeeplyNestedRepeatedSigner) GetInner() []*DeeplyNestedRepeatedSigner_Inner { if x != nil { return x.Inner } @@ -6070,7 +9392,7 @@ type BadSigner struct { func (x *BadSigner) Reset() { *x = BadSigner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[6] + mi := &file_signers_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6084,7 +9406,7 @@ func (*BadSigner) ProtoMessage() {} // Deprecated: Use BadSigner.ProtoReflect.Descriptor instead. func (*BadSigner) Descriptor() ([]byte, []int) { - return file_signers_proto_rawDescGZIP(), []int{6} + return file_signers_proto_rawDescGZIP(), []int{8} } func (x *BadSigner) GetSigner() []byte { @@ -6105,7 +9427,7 @@ type NoSignerOption struct { func (x *NoSignerOption) Reset() { *x = NoSignerOption{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[7] + mi := &file_signers_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6119,7 +9441,7 @@ func (*NoSignerOption) ProtoMessage() {} // Deprecated: Use NoSignerOption.ProtoReflect.Descriptor instead. func (*NoSignerOption) Descriptor() ([]byte, []int) { - return file_signers_proto_rawDescGZIP(), []int{7} + return file_signers_proto_rawDescGZIP(), []int{9} } func (x *NoSignerOption) GetSigner() []byte { @@ -6140,7 +9462,7 @@ type ValidatorSigner struct { func (x *ValidatorSigner) Reset() { *x = ValidatorSigner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[8] + mi := &file_signers_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6154,7 +9476,7 @@ func (*ValidatorSigner) ProtoMessage() {} // Deprecated: Use ValidatorSigner.ProtoReflect.Descriptor instead. func (*ValidatorSigner) Descriptor() ([]byte, []int) { - return file_signers_proto_rawDescGZIP(), []int{8} + return file_signers_proto_rawDescGZIP(), []int{10} } func (x *ValidatorSigner) GetSigner() string { @@ -6175,7 +9497,7 @@ type NestedSigner_Inner struct { func (x *NestedSigner_Inner) Reset() { *x = NestedSigner_Inner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[9] + mi := &file_signers_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6210,7 +9532,7 @@ type RepeatedNestedSigner_Inner struct { func (x *RepeatedNestedSigner_Inner) Reset() { *x = RepeatedNestedSigner_Inner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[10] + mi := &file_signers_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6245,7 +9567,7 @@ type NestedRepeatedSigner_Inner struct { func (x *NestedRepeatedSigner_Inner) Reset() { *x = NestedRepeatedSigner_Inner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[11] + mi := &file_signers_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6280,7 +9602,7 @@ type RepeatedNestedRepeatedSigner_Inner struct { func (x *RepeatedNestedRepeatedSigner_Inner) Reset() { *x = RepeatedNestedRepeatedSigner_Inner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[12] + mi := &file_signers_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6304,6 +9626,181 @@ func (x *RepeatedNestedRepeatedSigner_Inner) GetSigner() []string { return nil } +type DeeplyNestedSigner_InnerOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InnerTwo *DeeplyNestedSigner_InnerOne_InnerTwo `protobuf:"bytes,1,opt,name=inner_two,json=innerTwo,proto3" json:"inner_two,omitempty"` +} + +func (x *DeeplyNestedSigner_InnerOne) Reset() { + *x = DeeplyNestedSigner_InnerOne{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeeplyNestedSigner_InnerOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeeplyNestedSigner_InnerOne) ProtoMessage() {} + +// Deprecated: Use DeeplyNestedSigner_InnerOne.ProtoReflect.Descriptor instead. +func (*DeeplyNestedSigner_InnerOne) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *DeeplyNestedSigner_InnerOne) GetInnerTwo() *DeeplyNestedSigner_InnerOne_InnerTwo { + if x != nil { + return x.InnerTwo + } + return nil +} + +type DeeplyNestedSigner_InnerOne_InnerTwo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (x *DeeplyNestedSigner_InnerOne_InnerTwo) Reset() { + *x = DeeplyNestedSigner_InnerOne_InnerTwo{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeeplyNestedSigner_InnerOne_InnerTwo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeeplyNestedSigner_InnerOne_InnerTwo) ProtoMessage() {} + +// Deprecated: Use DeeplyNestedSigner_InnerOne_InnerTwo.ProtoReflect.Descriptor instead. +func (*DeeplyNestedSigner_InnerOne_InnerTwo) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{6, 0, 0} +} + +func (x *DeeplyNestedSigner_InnerOne_InnerTwo) GetSigner() string { + if x != nil { + return x.Signer + } + return "" +} + +type DeeplyNestedRepeatedSigner_Inner struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Inner []*DeeplyNestedRepeatedSigner_Inner_Inner `protobuf:"bytes,1,rep,name=inner,proto3" json:"inner,omitempty"` +} + +func (x *DeeplyNestedRepeatedSigner_Inner) Reset() { + *x = DeeplyNestedRepeatedSigner_Inner{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeeplyNestedRepeatedSigner_Inner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeeplyNestedRepeatedSigner_Inner) ProtoMessage() {} + +// Deprecated: Use DeeplyNestedRepeatedSigner_Inner.ProtoReflect.Descriptor instead. +func (*DeeplyNestedRepeatedSigner_Inner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *DeeplyNestedRepeatedSigner_Inner) GetInner() []*DeeplyNestedRepeatedSigner_Inner_Inner { + if x != nil { + return x.Inner + } + return nil +} + +type DeeplyNestedRepeatedSigner_Inner_Inner struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Inner []*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom `protobuf:"bytes,1,rep,name=inner,proto3" json:"inner,omitempty"` +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner) Reset() { + *x = DeeplyNestedRepeatedSigner_Inner_Inner{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeeplyNestedRepeatedSigner_Inner_Inner) ProtoMessage() {} + +// Deprecated: Use DeeplyNestedRepeatedSigner_Inner_Inner.ProtoReflect.Descriptor instead. +func (*DeeplyNestedRepeatedSigner_Inner_Inner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{7, 0, 0} +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner) GetInner() []*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom { + if x != nil { + return x.Inner + } + return nil +} + +type DeeplyNestedRepeatedSigner_Inner_Inner_Bottom struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Signer []string `protobuf:"bytes,1,rep,name=signer,proto3" json:"signer,omitempty"` +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Reset() { + *x = DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) ProtoMessage() {} + +// Deprecated: Use DeeplyNestedRepeatedSigner_Inner_Inner_Bottom.ProtoReflect.Descriptor instead. +func (*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{7, 0, 0, 0} +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) GetSigner() []string { + if x != nil { + return x.Signer + } + return nil +} + var File_signers_proto protoreflect.FileDescriptor var file_signers_proto_rawDesc = []byte{ @@ -6351,28 +9848,63 @@ var file_signers_proto_rawDesc = []byte{ 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, - 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x22, 0x30, 0x0a, 0x09, 0x42, 0x61, 0x64, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, - 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x28, 0x0a, 0x0e, 0x4e, 0x6f, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, - 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x22, 0x59, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, - 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x32, 0x4d, 0x0a, - 0x10, 0x54, 0x65, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x72, 0x12, 0x32, 0x0a, 0x10, 0x54, 0x65, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x0d, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x72, 0x1a, 0x0d, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x72, 0x22, 0x00, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x3b, 0x42, 0x0c, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x74, - 0x78, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x22, 0xf1, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x65, 0x70, 0x6c, + 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x39, 0x0a, + 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x44, 0x65, 0x65, 0x70, 0x6c, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4f, 0x6e, 0x65, 0x52, 0x08, + 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x4f, 0x6e, 0x65, 0x1a, 0x8f, 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x6e, + 0x65, 0x72, 0x4f, 0x6e, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x74, + 0x77, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x44, 0x65, 0x65, 0x70, 0x6c, + 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x2e, 0x49, 0x6e, + 0x6e, 0x65, 0x72, 0x4f, 0x6e, 0x65, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x77, 0x6f, 0x52, + 0x08, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x77, 0x6f, 0x1a, 0x2f, 0x0a, 0x08, 0x49, 0x6e, 0x6e, + 0x65, 0x72, 0x54, 0x77, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, + 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, + 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x74, 0x77, 0x6f, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, + 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x6f, 0x6e, 0x65, 0x22, 0xc1, 0x02, 0x0a, 0x1a, 0x44, + 0x65, 0x65, 0x70, 0x6c, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x05, 0x69, 0x6e, 0x6e, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x44, 0x65, 0x65, 0x70, 0x6c, + 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x52, 0x05, 0x69, 0x6e, 0x6e, + 0x65, 0x72, 0x1a, 0xdd, 0x01, 0x0a, 0x05, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x05, + 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x44, 0x65, + 0x65, 0x70, 0x6c, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x49, + 0x6e, 0x6e, 0x65, 0x72, 0x52, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x1a, 0x88, 0x01, 0x0a, 0x05, + 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x44, 0x65, 0x65, 0x70, 0x6c, 0x79, 0x4e, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x72, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x42, 0x6f, + 0x74, 0x74, 0x6f, 0x6d, 0x52, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x1a, 0x2d, 0x0a, 0x06, 0x42, + 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, + 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, + 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x69, 0x6e, 0x6e, + 0x65, 0x72, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x22, 0x30, + 0x0a, 0x09, 0x42, 0x61, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, + 0x22, 0x28, 0x0a, 0x0e, 0x4e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x59, 0x0a, 0x0f, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x39, 0x0a, + 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, + 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x32, 0x4d, 0x0a, 0x10, 0x54, 0x65, 0x73, 0x74, 0x53, 0x69, 0x6d, + 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x10, 0x54, 0x65, 0x73, + 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x0d, 0x2e, + 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x1a, 0x0d, 0x2e, 0x53, + 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x00, 0x1a, 0x05, 0x80, + 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x3b, 0x42, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, + 0x6c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6387,34 +9919,46 @@ func file_signers_proto_rawDescGZIP() []byte { return file_signers_proto_rawDescData } -var file_signers_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_signers_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_signers_proto_goTypes = []interface{}{ - (*SimpleSigner)(nil), // 0: SimpleSigner - (*RepeatedSigner)(nil), // 1: RepeatedSigner - (*NestedSigner)(nil), // 2: NestedSigner - (*RepeatedNestedSigner)(nil), // 3: RepeatedNestedSigner - (*NestedRepeatedSigner)(nil), // 4: NestedRepeatedSigner - (*RepeatedNestedRepeatedSigner)(nil), // 5: RepeatedNestedRepeatedSigner - (*BadSigner)(nil), // 6: BadSigner - (*NoSignerOption)(nil), // 7: NoSignerOption - (*ValidatorSigner)(nil), // 8: ValidatorSigner - (*NestedSigner_Inner)(nil), // 9: NestedSigner.Inner - (*RepeatedNestedSigner_Inner)(nil), // 10: RepeatedNestedSigner.Inner - (*NestedRepeatedSigner_Inner)(nil), // 11: NestedRepeatedSigner.Inner - (*RepeatedNestedRepeatedSigner_Inner)(nil), // 12: RepeatedNestedRepeatedSigner.Inner + (*SimpleSigner)(nil), // 0: SimpleSigner + (*RepeatedSigner)(nil), // 1: RepeatedSigner + (*NestedSigner)(nil), // 2: NestedSigner + (*RepeatedNestedSigner)(nil), // 3: RepeatedNestedSigner + (*NestedRepeatedSigner)(nil), // 4: NestedRepeatedSigner + (*RepeatedNestedRepeatedSigner)(nil), // 5: RepeatedNestedRepeatedSigner + (*DeeplyNestedSigner)(nil), // 6: DeeplyNestedSigner + (*DeeplyNestedRepeatedSigner)(nil), // 7: DeeplyNestedRepeatedSigner + (*BadSigner)(nil), // 8: BadSigner + (*NoSignerOption)(nil), // 9: NoSignerOption + (*ValidatorSigner)(nil), // 10: ValidatorSigner + (*NestedSigner_Inner)(nil), // 11: NestedSigner.Inner + (*RepeatedNestedSigner_Inner)(nil), // 12: RepeatedNestedSigner.Inner + (*NestedRepeatedSigner_Inner)(nil), // 13: NestedRepeatedSigner.Inner + (*RepeatedNestedRepeatedSigner_Inner)(nil), // 14: RepeatedNestedRepeatedSigner.Inner + (*DeeplyNestedSigner_InnerOne)(nil), // 15: DeeplyNestedSigner.InnerOne + (*DeeplyNestedSigner_InnerOne_InnerTwo)(nil), // 16: DeeplyNestedSigner.InnerOne.InnerTwo + (*DeeplyNestedRepeatedSigner_Inner)(nil), // 17: DeeplyNestedRepeatedSigner.Inner + (*DeeplyNestedRepeatedSigner_Inner_Inner)(nil), // 18: DeeplyNestedRepeatedSigner.Inner.Inner + (*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom)(nil), // 19: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom } var file_signers_proto_depIdxs = []int32{ - 9, // 0: NestedSigner.inner:type_name -> NestedSigner.Inner - 10, // 1: RepeatedNestedSigner.inner:type_name -> RepeatedNestedSigner.Inner - 11, // 2: NestedRepeatedSigner.inner:type_name -> NestedRepeatedSigner.Inner - 12, // 3: RepeatedNestedRepeatedSigner.inner:type_name -> RepeatedNestedRepeatedSigner.Inner - 0, // 4: TestSimpleSigner.TestSimpleSigner:input_type -> SimpleSigner - 0, // 5: TestSimpleSigner.TestSimpleSigner:output_type -> SimpleSigner - 5, // [5:6] is the sub-list for method output_type - 4, // [4:5] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 11, // 0: NestedSigner.inner:type_name -> NestedSigner.Inner + 12, // 1: RepeatedNestedSigner.inner:type_name -> RepeatedNestedSigner.Inner + 13, // 2: NestedRepeatedSigner.inner:type_name -> NestedRepeatedSigner.Inner + 14, // 3: RepeatedNestedRepeatedSigner.inner:type_name -> RepeatedNestedRepeatedSigner.Inner + 15, // 4: DeeplyNestedSigner.inner_one:type_name -> DeeplyNestedSigner.InnerOne + 17, // 5: DeeplyNestedRepeatedSigner.inner:type_name -> DeeplyNestedRepeatedSigner.Inner + 16, // 6: DeeplyNestedSigner.InnerOne.inner_two:type_name -> DeeplyNestedSigner.InnerOne.InnerTwo + 18, // 7: DeeplyNestedRepeatedSigner.Inner.inner:type_name -> DeeplyNestedRepeatedSigner.Inner.Inner + 19, // 8: DeeplyNestedRepeatedSigner.Inner.Inner.inner:type_name -> DeeplyNestedRepeatedSigner.Inner.Inner.Bottom + 0, // 9: TestSimpleSigner.TestSimpleSigner:input_type -> SimpleSigner + 0, // 10: TestSimpleSigner.TestSimpleSigner:output_type -> SimpleSigner + 10, // [10:11] is the sub-list for method output_type + 9, // [9:10] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_signers_proto_init() } @@ -6496,7 +10040,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BadSigner); i { + switch v := v.(*DeeplyNestedSigner); i { case 0: return &v.state case 1: @@ -6508,7 +10052,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NoSignerOption); i { + switch v := v.(*DeeplyNestedRepeatedSigner); i { case 0: return &v.state case 1: @@ -6520,7 +10064,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorSigner); i { + switch v := v.(*BadSigner); i { case 0: return &v.state case 1: @@ -6532,7 +10076,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NestedSigner_Inner); i { + switch v := v.(*NoSignerOption); i { case 0: return &v.state case 1: @@ -6544,7 +10088,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RepeatedNestedSigner_Inner); i { + switch v := v.(*ValidatorSigner); i { case 0: return &v.state case 1: @@ -6556,7 +10100,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NestedRepeatedSigner_Inner); i { + switch v := v.(*NestedSigner_Inner); i { case 0: return &v.state case 1: @@ -6568,6 +10112,30 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RepeatedNestedSigner_Inner); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NestedRepeatedSigner_Inner); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RepeatedNestedRepeatedSigner_Inner); i { case 0: return &v.state @@ -6579,6 +10147,66 @@ func file_signers_proto_init() { return nil } } + file_signers_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeeplyNestedSigner_InnerOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeeplyNestedSigner_InnerOne_InnerTwo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeeplyNestedRepeatedSigner_Inner); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeeplyNestedRepeatedSigner_Inner_Inner); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -6586,7 +10214,7 @@ func file_signers_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_signers_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 20, NumExtensions: 0, NumServices: 1, }, diff --git a/x/tx/signing/aminojson/aminojson.go b/x/tx/signing/aminojson/aminojson.go index 6d4c264e5d90..5b0d9e4d0547 100644 --- a/x/tx/signing/aminojson/aminojson.go +++ b/x/tx/signing/aminojson/aminojson.go @@ -2,6 +2,7 @@ package aminojson import ( "context" + "errors" "fmt" "google.golang.org/protobuf/reflect/protoregistry" @@ -22,7 +23,7 @@ type SignModeHandler struct { // SignModeHandlerOptions are the options for the SignModeHandler. type SignModeHandlerOptions struct { FileResolver signing.ProtoFileResolver - TypeResolver protoregistry.MessageTypeResolver + TypeResolver signing.TypeResolver Encoder *Encoder } @@ -43,6 +44,7 @@ func NewSignModeHandler(options SignModeHandlerOptions) *SignModeHandler { h.encoder = NewEncoder(EncoderOptions{ FileResolver: options.FileResolver, TypeResolver: options.TypeResolver, + EnumAsString: false, // ensure enum as string is disabled }) } else { h.encoder = *options.Encoder @@ -78,7 +80,7 @@ func (h SignModeHandler) GetSignBytes(_ context.Context, signerData signing.Sign f := txData.AuthInfo.Fee if f == nil { - return nil, fmt.Errorf("fee cannot be nil when tipper is not signer") + return nil, errors.New("fee cannot be nil when tipper is not signer") } fee = &aminojsonpb.AminoSignFee{ Amount: f.Amount, diff --git a/x/tx/signing/aminojson/any.go b/x/tx/signing/aminojson/any.go index 6898f50ce15f..c7e304a46977 100644 --- a/x/tx/signing/aminojson/any.go +++ b/x/tx/signing/aminojson/any.go @@ -11,12 +11,12 @@ import ( "google.golang.org/protobuf/types/known/anypb" ) -func (enc Encoder) marshalAny(message protoreflect.Message, writer io.Writer) error { +func marshalAny(enc *Encoder, message protoreflect.Message, writer io.Writer) error { // when a message contains a nested any field, and the top-level message has been unmarshalled into a dyanmicpb, // the nested any field will also be a dynamicpb. In this case, we must use the dynamicpb API. _, ok := message.Interface().(*dynamicpb.Message) if ok { - return enc.marshalDynamic(message, writer) + return marshalDynamic(enc, message, writer) } anyMsg, ok := message.Interface().(*anypb.Any) @@ -50,13 +50,7 @@ func (enc Encoder) marshalAny(message protoreflect.Message, writer io.Writer) er protoMessage = valueMsg.ProtoReflect() } - _, named := getMessageAminoName(protoMessage.Descriptor().Options()) - if !named { - return fmt.Errorf("message %s is packed into an any field, so requires an amino.name annotation", - anyMsg.TypeUrl) - } - - return enc.beginMarshal(protoMessage, writer) + return enc.beginMarshal(protoMessage, writer, true) } const ( @@ -64,7 +58,7 @@ const ( anyValueFieldName = "value" ) -func (enc Encoder) marshalDynamic(message protoreflect.Message, writer io.Writer) error { +func marshalDynamic(enc *Encoder, message protoreflect.Message, writer io.Writer) error { msgName := message.Get(message.Descriptor().Fields().ByName(anyTypeURLFieldName)).String()[1:] msgBytes := message.Get(message.Descriptor().Fields().ByName(anyValueFieldName)).Bytes() @@ -73,17 +67,11 @@ func (enc Encoder) marshalDynamic(message protoreflect.Message, writer io.Writer return errors.Wrapf(err, "can't resolve type URL %s", msgName) } - _, named := getMessageAminoName(desc.Options()) - if !named { - return fmt.Errorf("message %s is packed into an any field, so requires an amino.name annotation", - msgName) - } - valueMsg := dynamicpb.NewMessageType(desc.(protoreflect.MessageDescriptor)).New().Interface() err = proto.Unmarshal(msgBytes, valueMsg) if err != nil { return err } - return enc.beginMarshal(valueMsg.ProtoReflect(), writer) + return enc.beginMarshal(valueMsg.ProtoReflect(), writer, true) } diff --git a/x/tx/signing/aminojson/bench_test.go b/x/tx/signing/aminojson/bench_test.go index 9ccc11ddcf68..49f9302d4b7b 100644 --- a/x/tx/signing/aminojson/bench_test.go +++ b/x/tx/signing/aminojson/bench_test.go @@ -40,6 +40,7 @@ func BenchmarkAminoJSONDefaultSort(b *testing.B) { } func benchmarkAminoJSON(b *testing.B, addNaiveSort bool) { + b.Helper() enc := aminojson.NewEncoder(aminojson.EncoderOptions{DoNotSortFields: addNaiveSort}) b.ReportAllocs() b.ResetTimer() @@ -54,6 +55,7 @@ func benchmarkAminoJSON(b *testing.B, addNaiveSort bool) { } func runAminoJSON(b *testing.B, enc aminojson.Encoder, addNaiveSort bool) []byte { + b.Helper() bz, err := enc.Marshal(msg) if err != nil { b.Fatal(err) diff --git a/x/tx/signing/aminojson/encoder.go b/x/tx/signing/aminojson/encoder.go index acb899edbd61..07a7c8ea0792 100644 --- a/x/tx/signing/aminojson/encoder.go +++ b/x/tx/signing/aminojson/encoder.go @@ -72,10 +72,10 @@ func nullSliceAsEmptyEncoder(enc *Encoder, v protoreflect.Value, w io.Writer) er switch list := v.Interface().(type) { case protoreflect.List: if list.Len() == 0 { - _, err := w.Write([]byte("[]")) + _, err := io.WriteString(w, "[]") return err } - return enc.marshalList(list, w) + return enc.marshalList(list, nil /* no field descriptor available here */, w) default: return fmt.Errorf("unsupported type %T", list) } @@ -129,6 +129,7 @@ func moduleAccountEncoder(_ *Encoder, msg protoreflect.Message, w io.Writer) err pretty.Sequence = 0 } + // we do not want to use the json encoder here because it adds a newline bz, err := json.Marshal(pretty) if err != nil { return err @@ -146,13 +147,13 @@ func thresholdStringEncoder(enc *Encoder, msg protoreflect.Message, w io.Writer) if !ok { return errors.New("thresholdStringEncoder: msg not a multisig.LegacyAminoPubKey") } - _, err := w.Write([]byte(fmt.Sprintf(`{"threshold":"%d","pubkeys":`, pk.Threshold))) + _, err := fmt.Fprintf(w, `{"threshold":"%d","pubkeys":`, pk.Threshold) if err != nil { return err } if len(pk.PublicKeys) == 0 { - _, err = w.Write([]byte(`[]}`)) + _, err = io.WriteString(w, `[]}`) return err } @@ -160,10 +161,10 @@ func thresholdStringEncoder(enc *Encoder, msg protoreflect.Message, w io.Writer) pubkeysField := fields.ByName("public_keys") pubkeys := msg.Get(pubkeysField).List() - err = enc.marshalList(pubkeys, w) + err = enc.marshalList(pubkeys, pubkeysField, w) if err != nil { return err } - _, err = w.Write([]byte(`}`)) + _, err = io.WriteString(w, `}`) return err } diff --git a/x/tx/signing/aminojson/fuzz_test.go b/x/tx/signing/aminojson/fuzz_test.go new file mode 100644 index 000000000000..e5cbe7ccf3f1 --- /dev/null +++ b/x/tx/signing/aminojson/fuzz_test.go @@ -0,0 +1,75 @@ +package aminojson + +import ( + "context" + "encoding/json" + "testing" + + fuzz "github.com/google/gofuzz" + + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" + "cosmossdk.io/x/tx/signing/testutil" +) + +func FuzzSignModeGetSignBytes(f *testing.F) { + if testing.Short() { + f.Skip("not running in -short mode") + } + + // 1. Create seeds. + fee := &txv1beta1.Fee{ + Amount: []*basev1beta1.Coin{{Denom: "uatom", Amount: "1000"}}, + } + seed := &testutil.HandlerArgumentOptions{ + ChainID: "test-chain", + Memo: "sometestmemo", + + Msg: &bankv1beta1.MsgSend{ + FromAddress: "foo", + ToAddress: "bar", + Amount: []*basev1beta1.Coin{{Denom: "demon", Amount: "100"}}, + }, + AccNum: 1, + AccSeq: 2, + SignerAddress: "signerAddress", + Fee: fee, + } + + gf := fuzz.New() + for i := 0; i < 1e4; i++ { + blob, err := json.Marshal(seed) + if err != nil { + f.Fatal(err) + } + f.Add(blob) + + // 1.5. Mutate the seed for the next iteration. + // gofuzz cannot handle mutating "&bankv1beta1.MsgSend", + // hence why we are mutating fields individually. + gf.Fuzz(&seed.ChainID) + gf.Fuzz(&seed.Memo) + gf.Fuzz(&seed.AccNum) + gf.Fuzz(&seed.AccSeq) + gf.Fuzz(seed.Fee) + gf.Fuzz(&seed.SignerAddress) + } + + ctx := context.Background() + handler := NewSignModeHandler(SignModeHandlerOptions{}) + + // 2. Now run the fuzzers. + f.Fuzz(func(t *testing.T, in []byte) { + opts := new(testutil.HandlerArgumentOptions) + if err := json.Unmarshal(in, opts); err != nil { + return + } + + signerData, txData, err := testutil.MakeHandlerArguments(*opts) + if err != nil { + return + } + _, _ = handler.GetSignBytes(ctx, signerData, txData) + }) +} diff --git a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto index d28008c87dcf..8ab6373b864f 100644 --- a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto +++ b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto @@ -1,10 +1,8 @@ syntax = "proto3"; -import "cosmos_proto/cosmos.proto"; import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; import "google/protobuf/any.proto"; -import "cosmos/tx/v1beta1/tx.proto"; // AminoSignFee is the legacy amino json sign mode compatible version of txv1beta1.Fee, and differs from that message // by the name of the Gas field (GasLimit in txv1beta.Fee). @@ -27,5 +25,4 @@ message AminoSignDoc { string memo = 5 [(amino.dont_omitempty) = true]; AminoSignFee fee = 6 [(amino.dont_omitempty) = true]; repeated google.protobuf.Any msgs = 7 [(amino.dont_omitempty) = true]; - cosmos.tx.v1beta1.Tip tip = 8; -} \ No newline at end of file +} diff --git a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go index d1f7f2540d35..e8ad14368fd9 100644 --- a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go +++ b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go @@ -4,9 +4,7 @@ package aminojsonpb import ( _ "cosmossdk.io/api/amino" v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - v1beta11 "cosmossdk.io/api/cosmos/tx/v1beta1" fmt "fmt" - _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" @@ -747,7 +745,6 @@ var ( fd_AminoSignDoc_memo protoreflect.FieldDescriptor fd_AminoSignDoc_fee protoreflect.FieldDescriptor fd_AminoSignDoc_msgs protoreflect.FieldDescriptor - fd_AminoSignDoc_tip protoreflect.FieldDescriptor ) func init() { @@ -760,7 +757,6 @@ func init() { fd_AminoSignDoc_memo = md_AminoSignDoc.Fields().ByName("memo") fd_AminoSignDoc_fee = md_AminoSignDoc.Fields().ByName("fee") fd_AminoSignDoc_msgs = md_AminoSignDoc.Fields().ByName("msgs") - fd_AminoSignDoc_tip = md_AminoSignDoc.Fields().ByName("tip") } var _ protoreflect.Message = (*fastReflection_AminoSignDoc)(nil) @@ -870,12 +866,6 @@ func (x *fastReflection_AminoSignDoc) Range(f func(protoreflect.FieldDescriptor, return } } - if x.Tip != nil { - value := protoreflect.ValueOfMessage(x.Tip.ProtoReflect()) - if !f(fd_AminoSignDoc_tip, value) { - return - } - } } // Has reports whether a field is populated. @@ -905,8 +895,6 @@ func (x *fastReflection_AminoSignDoc) Has(fd protoreflect.FieldDescriptor) bool return x.Fee != nil case "AminoSignDoc.msgs": return len(x.Msgs) != 0 - case "AminoSignDoc.tip": - return x.Tip != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -937,8 +925,6 @@ func (x *fastReflection_AminoSignDoc) Clear(fd protoreflect.FieldDescriptor) { x.Fee = nil case "AminoSignDoc.msgs": x.Msgs = nil - case "AminoSignDoc.tip": - x.Tip = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -979,9 +965,6 @@ func (x *fastReflection_AminoSignDoc) Get(descriptor protoreflect.FieldDescripto } listValue := &_AminoSignDoc_7_list{list: &x.Msgs} return protoreflect.ValueOfList(listValue) - case "AminoSignDoc.tip": - value := x.Tip - return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -1018,8 +1001,6 @@ func (x *fastReflection_AminoSignDoc) Set(fd protoreflect.FieldDescriptor, value lv := value.List() clv := lv.(*_AminoSignDoc_7_list) x.Msgs = *clv.list - case "AminoSignDoc.tip": - x.Tip = value.Message().Interface().(*v1beta11.Tip) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -1051,11 +1032,6 @@ func (x *fastReflection_AminoSignDoc) Mutable(fd protoreflect.FieldDescriptor) p } value := &_AminoSignDoc_7_list{list: &x.Msgs} return protoreflect.ValueOfList(value) - case "AminoSignDoc.tip": - if x.Tip == nil { - x.Tip = new(v1beta11.Tip) - } - return protoreflect.ValueOfMessage(x.Tip.ProtoReflect()) case "AminoSignDoc.account_number": panic(fmt.Errorf("field account_number of message AminoSignDoc is not mutable")) case "AminoSignDoc.sequence": @@ -1095,9 +1071,6 @@ func (x *fastReflection_AminoSignDoc) NewField(fd protoreflect.FieldDescriptor) case "AminoSignDoc.msgs": list := []*anypb.Any{} return protoreflect.ValueOfList(&_AminoSignDoc_7_list{list: &list}) - case "AminoSignDoc.tip": - m := new(v1beta11.Tip) - return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -1194,10 +1167,6 @@ func (x *fastReflection_AminoSignDoc) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } - if x.Tip != nil { - l = options.Size(x.Tip) - n += 1 + l + runtime.Sov(uint64(l)) - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1227,20 +1196,6 @@ func (x *fastReflection_AminoSignDoc) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Tip != nil { - encoded, err := options.Marshal(x.Tip) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x42 - } if len(x.Msgs) > 0 { for iNdEx := len(x.Msgs) - 1; iNdEx >= 0; iNdEx-- { encoded, err := options.Marshal(x.Msgs[iNdEx]) @@ -1540,42 +1495,6 @@ func (x *fastReflection_AminoSignDoc) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 8: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Tip", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Tip == nil { - x.Tip = &v1beta11.Tip{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Tip); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1701,7 +1620,6 @@ type AminoSignDoc struct { Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` Fee *AminoSignFee `protobuf:"bytes,6,opt,name=fee,proto3" json:"fee,omitempty"` Msgs []*anypb.Any `protobuf:"bytes,7,rep,name=msgs,proto3" json:"msgs,omitempty"` - Tip *v1beta11.Tip `protobuf:"bytes,8,opt,name=tip,proto3" json:"tip,omitempty"` } func (x *AminoSignDoc) Reset() { @@ -1773,63 +1691,50 @@ func (x *AminoSignDoc) GetMsgs() []*anypb.Any { return nil } -func (x *AminoSignDoc) GetTip() *v1beta11.Tip { - if x != nil { - return x.Tip - } - return nil -} - var File_aminojsonpb_aminojson_proto protoreflect.FileDescriptor var file_aminojsonpb_aminojson_proto_rawDesc = []byte{ 0x0a, 0x1b, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x2f, 0x61, 0x6d, - 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, - 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, - 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xa2, 0x01, 0x0a, 0x0c, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, - 0x46, 0x65, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x16, - 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, - 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x17, - 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x12, 0x18, 0x0a, - 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x22, 0xc6, 0x02, 0x0a, 0x0c, 0x41, 0x6d, 0x69, 0x6e, - 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x12, 0x2c, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x12, 0x20, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x49, 0x64, 0x12, 0x19, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x26, 0x0a, - 0x03, 0x66, 0x65, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x6d, 0x69, - 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x46, 0x65, 0x65, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x07, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x12, 0x28, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x69, 0x70, 0x52, 0x03, 0x74, 0x69, 0x70, - 0x42, 0x4b, 0x42, 0x0e, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, - 0x6e, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, + 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x01, 0x0a, 0x0c, + 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x46, 0x65, 0x65, 0x12, 0x49, 0x0a, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x16, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x03, 0x67, 0x61, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, + 0x22, 0x9c, 0x02, 0x0a, 0x0c, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, + 0x63, 0x12, 0x2c, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x21, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, + 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x20, 0x0a, 0x08, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x05, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x04, 0x6d, + 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x26, 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x46, + 0x65, 0x65, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, 0x2f, + 0x0a, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, + 0x6e, 0x79, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x42, + 0x4b, 0x42, 0x0e, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, + 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1850,18 +1755,16 @@ var file_aminojsonpb_aminojson_proto_goTypes = []interface{}{ (*AminoSignDoc)(nil), // 1: AminoSignDoc (*v1beta1.Coin)(nil), // 2: cosmos.base.v1beta1.Coin (*anypb.Any)(nil), // 3: google.protobuf.Any - (*v1beta11.Tip)(nil), // 4: cosmos.tx.v1beta1.Tip } var file_aminojsonpb_aminojson_proto_depIdxs = []int32{ 2, // 0: AminoSignFee.amount:type_name -> cosmos.base.v1beta1.Coin 0, // 1: AminoSignDoc.fee:type_name -> AminoSignFee 3, // 2: AminoSignDoc.msgs:type_name -> google.protobuf.Any - 4, // 3: AminoSignDoc.tip:type_name -> cosmos.tx.v1beta1.Tip - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_aminojsonpb_aminojson_proto_init() } diff --git a/x/tx/signing/aminojson/internal/buf.lock b/x/tx/signing/aminojson/internal/buf.lock index 0c2167d10c41..77b19169b1f7 100644 --- a/x/tx/signing/aminojson/internal/buf.lock +++ b/x/tx/signing/aminojson/internal/buf.lock @@ -9,8 +9,8 @@ deps: - remote: buf.build owner: cosmos repository: cosmos-sdk - commit: a0f17dcd1d6b4a03ab50d377b36da149 - digest: shake256:fc36c3c09df4a908270170125aeb559af8424df3efa1179f09b51738b0e95df5c5f31f590e2a6ab8c31af497a0e15056efeddde7ba1e3297383d01badc68d3b3 + commit: 1356e87e6d1d4076b8bfb735737a0b63 + digest: shake256:574a0e72da9b55e30257557503bd4203513e5ca06dd8bc19fb8bf375fc8525a6bab4d9995e1554db7e9c649bc3778578e0cb96182176206f0653f2a17c073c46 - remote: buf.build owner: cosmos repository: gogo-proto diff --git a/x/tx/signing/aminojson/internal/testpb/test.proto b/x/tx/signing/aminojson/internal/testpb/test.proto index 0b1b3644c843..8be5a3dc1362 100644 --- a/x/tx/signing/aminojson/internal/testpb/test.proto +++ b/x/tx/signing/aminojson/internal/testpb/test.proto @@ -62,6 +62,11 @@ message ABitOfEverything { // google.protobuf.Duration duration = 24; } +message Duration { + google.protobuf.Duration duration = 1; + google.protobuf.Timestamp timestamp = 2; +} + message NestedMessage { option (amino.name) = "NestedMessage"; diff --git a/x/tx/signing/aminojson/internal/testpb/test.pulsar.go b/x/tx/signing/aminojson/internal/testpb/test.pulsar.go index ae8a54ee2571..7cc06a47766e 100644 --- a/x/tx/signing/aminojson/internal/testpb/test.pulsar.go +++ b/x/tx/signing/aminojson/internal/testpb/test.pulsar.go @@ -10,11 +10,11 @@ import ( protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" _ "google.golang.org/protobuf/types/known/anypb" - _ "google.golang.org/protobuf/types/known/durationpb" + durationpb "google.golang.org/protobuf/types/known/durationpb" _ "google.golang.org/protobuf/types/known/emptypb" _ "google.golang.org/protobuf/types/known/fieldmaskpb" _ "google.golang.org/protobuf/types/known/structpb" - _ "google.golang.org/protobuf/types/known/timestamppb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" _ "google.golang.org/protobuf/types/known/wrapperspb" io "io" reflect "reflect" @@ -2594,6 +2594,520 @@ func (x *fastReflection_ABitOfEverything) ProtoMethods() *protoiface.Methods { } } +var ( + md_Duration protoreflect.MessageDescriptor + fd_Duration_duration protoreflect.FieldDescriptor + fd_Duration_timestamp protoreflect.FieldDescriptor +) + +func init() { + file_testpb_test_proto_init() + md_Duration = File_testpb_test_proto.Messages().ByName("Duration") + fd_Duration_duration = md_Duration.Fields().ByName("duration") + fd_Duration_timestamp = md_Duration.Fields().ByName("timestamp") +} + +var _ protoreflect.Message = (*fastReflection_Duration)(nil) + +type fastReflection_Duration Duration + +func (x *Duration) ProtoReflect() protoreflect.Message { + return (*fastReflection_Duration)(x) +} + +func (x *Duration) slowProtoReflect() protoreflect.Message { + mi := &file_testpb_test_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Duration_messageType fastReflection_Duration_messageType +var _ protoreflect.MessageType = fastReflection_Duration_messageType{} + +type fastReflection_Duration_messageType struct{} + +func (x fastReflection_Duration_messageType) Zero() protoreflect.Message { + return (*fastReflection_Duration)(nil) +} +func (x fastReflection_Duration_messageType) New() protoreflect.Message { + return new(fastReflection_Duration) +} +func (x fastReflection_Duration_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Duration +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Duration) Descriptor() protoreflect.MessageDescriptor { + return md_Duration +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Duration) Type() protoreflect.MessageType { + return _fastReflection_Duration_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Duration) New() protoreflect.Message { + return new(fastReflection_Duration) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Duration) Interface() protoreflect.ProtoMessage { + return (*Duration)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Duration) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Duration != nil { + value := protoreflect.ValueOfMessage(x.Duration.ProtoReflect()) + if !f(fd_Duration_duration, value) { + return + } + } + if x.Timestamp != nil { + value := protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) + if !f(fd_Duration_timestamp, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Duration) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "testpb.Duration.duration": + return x.Duration != nil + case "testpb.Duration.timestamp": + return x.Timestamp != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Duration) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "testpb.Duration.duration": + x.Duration = nil + case "testpb.Duration.timestamp": + x.Timestamp = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Duration) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "testpb.Duration.duration": + value := x.Duration + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "testpb.Duration.timestamp": + value := x.Timestamp + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Duration) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "testpb.Duration.duration": + x.Duration = value.Message().Interface().(*durationpb.Duration) + case "testpb.Duration.timestamp": + x.Timestamp = value.Message().Interface().(*timestamppb.Timestamp) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Duration) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.Duration.duration": + if x.Duration == nil { + x.Duration = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.Duration.ProtoReflect()) + case "testpb.Duration.timestamp": + if x.Timestamp == nil { + x.Timestamp = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Duration) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.Duration.duration": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "testpb.Duration.timestamp": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Duration) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in testpb.Duration", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Duration) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Duration) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Duration) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Duration) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Duration) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Duration != nil { + l = options.Size(x.Duration) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Timestamp != nil { + l = options.Size(x.Timestamp) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Duration) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Timestamp != nil { + encoded, err := options.Marshal(x.Timestamp) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.Duration != nil { + encoded, err := options.Marshal(x.Duration) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Duration) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Duration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Duration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Duration == nil { + x.Duration = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Duration); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Timestamp == nil { + x.Timestamp = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Timestamp); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + var ( md_NestedMessage protoreflect.MessageDescriptor fd_NestedMessage_foo protoreflect.FieldDescriptor @@ -2616,7 +3130,7 @@ func (x *NestedMessage) ProtoReflect() protoreflect.Message { } func (x *NestedMessage) slowProtoReflect() protoreflect.Message { - mi := &file_testpb_test_proto_msgTypes[3] + mi := &file_testpb_test_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3357,6 +3871,49 @@ func (x *ABitOfEverything) GetSf64() int64 { return 0 } +type Duration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Duration *durationpb.Duration `protobuf:"bytes,1,opt,name=duration,proto3" json:"duration,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *Duration) Reset() { + *x = Duration{} + if protoimpl.UnsafeEnabled { + mi := &file_testpb_test_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Duration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Duration) ProtoMessage() {} + +// Deprecated: Use Duration.ProtoReflect.Descriptor instead. +func (*Duration) Descriptor() ([]byte, []int) { + return file_testpb_test_proto_rawDescGZIP(), []int{3} +} + +func (x *Duration) GetDuration() *durationpb.Duration { + if x != nil { + return x.Duration + } + return nil +} + +func (x *Duration) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + type NestedMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3369,7 +3926,7 @@ type NestedMessage struct { func (x *NestedMessage) Reset() { *x = NestedMessage{} if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_proto_msgTypes[3] + mi := &file_testpb_test_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3383,7 +3940,7 @@ func (*NestedMessage) ProtoMessage() {} // Deprecated: Use NestedMessage.ProtoReflect.Descriptor instead. func (*NestedMessage) Descriptor() ([]byte, []int) { - return file_testpb_test_proto_rawDescGZIP(), []int{3} + return file_testpb_test_proto_rawDescGZIP(), []int{4} } func (x *NestedMessage) GetFoo() string { @@ -3458,23 +4015,31 @@ var file_testpb_test_proto_rawDesc = []byte{ 0x12, 0x52, 0x04, 0x73, 0x69, 0x36, 0x34, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x66, 0x36, 0x34, 0x18, 0x13, 0x20, 0x01, 0x28, 0x10, 0x52, 0x04, 0x73, 0x66, 0x36, 0x34, 0x3a, 0x15, 0x8a, 0xe7, 0xb0, 0x2a, 0x10, 0x41, 0x42, 0x69, 0x74, 0x4f, 0x66, 0x45, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, - 0x6e, 0x67, 0x22, 0x47, 0x0a, 0x0d, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x03, 0x62, 0x61, 0x72, 0x3a, 0x12, 0x8a, 0xe7, 0xb0, 0x2a, 0x0d, 0x4e, 0x65, - 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x29, 0x0a, 0x06, 0x41, - 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, - 0x03, 0x54, 0x57, 0x4f, 0x10, 0x02, 0x42, 0x83, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x09, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, - 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, - 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x67, 0x22, 0x7b, 0x0a, 0x08, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, + 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, + 0x47, 0x0a, 0x0d, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x66, + 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x03, 0x62, 0x61, 0x72, 0x3a, 0x12, 0x8a, 0xe7, 0xb0, 0x2a, 0x0d, 0x4e, 0x65, 0x73, 0x74, 0x65, + 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x29, 0x0a, 0x06, 0x41, 0x6e, 0x45, 0x6e, + 0x75, 0x6d, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x57, + 0x4f, 0x10, 0x02, 0x42, 0x83, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x70, 0x62, 0x42, 0x09, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, + 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x74, 0x65, 0x73, + 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, + 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, + 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -3490,24 +4055,29 @@ func file_testpb_test_proto_rawDescGZIP() []byte { } var file_testpb_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_testpb_test_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_testpb_test_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_testpb_test_proto_goTypes = []interface{}{ - (AnEnum)(0), // 0: testpb.AnEnum - (*WithAMap)(nil), // 1: testpb.WithAMap - (*WithAList)(nil), // 2: testpb.WithAList - (*ABitOfEverything)(nil), // 3: testpb.ABitOfEverything - (*NestedMessage)(nil), // 4: testpb.NestedMessage - nil, // 5: testpb.WithAMap.StrMapEntry + (AnEnum)(0), // 0: testpb.AnEnum + (*WithAMap)(nil), // 1: testpb.WithAMap + (*WithAList)(nil), // 2: testpb.WithAList + (*ABitOfEverything)(nil), // 3: testpb.ABitOfEverything + (*Duration)(nil), // 4: testpb.Duration + (*NestedMessage)(nil), // 5: testpb.NestedMessage + nil, // 6: testpb.WithAMap.StrMapEntry + (*durationpb.Duration)(nil), // 7: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp } var file_testpb_test_proto_depIdxs = []int32{ - 5, // 0: testpb.WithAMap.str_map:type_name -> testpb.WithAMap.StrMapEntry - 4, // 1: testpb.ABitOfEverything.message:type_name -> testpb.NestedMessage + 6, // 0: testpb.WithAMap.str_map:type_name -> testpb.WithAMap.StrMapEntry + 5, // 1: testpb.ABitOfEverything.message:type_name -> testpb.NestedMessage 0, // 2: testpb.ABitOfEverything.enum:type_name -> testpb.AnEnum - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 7, // 3: testpb.Duration.duration:type_name -> google.protobuf.Duration + 8, // 4: testpb.Duration.timestamp:type_name -> google.protobuf.Timestamp + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_testpb_test_proto_init() } @@ -3553,6 +4123,18 @@ func file_testpb_test_proto_init() { } } file_testpb_test_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Duration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_testpb_test_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NestedMessage); i { case 0: return &v.state @@ -3571,7 +4153,7 @@ func file_testpb_test_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_testpb_test_proto_rawDesc, NumEnums: 1, - NumMessages: 5, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/x/tx/signing/aminojson/json_marshal.go b/x/tx/signing/aminojson/json_marshal.go index 4afb432329d6..800dfc7fd320 100644 --- a/x/tx/signing/aminojson/json_marshal.go +++ b/x/tx/signing/aminojson/json_marshal.go @@ -23,10 +23,16 @@ type FieldEncoder func(*Encoder, protoreflect.Value, io.Writer) error // EncoderOptions are options for creating a new Encoder. type EncoderOptions struct { - // DonotSortFields when set turns off sorting of field names. + // Indent can only be composed of space or tab characters. + // It defines the indentation used for each level of indentation. + Indent string + // DoNotSortFields when set turns off sorting of field names. DoNotSortFields bool + // EnumAsString when set will encode enums as strings instead of integers. + // Caution: Enabling this option produce different sign bytes. + EnumAsString bool // TypeResolver is used to resolve protobuf message types by TypeURL when marshaling any packed messages. - TypeResolver protoregistry.MessageTypeResolver + TypeResolver signing.TypeResolver // FileResolver is used to resolve protobuf file descriptors TypeURL when TypeResolver fails. FileResolver signing.ProtoFileResolver } @@ -34,12 +40,15 @@ type EncoderOptions struct { // Encoder is a JSON encoder that uses the Amino JSON encoding rules for protobuf messages. type Encoder struct { // maps cosmos_proto.scalar -> field encoder - scalarEncoders map[string]FieldEncoder - messageEncoders map[string]MessageEncoder - fieldEncoders map[string]FieldEncoder - fileResolver signing.ProtoFileResolver - typeResolver protoregistry.MessageTypeResolver - doNotSortFields bool + cosmosProtoScalarEncoders map[string]FieldEncoder + aminoMessageEncoders map[string]MessageEncoder + aminoFieldEncoders map[string]FieldEncoder + protoTypeEncoders map[string]MessageEncoder + fileResolver signing.ProtoFileResolver + typeResolver protoregistry.MessageTypeResolver + doNotSortFields bool + indent string + enumsAsString bool } // NewEncoder returns a new Encoder capable of serializing protobuf messages to JSON using the Amino JSON encoding @@ -52,21 +61,28 @@ func NewEncoder(options EncoderOptions) Encoder { options.TypeResolver = protoregistry.GlobalTypes } enc := Encoder{ - scalarEncoders: map[string]FieldEncoder{ + cosmosProtoScalarEncoders: map[string]FieldEncoder{ "cosmos.Dec": cosmosDecEncoder, "cosmos.Int": cosmosIntEncoder, }, - messageEncoders: map[string]MessageEncoder{ + aminoMessageEncoders: map[string]MessageEncoder{ "key_field": keyFieldEncoder, "module_account": moduleAccountEncoder, "threshold_string": thresholdStringEncoder, }, - fieldEncoders: map[string]FieldEncoder{ + aminoFieldEncoders: map[string]FieldEncoder{ "legacy_coins": nullSliceAsEmptyEncoder, }, + protoTypeEncoders: map[string]MessageEncoder{ + "google.protobuf.Timestamp": marshalTimestamp, + "google.protobuf.Duration": marshalDuration, + "google.protobuf.Any": marshalAny, + }, fileResolver: options.FileResolver, typeResolver: options.TypeResolver, doNotSortFields: options.DoNotSortFields, + indent: options.Indent, + enumsAsString: options.EnumAsString, } return enc } @@ -81,10 +97,10 @@ func NewEncoder(options EncoderOptions) Encoder { // ... // } func (enc Encoder) DefineMessageEncoding(name string, encoder MessageEncoder) Encoder { - if enc.messageEncoders == nil { - enc.messageEncoders = map[string]MessageEncoder{} + if enc.aminoMessageEncoders == nil { + enc.aminoMessageEncoders = map[string]MessageEncoder{} } - enc.messageEncoders[name] = encoder + enc.aminoMessageEncoders[name] = encoder return enc } @@ -102,36 +118,89 @@ func (enc Encoder) DefineMessageEncoding(name string, encoder MessageEncoder) En // ... // } func (enc Encoder) DefineFieldEncoding(name string, encoder FieldEncoder) Encoder { - if enc.fieldEncoders == nil { - enc.fieldEncoders = map[string]FieldEncoder{} + if enc.aminoFieldEncoders == nil { + enc.aminoFieldEncoders = map[string]FieldEncoder{} + } + enc.aminoFieldEncoders[name] = encoder + return enc +} + +// DefineScalarEncoding defines a custom encoding for a protobuf scalar field. The `name` field must match a usage of +// an (cosmos_proto.scalar) option in the protobuf message as in the following example. This encoding will be used +// instead of the default encoding for all usages of the tagged field. +// +// message Balance { +// string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +// ... +// } +func (enc Encoder) DefineScalarEncoding(name string, encoder FieldEncoder) Encoder { + if enc.cosmosProtoScalarEncoders == nil { + enc.cosmosProtoScalarEncoders = map[string]FieldEncoder{} + } + enc.cosmosProtoScalarEncoders[name] = encoder + return enc +} + +// DefineTypeEncoding defines a custom encoding for a protobuf message type. The `typeURL` field must match the +// type of the protobuf message as in the following example. This encoding will be used instead of the default +// encoding for all usages of the tagged message. +// +// message Foo { +// google.protobuf.Duration type_url = 1; +// ... +// } + +func (enc Encoder) DefineTypeEncoding(typeURL string, encoder MessageEncoder) Encoder { + if enc.protoTypeEncoders == nil { + enc.protoTypeEncoders = map[string]MessageEncoder{} } - enc.fieldEncoders[name] = encoder + enc.protoTypeEncoders[typeURL] = encoder return enc } // Marshal serializes a protobuf message to JSON. func (enc Encoder) Marshal(message proto.Message) ([]byte, error) { buf := &bytes.Buffer{} - err := enc.beginMarshal(message.ProtoReflect(), buf) + err := enc.beginMarshal(message.ProtoReflect(), buf, false) + + if enc.indent != "" { + indentBuf := &bytes.Buffer{} + if err := json.Indent(indentBuf, buf.Bytes(), "", enc.indent); err != nil { + return nil, err + } + + return indentBuf.Bytes(), err + } + return buf.Bytes(), err } -func (enc Encoder) beginMarshal(msg protoreflect.Message, writer io.Writer) error { - name, named := getMessageAminoName(msg.Descriptor().Options()) +func (enc Encoder) beginMarshal(msg protoreflect.Message, writer io.Writer, isAny bool) error { + var ( + name string + named bool + ) + + if isAny { + name, named = getMessageAminoNameAny(msg), true + } else { + name, named = getMessageAminoName(msg) + } + if named { - _, err := writer.Write([]byte(fmt.Sprintf(`{"type":"%s","value":`, name))) + _, err := fmt.Fprintf(writer, `{"type":"%s","value":`, name) if err != nil { return err } } - err := enc.marshal(protoreflect.ValueOfMessage(msg), writer) + err := enc.marshal(protoreflect.ValueOfMessage(msg), nil /* no field descriptor needed here */, writer) if err != nil { return err } if named { - _, err = writer.Write([]byte("}")) + _, err = io.WriteString(writer, "}") if err != nil { return err } @@ -140,7 +209,7 @@ func (enc Encoder) beginMarshal(msg protoreflect.Message, writer io.Writer) erro return nil } -func (enc Encoder) marshal(value protoreflect.Value, writer io.Writer) error { +func (enc Encoder) marshal(value protoreflect.Value, fd protoreflect.FieldDescriptor, writer io.Writer) error { switch val := value.Interface().(type) { case protoreflect.Message: err := enc.marshalMessage(val, writer) @@ -151,12 +220,23 @@ func (enc Encoder) marshal(value protoreflect.Value, writer io.Writer) error { case protoreflect.List: if !val.IsValid() { - _, err := writer.Write([]byte("null")) + _, err := io.WriteString(writer, "null") return err } - return enc.marshalList(val, writer) + return enc.marshalList(val, fd, writer) + + case string, bool, int32, uint32, []byte: + return jsonMarshal(writer, val) + + case protoreflect.EnumNumber: + if enc.enumsAsString && fd != nil { + desc := fd.Enum().Values().ByNumber(val) + if desc != nil { + _, err := io.WriteString(writer, fmt.Sprintf(`"%s"`, desc.Name())) + return err + } + } - case string, bool, int32, uint32, []byte, protoreflect.EnumNumber: return jsonMarshal(writer, val) case uint64, int64: @@ -178,14 +258,9 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er return errors.New("nil message") } - switch msg.Descriptor().FullName() { - case timestampFullName: - // replicate https://github.com/tendermint/go-amino/blob/8e779b71f40d175cd1302d3cd41a75b005225a7a/json-encode.go#L45-L51 - return marshalTimestamp(msg, writer) - case durationFullName: - return marshalDuration(msg, writer) - case anyFullName: - return enc.marshalAny(msg, writer) + // check if we have a custom type encoder for this type + if typeEnc, ok := enc.protoTypeEncoders[string(msg.Descriptor().FullName())]; ok { + return typeEnc(&enc, msg, writer) } if encoder := enc.getMessageEncoder(msg); encoder != nil { @@ -193,7 +268,7 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er return err } - _, err := writer.Write([]byte("{")) + _, err := io.WriteString(writer, "{") if err != nil { return err } @@ -248,15 +323,14 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er } if !first { - _, err = writer.Write([]byte(",")) + _, err = io.WriteString(writer, ",") if err != nil { return err } } if isOneOf && !writeNil { - _, err = writer.Write([]byte(fmt.Sprintf(`"%s":{"type":"%s","value":{`, - oneofFieldName, oneofTypeName))) + _, err = fmt.Fprintf(writer, `"%s":{"type":"%s","value":{`, oneofFieldName, oneofTypeName) if err != nil { return err } @@ -267,7 +341,7 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er return err } - _, err = writer.Write([]byte(":")) + _, err = io.WriteString(writer, ":") if err != nil { return err } @@ -279,19 +353,19 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er return err } } else if writeNil { - _, err = writer.Write([]byte("null")) + _, err = io.WriteString(writer, "null") if err != nil { return err } } else { - err = enc.marshal(v, writer) + err = enc.marshal(v, f, writer) if err != nil { return err } } if isOneOf && !writeNil { - _, err = writer.Write([]byte("}}")) + _, err = io.WriteString(writer, "}}") if err != nil { return err } @@ -300,7 +374,7 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er first = false } - _, err = writer.Write([]byte("}")) + _, err = io.WriteString(writer, "}") return err } @@ -313,10 +387,10 @@ func jsonMarshal(w io.Writer, v interface{}) error { return err } -func (enc Encoder) marshalList(list protoreflect.List, writer io.Writer) error { +func (enc Encoder) marshalList(list protoreflect.List, fd protoreflect.FieldDescriptor, writer io.Writer) error { n := list.Len() - _, err := writer.Write([]byte("[")) + _, err := io.WriteString(writer, "[") if err != nil { return err } @@ -324,25 +398,19 @@ func (enc Encoder) marshalList(list protoreflect.List, writer io.Writer) error { first := true for i := 0; i < n; i++ { if !first { - _, err := writer.Write([]byte(",")) + _, err := io.WriteString(writer, ",") if err != nil { return err } } first = false - err = enc.marshal(list.Get(i), writer) + err = enc.marshal(list.Get(i), fd, writer) if err != nil { return err } } - _, err = writer.Write([]byte("]")) + _, err = io.WriteString(writer, "]") return err } - -const ( - timestampFullName protoreflect.FullName = "google.protobuf.Timestamp" - durationFullName protoreflect.FullName = "google.protobuf.Duration" - anyFullName protoreflect.FullName = "google.protobuf.Any" -) diff --git a/x/tx/signing/aminojson/json_marshal_test.go b/x/tx/signing/aminojson/json_marshal_test.go index 08d4263cd29b..be8caf8c7364 100644 --- a/x/tx/signing/aminojson/json_marshal_test.go +++ b/x/tx/signing/aminojson/json_marshal_test.go @@ -2,9 +2,12 @@ package aminojson_test import ( "encoding/json" + "errors" "fmt" + "io" "reflect" "testing" + "time" "github.com/cosmos/cosmos-proto/rapidproto" "github.com/stretchr/testify/require" @@ -14,6 +17,7 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/types/dynamicpb" + "google.golang.org/protobuf/types/known/durationpb" "gotest.tools/v3/assert" "pgregory.net/rapid" @@ -117,12 +121,13 @@ func TestAminoJSON(t *testing.T) { require.Equal(t, string(sortedBz), string(encodedDefaultBz)) } -func naiveSortedJSON(t testing.TB, jsonToSort []byte) []byte { +func naiveSortedJSON(tb testing.TB, jsonToSort []byte) []byte { + tb.Helper() var c interface{} err := json.Unmarshal(jsonToSort, &c) - assert.NilError(t, err) + assert.NilError(tb, err) sortedBz, err := json.Marshal(c) - assert.NilError(t, err) + assert.NilError(tb, err) return sortedBz } @@ -173,6 +178,152 @@ func TestDynamicPb(t *testing.T) { require.NoError(t, err) dynamicBz, err := encoder.Marshal(dynamicMsg) require.NoError(t, err) - fmt.Printf("dynamicBz: %s\n", string(dynamicBz)) require.Equal(t, string(bz), string(dynamicBz)) } + +func TestMarshalDuration(t *testing.T) { + msg := &testpb.Duration{ + Duration: &durationpb.Duration{Seconds: 1}, + } + encoder := aminojson.NewEncoder(aminojson.EncoderOptions{}) + + bz, err := encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{"duration":"1000000000"}`, string(bz)) + + // define a custom marshaler for duration + encoder.DefineTypeEncoding("google.protobuf.Duration", func(_ *aminojson.Encoder, msg protoreflect.Message, w io.Writer) error { + var secondsName protoreflect.Name = "seconds" + + fields := msg.Descriptor().Fields() + secondsField := fields.ByName(secondsName) + if secondsField == nil { + return errors.New("expected seconds field") + } + seconds := msg.Get(secondsField).Int() + + _, err = fmt.Fprint(w, "\"", (time.Duration(seconds) * time.Second).String(), "\"") + return err + }) + bz, err = encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{"duration":"1s"}`, string(bz)) +} + +func TestIndent(t *testing.T) { + encoder := aminojson.NewEncoder(aminojson.EncoderOptions{Indent: " "}) + + msg := &testpb.ABitOfEverything{ + Message: &testpb.NestedMessage{ + Foo: "test", + Bar: 0, // this is the default value and should be omitted from output + }, + Enum: testpb.AnEnum_ONE, + Repeated: []int32{3, -7, 2, 6, 4}, + Str: `abcxyz"foo"def`, + Bool: true, + Bytes: []byte{0, 1, 2, 3}, + I32: -15, + F32: 1001, + U32: 1200, + Si32: -376, + Sf32: -1000, + I64: 14578294827584932, + F64: 9572348124213523654, + U64: 4759492485, + Si64: -59268425823934, + Sf64: -659101379604211154, + } + + bz, err := encoder.Marshal(msg) + require.NoError(t, err) + fmt.Println(string(bz)) + require.Equal(t, `{ + "type": "ABitOfEverything", + "value": { + "bool": true, + "bytes": "AAECAw==", + "enum": 1, + "f32": 1001, + "f64": "9572348124213523654", + "i32": -15, + "i64": "14578294827584932", + "message": { + "foo": "test" + }, + "repeated": [ + 3, + -7, + 2, + 6, + 4 + ], + "sf32": -1000, + "sf64": "-659101379604211154", + "si32": -376, + "si64": "-59268425823934", + "str": "abcxyz\"foo\"def", + "u32": 1200, + "u64": "4759492485" + } +}`, string(bz)) +} + +func TestEnumAsString(t *testing.T) { + encoder := aminojson.NewEncoder(aminojson.EncoderOptions{Indent: " ", EnumAsString: true}) + + msg := &testpb.ABitOfEverything{ + Message: &testpb.NestedMessage{ + Foo: "test", + Bar: 0, // this is the default value and should be omitted from output + }, + Enum: testpb.AnEnum_ONE, + Repeated: []int32{3, -7, 2, 6, 4}, + Str: `abcxyz"foo"def`, + Bool: true, + Bytes: []byte{0, 1, 2, 3}, + I32: -15, + F32: 1001, + U32: 1200, + Si32: -376, + Sf32: -1000, + I64: 14578294827584932, + F64: 9572348124213523654, + U64: 4759492485, + Si64: -59268425823934, + Sf64: -659101379604211154, + } + + bz, err := encoder.Marshal(msg) + require.NoError(t, err) + fmt.Println(string(bz)) + require.Equal(t, `{ + "type": "ABitOfEverything", + "value": { + "bool": true, + "bytes": "AAECAw==", + "enum": "ONE", + "f32": 1001, + "f64": "9572348124213523654", + "i32": -15, + "i64": "14578294827584932", + "message": { + "foo": "test" + }, + "repeated": [ + 3, + -7, + 2, + 6, + 4 + ], + "sf32": -1000, + "sf64": "-659101379604211154", + "si32": -376, + "si64": "-59268425823934", + "str": "abcxyz\"foo\"def", + "u32": 1200, + "u64": "4759492485" + } +}`, string(bz)) +} diff --git a/x/tx/signing/aminojson/options.go b/x/tx/signing/aminojson/options.go index f8b8991d04db..0eecedb88731 100644 --- a/x/tx/signing/aminojson/options.go +++ b/x/tx/signing/aminojson/options.go @@ -2,6 +2,7 @@ package aminojson import ( cosmos_proto "github.com/cosmos/cosmos-proto" + gogoproto "github.com/cosmos/gogoproto/proto" "github.com/iancoleman/strcase" "github.com/pkg/errors" "google.golang.org/protobuf/proto" @@ -12,14 +13,38 @@ import ( // getMessageAminoName returns the amino name of a message if it has been set by the `amino.name` option. // If the message does not have an amino name, then the function returns false. -func getMessageAminoName(messageOptions proto.Message) (string, bool) { +func getMessageAminoName(msg protoreflect.Message) (string, bool) { + messageOptions := msg.Descriptor().Options() if proto.HasExtension(messageOptions, amino.E_Name) { name := proto.GetExtension(messageOptions, amino.E_Name) return name.(string), true } + return "", false } +// getMessageAminoName returns the amino name of a message if it has been set by the `amino.name` option. +// If the message does not have an amino name, then it returns the msg url. +// If it cannot get the msg url, then it returns false. +func getMessageAminoNameAny(msg protoreflect.Message) string { + messageOptions := msg.Descriptor().Options() + if proto.HasExtension(messageOptions, amino.E_Name) { + name := proto.GetExtension(messageOptions, amino.E_Name) + return name.(string) + } + + msgURL := "/" + string(msg.Descriptor().FullName()) + if msgURL != "/" { + return msgURL + } + + if m, ok := msg.(gogoproto.Message); ok { + return "/" + gogoproto.MessageName(m) + } + + return "" +} + // omitEmpty returns true if the field should be omitted if empty. Empty field omission is the default behavior. func omitEmpty(field protoreflect.FieldDescriptor) bool { opts := field.Options() @@ -64,7 +89,7 @@ func (enc Encoder) getMessageEncoder(message protoreflect.Message) MessageEncode opts := message.Descriptor().Options() if proto.HasExtension(opts, amino.E_MessageEncoding) { encoding := proto.GetExtension(opts, amino.E_MessageEncoding).(string) - if fn, ok := enc.messageEncoders[encoding]; ok { + if fn, ok := enc.aminoMessageEncoders[encoding]; ok { return fn } } @@ -75,13 +100,13 @@ func (enc Encoder) getFieldEncoding(field protoreflect.FieldDescriptor) FieldEnc opts := field.Options() if proto.HasExtension(opts, amino.E_Encoding) { encoding := proto.GetExtension(opts, amino.E_Encoding).(string) - if fn, ok := enc.fieldEncoders[encoding]; ok { + if fn, ok := enc.aminoFieldEncoders[encoding]; ok { return fn } } if proto.HasExtension(opts, cosmos_proto.E_Scalar) { scalar := proto.GetExtension(opts, cosmos_proto.E_Scalar).(string) - if fn, ok := enc.scalarEncoders[scalar]; ok { + if fn, ok := enc.cosmosProtoScalarEncoders[scalar]; ok { return fn } } diff --git a/x/tx/signing/aminojson/options_test.go b/x/tx/signing/aminojson/options_test.go new file mode 100644 index 000000000000..8038827f0f7f --- /dev/null +++ b/x/tx/signing/aminojson/options_test.go @@ -0,0 +1,30 @@ +package aminojson + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/x/tx/signing/aminojson/internal/testpb" +) + +func Test_getMessageAminoName(t *testing.T) { + msg := &testpb.ABitOfEverything{} + name, ok := getMessageAminoName(msg.ProtoReflect()) + require.True(t, ok) + require.Equal(t, "ABitOfEverything", name) + + secondMsg := &testpb.Duration{} + _, ok = getMessageAminoName(secondMsg.ProtoReflect()) + require.False(t, ok) +} + +func Test_getMessageAminoNameAny(t *testing.T) { + msg := &testpb.ABitOfEverything{} + name := getMessageAminoNameAny(msg.ProtoReflect()) + require.Equal(t, "ABitOfEverything", name) + + secondMsg := &testpb.Duration{} + name = getMessageAminoNameAny(secondMsg.ProtoReflect()) + require.Equal(t, "/testpb.Duration", name) +} diff --git a/x/tx/signing/aminojson/time.go b/x/tx/signing/aminojson/time.go index da02514c0255..9bfa035928e7 100644 --- a/x/tx/signing/aminojson/time.go +++ b/x/tx/signing/aminojson/time.go @@ -1,6 +1,7 @@ package aminojson import ( + "errors" "fmt" "io" "math" @@ -14,16 +15,17 @@ const ( nanosName protoreflect.Name = "nanos" ) -func marshalTimestamp(message protoreflect.Message, writer io.Writer) error { +// marshalTimestamp replicate https://github.com/tendermint/go-amino/blob/8e779b71f40d175cd1302d3cd41a75b005225a7a/json-encode.go#L45-L51 +func marshalTimestamp(_ *Encoder, message protoreflect.Message, writer io.Writer) error { fields := message.Descriptor().Fields() secondsField := fields.ByName(secondsName) if secondsField == nil { - return fmt.Errorf("expected seconds field") + return errors.New("expected seconds field") } nanosField := fields.ByName(nanosName) if nanosField == nil { - return fmt.Errorf("expected nanos field") + return errors.New("expected nanos field") } seconds := message.Get(secondsField).Int() @@ -48,11 +50,11 @@ func marshalTimestamp(message protoreflect.Message, writer io.Writer) error { // gogoproto encodes google.protobuf.Duration as a time.Duration, which is 64-bit signed integer. const MaxDurationSeconds = int64(math.MaxInt64)/1e9 - 1 -func marshalDuration(message protoreflect.Message, writer io.Writer) error { +func marshalDuration(_ *Encoder, message protoreflect.Message, writer io.Writer) error { fields := message.Descriptor().Fields() secondsField := fields.ByName(secondsName) if secondsField == nil { - return fmt.Errorf("expected seconds field") + return errors.New("expected seconds field") } // todo @@ -64,11 +66,11 @@ func marshalDuration(message protoreflect.Message, writer io.Writer) error { nanosField := fields.ByName(nanosName) if nanosField == nil { - return fmt.Errorf("expected nanos field") + return errors.New("expected nanos field") } nanos := message.Get(nanosField).Int() totalNanos := nanos + (seconds * 1e9) - _, err := writer.Write([]byte(fmt.Sprintf(`"%d"`, totalNanos))) + _, err := fmt.Fprintf(writer, `"%d"`, totalNanos) return err } diff --git a/x/tx/signing/context.go b/x/tx/signing/context.go index c4e99bdf2003..d90fb4a5cb30 100644 --- a/x/tx/signing/context.go +++ b/x/tx/signing/context.go @@ -14,6 +14,11 @@ import ( "cosmossdk.io/core/address" ) +type TypeResolver interface { + protoregistry.MessageTypeResolver + protoregistry.ExtensionTypeResolver +} + // Context is a context for retrieving the list of signers from a // message where signers are specified by the cosmos.msg.v1.signer protobuf // option. It also contains the ProtoFileResolver and address.Codec's used @@ -25,6 +30,7 @@ type Context struct { validatorAddressCodec address.Codec getSignersFuncs map[protoreflect.FullName]GetSignersFunc customGetSignerFuncs map[protoreflect.FullName]GetSignersFunc + maxRecursionDepth int } // Options are options for creating Context which will be used for signing operations. @@ -34,7 +40,7 @@ type Options struct { FileResolver ProtoFileResolver // TypeResolver is the protobuf type resolver to use for resolving message types. - TypeResolver protoregistry.MessageTypeResolver + TypeResolver TypeResolver // AddressCodec is the codec for converting addresses between strings and bytes. AddressCodec address.Codec @@ -42,7 +48,11 @@ type Options struct { // ValidatorAddressCodec is the codec for converting validator addresses between strings and bytes. ValidatorAddressCodec address.Codec + // CustomGetSigners is a map of message types to custom GetSignersFuncs. CustomGetSigners map[protoreflect.FullName]GetSignersFunc + + // MaxRecursionDepth is the maximum depth of nested messages that will be traversed + MaxRecursionDepth int } // DefineCustomGetSigners defines a custom GetSigners function for a given @@ -85,6 +95,10 @@ func NewContext(options Options) (*Context, error) { return nil, errors.New("validator address codec is required") } + if options.MaxRecursionDepth <= 0 { + options.MaxRecursionDepth = 32 + } + customGetSignerFuncs := map[protoreflect.FullName]GetSignersFunc{} for k := range options.CustomGetSigners { customGetSignerFuncs[k] = options.CustomGetSigners[k] @@ -97,6 +111,7 @@ func NewContext(options Options) (*Context, error) { validatorAddressCodec: options.ValidatorAddressCodec, getSignersFuncs: map[protoreflect.FullName]GetSignersFunc{}, customGetSignerFuncs: customGetSignerFuncs, + maxRecursionDepth: options.MaxRecursionDepth, } return c, nil @@ -203,92 +218,87 @@ func (c *Context) makeGetSignersFunc(descriptor protoreflect.MessageDescriptor) } } case protoreflect.MessageKind: - isList := field.IsList() - nestedMessage := field.Message() - nestedSignersFields, err := getSignersFieldNames(nestedMessage) - if err != nil { - return nil, err - } - - if len(nestedSignersFields) != 1 { - return nil, fmt.Errorf("nested cosmos.msg.v1.signer option in message %s must contain only one value", nestedMessage.FullName()) - } - - nestedFieldName := nestedSignersFields[0] - nestedField := nestedMessage.Fields().ByName(protoreflect.Name(nestedFieldName)) - nestedIsList := nestedField.IsList() - if nestedField == nil { - return nil, fmt.Errorf("field %s not found in message %s", nestedFieldName, nestedMessage.FullName()) - } - - if nestedField.Kind() != protoreflect.StringKind || nestedField.IsMap() || nestedField.HasOptionalKeyword() { - return nil, fmt.Errorf("nested signer field %s in message %s must be a simple string", nestedFieldName, nestedMessage.FullName()) - } - - addrCdc := c.getAddressCodec(nestedField) - - if isList { - if nestedIsList { - fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { - msgs := msg.ProtoReflect().Get(field).List() - m := msgs.Len() - for i := 0; i < m; i++ { - signers := msgs.Get(i).Message().Get(nestedField).List() - n := signers.Len() - for j := 0; j < n; j++ { - addrStr := signers.Get(j).String() - addrBz, err := addrCdc.StringToBytes(addrStr) - if err != nil { - return nil, err - } - arr = append(arr, addrBz) - } - } - return arr, nil - } - } else { - fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { - msgs := msg.ProtoReflect().Get(field).List() - m := msgs.Len() - for i := 0; i < m; i++ { - addrStr := msgs.Get(i).Message().Get(nestedField).String() - addrBz, err := addrCdc.StringToBytes(addrStr) + var fieldGetter func(protoreflect.Message, int) ([][]byte, error) + fieldGetter = func(msg protoreflect.Message, depth int) ([][]byte, error) { + if depth > c.maxRecursionDepth { + return nil, errors.New("maximum recursion depth exceeded") + } + desc := msg.Descriptor() + signerFields, err := getSignersFieldNames(desc) + if err != nil { + return nil, err + } + if len(signerFields) != 1 { + return nil, fmt.Errorf("nested cosmos.msg.v1.signer option in message %s must contain only one value", desc.FullName()) + } + signerFieldName := signerFields[0] + childField := desc.Fields().ByName(protoreflect.Name(signerFieldName)) + switch { + case childField.Kind() == protoreflect.MessageKind: + if childField.IsList() { + childMsgs := msg.Get(childField).List() + var arr [][]byte + for i := 0; i < childMsgs.Len(); i++ { + res, err := fieldGetter(childMsgs.Get(i).Message(), depth+1) if err != nil { return nil, err } - arr = append(arr, addrBz) + arr = append(arr, res...) } return arr, nil + } else { + return fieldGetter(msg.Get(childField).Message(), depth+1) } - } - } else { - if nestedIsList { - fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { - nestedMsg := msg.ProtoReflect().Get(field).Message() - signers := nestedMsg.Get(nestedField).List() - n := signers.Len() - for j := 0; j < n; j++ { - addrStr := signers.Get(j).String() + case childField.IsMap() || childField.HasOptionalKeyword(): + return nil, fmt.Errorf("cosmos.msg.v1.signer field %s in message %s must not be a map or optional", signerFieldName, desc.FullName()) + case childField.Kind() == protoreflect.StringKind: + addrCdc := c.getAddressCodec(childField) + if childField.IsList() { + childMsgs := msg.Get(childField).List() + n := childMsgs.Len() + var res [][]byte + for i := 0; i < n; i++ { + addrStr := childMsgs.Get(i).String() addrBz, err := addrCdc.StringToBytes(addrStr) if err != nil { return nil, err } - arr = append(arr, addrBz) + res = append(res, addrBz) } - return arr, nil - } - } else { - fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { - addrStr := msg.ProtoReflect().Get(field).Message().Get(nestedField).String() + return res, nil + } else { + addrStr := msg.Get(childField).String() addrBz, err := addrCdc.StringToBytes(addrStr) if err != nil { return nil, err } - return append(arr, addrBz), nil + return [][]byte{addrBz}, nil } } + return nil, fmt.Errorf("unexpected field type %s for field %s in message %s, only string and message type are supported", + childField.Kind(), signerFieldName, desc.FullName()) } + fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { + if field.IsList() { + signers := msg.ProtoReflect().Get(field).List() + n := signers.Len() + for i := 0; i < n; i++ { + res, err := fieldGetter(signers.Get(i).Message(), 0) + if err != nil { + return nil, err + } + arr = append(arr, res...) + } + } else { + res, err := fieldGetter(msg.ProtoReflect().Get(field).Message(), 0) + if err != nil { + return nil, err + } + arr = append(arr, res...) + } + return arr, nil + } default: return nil, fmt.Errorf("unexpected field type %s for field %s in message %s", field.Kind(), fieldName, descriptor.FullName()) } diff --git a/x/tx/signing/context_test.go b/x/tx/signing/context_test.go index 0be18c98914b..d8c2b370333a 100644 --- a/x/tx/signing/context_test.go +++ b/x/tx/signing/context_test.go @@ -14,6 +14,43 @@ import ( "cosmossdk.io/x/tx/internal/testpb" ) +var deeplyNestedRepeatedSigner = &testpb.DeeplyNestedRepeatedSigner{ + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner{ + { + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner_Inner{ + { + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{ + { + Signer: []string{hex.EncodeToString([]byte("foo")), hex.EncodeToString([]byte("bar"))}, + }, + }, + }, + }, + }, + { + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner_Inner{ + { + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{ + { + Signer: []string{hex.EncodeToString([]byte("baz"))}, + }, + }, + }, + { + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{ + { + Signer: []string{hex.EncodeToString([]byte("qux")), hex.EncodeToString([]byte("fuz"))}, + }, + { + Signer: []string{hex.EncodeToString([]byte("bing")), hex.EncodeToString([]byte("bap"))}, + }, + }, + }, + }, + }, + }, +} + func TestGetSigners(t *testing.T) { ctx, err := NewContext(Options{ AddressCodec: dummyAddressCodec{}, @@ -88,7 +125,18 @@ func TestGetSigners(t *testing.T) { want: [][]byte{[]byte("foo"), []byte("bar")}, }, { - name: "nested repeated", + name: "deeply nested", + msg: &testpb.DeeplyNestedSigner{ + InnerOne: &testpb.DeeplyNestedSigner_InnerOne{ + InnerTwo: &testpb.DeeplyNestedSigner_InnerOne_InnerTwo{ + Signer: hex.EncodeToString([]byte("foo")), + }, + }, + }, + want: [][]byte{[]byte("foo")}, + }, + { + name: "nested repeated #1", msg: &testpb.NestedRepeatedSigner{Inner: &testpb.NestedRepeatedSigner_Inner{ Signer: []string{ hex.EncodeToString([]byte("foo")), @@ -97,6 +145,11 @@ func TestGetSigners(t *testing.T) { }}, want: [][]byte{[]byte("foo"), []byte("bar")}, }, + { + name: "nested repeated #2", + msg: deeplyNestedRepeatedSigner, + want: [][]byte{[]byte("foo"), []byte("bar"), []byte("baz"), []byte("qux"), []byte("fuz"), []byte("bing"), []byte("bap")}, + }, { name: "repeated nested repeated", msg: &testpb.RepeatedNestedRepeatedSigner{Inner: []*testpb.RepeatedNestedRepeatedSigner_Inner{ @@ -145,6 +198,27 @@ func TestGetSigners(t *testing.T) { } } +func TestMaxRecursionDepth(t *testing.T) { + ctx, err := NewContext(Options{ + AddressCodec: dummyAddressCodec{}, + ValidatorAddressCodec: dummyValidatorAddressCodec{}, + MaxRecursionDepth: 1, + }) + require.NoError(t, err) + + _, err = ctx.GetSigners(deeplyNestedRepeatedSigner) + require.ErrorContains(t, err, "maximum recursion depth exceeded") + + ctx, err = NewContext(Options{ + AddressCodec: dummyAddressCodec{}, + ValidatorAddressCodec: dummyValidatorAddressCodec{}, + MaxRecursionDepth: 5, + }) + require.NoError(t, err) + _, err = ctx.GetSigners(deeplyNestedRepeatedSigner) + require.NoError(t, err) +} + func TestDefineCustomGetSigners(t *testing.T) { customMsg := &testpb.Ballot{} signers := [][]byte{[]byte("foo")} diff --git a/x/tx/signing/direct/direct.go b/x/tx/signing/direct/direct.go index 420daf6012ef..57e005981010 100644 --- a/x/tx/signing/direct/direct.go +++ b/x/tx/signing/direct/direct.go @@ -10,6 +10,11 @@ import ( "cosmossdk.io/x/tx/signing" ) +var ( + _ signing.SignModeHandler = SignModeHandler{} + protov2MarshalOpts = proto.MarshalOptions{Deterministic: true} +) + // SignModeHandler is the SIGN_MODE_DIRECT implementation of signing.SignModeHandler. type SignModeHandler struct{} @@ -20,12 +25,10 @@ func (h SignModeHandler) Mode() signingv1beta1.SignMode { // GetSignBytes implements signing.SignModeHandler.GetSignBytes. func (SignModeHandler) GetSignBytes(_ context.Context, signerData signing.SignerData, txData signing.TxData) ([]byte, error) { - return proto.Marshal(&txv1beta1.SignDoc{ + return protov2MarshalOpts.Marshal(&txv1beta1.SignDoc{ BodyBytes: txData.BodyBytes, AuthInfoBytes: txData.AuthInfoBytes, ChainId: signerData.ChainID, AccountNumber: signerData.AccountNumber, }) } - -var _ signing.SignModeHandler = SignModeHandler{} diff --git a/x/tx/signing/directaux/direct_aux.go b/x/tx/signing/directaux/direct_aux.go index 2ed0f149e353..fbc56b670888 100644 --- a/x/tx/signing/directaux/direct_aux.go +++ b/x/tx/signing/directaux/direct_aux.go @@ -2,6 +2,7 @@ package directaux import ( "context" + "errors" "fmt" "github.com/cosmos/cosmos-proto/anyutil" @@ -34,7 +35,7 @@ func NewSignModeHandler(options SignModeHandlerOptions) (SignModeHandler, error) h := SignModeHandler{} if options.SignersContext == nil { - return h, fmt.Errorf("signers context is required") + return h, errors.New("signers context is required") } h.signersContext = options.SignersContext @@ -60,7 +61,7 @@ func (h SignModeHandler) Mode() signingv1beta1.SignMode { // https://github.com/cosmos/cosmos-sdk/blob/4a6a1e3cb8de459891cb0495052589673d14ef51/x/auth/tx/builder.go#L142 func (h SignModeHandler) getFirstSigner(txData signing.TxData) ([]byte, error) { if len(txData.Body.Messages) == 0 { - return nil, fmt.Errorf("no signer found") + return nil, errors.New("no signer found") } msg, err := anyutil.Unpack(txData.Body.Messages[0], h.fileResolver, h.typeResolver) @@ -100,7 +101,8 @@ func (h SignModeHandler) GetSignBytes( ChainId: signerData.ChainID, AccountNumber: signerData.AccountNumber, Sequence: signerData.Sequence, - Tip: txData.AuthInfo.Tip, //nolint:staticcheck // keep it for compatibility } - return proto.Marshal(signDocDirectAux) + + protov2MarshalOpts := proto.MarshalOptions{Deterministic: true} + return protov2MarshalOpts.Marshal(signDocDirectAux) } diff --git a/x/tx/signing/directaux/direct_aux_test.go b/x/tx/signing/directaux/direct_aux_test.go index 7a1d8a9df7ef..00c48222aa89 100644 --- a/x/tx/signing/directaux/direct_aux_test.go +++ b/x/tx/signing/directaux/direct_aux_test.go @@ -54,7 +54,6 @@ func TestDirectAuxHandler(t *testing.T) { GasLimit: 20000, Payer: feePayerAddr, } - tip := &txv1beta1.Tip{Amount: []*basev1beta1.Coin{{Denom: "tip-token", Amount: "10"}}} //nolint:staticcheck // we still need this deprecated struct txBody := &txv1beta1.TxBody{ Messages: []*anypb.Any{msg}, @@ -63,7 +62,6 @@ func TestDirectAuxHandler(t *testing.T) { authInfo := &txv1beta1.AuthInfo{ Fee: fee, - Tip: tip, SignerInfos: signerInfo, } @@ -113,7 +111,6 @@ func TestDirectAuxHandler(t *testing.T) { } authInfoWithNoFeePayer := &txv1beta1.AuthInfo{ Fee: feeWithNoPayer, - Tip: tip, SignerInfos: signerInfo, } authInfoWithNoFeePayerBz, err := proto.Marshal(authInfoWithNoFeePayer) @@ -139,7 +136,6 @@ func TestDirectAuxHandler(t *testing.T) { ChainId: chainID, AccountNumber: accNum, Sequence: accSeq, - Tip: tip, } expectedSignBytes, err := proto.Marshal(signDocDirectAux) require.NoError(t, err) diff --git a/x/tx/signing/testutil/util.go b/x/tx/signing/testutil/util.go index 17a79cda3295..dfa265992a35 100644 --- a/x/tx/signing/testutil/util.go +++ b/x/tx/signing/testutil/util.go @@ -17,7 +17,6 @@ type HandlerArgumentOptions struct { Msg proto.Message AccNum uint64 AccSeq uint64 - Tip *txv1beta1.Tip //nolint:staticcheck // we still need this deprecated struct Fee *txv1beta1.Fee SignerAddress string } @@ -57,15 +56,16 @@ func MakeHandlerArguments(options HandlerArgumentOptions) (signing.SignerData, s authInfo := &txv1beta1.AuthInfo{ Fee: options.Fee, - Tip: options.Tip, SignerInfos: signerInfo, } - bodyBz, err := proto.Marshal(txBody) + protov2MarshalOpts := proto.MarshalOptions{Deterministic: true} + bodyBz, err := protov2MarshalOpts.Marshal(txBody) if err != nil { return signing.SignerData{}, signing.TxData{}, err } - authInfoBz, err := proto.Marshal(authInfo) + + authInfoBz, err := protov2MarshalOpts.Marshal(authInfo) if err != nil { return signing.SignerData{}, signing.TxData{}, err } diff --git a/x/tx/signing/textual/any.go b/x/tx/signing/textual/any.go index 7818fb27e4d1..3770969dc580 100644 --- a/x/tx/signing/textual/any.go +++ b/x/tx/signing/textual/any.go @@ -2,6 +2,7 @@ package textual import ( "context" + "errors" "fmt" "strings" @@ -74,7 +75,7 @@ func (ar anyValueRenderer) Format(ctx context.Context, v protoreflect.Value) ([] // Parse implements the ValueRenderer interface. func (ar anyValueRenderer) Parse(ctx context.Context, screens []Screen) (protoreflect.Value, error) { if len(screens) == 0 { - return nilValue, fmt.Errorf("expect at least one screen") + return nilValue, errors.New("expect at least one screen") } if screens[0].Indent != 0 { return nilValue, fmt.Errorf("bad indentation: want 0, got %d", screens[0].Indent) @@ -82,7 +83,7 @@ func (ar anyValueRenderer) Parse(ctx context.Context, screens []Screen) (protore typeURL := screens[0].Content msgType, err := ar.tr.typeResolver.FindMessageByURL(typeURL) - if err == protoregistry.NotFound { + if errors.Is(err, protoregistry.NotFound) { // If the proto v2 registry doesn't have this message, then we use // protoFiles (which can e.g. be initialized to gogo's MergedRegistry) // to retrieve the message descriptor, and then use dynamicpb on that diff --git a/x/tx/signing/textual/coin_test.go b/x/tx/signing/textual/coin_test.go index 8ebdad6c85f9..07af1841f9b4 100644 --- a/x/tx/signing/textual/coin_test.go +++ b/x/tx/signing/textual/coin_test.go @@ -3,6 +3,7 @@ package textual_test import ( "context" "encoding/json" + "errors" "fmt" "os" "testing" @@ -55,7 +56,7 @@ func TestMetadataQuerier(t *testing.T) { require.Error(t, err) // Errors if metadata querier returns an error - expErr := fmt.Errorf("mock error") + expErr := errors.New("mock error") txt, err := textual.NewSignModeHandler(textual.SignModeOptions{ CoinMetadataQuerier: func(_ context.Context, _ string) (*bankv1beta1.Metadata, error) { return nil, expErr diff --git a/x/tx/signing/textual/coins.go b/x/tx/signing/textual/coins.go index 049b13421429..2bcd8230905d 100644 --- a/x/tx/signing/textual/coins.go +++ b/x/tx/signing/textual/coins.go @@ -2,14 +2,15 @@ package textual import ( "context" + "errors" "fmt" + "sort" "strings" "google.golang.org/protobuf/reflect/protoreflect" bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - corecoins "cosmossdk.io/core/coins" "cosmossdk.io/math" ) @@ -32,7 +33,7 @@ var _ RepeatedValueRenderer = coinsValueRenderer{} func (vr coinsValueRenderer) Format(ctx context.Context, v protoreflect.Value) ([]Screen, error) { if vr.coinMetadataQuerier == nil { - return nil, fmt.Errorf("expected non-nil coin metadata querier") + return nil, errors.New("expected non-nil coin metadata querier") } // Since this value renderer has a FormatRepeated method, the Format one @@ -48,7 +49,7 @@ func (vr coinsValueRenderer) Format(ctx context.Context, v protoreflect.Value) ( return nil, err } - formatted, err := corecoins.FormatCoins([]*basev1beta1.Coin{coin}, []*bankv1beta1.Metadata{metadata}) + formatted, err := FormatCoins([]*basev1beta1.Coin{coin}, []*bankv1beta1.Metadata{metadata}) if err != nil { return nil, err } @@ -58,7 +59,7 @@ func (vr coinsValueRenderer) Format(ctx context.Context, v protoreflect.Value) ( func (vr coinsValueRenderer) FormatRepeated(ctx context.Context, v protoreflect.Value) ([]Screen, error) { if vr.coinMetadataQuerier == nil { - return nil, fmt.Errorf("expected non-nil coin metadata querier") + return nil, errors.New("expected non-nil coin metadata querier") } protoCoins := v.List() @@ -76,7 +77,7 @@ func (vr coinsValueRenderer) FormatRepeated(ctx context.Context, v protoreflect. } } - formatted, err := corecoins.FormatCoins(coins, metadatas) + formatted, err := FormatCoins(coins, metadatas) if err != nil { return nil, err } @@ -217,3 +218,92 @@ func parseCoin(coinStr string, metadata *bankv1beta1.Metadata) (*basev1beta1.Coi Denom: baseDenom, }, nil } + +// formatCoin formats a sdk.Coin into a value-rendered string, using the +// given metadata about the denom. It returns the formatted coin string, the +// display denom, and an optional error. +func formatCoin(coin *basev1beta1.Coin, metadata *bankv1beta1.Metadata) (string, error) { + coinDenom := coin.Denom + + // Return early if no display denom or display denom is the current coin denom. + if metadata == nil || metadata.Display == "" || coinDenom == metadata.Display { + vr, err := math.FormatDec(coin.Amount) + return vr + " " + coin.Denom, err + } + + dispDenom := metadata.Display + + // Find exponents of both denoms. + var coinExp, dispExp uint32 + foundCoinExp, foundDispExp := false, false + for _, unit := range metadata.DenomUnits { + if coinDenom == unit.Denom { + coinExp = unit.Exponent + foundCoinExp = true + } + if dispDenom == unit.Denom { + dispExp = unit.Exponent + foundDispExp = true + } + } + + // If we didn't find either exponent, then we return early. + if !foundCoinExp || !foundDispExp { + vr, err := math.FormatInt(coin.Amount) + return vr + " " + coin.Denom, err + } + + dispAmount, err := math.LegacyNewDecFromStr(coin.Amount) + if err != nil { + return "", err + } + + if coinExp > dispExp { + dispAmount = dispAmount.Mul(math.LegacyNewDec(10).Power(uint64(coinExp - dispExp))) + } else { + dispAmount = dispAmount.Quo(math.LegacyNewDec(10).Power(uint64(dispExp - coinExp))) + } + + vr, err := math.FormatDec(dispAmount.String()) + return vr + " " + dispDenom, err +} + +// FormatCoins formats Coins into a value-rendered string, which uses +// `formatCoin` separated by ", " (a comma and a space), and sorted +// alphabetically by value-rendered denoms. It expects an array of metadata +// (optionally nil), where each metadata at index `i` MUST match the coin denom +// at the same index. +func FormatCoins(coins []*basev1beta1.Coin, metadata []*bankv1beta1.Metadata) (string, error) { + if len(coins) != len(metadata) { + return "", fmt.Errorf("formatCoins expect one metadata for each coin; expected %d, got %d", len(coins), len(metadata)) + } + + formatted := make([]string, len(coins)) + for i, coin := range coins { + var err error + formatted[i], err = formatCoin(coin, metadata[i]) + if err != nil { + return "", err + } + + // If a coin contains a comma, return an error given that the output + // could be misinterpreted by the user as 2 different coins. + if strings.Contains(formatted[i], ",") { + return "", fmt.Errorf("coin %s contains a comma", formatted[i]) + } + } + + if len(coins) == 0 { + return emptyCoins, nil + } + + // Sort the formatted coins by display denom. + sort.SliceStable(formatted, func(i, j int) bool { + denomI := strings.Split(formatted[i], " ")[1] + denomJ := strings.Split(formatted[j], " ")[1] + + return denomI < denomJ + }) + + return strings.Join(formatted, ", "), nil +} diff --git a/x/tx/signing/textual/coins_test.go b/x/tx/signing/textual/coins_test.go index 35c7c4c27ad3..c9e1bbf6dd7a 100644 --- a/x/tx/signing/textual/coins_test.go +++ b/x/tx/signing/textual/coins_test.go @@ -66,12 +66,13 @@ func TestCoinsJSONTestcases(t *testing.T) { // rendering, so we lose initial Coins ordering. Instead, we just check // set equality using a map. func checkCoinsEqual(t *testing.T, l1, l2 protoreflect.List) { + t.Helper() require.Equal(t, l1.Len(), l2.Len()) coinsMap := make(map[string]*basev1beta1.Coin, l1.Len()) for i := 0; i < l1.Len(); i++ { coin, ok := l1.Get(i).Message().Interface().(*basev1beta1.Coin) - require.True(t, ok) + require.True(t, ok, "not a *basev1beta1.Coin: %#v", l1.Get(i).Message().Interface()) coinsMap[coin.Denom] = coin } @@ -85,12 +86,13 @@ func checkCoinsEqual(t *testing.T, l1, l2 protoreflect.List) { } func checkCoinEqual(t *testing.T, coin, coin1 *basev1beta1.Coin) { + t.Helper() require.Equal(t, coin1.Denom, coin.Denom) v, ok := math.NewIntFromString(coin.Amount) require.True(t, ok) v1, ok := math.NewIntFromString(coin1.Amount) require.True(t, ok) - require.True(t, v.Equal(v1)) + require.True(t, v.Equal(v1), "Mismatch\n\tv: %+v\n\tv1: %+v", v, v1) } // coinsJSONTest is the type of test cases in the testdata file. @@ -104,3 +106,64 @@ type coinsJSONTest struct { Text string Error bool } + +// formatCoinJSONTest is the type of test cases in the coin.json file. +type formatCoinJSONTest struct { + Proto *basev1beta1.Coin + Metadata *bankv1beta1.Metadata + Text string + Error bool +} + +func TestFormatCoin(t *testing.T) { + var testcases []formatCoinJSONTest + raw, err := os.ReadFile("./internal/testdata/coin.json") + require.NoError(t, err) + err = json.Unmarshal(raw, &testcases) + require.NoError(t, err) + + for _, tc := range testcases { + t.Run(tc.Text, func(t *testing.T) { + if tc.Proto != nil { + out, err := textual.FormatCoins([]*basev1beta1.Coin{tc.Proto}, []*bankv1beta1.Metadata{tc.Metadata}) + + if tc.Error { + require.Error(t, err) + return + } + + require.NoError(t, err) + require.Equal(t, tc.Text, out) + } + }) + } +} + +func TestFormatCoins(t *testing.T) { + var testcases []coinsJSONTest + raw, err := os.ReadFile("./internal/testdata/coins.json") + require.NoError(t, err) + err = json.Unmarshal(raw, &testcases) + require.NoError(t, err) + + for _, tc := range testcases { + t.Run(tc.Text, func(t *testing.T) { + if tc.Proto != nil { + metadata := make([]*bankv1beta1.Metadata, len(tc.Proto)) + for i, coin := range tc.Proto { + metadata[i] = tc.Metadata[coin.Denom] + } + + out, err := textual.FormatCoins(tc.Proto, metadata) + + if tc.Error { + require.Error(t, err) + return + } + + require.NoError(t, err) + require.Equal(t, tc.Text, out) + } + }) + } +} diff --git a/x/tx/signing/textual/dec_test.go b/x/tx/signing/textual/dec_test.go index defb6d9cc509..f8c7b3ebe2f4 100644 --- a/x/tx/signing/textual/dec_test.go +++ b/x/tx/signing/textual/dec_test.go @@ -38,6 +38,7 @@ func TestDecJSONTestcases(t *testing.T) { } func checkDecTest(t *testing.T, r textual.ValueRenderer, pv protoreflect.Value, expected string) { + t.Helper() screens, err := r.Format(context.Background(), pv) require.NoError(t, err) require.Len(t, screens, 1) diff --git a/x/tx/signing/textual/e2e_test.go b/x/tx/signing/textual/e2e_test.go index 1f6dc09b66a5..e759d403f446 100644 --- a/x/tx/signing/textual/e2e_test.go +++ b/x/tx/signing/textual/e2e_test.go @@ -71,6 +71,10 @@ func TestE2EJSONTestcases(t *testing.T) { AuthInfoBytes: authInfoBz, }) require.NoError(t, err) + decodeWant, err := hex.DecodeString(tc.Cbor) + require.NoError(t, err) + t.Log("got: " + string(signDoc)) + t.Log("want " + string(decodeWant)) require.Equal(t, tc.Cbor, hex.EncodeToString(signDoc)) }) } diff --git a/x/tx/signing/textual/fuzz_test.go b/x/tx/signing/textual/fuzz_test.go index 81e2fbb867b4..bdbf1be24397 100644 --- a/x/tx/signing/textual/fuzz_test.go +++ b/x/tx/signing/textual/fuzz_test.go @@ -1,14 +1,20 @@ package textual_test import ( + "bytes" "context" "encoding/json" "os" + "regexp" "testing" + "github.com/google/go-cmp/cmp" "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/testing/protocmp" tspb "google.golang.org/protobuf/types/known/timestamppb" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + "cosmossdk.io/x/tx/internal/testpb" "cosmossdk.io/x/tx/signing/textual" ) @@ -101,3 +107,195 @@ func FuzzTimestampJSONParseToParseRoundTrip(f *testing.F) { } }) } + +func FuzzBytesValueRendererParse(f *testing.F) { + // 1. Generate some seeds from testdata. + seed, err := os.ReadFile("./internal/testdata/bytes.json") + if err != nil { + f.Fatal(err) + } + f.Add(seed) + + tr, err := textual.NewSignModeHandler(textual.SignModeOptions{CoinMetadataQuerier: EmptyCoinMetadataQuerier}) + if err != nil { + f.Fatal(err) + } + + ctx := context.Background() + + f.Fuzz(func(t *testing.T, input []byte) { + var testCases []bytesTest + if err := json.Unmarshal(input, &testCases); err != nil { + return + } + + for _, tc := range testCases { + rend, err := tr.GetFieldValueRenderer(fieldDescriptorFromName("BYTES")) + if err != nil { + t.Fatal(err) + } + + screens, err := rend.Format(ctx, protoreflect.ValueOfBytes(tc.base64)) + if err != nil { + t.Fatal(err) + } + if g, w := len(screens), 1; g != w { + t.Fatalf("Mismatch screen count: got=%d, want=%d", g, w) + } + + // Round trip and test. + val, err := rend.Parse(ctx, screens) + if err != nil { + t.Fatal(err) + } + if g, w := len(tc.base64), 35; g > w { + if len(val.Bytes()) != 0 { + t.Fatalf("val.Bytes() != 0:\n\tGot: % x", val.Bytes()) + } + } else if !bytes.Equal(tc.base64, val.Bytes()) { + t.Fatalf("val.Bytes() mismatch:\n\tGot: % x\n\tWant: % x", val.Bytes(), tc.base64) + } + } + }) +} + +func FuzzMessageValueRendererParse(f *testing.F) { + if testing.Short() { + f.Skip() + } + + // 1. Use the seeds from testdata and mutate them. + seed, err := os.ReadFile("./internal/testdata/message.json") + if err != nil { + f.Fatal(err) + } + f.Add(seed) + + ctx := context.Background() + tr, err := textual.NewSignModeHandler(textual.SignModeOptions{CoinMetadataQuerier: EmptyCoinMetadataQuerier}) + if err != nil { + f.Fatalf("Failed to create SignModeHandler: %v", err) + } + + f.Fuzz(func(t *testing.T, input []byte) { + var testCases []messageJSONTest + if err := json.Unmarshal(input, &testCases); err != nil { + return + } + + for _, tc := range testCases { + rend := textual.NewMessageValueRenderer(tr, (&testpb.Foo{}).ProtoReflect().Descriptor()) + + var screens []textual.Screen + var err error + + if tc.Proto != nil { + screens, err = rend.Format(ctx, protoreflect.ValueOf(tc.Proto.ProtoReflect())) + if err != nil { + continue + } + } + + val, err := rend.Parse(ctx, screens) + if err != nil { + continue + } + + msg := val.Message().Interface() + gotMsg, ok := msg.(*testpb.Foo) + if !ok { + t.Fatalf("Wrong type for Foo: %T", msg) + } + diff := cmp.Diff(gotMsg, tc.Proto, protocmp.Transform()) + if diff != "" { + t.Fatalf("Roundtrip mismatch\n\tGot: %#v\n\tWant: %#v", gotMsg, tc.Proto) + } + } + }) +} + +// Copied from types/coin.go but pasted in here so as to avoid any imports +// of that package as has been mandated by team decisions. +var ( + reCoinDenom = regexp.MustCompile(`[a-zA-Z][a-zA-Z0-9/:._-]{2,127}`) + reCoinAmount = regexp.MustCompile(`[[:digit:]]+(?:\.[[:digit:]]+)?|\.[[:digit:]]+`) +) + +func FuzzCoinsJSONTestcases(f *testing.F) { + f.Skip() // https://github.com/cosmos/cosmos-sdk/pull/16521#issuecomment-1614507574 + + // Generate some seeds. + seed, err := os.ReadFile("./internal/testdata/coins.json") + if err != nil { + f.Fatal(err) + } + f.Add(seed) + + txt, err := textual.NewSignModeHandler(textual.SignModeOptions{CoinMetadataQuerier: mockCoinMetadataQuerier}) + if err != nil { + f.Fatal(err) + } + rend, err := txt.GetFieldValueRenderer(fieldDescriptorFromName("COINS")) + if err != nil { + f.Fatal(err) + } + vrr := rend.(textual.RepeatedValueRenderer) + + f.Fuzz(func(t *testing.T, input []byte) { + var testCases []coinsJSONTest + if err := json.Unmarshal(input, &testCases); err != nil { + return + } + + for _, tc := range testCases { + if tc.Proto == nil { + continue + } + + // Create a context.Context containing all coins metadata, to simulate + // that they are in state. + ctx := context.Background() + for _, v := range tc.Metadata { + ctx = addMetadataToContext(ctx, v) + } + + listValue := NewGenericList(tc.Proto) + screens, err := vrr.FormatRepeated(ctx, protoreflect.ValueOf(listValue)) + if err != nil { + cpt := tc.Proto[0] + likeEmpty := err.Error() == "cannot format empty string" || err.Error() == "decimal string cannot be empty" + if likeEmpty && (!reCoinDenom.MatchString(cpt.Denom) || cpt.Amount == "") { + return + } + if !reCoinDenom.MatchString(cpt.Denom) { + return + } + if !reCoinAmount.MatchString(cpt.Amount) { + return + } + t.Fatalf("%v\n%q\n%#v => %t", err, tc.Text, cpt, cpt.Amount == "") + } + + if g, w := len(screens), 1; g != w { + t.Fatalf("Screens mismatch: got=%d want=%d", g, w) + } + + wantContent := tc.Text + if wantContent == "" { + wantContent = "zero" + } + if false { + if g, w := screens[0].Content, wantContent; g != w { + t.Fatalf("Content mismatch:\n\tGot: %s\n\tWant: %s", g, w) + } + } + + // Round trip. + parsedValue := NewGenericList([]*basev1beta1.Coin{}) + if err := vrr.ParseRepeated(ctx, screens, parsedValue); err != nil { + return + } + checkCoinsEqual(t, listValue, parsedValue) + } + }) +} diff --git a/x/tx/signing/textual/handler.go b/x/tx/signing/textual/handler.go index 5d7768227a28..67ab53a5c095 100644 --- a/x/tx/signing/textual/handler.go +++ b/x/tx/signing/textual/handler.go @@ -3,6 +3,7 @@ package textual import ( "bytes" "context" + "errors" "fmt" "reflect" @@ -67,7 +68,7 @@ type SignModeHandler struct { // NewSignModeHandler returns a new SignModeHandler which generates sign bytes and provides value renderers. func NewSignModeHandler(o SignModeOptions) (*SignModeHandler, error) { if o.CoinMetadataQuerier == nil { - return nil, fmt.Errorf("coinMetadataQuerier must be non-empty") + return nil, errors.New("coinMetadataQuerier must be non-empty") } if o.FileResolver == nil { o.FileResolver = protoregistry.GlobalFiles @@ -134,7 +135,7 @@ func (r *SignModeHandler) GetFieldValueRenderer(fd protoreflect.FieldDescriptor) } if fd.IsMap() { - return nil, fmt.Errorf("value renderers cannot format value of type map") + return nil, errors.New("value renderers cannot format value of type map") } return NewMessageValueRenderer(r, md), nil case fd.Kind() == protoreflect.BoolKind: diff --git a/x/tx/signing/textual/int_test.go b/x/tx/signing/textual/int_test.go index 2767a2430c06..100ec3097157 100644 --- a/x/tx/signing/textual/int_test.go +++ b/x/tx/signing/textual/int_test.go @@ -78,6 +78,7 @@ func TestIntJSONTestcases(t *testing.T) { // checkNumberTest checks that the output of a number value renderer // matches the expected string. Only use it to test numbers. func checkNumberTest(t *testing.T, r textual.ValueRenderer, pv protoreflect.Value, expected string) { + t.Helper() screens, err := r.Format(context.Background(), pv) require.NoError(t, err) require.Len(t, screens, 1) diff --git a/x/tx/signing/textual/internal/testdata/coin.json b/x/tx/signing/textual/internal/testdata/coin.json index 1a1ac79b9306..02231d2d712e 100644 --- a/x/tx/signing/textual/internal/testdata/coin.json +++ b/x/tx/signing/textual/internal/testdata/coin.json @@ -327,5 +327,10 @@ {"text":"", "error": true}, {"text":"1COSM", "error": true}, {"text":"1 COSM", "error": true}, - {"text":" 1 COSM", "error": true} + {"text":" 1 COSM", "error": true}, + { + "proto": {"amount": "10000000", "denom": "point, 222222 point"}, + "metadata": {"display": "POINT", "base": "point", "denom_units": [{"denom": "point", "exponent": 0}, {"denom": "POINT", "exponent": 0}]}, + "error": true + } ] diff --git a/x/tx/signing/textual/internal/testdata/e2e.json b/x/tx/signing/textual/internal/testdata/e2e.json index 49f5c6effdb3..2ab0e30f5b96 100644 --- a/x/tx/signing/textual/internal/testdata/e2e.json +++ b/x/tx/signing/textual/internal/testdata/e2e.json @@ -286,13 +286,6 @@ "gas_limit": 100000, "payer": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "granter": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs" - }, - "tip": { - "amount": [ - { "amount": "20000", "denom": "uatom" }, - { "amount": "30000", "denom": "uosmo" } - ], - "tipper": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" } } }, @@ -344,8 +337,6 @@ { "title": "Fees", "content": "0.002 ATOM" }, { "title": "Fee payer", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "expert": true }, { "title": "Fee granter", "content": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs", "expert": true }, - { "title": "Tip", "content": "0.02 ATOM, 30'000 uosmo" }, - { "title": "Tipper", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" }, { "title": "Gas limit", "content": "100'000", "expert": true }, { "title": "Timeout height", "content": "20", "expert": true }, { "title": "Other signer", "content": "1 SignerInfo", "expert": true }, @@ -381,8 +372,8 @@ { "title": "Non critical extension options (1/1)", "content": "/cosmos.auth.v1beta1.Params", "indent": 1, "expert": true }, { "title": "Max memo characters", "content": "10", "indent": 2, "expert": true }, { "content": "End of Non critical extension options", "expert": true }, - { "title": "Hash of raw bytes", "content": "7ea02e8f0baed2db969e2d9ae4dc51fa31116259bd42897588072faf0ebb4d2e", "expert": true } + { "title": "Hash of raw bytes", "content": "e7be7808de4985bd609811d2a32805cb233c168c7d247d61d37f4a6dd4cf3a2a", "expert": true } ], - "cbor": "a101983fa20168436861696e20696402686d792d636861696ea2016e4163636f756e74206e756d626572026131a2016853657175656e6365026132a301674164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a3016a5075626c6963206b657902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657904f5a401634b657902785230324542204444374620453446442045423736204443384120323035452046363544203739304320443330452038413337203541354320323532382045423341203932334120463146422034443739203444030104f5a102781f54686973207472616e73616374696f6e206861732032204d65737361676573a3016d4d6573736167652028312f322902781d2f636f736d6f732e617574687a2e763162657461312e4d7367457865630301a301674772616e74656502782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301644d73677302653120416e790302a3016a4d7367732028312f312902781c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e640303a3016c46726f6d206164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730304a3016a546f206164647265737302782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b6835740304a30166416d6f756e74026731302041544f4d0304a2026b456e64206f66204d7367730302a3016d4d6573736167652028322f322902762f636f736d6f732e676f762e76312e4d7367566f74650301a3016b50726f706f73616c2069640261310302a30165566f74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301664f7074696f6e026f564f54455f4f5054494f4e5f5945530302a301684d65746164617461027901e34c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e6720656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f726520657420646f6c6f7265206d61676e6120616c697175612e20557420656e696d206164206d696e696d2076656e69616d2c2071756973206e6f737472756420657865726369746174696f6e20756c6c616d636f206c61626f726973206e69736920757420616c697175697020657820656120636f6d6d6f646f20636f6e7365717561742e2044756973206175746520697275726520646f6c6f7220696e20726570726568656e646572697420696e20766f6c7570746174652076656c697420657373652063696c6c756d20646f6c6f726520657520667567696174206e756c6c612070617269617475722e204578636570746575722073696e74206f6363616563617420637570696461746174206e6f6e2070726f6964656e742c2073756e7420696e2063756c706120717569206f666669636961206465736572756e74206d6f6c6c697420616e696d20696420657374206c61626f72756d2e20416c736f20697420656e647320696e2020612073696e676c6520616d70657273616e6420400302a1026e456e64206f66204d657373616765a201644d656d6f0278193e20e29a9befb88f5c7532363942e29a9befb88f2020202020a2016446656573026a302e3030322041544f4da3016946656520706179657202782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b68357404f5a3016b466565206772616e74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a201635469700277302e30322041544f4d2c2033302730303020756f736d6fa2016654697070657202782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b683574a30169476173206c696d697402673130302730303004f5a3016e54696d656f7574206865696768740262323004f5a3016c4f74686572207369676e6572026c31205369676e6572496e666f04f5a401724f74686572207369676e65722028312f312902715369676e6572496e666f206f626a656374030104f5a4016a5075626c6963206b65790278292f636f736d6f732e63727970746f2e6d756c74697369672e4c6567616379416d696e6f5075624b6579030204f5a401695468726573686f6c64026132030304f5a4016b5075626c6963206b65797302653220416e79030304f5a401715075626c6963206b6579732028312f322902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b6579030404f5a401634b657902785230323537203445424520304246432037353446203539363720334241312031423237203530304620393135382041444532204531374520314130312038324230204341384220433635322034444230203933030504f5a401715075626c6963206b6579732028322f322902781d2f636f736d6f732e63727970746f2e656432353531392e5075624b6579030404f5a401634b657902785230333135203043343720463138412041333237203136413620353437452044413842203733363920303637442043453131204431343120363234352042373738203735364320463833352039363738203737030504f5a30272456e64206f66205075626c6963206b657973030304f5a401694d6f646520696e666f026f4d6f6465496e666f206f626a656374030204f5a401654d756c7469026c4d756c7469206f626a656374030304f5a4016842697461727261790276436f6d706163744269744172726179206f626a656374030404f5a40171457874726120626974732073746f726564026135030504f5a40165456c656d7302623438030504f5a4016a4d6f646520696e666f73026a32204d6f6465496e666f030404f5a401704d6f646520696e666f732028312f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a401704d6f646520696e666f732028322f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a30271456e64206f66204d6f646520696e666f73030404f5a4016853657175656e6365026135030204f5a20273456e64206f66204f74686572207369676e657204f5a30171457874656e73696f6e206f7074696f6e7302653120416e7904f5a40177457874656e73696f6e206f7074696f6e732028312f31290278192f636f736d6f732e626173652e763162657461312e436f696e030104f5a30266352041544f4d030204f5a2027818456e64206f6620457874656e73696f6e206f7074696f6e7304f5a301781e4e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7302653120416e7904f5a40178244e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e732028312f312902781b2f636f736d6f732e617574682e763162657461312e506172616d73030104f5a401734d6178206d656d6f206368617261637465727302623130030204f5a2027825456e64206f66204e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7304f5a3017148617368206f66207261772062797465730278403765613032653866306261656432646239363965326439616534646335316661333131313632353962643432383937353838303732666166306562623464326504f5" + "cbor": "a101983da20168436861696e20696402686d792d636861696ea2016e4163636f756e74206e756d626572026131a2016853657175656e6365026132a301674164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a3016a5075626c6963206b657902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657904f5a401634b657902785230324542204444374620453446442045423736204443384120323035452046363544203739304320443330452038413337203541354320323532382045423341203932334120463146422034443739203444030104f5a102781f54686973207472616e73616374696f6e206861732032204d65737361676573a3016d4d6573736167652028312f322902781d2f636f736d6f732e617574687a2e763162657461312e4d7367457865630301a301674772616e74656502782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301644d73677302653120416e790302a3016a4d7367732028312f312902781c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e640303a3016c46726f6d206164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730304a3016a546f206164647265737302782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b6835740304a30166416d6f756e74026731302041544f4d0304a2026b456e64206f66204d7367730302a3016d4d6573736167652028322f322902762f636f736d6f732e676f762e76312e4d7367566f74650301a3016b50726f706f73616c2069640261310302a30165566f74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301664f7074696f6e026f564f54455f4f5054494f4e5f5945530302a301684d65746164617461027901e34c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e6720656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f726520657420646f6c6f7265206d61676e6120616c697175612e20557420656e696d206164206d696e696d2076656e69616d2c2071756973206e6f737472756420657865726369746174696f6e20756c6c616d636f206c61626f726973206e69736920757420616c697175697020657820656120636f6d6d6f646f20636f6e7365717561742e2044756973206175746520697275726520646f6c6f7220696e20726570726568656e646572697420696e20766f6c7570746174652076656c697420657373652063696c6c756d20646f6c6f726520657520667567696174206e756c6c612070617269617475722e204578636570746575722073696e74206f6363616563617420637570696461746174206e6f6e2070726f6964656e742c2073756e7420696e2063756c706120717569206f666669636961206465736572756e74206d6f6c6c697420616e696d20696420657374206c61626f72756d2e20416c736f20697420656e647320696e2020612073696e676c6520616d70657273616e6420400302a1026e456e64206f66204d657373616765a201644d656d6f0278193e20e29a9befb88f5c7532363942e29a9befb88f2020202020a2016446656573026a302e3030322041544f4da3016946656520706179657202782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b68357404f5a3016b466565206772616e74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a30169476173206c696d697402673130302730303004f5a3016e54696d656f7574206865696768740262323004f5a3016c4f74686572207369676e6572026c31205369676e6572496e666f04f5a401724f74686572207369676e65722028312f312902715369676e6572496e666f206f626a656374030104f5a4016a5075626c6963206b65790278292f636f736d6f732e63727970746f2e6d756c74697369672e4c6567616379416d696e6f5075624b6579030204f5a401695468726573686f6c64026132030304f5a4016b5075626c6963206b65797302653220416e79030304f5a401715075626c6963206b6579732028312f322902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b6579030404f5a401634b657902785230323537203445424520304246432037353446203539363720334241312031423237203530304620393135382041444532204531374520314130312038324230204341384220433635322034444230203933030504f5a401715075626c6963206b6579732028322f322902781d2f636f736d6f732e63727970746f2e656432353531392e5075624b6579030404f5a401634b657902785230333135203043343720463138412041333237203136413620353437452044413842203733363920303637442043453131204431343120363234352042373738203735364320463833352039363738203737030504f5a30272456e64206f66205075626c6963206b657973030304f5a401694d6f646520696e666f026f4d6f6465496e666f206f626a656374030204f5a401654d756c7469026c4d756c7469206f626a656374030304f5a4016842697461727261790276436f6d706163744269744172726179206f626a656374030404f5a40171457874726120626974732073746f726564026135030504f5a40165456c656d7302623438030504f5a4016a4d6f646520696e666f73026a32204d6f6465496e666f030404f5a401704d6f646520696e666f732028312f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a401704d6f646520696e666f732028322f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a30271456e64206f66204d6f646520696e666f73030404f5a4016853657175656e6365026135030204f5a20273456e64206f66204f74686572207369676e657204f5a30171457874656e73696f6e206f7074696f6e7302653120416e7904f5a40177457874656e73696f6e206f7074696f6e732028312f31290278192f636f736d6f732e626173652e763162657461312e436f696e030104f5a30266352041544f4d030204f5a2027818456e64206f6620457874656e73696f6e206f7074696f6e7304f5a301781e4e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7302653120416e7904f5a40178244e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e732028312f312902781b2f636f736d6f732e617574682e763162657461312e506172616d73030104f5a401734d6178206d656d6f206368617261637465727302623130030204f5a2027825456e64206f66204e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7304f5a3017148617368206f66207261772062797465730278406537626537383038646534393835626436303938313164326133323830356362323333633136386337643234376436316433376634613664643463663361326104f5" } ] diff --git a/x/tx/signing/textual/internal/testdata/tx.json b/x/tx/signing/textual/internal/testdata/tx.json index c071d08eec28..bbafe3b14120 100644 --- a/x/tx/signing/textual/internal/testdata/tx.json +++ b/x/tx/signing/textual/internal/testdata/tx.json @@ -299,13 +299,6 @@ "gas_limit": 100000, "payer": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "granter": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs" - }, - "tip": { - "amount": [ - { "amount": "20000", "denom": "uatom" }, - { "amount": "30000", "denom": "uosmo" } - ], - "tipper": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" } } }, @@ -357,8 +350,6 @@ { "title": "Fees", "content": "0.002 ATOM" }, { "title": "Fee payer", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "expert": true }, { "title": "Fee granter", "content": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs", "expert": true }, - { "title": "Tip", "content": "0.02 ATOM, 30'000 uosmo" }, - { "title": "Tipper", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" }, { "title": "Gas limit", "content": "100'000", "expert": true }, { "title": "Timeout height", "content": "20", "expert": true }, { "title": "Other signer", "content": "1 SignerInfo", "expert": true }, @@ -394,7 +385,7 @@ { "title": "Non critical extension options (1/1)", "content": "/cosmos.auth.v1beta1.Params", "indent": 1, "expert": true }, { "title": "Max memo characters", "content": "10", "indent": 2, "expert": true }, { "content": "End of Non critical extension options", "expert": true }, - { "title": "Hash of raw bytes", "content": "7ea02e8f0baed2db969e2d9ae4dc51fa31116259bd42897588072faf0ebb4d2e", "expert": true } + { "title": "Hash of raw bytes", "content": "e7be7808de4985bd609811d2a32805cb233c168c7d247d61d37f4a6dd4cf3a2a", "expert": true } ] } ] diff --git a/x/tx/signing/textual/internal/textualpb/textual.proto b/x/tx/signing/textual/internal/textualpb/textual.proto index efd8d35275bd..cddfc99d6e6b 100644 --- a/x/tx/signing/textual/internal/textualpb/textual.proto +++ b/x/tx/signing/textual/internal/textualpb/textual.proto @@ -77,8 +77,6 @@ message Envelope { repeated cosmos.base.v1beta1.Coin fees = 8; string fee_payer = 9; string fee_granter = 10; - repeated cosmos.base.v1beta1.Coin tip = 11; - string tipper = 12; uint64 gas_limit = 13; uint64 timeout_height = 14; repeated cosmos.tx.v1beta1.SignerInfo other_signer = 15; diff --git a/x/tx/signing/textual/testdata/fuzz/FuzzCoinsJSONTestcases/4d81af7cc74558bf b/x/tx/signing/textual/testdata/fuzz/FuzzCoinsJSONTestcases/4d81af7cc74558bf new file mode 100644 index 000000000000..f16030abe365 --- /dev/null +++ b/x/tx/signing/textual/testdata/fuzz/FuzzCoinsJSONTestcases/4d81af7cc74558bf @@ -0,0 +1,2 @@ +go test fuzz v1 +[]byte("[{\"proto\":[{\"Amount\":\"0\"},{\"Amount\":\"1\"}]}]") diff --git a/x/tx/signing/textual/timestamp_test.go b/x/tx/signing/textual/timestamp_test.go index c3f047401ec5..65d2a99a9323 100644 --- a/x/tx/signing/textual/timestamp_test.go +++ b/x/tx/signing/textual/timestamp_test.go @@ -43,6 +43,7 @@ func TestTimestampJsonTestcasesExtraneousNanos(t *testing.T) { } func testTimestampJSONTestcases(t *testing.T, raw []byte) { + t.Helper() var testcases []timestampJSONTest err := json.Unmarshal(raw, &testcases) require.NoError(t, err) diff --git a/x/tx/signing/textual/tx.go b/x/tx/signing/textual/tx.go index 0b2c64d84aec..501189e3e5d6 100644 --- a/x/tx/signing/textual/tx.go +++ b/x/tx/signing/textual/tx.go @@ -83,10 +83,7 @@ func (vr txValueRenderer) Format(ctx context.Context, v protoreflect.Value) ([]S NonCriticalExtensionOptions: txBody.NonCriticalExtensionOptions, HashOfRawBytes: getHash(textualData.BodyBytes, textualData.AuthInfoBytes), } - if txAuthInfo.Tip != nil { //nolint:staticcheck // we still need this deprecated struct - envelope.Tip = txAuthInfo.Tip.Amount //nolint:staticcheck // we still need this deprecated struct - envelope.Tipper = txAuthInfo.Tip.Tipper //nolint:staticcheck // we still need this deprecated struct - } + // Find all other tx signers than the current signer. In the case where our // Textual signer is one key of a multisig, then otherSigners will include // the multisig pubkey. @@ -243,12 +240,6 @@ func (vr txValueRenderer) Parse(ctx context.Context, screens []Screen) (protoref Granter: envelope.FeeGranter, }, } - if envelope.Tip != nil { - authInfo.Tip = &txv1beta1.Tip{ //nolint:staticcheck // we still need this deprecated struct - Amount: envelope.Tip, - Tipper: envelope.Tipper, - } - } // Figure out the signers in the correct order. signers, err := getSigners(txBody, authInfo) @@ -281,11 +272,12 @@ func (vr txValueRenderer) Parse(ctx context.Context, screens []Screen) (protoref // Note that we might not always get back the exact bodyBz and authInfoBz // that was passed into, because protobuf is not deterministic. // In tests, we don't check bytes equality, but protobuf object equality. - bodyBz, err := proto.Marshal(txBody) + protov2MarshalOpts := proto.MarshalOptions{Deterministic: true} + bodyBz, err := protov2MarshalOpts.Marshal(txBody) if err != nil { return nilValue, err } - authInfoBz, err := proto.Marshal(authInfo) + authInfoBz, err := protov2MarshalOpts.Marshal(authInfo) if err != nil { return nilValue, err } diff --git a/x/tx/signing/textual/tx_test.go b/x/tx/signing/textual/tx_test.go index f12b0d01384f..47acb0a8bec8 100644 --- a/x/tx/signing/textual/tx_test.go +++ b/x/tx/signing/textual/tx_test.go @@ -117,6 +117,7 @@ func TestTxJSONTestcases(t *testing.T) { // createTextualData creates a Textual data give then JSON // test case. func createTextualData(t *testing.T, jsonTx txJSONTestTx, jsonSignerData json.RawMessage) (*txv1beta1.TxBody, []byte, *txv1beta1.AuthInfo, []byte, signing.SignerData) { + t.Helper() body := &txv1beta1.TxBody{} authInfo := &txv1beta1.AuthInfo{} protoSignerData := &textualpb.SignerData{} From 8c42fdcfba17f48b32c5b0b2ccb4693a6048106a Mon Sep 17 00:00:00 2001 From: HuangYi Date: Wed, 10 Apr 2024 11:21:27 +0800 Subject: [PATCH 2/2] fix lint --- x/tx/signing/context.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/x/tx/signing/context.go b/x/tx/signing/context.go index d90fb4a5cb30..2d0a01be139d 100644 --- a/x/tx/signing/context.go +++ b/x/tx/signing/context.go @@ -246,9 +246,8 @@ func (c *Context) makeGetSignersFunc(descriptor protoreflect.MessageDescriptor) arr = append(arr, res...) } return arr, nil - } else { - return fieldGetter(msg.Get(childField).Message(), depth+1) } + return fieldGetter(msg.Get(childField).Message(), depth+1) case childField.IsMap() || childField.HasOptionalKeyword(): return nil, fmt.Errorf("cosmos.msg.v1.signer field %s in message %s must not be a map or optional", signerFieldName, desc.FullName()) case childField.Kind() == protoreflect.StringKind: @@ -266,14 +265,13 @@ func (c *Context) makeGetSignersFunc(descriptor protoreflect.MessageDescriptor) res = append(res, addrBz) } return res, nil - } else { - addrStr := msg.Get(childField).String() - addrBz, err := addrCdc.StringToBytes(addrStr) - if err != nil { - return nil, err - } - return [][]byte{addrBz}, nil } + addrStr := msg.Get(childField).String() + addrBz, err := addrCdc.StringToBytes(addrStr) + if err != nil { + return nil, err + } + return [][]byte{addrBz}, nil } return nil, fmt.Errorf("unexpected field type %s for field %s in message %s, only string and message type are supported", childField.Kind(), signerFieldName, desc.FullName())