diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 037c6d3b0..4f9bfb904 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -12,5 +12,5 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: - version: v1.55.2 - args: --timeout=5m0s + version: v1.60 + args: --timeout=10m0s diff --git a/.golangci.yml b/.golangci.yml index 6375d8b37..b7b8f7ca2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,6 @@ run: timeout: 5m - go: '1.22.3' + go: "1.22.3" linters: disable-all: true @@ -8,7 +8,7 @@ linters: - bodyclose - whitespace - errcheck - - exportloopref + - copyloopvar - gci - gocritic - gofumpt @@ -30,19 +30,24 @@ issues: - ".*\\.pb\\.gw\\.\\.go$" - ".*\\.pulsar\\.go$" exclude-rules: - - text: 'Use of weak random number generator' + - text: "Use of weak random number generator" linters: - gosec - - text: 'ST1003:' + - text: "ST1003:" linters: - stylecheck - + linters-settings: gci: custom-order: true sections: - standard # Standard section: captures all standard packages. - default # Default section: contains all imports that could not be matched to another section type. + - prefix(github.com/cometbft/cometbft) # comet + - prefix(github.com/cosmos) # cosmos org + - prefix(cosmossdk.io) # new modules + - prefix(github.com/cosmos/cosmos-sdk) # cosmos sdk + - prefix(github.com/bandprotocol) # band org - prefix(github.com/bandprotocol/chain) gocritic: disabled-checks: @@ -100,4 +105,3 @@ linters-settings: - G504 # Import blocklist: net/http/cgi - G505 # Import blocklist: crypto/sha1 - G601 # Implicit memory aliasing of items from a range statement - diff --git a/CHANGELOG.md b/CHANGELOG.md index b10b64f9f..5efc04c21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,101 +2,105 @@ ## Unreleased -- (bump) Use go 1.22.3 -- (bump) Use cosmos-sdk package v0.47.11 / ibc-go v7.5.0 -- (bump) replace github.com/tendermint/tendermint by github.com/cometbft/cometbft v0.37.5 -- (bump) migrated from gogo/protobuf to cosmos/gogoproto -- (bump) Use go-owasm v0.3.1 -- (chain) Remove disablefeeless flag -- (chain) Remove old oracle ante -- (chain) Remove legacy migrate cmd -- (chain) Use priority based on gas_prices of uband but MsgReport will have the highest priority -- (chain) Add globalfee module to set the min-gas-price on protocol level (MinimumGasPrice param) -- (chain) Add group module from cosmos-sdk -- (chain) Set MinimumGasPrice to 0.0025uband -- (chain) Update proof to support newly added module -- (chain) Migrate REST Endpoint to GRPC -- (chain) update oracle params to support cosmos-sdk 0.47 -- (chain) Add consensus module to handle managing Tendermint consensus parameters +* (chain) Return error on AllocationToken at beginblock instead of panic +* (chain) Add autocli for oracle module +* (bump) Use go 1.22.3 +* (bump) Use cosmos-sdk package v0.50.10 / ibc-go v8.5.1 +* (bump) replace github.com/tendermint/tendermint by github.com/cometbft/cometbft v0.38.12 +* (bump) migrated from gogo/protobuf to cosmos/gogoproto +* (bump) Use go-owasm v0.3.1 +* (chain) Remove disablefeeless flag +* (chain) Remove old oracle ante +* (chain) Remove legacy migrate cmd +* (chain) Use priority based on gas_prices of uband but MsgReport will have the highest priority +* (chain) Add globalfee module to set the min-gas-price on protocol level (MinimumGasPrice param) +* (chain) Add group module from cosmos-sdk +* (chain) Set MinimumGasPrice to 0.0025uband +* (chain) Update proof to support newly added module +* (chain) Migrate REST Endpoint to GRPC +* (chain) update oracle params to support cosmos-sdk 0.47+ +* (chain) Add consensus module to handle managing Tendermint consensus parameters +* (chain) Change the allocation of remaining tokens from the community pool to the Proposer ## [v2.5.3](https://github.com/bandprotocol/chain/releases/tag/v2.5.3) -- (bump) Use cometbft v0.34.29 -- (yoda) Get information of requests through endpoint instead of events +* (bump) Use cometbft v0.34.29 +* (yoda) Get information of requests through endpoint instead of events + ## [v2.5.2](https://github.com/bandprotocol/chain/releases/tag/v2.5.2) -- (bump) Use cosmos-sdk v0.45.16 / ibc-go v4.3.1 / cometbft v0.34.28 +* (bump) Use cosmos-sdk v0.45.16 / ibc-go v4.3.1 / cometbft v0.34.28 ## [v2.5.1](https://github.com/bandprotocol/chain/releases/tag/v2.5.1) -- (bump) Use cosmos-sdk package v0.45.15 / tendermint v0.34.27 -- (bump) Use go-owasm v0.2.3 -- (chain) Support statically linked binary for bandd +* (bump) Use cosmos-sdk package v0.45.15 / tendermint v0.34.27 +* (bump) Use go-owasm v0.2.3 +* (chain) Support statically linked binary for bandd ## [v2.5.0](https://github.com/bandprotocol/chain/releases/tag/v2.5.0) -- (bump) Use cosmos-sdk package v0.45.14 / tendermint v0.34.26 / ibc-go v4.3.0 -- (chain) add new rest paths to prepare for the moving from rest to grpc in 2.6.x +* (bump) Use cosmos-sdk package v0.45.14 / tendermint v0.34.26 / ibc-go v4.3.0 +* (chain) add new rest paths to prepare for the moving from rest to grpc in 2.6.x ## [v2.4.1](https://github.com/bandprotocol/chain/releases/tag/v2.4.1) -- (bump) Use cosmos-sdk package v0.45.10 / tendermint v0.34.22 / ibc-go v3.3.1 +* (bump) Use cosmos-sdk package v0.45.10 / tendermint v0.34.22 / ibc-go v3.3.1 ## [v2.4.0](https://github.com/bandprotocol/chain/releases/tag/v2.4.0) -- (bump) Use go 1.19 -- (bump) Use cosmos-sdk package v0.45.9 / tendermint v0.34.21 / ibc-go v3.3.0 -- (bump) Use go-owasm v0.2.2 -- (chain) Add ICA host module -- (chain) Add MaxDelay parameter for request verification query -- (chain) Add IsDelay parameter for request verification response -- (chain) Add snapshot extension for oracle module -- (chain) change DefaultBlockMaxGas to 50M -- (chain) change DefaultBaseRequestGas to 50k -- (chain) change multiplier of cosmos gas to owasm gas to 20M -- (yoda) Add BAND_DATA_SOURCE_ID in header -- (yoda) Update to broadcast transactions by sync mode +* (bump) Use go 1.19 +* (bump) Use cosmos-sdk package v0.45.9 / tendermint v0.34.21 / ibc-go v3.3.0 +* (bump) Use go-owasm v0.2.2 +* (chain) Add ICA host module +* (chain) Add MaxDelay parameter for request verification query +* (chain) Add IsDelay parameter for request verification response +* (chain) Add snapshot extension for oracle module +* (chain) change DefaultBlockMaxGas to 50M +* (chain) change DefaultBaseRequestGas to 50k +* (chain) change multiplier of cosmos gas to owasm gas to 20M +* (yoda) Add BAND_DATA_SOURCE_ID in header +* (yoda) Update to broadcast transactions by sync mode ## [v2.3.3](https://github.com/bandprotocol/chain/releases/tag/v2.3.3) -- (yoda) Change severity of error when query log -- (bump) Use cosmos-sdk package v0.44.5 / tendermint v0.34.14 / ibc-go v1.1.5 +* (yoda) Change severity of error when query log +* (bump) Use cosmos-sdk package v0.44.5 / tendermint v0.34.14 / ibc-go v1.1.5 ## [v2.3.2](https://github.com/bandprotocol/chain/releases/tag/v2.3.2) -- (bump) Use cosmos-sdk package v0.44.2 -- (yoda) Fix Yoda can't cache file +* (bump) Use cosmos-sdk package v0.44.2 +* (yoda) Fix Yoda can't cache file ## [v2.3.0](https://github.com/bandprotocol/chain/releases/tag/v2.3.0) -- (bump) Use cosmos-sdk package v0.44.0 -- (bump) Use ibc-go package v1.1.0 +* (bump) Use cosmos-sdk package v0.44.0 +* (bump) Use ibc-go package v1.1.0 ## [v2.2.0](https://github.com/bandprotocol/chain/releases/tag/v2.2.0) -- (bump) Use ibc-go package v1.0.1 -- (chain) Replace report authorization with generic authorization -- (yoda) Fix yoda to send report by MsgExec. -- (yoda) Add feature on yoda keys list to show grant status of reporter -- (chain) Remove MsgAddReporter/MsgRemoveReporter + Using Grant in authz module to manage authorization of reporter -- (chain) Refactor QueryRequestVerification -- (chore) Change max owasm gas to be the same as block gas limit (8000000) -- (chore) Limit block gas to 8000000 -- (test) Refactor tests -- (ibc) Remove escrowAddress for IBC oracle request and use a given relayer account instead -- (chain) Replace int64 with uint64 for ids and counts -- (patch) Use ibc-go package v1.0.0 -- (patch) Upgrade SDK version to v0.43.0 -- (chain) Support oracle script functions - GetPrepareTime() and GetExecuteTime() - for retrieving prepare and execute blocktime respectively. +* (bump) Use ibc-go package v1.0.1 +* (chain) Replace report authorization with generic authorization +* (yoda) Fix yoda to send report by MsgExec. +* (yoda) Add feature on yoda keys list to show grant status of reporter +* (chain) Remove MsgAddReporter/MsgRemoveReporter + Using Grant in authz module to manage authorization of reporter +* (chain) Refactor QueryRequestVerification +* (chore) Change max owasm gas to be the same as block gas limit (8000000) +* (chore) Limit block gas to 8000000 +* (test) Refactor tests +* (ibc) Remove escrowAddress for IBC oracle request and use a given relayer account instead +* (chain) Replace int64 with uint64 for ids and counts +* (patch) Use ibc-go package v1.0.0 +* (patch) Upgrade SDK version to v0.43.0 +* (chain) Support oracle script functions - GetPrepareTime() and GetExecuteTime() - for retrieving prepare and execute blocktime respectively. ## [v2.1.1](https://github.com/bandprotocol/chain/releases/tag/v2.1.1) -- (bandd) Increase max block size for evidence size +* (bandd) Increase max block size for evidence size ## [v2.1.0](https://github.com/bandprotocol/chain/releases/tag/v2.1.0) -- (app) Adjust block params on init and migrate command -- (bandd) Bump SDK to 0.42.9 to resolve IBC channel restart SDK issue [9800](https://github.com/cosmos/cosmos-sdk/issues/9800). -- (yoda) Add retry logic when query data from node -- (bandd) Parameterized max data report size +* (app) Adjust block params on init and migrate command +* (bandd) Bump SDK to 0.42.9 to resolve IBC channel restart SDK issue [9800](https://github.com/cosmos/cosmos-sdk/issues/9800). +* (yoda) Add retry logic when query data from node +* (bandd) Parameterized max data report size diff --git a/Makefile b/Makefile index 7af3b5970..df42b3b45 100644 --- a/Makefile +++ b/Makefile @@ -79,7 +79,7 @@ test: ### Protobuf ### ############################################################################### -protoVer=0.13.0 +protoVer=0.14.0 protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) @@ -103,6 +103,11 @@ proto-lint: proto-check-breaking: @$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main +proto-update-deps: + @echo "Updating Protobuf dependencies" + + $(DOCKER) run --rm -v $(CURDIR)/proto:/workspace --workdir /workspace $(protoImageName) buf mod update + ############################################################################### ### Simulation ### ############################################################################### diff --git a/api/bandchain/v1/node/query.pulsar.go b/api/bandchain/v1/node/query.pulsar.go new file mode 100644 index 000000000..12d7180dc --- /dev/null +++ b/api/bandchain/v1/node/query.pulsar.go @@ -0,0 +1,2531 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package node + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_ChainIDRequest protoreflect.MessageDescriptor +) + +func init() { + file_bandchain_v1_node_query_proto_init() + md_ChainIDRequest = File_bandchain_v1_node_query_proto.Messages().ByName("ChainIDRequest") +} + +var _ protoreflect.Message = (*fastReflection_ChainIDRequest)(nil) + +type fastReflection_ChainIDRequest ChainIDRequest + +func (x *ChainIDRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_ChainIDRequest)(x) +} + +func (x *ChainIDRequest) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_node_query_proto_msgTypes[0] + 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_ChainIDRequest_messageType fastReflection_ChainIDRequest_messageType +var _ protoreflect.MessageType = fastReflection_ChainIDRequest_messageType{} + +type fastReflection_ChainIDRequest_messageType struct{} + +func (x fastReflection_ChainIDRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_ChainIDRequest)(nil) +} +func (x fastReflection_ChainIDRequest_messageType) New() protoreflect.Message { + return new(fastReflection_ChainIDRequest) +} +func (x fastReflection_ChainIDRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ChainIDRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ChainIDRequest) Descriptor() protoreflect.MessageDescriptor { + return md_ChainIDRequest +} + +// 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_ChainIDRequest) Type() protoreflect.MessageType { + return _fastReflection_ChainIDRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ChainIDRequest) New() protoreflect.Message { + return new(fastReflection_ChainIDRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ChainIDRequest) Interface() protoreflect.ProtoMessage { + return (*ChainIDRequest)(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_ChainIDRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_ChainIDRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ChainIDRequest")) + } + panic(fmt.Errorf("message bandchain.v1.node.ChainIDRequest 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_ChainIDRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ChainIDRequest")) + } + panic(fmt.Errorf("message bandchain.v1.node.ChainIDRequest 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_ChainIDRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ChainIDRequest")) + } + panic(fmt.Errorf("message bandchain.v1.node.ChainIDRequest 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_ChainIDRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ChainIDRequest")) + } + panic(fmt.Errorf("message bandchain.v1.node.ChainIDRequest 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_ChainIDRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ChainIDRequest")) + } + panic(fmt.Errorf("message bandchain.v1.node.ChainIDRequest 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_ChainIDRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ChainIDRequest")) + } + panic(fmt.Errorf("message bandchain.v1.node.ChainIDRequest 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_ChainIDRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.node.ChainIDRequest", 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_ChainIDRequest) 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_ChainIDRequest) 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_ChainIDRequest) 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_ChainIDRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ChainIDRequest) + 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.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().(*ChainIDRequest) + 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 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().(*ChainIDRequest) + 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: ChainIDRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ChainIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_ChainIDResponse protoreflect.MessageDescriptor + fd_ChainIDResponse_chain_id protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_node_query_proto_init() + md_ChainIDResponse = File_bandchain_v1_node_query_proto.Messages().ByName("ChainIDResponse") + fd_ChainIDResponse_chain_id = md_ChainIDResponse.Fields().ByName("chain_id") +} + +var _ protoreflect.Message = (*fastReflection_ChainIDResponse)(nil) + +type fastReflection_ChainIDResponse ChainIDResponse + +func (x *ChainIDResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_ChainIDResponse)(x) +} + +func (x *ChainIDResponse) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_node_query_proto_msgTypes[1] + 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_ChainIDResponse_messageType fastReflection_ChainIDResponse_messageType +var _ protoreflect.MessageType = fastReflection_ChainIDResponse_messageType{} + +type fastReflection_ChainIDResponse_messageType struct{} + +func (x fastReflection_ChainIDResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_ChainIDResponse)(nil) +} +func (x fastReflection_ChainIDResponse_messageType) New() protoreflect.Message { + return new(fastReflection_ChainIDResponse) +} +func (x fastReflection_ChainIDResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ChainIDResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ChainIDResponse) Descriptor() protoreflect.MessageDescriptor { + return md_ChainIDResponse +} + +// 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_ChainIDResponse) Type() protoreflect.MessageType { + return _fastReflection_ChainIDResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ChainIDResponse) New() protoreflect.Message { + return new(fastReflection_ChainIDResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ChainIDResponse) Interface() protoreflect.ProtoMessage { + return (*ChainIDResponse)(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_ChainIDResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ChainId != "" { + value := protoreflect.ValueOfString(x.ChainId) + if !f(fd_ChainIDResponse_chain_id, 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_ChainIDResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.node.ChainIDResponse.chain_id": + return x.ChainId != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ChainIDResponse")) + } + panic(fmt.Errorf("message bandchain.v1.node.ChainIDResponse 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_ChainIDResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.node.ChainIDResponse.chain_id": + x.ChainId = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ChainIDResponse")) + } + panic(fmt.Errorf("message bandchain.v1.node.ChainIDResponse 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_ChainIDResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.node.ChainIDResponse.chain_id": + value := x.ChainId + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ChainIDResponse")) + } + panic(fmt.Errorf("message bandchain.v1.node.ChainIDResponse 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_ChainIDResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.node.ChainIDResponse.chain_id": + x.ChainId = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ChainIDResponse")) + } + panic(fmt.Errorf("message bandchain.v1.node.ChainIDResponse 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_ChainIDResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.node.ChainIDResponse.chain_id": + panic(fmt.Errorf("field chain_id of message bandchain.v1.node.ChainIDResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ChainIDResponse")) + } + panic(fmt.Errorf("message bandchain.v1.node.ChainIDResponse 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_ChainIDResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.node.ChainIDResponse.chain_id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ChainIDResponse")) + } + panic(fmt.Errorf("message bandchain.v1.node.ChainIDResponse 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_ChainIDResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.node.ChainIDResponse", 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_ChainIDResponse) 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_ChainIDResponse) 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_ChainIDResponse) 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_ChainIDResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ChainIDResponse) + 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.ChainId) + 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().(*ChainIDResponse) + 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.ChainId) > 0 { + i -= len(x.ChainId) + copy(dAtA[i:], x.ChainId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) + 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().(*ChainIDResponse) + 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: ChainIDResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ChainIDResponse: 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 ChainId", 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.ChainId = 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_EVMValidatorsRequest protoreflect.MessageDescriptor +) + +func init() { + file_bandchain_v1_node_query_proto_init() + md_EVMValidatorsRequest = File_bandchain_v1_node_query_proto.Messages().ByName("EVMValidatorsRequest") +} + +var _ protoreflect.Message = (*fastReflection_EVMValidatorsRequest)(nil) + +type fastReflection_EVMValidatorsRequest EVMValidatorsRequest + +func (x *EVMValidatorsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_EVMValidatorsRequest)(x) +} + +func (x *EVMValidatorsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_node_query_proto_msgTypes[2] + 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_EVMValidatorsRequest_messageType fastReflection_EVMValidatorsRequest_messageType +var _ protoreflect.MessageType = fastReflection_EVMValidatorsRequest_messageType{} + +type fastReflection_EVMValidatorsRequest_messageType struct{} + +func (x fastReflection_EVMValidatorsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_EVMValidatorsRequest)(nil) +} +func (x fastReflection_EVMValidatorsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_EVMValidatorsRequest) +} +func (x fastReflection_EVMValidatorsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EVMValidatorsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EVMValidatorsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_EVMValidatorsRequest +} + +// 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_EVMValidatorsRequest) Type() protoreflect.MessageType { + return _fastReflection_EVMValidatorsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EVMValidatorsRequest) New() protoreflect.Message { + return new(fastReflection_EVMValidatorsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EVMValidatorsRequest) Interface() protoreflect.ProtoMessage { + return (*EVMValidatorsRequest)(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_EVMValidatorsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_EVMValidatorsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.EVMValidatorsRequest")) + } + panic(fmt.Errorf("message bandchain.v1.node.EVMValidatorsRequest 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_EVMValidatorsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.EVMValidatorsRequest")) + } + panic(fmt.Errorf("message bandchain.v1.node.EVMValidatorsRequest 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_EVMValidatorsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.EVMValidatorsRequest")) + } + panic(fmt.Errorf("message bandchain.v1.node.EVMValidatorsRequest 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_EVMValidatorsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.EVMValidatorsRequest")) + } + panic(fmt.Errorf("message bandchain.v1.node.EVMValidatorsRequest 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_EVMValidatorsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.EVMValidatorsRequest")) + } + panic(fmt.Errorf("message bandchain.v1.node.EVMValidatorsRequest 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_EVMValidatorsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.EVMValidatorsRequest")) + } + panic(fmt.Errorf("message bandchain.v1.node.EVMValidatorsRequest 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_EVMValidatorsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.node.EVMValidatorsRequest", 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_EVMValidatorsRequest) 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_EVMValidatorsRequest) 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_EVMValidatorsRequest) 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_EVMValidatorsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EVMValidatorsRequest) + 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.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().(*EVMValidatorsRequest) + 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 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().(*EVMValidatorsRequest) + 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: EVMValidatorsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EVMValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 = (*_EVMValidatorsResponse_2_list)(nil) + +type _EVMValidatorsResponse_2_list struct { + list *[]*ValidatorMinimal +} + +func (x *_EVMValidatorsResponse_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_EVMValidatorsResponse_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_EVMValidatorsResponse_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ValidatorMinimal) + (*x.list)[i] = concreteValue +} + +func (x *_EVMValidatorsResponse_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ValidatorMinimal) + *x.list = append(*x.list, concreteValue) +} + +func (x *_EVMValidatorsResponse_2_list) AppendMutable() protoreflect.Value { + v := new(ValidatorMinimal) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_EVMValidatorsResponse_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_EVMValidatorsResponse_2_list) NewElement() protoreflect.Value { + v := new(ValidatorMinimal) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_EVMValidatorsResponse_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_EVMValidatorsResponse protoreflect.MessageDescriptor + fd_EVMValidatorsResponse_block_height protoreflect.FieldDescriptor + fd_EVMValidatorsResponse_validators protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_node_query_proto_init() + md_EVMValidatorsResponse = File_bandchain_v1_node_query_proto.Messages().ByName("EVMValidatorsResponse") + fd_EVMValidatorsResponse_block_height = md_EVMValidatorsResponse.Fields().ByName("block_height") + fd_EVMValidatorsResponse_validators = md_EVMValidatorsResponse.Fields().ByName("validators") +} + +var _ protoreflect.Message = (*fastReflection_EVMValidatorsResponse)(nil) + +type fastReflection_EVMValidatorsResponse EVMValidatorsResponse + +func (x *EVMValidatorsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_EVMValidatorsResponse)(x) +} + +func (x *EVMValidatorsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_node_query_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_EVMValidatorsResponse_messageType fastReflection_EVMValidatorsResponse_messageType +var _ protoreflect.MessageType = fastReflection_EVMValidatorsResponse_messageType{} + +type fastReflection_EVMValidatorsResponse_messageType struct{} + +func (x fastReflection_EVMValidatorsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_EVMValidatorsResponse)(nil) +} +func (x fastReflection_EVMValidatorsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_EVMValidatorsResponse) +} +func (x fastReflection_EVMValidatorsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EVMValidatorsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EVMValidatorsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_EVMValidatorsResponse +} + +// 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_EVMValidatorsResponse) Type() protoreflect.MessageType { + return _fastReflection_EVMValidatorsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EVMValidatorsResponse) New() protoreflect.Message { + return new(fastReflection_EVMValidatorsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EVMValidatorsResponse) Interface() protoreflect.ProtoMessage { + return (*EVMValidatorsResponse)(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_EVMValidatorsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BlockHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.BlockHeight) + if !f(fd_EVMValidatorsResponse_block_height, value) { + return + } + } + if len(x.Validators) != 0 { + value := protoreflect.ValueOfList(&_EVMValidatorsResponse_2_list{list: &x.Validators}) + if !f(fd_EVMValidatorsResponse_validators, 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_EVMValidatorsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.node.EVMValidatorsResponse.block_height": + return x.BlockHeight != int64(0) + case "bandchain.v1.node.EVMValidatorsResponse.validators": + return len(x.Validators) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.EVMValidatorsResponse")) + } + panic(fmt.Errorf("message bandchain.v1.node.EVMValidatorsResponse 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_EVMValidatorsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.node.EVMValidatorsResponse.block_height": + x.BlockHeight = int64(0) + case "bandchain.v1.node.EVMValidatorsResponse.validators": + x.Validators = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.EVMValidatorsResponse")) + } + panic(fmt.Errorf("message bandchain.v1.node.EVMValidatorsResponse 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_EVMValidatorsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.node.EVMValidatorsResponse.block_height": + value := x.BlockHeight + return protoreflect.ValueOfInt64(value) + case "bandchain.v1.node.EVMValidatorsResponse.validators": + if len(x.Validators) == 0 { + return protoreflect.ValueOfList(&_EVMValidatorsResponse_2_list{}) + } + listValue := &_EVMValidatorsResponse_2_list{list: &x.Validators} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.EVMValidatorsResponse")) + } + panic(fmt.Errorf("message bandchain.v1.node.EVMValidatorsResponse 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_EVMValidatorsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.node.EVMValidatorsResponse.block_height": + x.BlockHeight = value.Int() + case "bandchain.v1.node.EVMValidatorsResponse.validators": + lv := value.List() + clv := lv.(*_EVMValidatorsResponse_2_list) + x.Validators = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.EVMValidatorsResponse")) + } + panic(fmt.Errorf("message bandchain.v1.node.EVMValidatorsResponse 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_EVMValidatorsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.node.EVMValidatorsResponse.validators": + if x.Validators == nil { + x.Validators = []*ValidatorMinimal{} + } + value := &_EVMValidatorsResponse_2_list{list: &x.Validators} + return protoreflect.ValueOfList(value) + case "bandchain.v1.node.EVMValidatorsResponse.block_height": + panic(fmt.Errorf("field block_height of message bandchain.v1.node.EVMValidatorsResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.EVMValidatorsResponse")) + } + panic(fmt.Errorf("message bandchain.v1.node.EVMValidatorsResponse 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_EVMValidatorsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.node.EVMValidatorsResponse.block_height": + return protoreflect.ValueOfInt64(int64(0)) + case "bandchain.v1.node.EVMValidatorsResponse.validators": + list := []*ValidatorMinimal{} + return protoreflect.ValueOfList(&_EVMValidatorsResponse_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.EVMValidatorsResponse")) + } + panic(fmt.Errorf("message bandchain.v1.node.EVMValidatorsResponse 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_EVMValidatorsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.node.EVMValidatorsResponse", 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_EVMValidatorsResponse) 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_EVMValidatorsResponse) 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_EVMValidatorsResponse) 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_EVMValidatorsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EVMValidatorsResponse) + 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.BlockHeight != 0 { + n += 1 + runtime.Sov(uint64(x.BlockHeight)) + } + if len(x.Validators) > 0 { + for _, e := range x.Validators { + 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().(*EVMValidatorsResponse) + 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.Validators) > 0 { + for iNdEx := len(x.Validators) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Validators[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] = 0x12 + } + } + if x.BlockHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockHeight)) + i-- + dAtA[i] = 0x8 + } + 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().(*EVMValidatorsResponse) + 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: EVMValidatorsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EVMValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + x.BlockHeight = 0 + 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++ + x.BlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Validators", 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.Validators = append(x.Validators, &ValidatorMinimal{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Validators[len(x.Validators)-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 ( + md_ValidatorMinimal protoreflect.MessageDescriptor + fd_ValidatorMinimal_address protoreflect.FieldDescriptor + fd_ValidatorMinimal_voting_power protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_node_query_proto_init() + md_ValidatorMinimal = File_bandchain_v1_node_query_proto.Messages().ByName("ValidatorMinimal") + fd_ValidatorMinimal_address = md_ValidatorMinimal.Fields().ByName("address") + fd_ValidatorMinimal_voting_power = md_ValidatorMinimal.Fields().ByName("voting_power") +} + +var _ protoreflect.Message = (*fastReflection_ValidatorMinimal)(nil) + +type fastReflection_ValidatorMinimal ValidatorMinimal + +func (x *ValidatorMinimal) ProtoReflect() protoreflect.Message { + return (*fastReflection_ValidatorMinimal)(x) +} + +func (x *ValidatorMinimal) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_node_query_proto_msgTypes[4] + 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_ValidatorMinimal_messageType fastReflection_ValidatorMinimal_messageType +var _ protoreflect.MessageType = fastReflection_ValidatorMinimal_messageType{} + +type fastReflection_ValidatorMinimal_messageType struct{} + +func (x fastReflection_ValidatorMinimal_messageType) Zero() protoreflect.Message { + return (*fastReflection_ValidatorMinimal)(nil) +} +func (x fastReflection_ValidatorMinimal_messageType) New() protoreflect.Message { + return new(fastReflection_ValidatorMinimal) +} +func (x fastReflection_ValidatorMinimal_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorMinimal +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ValidatorMinimal) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorMinimal +} + +// 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_ValidatorMinimal) Type() protoreflect.MessageType { + return _fastReflection_ValidatorMinimal_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ValidatorMinimal) New() protoreflect.Message { + return new(fastReflection_ValidatorMinimal) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ValidatorMinimal) Interface() protoreflect.ProtoMessage { + return (*ValidatorMinimal)(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_ValidatorMinimal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_ValidatorMinimal_address, value) { + return + } + } + if x.VotingPower != int64(0) { + value := protoreflect.ValueOfInt64(x.VotingPower) + if !f(fd_ValidatorMinimal_voting_power, 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_ValidatorMinimal) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.node.ValidatorMinimal.address": + return x.Address != "" + case "bandchain.v1.node.ValidatorMinimal.voting_power": + return x.VotingPower != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ValidatorMinimal")) + } + panic(fmt.Errorf("message bandchain.v1.node.ValidatorMinimal 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_ValidatorMinimal) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.node.ValidatorMinimal.address": + x.Address = "" + case "bandchain.v1.node.ValidatorMinimal.voting_power": + x.VotingPower = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ValidatorMinimal")) + } + panic(fmt.Errorf("message bandchain.v1.node.ValidatorMinimal 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_ValidatorMinimal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.node.ValidatorMinimal.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "bandchain.v1.node.ValidatorMinimal.voting_power": + value := x.VotingPower + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ValidatorMinimal")) + } + panic(fmt.Errorf("message bandchain.v1.node.ValidatorMinimal 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_ValidatorMinimal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.node.ValidatorMinimal.address": + x.Address = value.Interface().(string) + case "bandchain.v1.node.ValidatorMinimal.voting_power": + x.VotingPower = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ValidatorMinimal")) + } + panic(fmt.Errorf("message bandchain.v1.node.ValidatorMinimal 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_ValidatorMinimal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.node.ValidatorMinimal.address": + panic(fmt.Errorf("field address of message bandchain.v1.node.ValidatorMinimal is not mutable")) + case "bandchain.v1.node.ValidatorMinimal.voting_power": + panic(fmt.Errorf("field voting_power of message bandchain.v1.node.ValidatorMinimal is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ValidatorMinimal")) + } + panic(fmt.Errorf("message bandchain.v1.node.ValidatorMinimal 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_ValidatorMinimal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.node.ValidatorMinimal.address": + return protoreflect.ValueOfString("") + case "bandchain.v1.node.ValidatorMinimal.voting_power": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.node.ValidatorMinimal")) + } + panic(fmt.Errorf("message bandchain.v1.node.ValidatorMinimal 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_ValidatorMinimal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.node.ValidatorMinimal", 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_ValidatorMinimal) 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_ValidatorMinimal) 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_ValidatorMinimal) 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_ValidatorMinimal) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ValidatorMinimal) + 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.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.VotingPower != 0 { + n += 1 + runtime.Sov(uint64(x.VotingPower)) + } + 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().(*ValidatorMinimal) + 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.VotingPower != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.VotingPower)) + i-- + dAtA[i] = 0x10 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + 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().(*ValidatorMinimal) + 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: ValidatorMinimal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ValidatorMinimal: 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 Address", 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VotingPower", wireType) + } + x.VotingPower = 0 + 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++ + x.VotingPower |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: bandchain/v1/node/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ChainIDRequest is request type for the Service/ChainID RPC method. +type ChainIDRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ChainIDRequest) Reset() { + *x = ChainIDRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_node_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChainIDRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChainIDRequest) ProtoMessage() {} + +// Deprecated: Use ChainIDRequest.ProtoReflect.Descriptor instead. +func (*ChainIDRequest) Descriptor() ([]byte, []int) { + return file_bandchain_v1_node_query_proto_rawDescGZIP(), []int{0} +} + +// ChainIDResponse is response type for the Service/ChainID RPC method. +type ChainIDResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (x *ChainIDResponse) Reset() { + *x = ChainIDResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_node_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChainIDResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChainIDResponse) ProtoMessage() {} + +// Deprecated: Use ChainIDResponse.ProtoReflect.Descriptor instead. +func (*ChainIDResponse) Descriptor() ([]byte, []int) { + return file_bandchain_v1_node_query_proto_rawDescGZIP(), []int{1} +} + +func (x *ChainIDResponse) GetChainId() string { + if x != nil { + return x.ChainId + } + return "" +} + +// EVMValidatorsRequest is request type for the Service/EVMValidators RPC method. +type EVMValidatorsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *EVMValidatorsRequest) Reset() { + *x = EVMValidatorsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_node_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EVMValidatorsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EVMValidatorsRequest) ProtoMessage() {} + +// Deprecated: Use EVMValidatorsRequest.ProtoReflect.Descriptor instead. +func (*EVMValidatorsRequest) Descriptor() ([]byte, []int) { + return file_bandchain_v1_node_query_proto_rawDescGZIP(), []int{2} +} + +// EVMValidatorsResponse is response type for the Service/EVMValidators RPC method. +type EVMValidatorsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // BlockHeight is the latest block height + BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + // Validators is list of validator's addresss and voting power + Validators []*ValidatorMinimal `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators,omitempty"` +} + +func (x *EVMValidatorsResponse) Reset() { + *x = EVMValidatorsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_node_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EVMValidatorsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EVMValidatorsResponse) ProtoMessage() {} + +// Deprecated: Use EVMValidatorsResponse.ProtoReflect.Descriptor instead. +func (*EVMValidatorsResponse) Descriptor() ([]byte, []int) { + return file_bandchain_v1_node_query_proto_rawDescGZIP(), []int{3} +} + +func (x *EVMValidatorsResponse) GetBlockHeight() int64 { + if x != nil { + return x.BlockHeight + } + return 0 +} + +func (x *EVMValidatorsResponse) GetValidators() []*ValidatorMinimal { + if x != nil { + return x.Validators + } + return nil +} + +// ValidatorMinimal is the data structure for storing validator's address and voting power +type ValidatorMinimal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + VotingPower int64 `protobuf:"varint,2,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` +} + +func (x *ValidatorMinimal) Reset() { + *x = ValidatorMinimal{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_node_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidatorMinimal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidatorMinimal) ProtoMessage() {} + +// Deprecated: Use ValidatorMinimal.ProtoReflect.Descriptor instead. +func (*ValidatorMinimal) Descriptor() ([]byte, []int) { + return file_bandchain_v1_node_query_proto_rawDescGZIP(), []int{4} +} + +func (x *ValidatorMinimal) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *ValidatorMinimal) GetVotingPower() int64 { + if x != nil { + return x.VotingPower + } + return 0 +} + +var File_bandchain_v1_node_query_proto protoreflect.FileDescriptor + +var file_bandchain_v1_node_query_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6e, + 0x6f, 0x64, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x11, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6e, 0x6f, + 0x64, 0x65, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x10, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, + 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x39, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x08, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0b, 0xe2, + 0xde, 0x1f, 0x07, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x49, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x45, 0x56, 0x4d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x85, 0x01, 0x0a, 0x15, + 0x45, 0x56, 0x4d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x49, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, + 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6e, 0x6f, 0x64, 0x65, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x61, + 0x6c, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x73, 0x22, 0x4f, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x6f, 0x77, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, + 0x6f, 0x77, 0x65, 0x72, 0x32, 0x86, 0x02, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x70, 0x0a, 0x07, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x12, 0x21, 0x2e, 0x62, 0x61, + 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, + 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6e, 0x6f, + 0x64, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x62, 0x61, 0x6e, + 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, + 0x69, 0x64, 0x12, 0x88, 0x01, 0x0a, 0x0d, 0x45, 0x56, 0x4d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x73, 0x12, 0x27, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x45, 0x56, 0x4d, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, + 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6e, 0x6f, 0x64, + 0x65, 0x2e, 0x45, 0x56, 0x4d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, + 0x1c, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x65, + 0x76, 0x6d, 0x2d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x42, 0xc1, 0x01, + 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x62, 0x61, 0x6e, 0x64, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0xa2, 0x02, 0x03, + 0x42, 0x56, 0x4e, 0xaa, 0x02, 0x11, 0x42, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, + 0x56, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0xca, 0x02, 0x11, 0x42, 0x61, 0x6e, 0x64, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x4e, 0x6f, 0x64, 0x65, 0xe2, 0x02, 0x1d, 0x42, 0x61, + 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x4e, 0x6f, 0x64, 0x65, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x42, 0x61, + 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x3a, 0x3a, 0x4e, 0x6f, 0x64, + 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_bandchain_v1_node_query_proto_rawDescOnce sync.Once + file_bandchain_v1_node_query_proto_rawDescData = file_bandchain_v1_node_query_proto_rawDesc +) + +func file_bandchain_v1_node_query_proto_rawDescGZIP() []byte { + file_bandchain_v1_node_query_proto_rawDescOnce.Do(func() { + file_bandchain_v1_node_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_bandchain_v1_node_query_proto_rawDescData) + }) + return file_bandchain_v1_node_query_proto_rawDescData +} + +var file_bandchain_v1_node_query_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_bandchain_v1_node_query_proto_goTypes = []interface{}{ + (*ChainIDRequest)(nil), // 0: bandchain.v1.node.ChainIDRequest + (*ChainIDResponse)(nil), // 1: bandchain.v1.node.ChainIDResponse + (*EVMValidatorsRequest)(nil), // 2: bandchain.v1.node.EVMValidatorsRequest + (*EVMValidatorsResponse)(nil), // 3: bandchain.v1.node.EVMValidatorsResponse + (*ValidatorMinimal)(nil), // 4: bandchain.v1.node.ValidatorMinimal +} +var file_bandchain_v1_node_query_proto_depIdxs = []int32{ + 4, // 0: bandchain.v1.node.EVMValidatorsResponse.validators:type_name -> bandchain.v1.node.ValidatorMinimal + 0, // 1: bandchain.v1.node.Service.ChainID:input_type -> bandchain.v1.node.ChainIDRequest + 2, // 2: bandchain.v1.node.Service.EVMValidators:input_type -> bandchain.v1.node.EVMValidatorsRequest + 1, // 3: bandchain.v1.node.Service.ChainID:output_type -> bandchain.v1.node.ChainIDResponse + 3, // 4: bandchain.v1.node.Service.EVMValidators:output_type -> bandchain.v1.node.EVMValidatorsResponse + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_bandchain_v1_node_query_proto_init() } +func file_bandchain_v1_node_query_proto_init() { + if File_bandchain_v1_node_query_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_bandchain_v1_node_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChainIDRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_node_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChainIDResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_node_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EVMValidatorsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_node_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EVMValidatorsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_node_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidatorMinimal); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_bandchain_v1_node_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_bandchain_v1_node_query_proto_goTypes, + DependencyIndexes: file_bandchain_v1_node_query_proto_depIdxs, + MessageInfos: file_bandchain_v1_node_query_proto_msgTypes, + }.Build() + File_bandchain_v1_node_query_proto = out.File + file_bandchain_v1_node_query_proto_rawDesc = nil + file_bandchain_v1_node_query_proto_goTypes = nil + file_bandchain_v1_node_query_proto_depIdxs = nil +} diff --git a/api/bandchain/v1/node/query_grpc.pb.go b/api/bandchain/v1/node/query_grpc.pb.go new file mode 100644 index 000000000..995a37b4c --- /dev/null +++ b/api/bandchain/v1/node/query_grpc.pb.go @@ -0,0 +1,150 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: bandchain/v1/node/query.proto + +package node + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Service_ChainID_FullMethodName = "/bandchain.v1.node.Service/ChainID" + Service_EVMValidators_FullMethodName = "/bandchain.v1.node.Service/EVMValidators" +) + +// ServiceClient is the client API for Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ServiceClient interface { + // ChainID queries the chain ID of this node + ChainID(ctx context.Context, in *ChainIDRequest, opts ...grpc.CallOption) (*ChainIDResponse, error) + // EVMValidators queries current list of validator's address and power + EVMValidators(ctx context.Context, in *EVMValidatorsRequest, opts ...grpc.CallOption) (*EVMValidatorsResponse, error) +} + +type serviceClient struct { + cc grpc.ClientConnInterface +} + +func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient { + return &serviceClient{cc} +} + +func (c *serviceClient) ChainID(ctx context.Context, in *ChainIDRequest, opts ...grpc.CallOption) (*ChainIDResponse, error) { + out := new(ChainIDResponse) + err := c.cc.Invoke(ctx, Service_ChainID_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) EVMValidators(ctx context.Context, in *EVMValidatorsRequest, opts ...grpc.CallOption) (*EVMValidatorsResponse, error) { + out := new(EVMValidatorsResponse) + err := c.cc.Invoke(ctx, Service_EVMValidators_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ServiceServer is the server API for Service service. +// All implementations must embed UnimplementedServiceServer +// for forward compatibility +type ServiceServer interface { + // ChainID queries the chain ID of this node + ChainID(context.Context, *ChainIDRequest) (*ChainIDResponse, error) + // EVMValidators queries current list of validator's address and power + EVMValidators(context.Context, *EVMValidatorsRequest) (*EVMValidatorsResponse, error) + mustEmbedUnimplementedServiceServer() +} + +// UnimplementedServiceServer must be embedded to have forward compatible implementations. +type UnimplementedServiceServer struct { +} + +func (UnimplementedServiceServer) ChainID(context.Context, *ChainIDRequest) (*ChainIDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChainID not implemented") +} +func (UnimplementedServiceServer) EVMValidators(context.Context, *EVMValidatorsRequest) (*EVMValidatorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EVMValidators not implemented") +} +func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {} + +// UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ServiceServer will +// result in compilation errors. +type UnsafeServiceServer interface { + mustEmbedUnimplementedServiceServer() +} + +func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) { + s.RegisterService(&Service_ServiceDesc, srv) +} + +func _Service_ChainID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChainIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).ChainID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Service_ChainID_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).ChainID(ctx, req.(*ChainIDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_EVMValidators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EVMValidatorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).EVMValidators(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Service_EVMValidators_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).EVMValidators(ctx, req.(*EVMValidatorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Service_ServiceDesc is the grpc.ServiceDesc for Service service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Service_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "bandchain.v1.node.Service", + HandlerType: (*ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ChainID", + Handler: _Service_ChainID_Handler, + }, + { + MethodName: "EVMValidators", + Handler: _Service_EVMValidators_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "bandchain/v1/node/query.proto", +} diff --git a/api/bandchain/v1/oracle/proof.pulsar.go b/api/bandchain/v1/oracle/proof.pulsar.go new file mode 100644 index 000000000..9847a6a45 --- /dev/null +++ b/api/bandchain/v1/oracle/proof.pulsar.go @@ -0,0 +1,12992 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package oracle + +import ( + fmt "fmt" + v1 "github.com/bandprotocol/chain/v3/api/oracle/v1" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_ProofRequest protoreflect.MessageDescriptor + fd_ProofRequest_request_id protoreflect.FieldDescriptor + fd_ProofRequest_height protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_ProofRequest = File_bandchain_v1_oracle_proof_proto.Messages().ByName("ProofRequest") + fd_ProofRequest_request_id = md_ProofRequest.Fields().ByName("request_id") + fd_ProofRequest_height = md_ProofRequest.Fields().ByName("height") +} + +var _ protoreflect.Message = (*fastReflection_ProofRequest)(nil) + +type fastReflection_ProofRequest ProofRequest + +func (x *ProofRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_ProofRequest)(x) +} + +func (x *ProofRequest) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[0] + 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_ProofRequest_messageType fastReflection_ProofRequest_messageType +var _ protoreflect.MessageType = fastReflection_ProofRequest_messageType{} + +type fastReflection_ProofRequest_messageType struct{} + +func (x fastReflection_ProofRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_ProofRequest)(nil) +} +func (x fastReflection_ProofRequest_messageType) New() protoreflect.Message { + return new(fastReflection_ProofRequest) +} +func (x fastReflection_ProofRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ProofRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ProofRequest) Descriptor() protoreflect.MessageDescriptor { + return md_ProofRequest +} + +// 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_ProofRequest) Type() protoreflect.MessageType { + return _fastReflection_ProofRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ProofRequest) New() protoreflect.Message { + return new(fastReflection_ProofRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ProofRequest) Interface() protoreflect.ProtoMessage { + return (*ProofRequest)(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_ProofRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.RequestId != uint64(0) { + value := protoreflect.ValueOfUint64(x.RequestId) + if !f(fd_ProofRequest_request_id, value) { + return + } + } + if x.Height != int64(0) { + value := protoreflect.ValueOfInt64(x.Height) + if !f(fd_ProofRequest_height, 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_ProofRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.ProofRequest.request_id": + return x.RequestId != uint64(0) + case "bandchain.v1.oracle.ProofRequest.height": + return x.Height != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.ProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.ProofRequest 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_ProofRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.ProofRequest.request_id": + x.RequestId = uint64(0) + case "bandchain.v1.oracle.ProofRequest.height": + x.Height = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.ProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.ProofRequest 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_ProofRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.ProofRequest.request_id": + value := x.RequestId + return protoreflect.ValueOfUint64(value) + case "bandchain.v1.oracle.ProofRequest.height": + value := x.Height + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.ProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.ProofRequest 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_ProofRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.ProofRequest.request_id": + x.RequestId = value.Uint() + case "bandchain.v1.oracle.ProofRequest.height": + x.Height = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.ProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.ProofRequest 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_ProofRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.ProofRequest.request_id": + panic(fmt.Errorf("field request_id of message bandchain.v1.oracle.ProofRequest is not mutable")) + case "bandchain.v1.oracle.ProofRequest.height": + panic(fmt.Errorf("field height of message bandchain.v1.oracle.ProofRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.ProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.ProofRequest 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_ProofRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.ProofRequest.request_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "bandchain.v1.oracle.ProofRequest.height": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.ProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.ProofRequest 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_ProofRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.ProofRequest", 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_ProofRequest) 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_ProofRequest) 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_ProofRequest) 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_ProofRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ProofRequest) + 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.RequestId != 0 { + n += 1 + runtime.Sov(uint64(x.RequestId)) + } + if x.Height != 0 { + n += 1 + runtime.Sov(uint64(x.Height)) + } + 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().(*ProofRequest) + 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.Height != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Height)) + i-- + dAtA[i] = 0x10 + } + if x.RequestId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RequestId)) + i-- + dAtA[i] = 0x8 + } + 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().(*ProofRequest) + 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: ProofRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ProofRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) + } + x.RequestId = 0 + 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++ + x.RequestId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + x.Height = 0 + 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++ + x.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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_ProofResponse protoreflect.MessageDescriptor + fd_ProofResponse_height protoreflect.FieldDescriptor + fd_ProofResponse_result protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_ProofResponse = File_bandchain_v1_oracle_proof_proto.Messages().ByName("ProofResponse") + fd_ProofResponse_height = md_ProofResponse.Fields().ByName("height") + fd_ProofResponse_result = md_ProofResponse.Fields().ByName("result") +} + +var _ protoreflect.Message = (*fastReflection_ProofResponse)(nil) + +type fastReflection_ProofResponse ProofResponse + +func (x *ProofResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_ProofResponse)(x) +} + +func (x *ProofResponse) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[1] + 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_ProofResponse_messageType fastReflection_ProofResponse_messageType +var _ protoreflect.MessageType = fastReflection_ProofResponse_messageType{} + +type fastReflection_ProofResponse_messageType struct{} + +func (x fastReflection_ProofResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_ProofResponse)(nil) +} +func (x fastReflection_ProofResponse_messageType) New() protoreflect.Message { + return new(fastReflection_ProofResponse) +} +func (x fastReflection_ProofResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ProofResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ProofResponse) Descriptor() protoreflect.MessageDescriptor { + return md_ProofResponse +} + +// 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_ProofResponse) Type() protoreflect.MessageType { + return _fastReflection_ProofResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ProofResponse) New() protoreflect.Message { + return new(fastReflection_ProofResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ProofResponse) Interface() protoreflect.ProtoMessage { + return (*ProofResponse)(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_ProofResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Height != int64(0) { + value := protoreflect.ValueOfInt64(x.Height) + if !f(fd_ProofResponse_height, value) { + return + } + } + if x.Result != nil { + value := protoreflect.ValueOfMessage(x.Result.ProtoReflect()) + if !f(fd_ProofResponse_result, 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_ProofResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.ProofResponse.height": + return x.Height != int64(0) + case "bandchain.v1.oracle.ProofResponse.result": + return x.Result != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.ProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.ProofResponse 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_ProofResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.ProofResponse.height": + x.Height = int64(0) + case "bandchain.v1.oracle.ProofResponse.result": + x.Result = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.ProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.ProofResponse 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_ProofResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.ProofResponse.height": + value := x.Height + return protoreflect.ValueOfInt64(value) + case "bandchain.v1.oracle.ProofResponse.result": + value := x.Result + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.ProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.ProofResponse 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_ProofResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.ProofResponse.height": + x.Height = value.Int() + case "bandchain.v1.oracle.ProofResponse.result": + x.Result = value.Message().Interface().(*SingleProofResult) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.ProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.ProofResponse 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_ProofResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.ProofResponse.result": + if x.Result == nil { + x.Result = new(SingleProofResult) + } + return protoreflect.ValueOfMessage(x.Result.ProtoReflect()) + case "bandchain.v1.oracle.ProofResponse.height": + panic(fmt.Errorf("field height of message bandchain.v1.oracle.ProofResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.ProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.ProofResponse 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_ProofResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.ProofResponse.height": + return protoreflect.ValueOfInt64(int64(0)) + case "bandchain.v1.oracle.ProofResponse.result": + m := new(SingleProofResult) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.ProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.ProofResponse 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_ProofResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.ProofResponse", 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_ProofResponse) 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_ProofResponse) 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_ProofResponse) 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_ProofResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ProofResponse) + 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.Height != 0 { + n += 1 + runtime.Sov(uint64(x.Height)) + } + if x.Result != nil { + l = options.Size(x.Result) + 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().(*ProofResponse) + 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.Result != nil { + encoded, err := options.Marshal(x.Result) + 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.Height != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Height)) + i-- + dAtA[i] = 0x8 + } + 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().(*ProofResponse) + 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: ProofResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + x.Height = 0 + 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++ + x.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Result", 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.Result == nil { + x.Result = &SingleProofResult{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Result); 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 = (*_MultiProofRequest_1_list)(nil) + +type _MultiProofRequest_1_list struct { + list *[]uint64 +} + +func (x *_MultiProofRequest_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MultiProofRequest_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfUint64((*x.list)[i]) +} + +func (x *_MultiProofRequest_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Uint() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MultiProofRequest_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Uint() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MultiProofRequest_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MultiProofRequest at list field RequestIds as it is not of Message kind")) +} + +func (x *_MultiProofRequest_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MultiProofRequest_1_list) NewElement() protoreflect.Value { + v := uint64(0) + return protoreflect.ValueOfUint64(v) +} + +func (x *_MultiProofRequest_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MultiProofRequest protoreflect.MessageDescriptor + fd_MultiProofRequest_request_ids protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_MultiProofRequest = File_bandchain_v1_oracle_proof_proto.Messages().ByName("MultiProofRequest") + fd_MultiProofRequest_request_ids = md_MultiProofRequest.Fields().ByName("request_ids") +} + +var _ protoreflect.Message = (*fastReflection_MultiProofRequest)(nil) + +type fastReflection_MultiProofRequest MultiProofRequest + +func (x *MultiProofRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_MultiProofRequest)(x) +} + +func (x *MultiProofRequest) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[2] + 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_MultiProofRequest_messageType fastReflection_MultiProofRequest_messageType +var _ protoreflect.MessageType = fastReflection_MultiProofRequest_messageType{} + +type fastReflection_MultiProofRequest_messageType struct{} + +func (x fastReflection_MultiProofRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_MultiProofRequest)(nil) +} +func (x fastReflection_MultiProofRequest_messageType) New() protoreflect.Message { + return new(fastReflection_MultiProofRequest) +} +func (x fastReflection_MultiProofRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MultiProofRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MultiProofRequest) Descriptor() protoreflect.MessageDescriptor { + return md_MultiProofRequest +} + +// 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_MultiProofRequest) Type() protoreflect.MessageType { + return _fastReflection_MultiProofRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MultiProofRequest) New() protoreflect.Message { + return new(fastReflection_MultiProofRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MultiProofRequest) Interface() protoreflect.ProtoMessage { + return (*MultiProofRequest)(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_MultiProofRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.RequestIds) != 0 { + value := protoreflect.ValueOfList(&_MultiProofRequest_1_list{list: &x.RequestIds}) + if !f(fd_MultiProofRequest_request_ids, 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_MultiProofRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProofRequest.request_ids": + return len(x.RequestIds) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofRequest 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_MultiProofRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProofRequest.request_ids": + x.RequestIds = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofRequest 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_MultiProofRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.MultiProofRequest.request_ids": + if len(x.RequestIds) == 0 { + return protoreflect.ValueOfList(&_MultiProofRequest_1_list{}) + } + listValue := &_MultiProofRequest_1_list{list: &x.RequestIds} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofRequest 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_MultiProofRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProofRequest.request_ids": + lv := value.List() + clv := lv.(*_MultiProofRequest_1_list) + x.RequestIds = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofRequest 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_MultiProofRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProofRequest.request_ids": + if x.RequestIds == nil { + x.RequestIds = []uint64{} + } + value := &_MultiProofRequest_1_list{list: &x.RequestIds} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofRequest 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_MultiProofRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProofRequest.request_ids": + list := []uint64{} + return protoreflect.ValueOfList(&_MultiProofRequest_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofRequest 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_MultiProofRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.MultiProofRequest", 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_MultiProofRequest) 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_MultiProofRequest) 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_MultiProofRequest) 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_MultiProofRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MultiProofRequest) + 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.RequestIds) > 0 { + l = 0 + for _, e := range x.RequestIds { + l += runtime.Sov(uint64(e)) + } + n += 1 + runtime.Sov(uint64(l)) + 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().(*MultiProofRequest) + 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.RequestIds) > 0 { + var pksize2 int + for _, num := range x.RequestIds { + pksize2 += runtime.Sov(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num := range x.RequestIds { + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ + } + i = runtime.EncodeVarint(dAtA, i, uint64(pksize2)) + 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().(*MultiProofRequest) + 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: MultiProofRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MultiProofRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v 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++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.RequestIds = append(x.RequestIds, v) + } else if wireType == 2 { + var packedLen 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++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + packedLen + 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 + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(x.RequestIds) == 0 { + x.RequestIds = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v 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++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.RequestIds = append(x.RequestIds, v) + } + } else { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestIds", wireType) + } + 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_MultiProofResponse protoreflect.MessageDescriptor + fd_MultiProofResponse_height protoreflect.FieldDescriptor + fd_MultiProofResponse_result protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_MultiProofResponse = File_bandchain_v1_oracle_proof_proto.Messages().ByName("MultiProofResponse") + fd_MultiProofResponse_height = md_MultiProofResponse.Fields().ByName("height") + fd_MultiProofResponse_result = md_MultiProofResponse.Fields().ByName("result") +} + +var _ protoreflect.Message = (*fastReflection_MultiProofResponse)(nil) + +type fastReflection_MultiProofResponse MultiProofResponse + +func (x *MultiProofResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MultiProofResponse)(x) +} + +func (x *MultiProofResponse) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_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_MultiProofResponse_messageType fastReflection_MultiProofResponse_messageType +var _ protoreflect.MessageType = fastReflection_MultiProofResponse_messageType{} + +type fastReflection_MultiProofResponse_messageType struct{} + +func (x fastReflection_MultiProofResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MultiProofResponse)(nil) +} +func (x fastReflection_MultiProofResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MultiProofResponse) +} +func (x fastReflection_MultiProofResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MultiProofResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MultiProofResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MultiProofResponse +} + +// 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_MultiProofResponse) Type() protoreflect.MessageType { + return _fastReflection_MultiProofResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MultiProofResponse) New() protoreflect.Message { + return new(fastReflection_MultiProofResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MultiProofResponse) Interface() protoreflect.ProtoMessage { + return (*MultiProofResponse)(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_MultiProofResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Height != int64(0) { + value := protoreflect.ValueOfInt64(x.Height) + if !f(fd_MultiProofResponse_height, value) { + return + } + } + if x.Result != nil { + value := protoreflect.ValueOfMessage(x.Result.ProtoReflect()) + if !f(fd_MultiProofResponse_result, 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_MultiProofResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProofResponse.height": + return x.Height != int64(0) + case "bandchain.v1.oracle.MultiProofResponse.result": + return x.Result != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofResponse 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_MultiProofResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProofResponse.height": + x.Height = int64(0) + case "bandchain.v1.oracle.MultiProofResponse.result": + x.Result = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofResponse 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_MultiProofResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.MultiProofResponse.height": + value := x.Height + return protoreflect.ValueOfInt64(value) + case "bandchain.v1.oracle.MultiProofResponse.result": + value := x.Result + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofResponse 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_MultiProofResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProofResponse.height": + x.Height = value.Int() + case "bandchain.v1.oracle.MultiProofResponse.result": + x.Result = value.Message().Interface().(*MultiProofResult) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofResponse 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_MultiProofResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProofResponse.result": + if x.Result == nil { + x.Result = new(MultiProofResult) + } + return protoreflect.ValueOfMessage(x.Result.ProtoReflect()) + case "bandchain.v1.oracle.MultiProofResponse.height": + panic(fmt.Errorf("field height of message bandchain.v1.oracle.MultiProofResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofResponse 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_MultiProofResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProofResponse.height": + return protoreflect.ValueOfInt64(int64(0)) + case "bandchain.v1.oracle.MultiProofResponse.result": + m := new(MultiProofResult) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofResponse 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_MultiProofResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.MultiProofResponse", 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_MultiProofResponse) 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_MultiProofResponse) 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_MultiProofResponse) 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_MultiProofResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MultiProofResponse) + 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.Height != 0 { + n += 1 + runtime.Sov(uint64(x.Height)) + } + if x.Result != nil { + l = options.Size(x.Result) + 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().(*MultiProofResponse) + 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.Result != nil { + encoded, err := options.Marshal(x.Result) + 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.Height != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Height)) + i-- + dAtA[i] = 0x8 + } + 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().(*MultiProofResponse) + 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: MultiProofResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MultiProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + x.Height = 0 + 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++ + x.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Result", 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.Result == nil { + x.Result = &MultiProofResult{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Result); 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_RequestCountProofRequest protoreflect.MessageDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_RequestCountProofRequest = File_bandchain_v1_oracle_proof_proto.Messages().ByName("RequestCountProofRequest") +} + +var _ protoreflect.Message = (*fastReflection_RequestCountProofRequest)(nil) + +type fastReflection_RequestCountProofRequest RequestCountProofRequest + +func (x *RequestCountProofRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_RequestCountProofRequest)(x) +} + +func (x *RequestCountProofRequest) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[4] + 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_RequestCountProofRequest_messageType fastReflection_RequestCountProofRequest_messageType +var _ protoreflect.MessageType = fastReflection_RequestCountProofRequest_messageType{} + +type fastReflection_RequestCountProofRequest_messageType struct{} + +func (x fastReflection_RequestCountProofRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_RequestCountProofRequest)(nil) +} +func (x fastReflection_RequestCountProofRequest_messageType) New() protoreflect.Message { + return new(fastReflection_RequestCountProofRequest) +} +func (x fastReflection_RequestCountProofRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_RequestCountProofRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_RequestCountProofRequest) Descriptor() protoreflect.MessageDescriptor { + return md_RequestCountProofRequest +} + +// 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_RequestCountProofRequest) Type() protoreflect.MessageType { + return _fastReflection_RequestCountProofRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_RequestCountProofRequest) New() protoreflect.Message { + return new(fastReflection_RequestCountProofRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_RequestCountProofRequest) Interface() protoreflect.ProtoMessage { + return (*RequestCountProofRequest)(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_RequestCountProofRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_RequestCountProofRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestCountProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestCountProofRequest 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_RequestCountProofRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestCountProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestCountProofRequest 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_RequestCountProofRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestCountProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestCountProofRequest 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_RequestCountProofRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestCountProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestCountProofRequest 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_RequestCountProofRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestCountProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestCountProofRequest 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_RequestCountProofRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestCountProofRequest")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestCountProofRequest 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_RequestCountProofRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.RequestCountProofRequest", 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_RequestCountProofRequest) 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_RequestCountProofRequest) 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_RequestCountProofRequest) 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_RequestCountProofRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*RequestCountProofRequest) + 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.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().(*RequestCountProofRequest) + 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 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().(*RequestCountProofRequest) + 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: RequestCountProofRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RequestCountProofRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_RequestCountProofResponse protoreflect.MessageDescriptor + fd_RequestCountProofResponse_height protoreflect.FieldDescriptor + fd_RequestCountProofResponse_result protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_RequestCountProofResponse = File_bandchain_v1_oracle_proof_proto.Messages().ByName("RequestCountProofResponse") + fd_RequestCountProofResponse_height = md_RequestCountProofResponse.Fields().ByName("height") + fd_RequestCountProofResponse_result = md_RequestCountProofResponse.Fields().ByName("result") +} + +var _ protoreflect.Message = (*fastReflection_RequestCountProofResponse)(nil) + +type fastReflection_RequestCountProofResponse RequestCountProofResponse + +func (x *RequestCountProofResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_RequestCountProofResponse)(x) +} + +func (x *RequestCountProofResponse) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[5] + 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_RequestCountProofResponse_messageType fastReflection_RequestCountProofResponse_messageType +var _ protoreflect.MessageType = fastReflection_RequestCountProofResponse_messageType{} + +type fastReflection_RequestCountProofResponse_messageType struct{} + +func (x fastReflection_RequestCountProofResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_RequestCountProofResponse)(nil) +} +func (x fastReflection_RequestCountProofResponse_messageType) New() protoreflect.Message { + return new(fastReflection_RequestCountProofResponse) +} +func (x fastReflection_RequestCountProofResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_RequestCountProofResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_RequestCountProofResponse) Descriptor() protoreflect.MessageDescriptor { + return md_RequestCountProofResponse +} + +// 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_RequestCountProofResponse) Type() protoreflect.MessageType { + return _fastReflection_RequestCountProofResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_RequestCountProofResponse) New() protoreflect.Message { + return new(fastReflection_RequestCountProofResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_RequestCountProofResponse) Interface() protoreflect.ProtoMessage { + return (*RequestCountProofResponse)(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_RequestCountProofResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Height != int64(0) { + value := protoreflect.ValueOfInt64(x.Height) + if !f(fd_RequestCountProofResponse_height, value) { + return + } + } + if x.Result != nil { + value := protoreflect.ValueOfMessage(x.Result.ProtoReflect()) + if !f(fd_RequestCountProofResponse_result, 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_RequestCountProofResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.RequestCountProofResponse.height": + return x.Height != int64(0) + case "bandchain.v1.oracle.RequestCountProofResponse.result": + return x.Result != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestCountProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestCountProofResponse 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_RequestCountProofResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.RequestCountProofResponse.height": + x.Height = int64(0) + case "bandchain.v1.oracle.RequestCountProofResponse.result": + x.Result = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestCountProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestCountProofResponse 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_RequestCountProofResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.RequestCountProofResponse.height": + value := x.Height + return protoreflect.ValueOfInt64(value) + case "bandchain.v1.oracle.RequestCountProofResponse.result": + value := x.Result + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestCountProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestCountProofResponse 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_RequestCountProofResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.RequestCountProofResponse.height": + x.Height = value.Int() + case "bandchain.v1.oracle.RequestCountProofResponse.result": + x.Result = value.Message().Interface().(*CountProofResult) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestCountProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestCountProofResponse 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_RequestCountProofResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.RequestCountProofResponse.result": + if x.Result == nil { + x.Result = new(CountProofResult) + } + return protoreflect.ValueOfMessage(x.Result.ProtoReflect()) + case "bandchain.v1.oracle.RequestCountProofResponse.height": + panic(fmt.Errorf("field height of message bandchain.v1.oracle.RequestCountProofResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestCountProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestCountProofResponse 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_RequestCountProofResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.RequestCountProofResponse.height": + return protoreflect.ValueOfInt64(int64(0)) + case "bandchain.v1.oracle.RequestCountProofResponse.result": + m := new(CountProofResult) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestCountProofResponse")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestCountProofResponse 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_RequestCountProofResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.RequestCountProofResponse", 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_RequestCountProofResponse) 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_RequestCountProofResponse) 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_RequestCountProofResponse) 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_RequestCountProofResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*RequestCountProofResponse) + 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.Height != 0 { + n += 1 + runtime.Sov(uint64(x.Height)) + } + if x.Result != nil { + l = options.Size(x.Result) + 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().(*RequestCountProofResponse) + 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.Result != nil { + encoded, err := options.Marshal(x.Result) + 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.Height != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Height)) + i-- + dAtA[i] = 0x8 + } + 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().(*RequestCountProofResponse) + 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: RequestCountProofResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RequestCountProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + x.Height = 0 + 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++ + x.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Result", 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.Result == nil { + x.Result = &CountProofResult{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Result); 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_SingleProofResult protoreflect.MessageDescriptor + fd_SingleProofResult_proof protoreflect.FieldDescriptor + fd_SingleProofResult_evm_proof_bytes protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_SingleProofResult = File_bandchain_v1_oracle_proof_proto.Messages().ByName("SingleProofResult") + fd_SingleProofResult_proof = md_SingleProofResult.Fields().ByName("proof") + fd_SingleProofResult_evm_proof_bytes = md_SingleProofResult.Fields().ByName("evm_proof_bytes") +} + +var _ protoreflect.Message = (*fastReflection_SingleProofResult)(nil) + +type fastReflection_SingleProofResult SingleProofResult + +func (x *SingleProofResult) ProtoReflect() protoreflect.Message { + return (*fastReflection_SingleProofResult)(x) +} + +func (x *SingleProofResult) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[6] + 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_SingleProofResult_messageType fastReflection_SingleProofResult_messageType +var _ protoreflect.MessageType = fastReflection_SingleProofResult_messageType{} + +type fastReflection_SingleProofResult_messageType struct{} + +func (x fastReflection_SingleProofResult_messageType) Zero() protoreflect.Message { + return (*fastReflection_SingleProofResult)(nil) +} +func (x fastReflection_SingleProofResult_messageType) New() protoreflect.Message { + return new(fastReflection_SingleProofResult) +} +func (x fastReflection_SingleProofResult_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_SingleProofResult +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_SingleProofResult) Descriptor() protoreflect.MessageDescriptor { + return md_SingleProofResult +} + +// 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_SingleProofResult) Type() protoreflect.MessageType { + return _fastReflection_SingleProofResult_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_SingleProofResult) New() protoreflect.Message { + return new(fastReflection_SingleProofResult) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_SingleProofResult) Interface() protoreflect.ProtoMessage { + return (*SingleProofResult)(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_SingleProofResult) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Proof != nil { + value := protoreflect.ValueOfMessage(x.Proof.ProtoReflect()) + if !f(fd_SingleProofResult_proof, value) { + return + } + } + if len(x.EvmProofBytes) != 0 { + value := protoreflect.ValueOfBytes(x.EvmProofBytes) + if !f(fd_SingleProofResult_evm_proof_bytes, 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_SingleProofResult) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.SingleProofResult.proof": + return x.Proof != nil + case "bandchain.v1.oracle.SingleProofResult.evm_proof_bytes": + return len(x.EvmProofBytes) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.SingleProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.SingleProofResult 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_SingleProofResult) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.SingleProofResult.proof": + x.Proof = nil + case "bandchain.v1.oracle.SingleProofResult.evm_proof_bytes": + x.EvmProofBytes = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.SingleProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.SingleProofResult 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_SingleProofResult) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.SingleProofResult.proof": + value := x.Proof + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "bandchain.v1.oracle.SingleProofResult.evm_proof_bytes": + value := x.EvmProofBytes + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.SingleProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.SingleProofResult 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_SingleProofResult) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.SingleProofResult.proof": + x.Proof = value.Message().Interface().(*SingleProof) + case "bandchain.v1.oracle.SingleProofResult.evm_proof_bytes": + x.EvmProofBytes = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.SingleProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.SingleProofResult 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_SingleProofResult) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.SingleProofResult.proof": + if x.Proof == nil { + x.Proof = new(SingleProof) + } + return protoreflect.ValueOfMessage(x.Proof.ProtoReflect()) + case "bandchain.v1.oracle.SingleProofResult.evm_proof_bytes": + panic(fmt.Errorf("field evm_proof_bytes of message bandchain.v1.oracle.SingleProofResult is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.SingleProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.SingleProofResult 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_SingleProofResult) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.SingleProofResult.proof": + m := new(SingleProof) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "bandchain.v1.oracle.SingleProofResult.evm_proof_bytes": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.SingleProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.SingleProofResult 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_SingleProofResult) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.SingleProofResult", 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_SingleProofResult) 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_SingleProofResult) 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_SingleProofResult) 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_SingleProofResult) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*SingleProofResult) + 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.Proof != nil { + l = options.Size(x.Proof) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.EvmProofBytes) + 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().(*SingleProofResult) + 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.EvmProofBytes) > 0 { + i -= len(x.EvmProofBytes) + copy(dAtA[i:], x.EvmProofBytes) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EvmProofBytes))) + i-- + dAtA[i] = 0x12 + } + if x.Proof != nil { + encoded, err := options.Marshal(x.Proof) + 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().(*SingleProofResult) + 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: SingleProofResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SingleProofResult: 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 Proof", 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.Proof == nil { + x.Proof = &SingleProof{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Proof); 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 EvmProofBytes", 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.EvmProofBytes = append(x.EvmProofBytes[:0], dAtA[iNdEx:postIndex]...) + if x.EvmProofBytes == nil { + x.EvmProofBytes = []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_MultiProofResult protoreflect.MessageDescriptor + fd_MultiProofResult_proof protoreflect.FieldDescriptor + fd_MultiProofResult_evm_proof_bytes protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_MultiProofResult = File_bandchain_v1_oracle_proof_proto.Messages().ByName("MultiProofResult") + fd_MultiProofResult_proof = md_MultiProofResult.Fields().ByName("proof") + fd_MultiProofResult_evm_proof_bytes = md_MultiProofResult.Fields().ByName("evm_proof_bytes") +} + +var _ protoreflect.Message = (*fastReflection_MultiProofResult)(nil) + +type fastReflection_MultiProofResult MultiProofResult + +func (x *MultiProofResult) ProtoReflect() protoreflect.Message { + return (*fastReflection_MultiProofResult)(x) +} + +func (x *MultiProofResult) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_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_MultiProofResult_messageType fastReflection_MultiProofResult_messageType +var _ protoreflect.MessageType = fastReflection_MultiProofResult_messageType{} + +type fastReflection_MultiProofResult_messageType struct{} + +func (x fastReflection_MultiProofResult_messageType) Zero() protoreflect.Message { + return (*fastReflection_MultiProofResult)(nil) +} +func (x fastReflection_MultiProofResult_messageType) New() protoreflect.Message { + return new(fastReflection_MultiProofResult) +} +func (x fastReflection_MultiProofResult_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MultiProofResult +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MultiProofResult) Descriptor() protoreflect.MessageDescriptor { + return md_MultiProofResult +} + +// 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_MultiProofResult) Type() protoreflect.MessageType { + return _fastReflection_MultiProofResult_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MultiProofResult) New() protoreflect.Message { + return new(fastReflection_MultiProofResult) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MultiProofResult) Interface() protoreflect.ProtoMessage { + return (*MultiProofResult)(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_MultiProofResult) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Proof != nil { + value := protoreflect.ValueOfMessage(x.Proof.ProtoReflect()) + if !f(fd_MultiProofResult_proof, value) { + return + } + } + if len(x.EvmProofBytes) != 0 { + value := protoreflect.ValueOfBytes(x.EvmProofBytes) + if !f(fd_MultiProofResult_evm_proof_bytes, 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_MultiProofResult) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProofResult.proof": + return x.Proof != nil + case "bandchain.v1.oracle.MultiProofResult.evm_proof_bytes": + return len(x.EvmProofBytes) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofResult 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_MultiProofResult) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProofResult.proof": + x.Proof = nil + case "bandchain.v1.oracle.MultiProofResult.evm_proof_bytes": + x.EvmProofBytes = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofResult 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_MultiProofResult) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.MultiProofResult.proof": + value := x.Proof + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "bandchain.v1.oracle.MultiProofResult.evm_proof_bytes": + value := x.EvmProofBytes + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofResult 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_MultiProofResult) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProofResult.proof": + x.Proof = value.Message().Interface().(*MultiProof) + case "bandchain.v1.oracle.MultiProofResult.evm_proof_bytes": + x.EvmProofBytes = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofResult 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_MultiProofResult) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProofResult.proof": + if x.Proof == nil { + x.Proof = new(MultiProof) + } + return protoreflect.ValueOfMessage(x.Proof.ProtoReflect()) + case "bandchain.v1.oracle.MultiProofResult.evm_proof_bytes": + panic(fmt.Errorf("field evm_proof_bytes of message bandchain.v1.oracle.MultiProofResult is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofResult 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_MultiProofResult) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProofResult.proof": + m := new(MultiProof) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "bandchain.v1.oracle.MultiProofResult.evm_proof_bytes": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProofResult 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_MultiProofResult) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.MultiProofResult", 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_MultiProofResult) 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_MultiProofResult) 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_MultiProofResult) 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_MultiProofResult) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MultiProofResult) + 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.Proof != nil { + l = options.Size(x.Proof) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.EvmProofBytes) + 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().(*MultiProofResult) + 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.EvmProofBytes) > 0 { + i -= len(x.EvmProofBytes) + copy(dAtA[i:], x.EvmProofBytes) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EvmProofBytes))) + i-- + dAtA[i] = 0x12 + } + if x.Proof != nil { + encoded, err := options.Marshal(x.Proof) + 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().(*MultiProofResult) + 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: MultiProofResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MultiProofResult: 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 Proof", 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.Proof == nil { + x.Proof = &MultiProof{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Proof); 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 EvmProofBytes", 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.EvmProofBytes = append(x.EvmProofBytes[:0], dAtA[iNdEx:postIndex]...) + if x.EvmProofBytes == nil { + x.EvmProofBytes = []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_CountProofResult protoreflect.MessageDescriptor + fd_CountProofResult_proof protoreflect.FieldDescriptor + fd_CountProofResult_evm_proof_bytes protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_CountProofResult = File_bandchain_v1_oracle_proof_proto.Messages().ByName("CountProofResult") + fd_CountProofResult_proof = md_CountProofResult.Fields().ByName("proof") + fd_CountProofResult_evm_proof_bytes = md_CountProofResult.Fields().ByName("evm_proof_bytes") +} + +var _ protoreflect.Message = (*fastReflection_CountProofResult)(nil) + +type fastReflection_CountProofResult CountProofResult + +func (x *CountProofResult) ProtoReflect() protoreflect.Message { + return (*fastReflection_CountProofResult)(x) +} + +func (x *CountProofResult) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_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_CountProofResult_messageType fastReflection_CountProofResult_messageType +var _ protoreflect.MessageType = fastReflection_CountProofResult_messageType{} + +type fastReflection_CountProofResult_messageType struct{} + +func (x fastReflection_CountProofResult_messageType) Zero() protoreflect.Message { + return (*fastReflection_CountProofResult)(nil) +} +func (x fastReflection_CountProofResult_messageType) New() protoreflect.Message { + return new(fastReflection_CountProofResult) +} +func (x fastReflection_CountProofResult_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_CountProofResult +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_CountProofResult) Descriptor() protoreflect.MessageDescriptor { + return md_CountProofResult +} + +// 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_CountProofResult) Type() protoreflect.MessageType { + return _fastReflection_CountProofResult_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_CountProofResult) New() protoreflect.Message { + return new(fastReflection_CountProofResult) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_CountProofResult) Interface() protoreflect.ProtoMessage { + return (*CountProofResult)(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_CountProofResult) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Proof != nil { + value := protoreflect.ValueOfMessage(x.Proof.ProtoReflect()) + if !f(fd_CountProofResult_proof, value) { + return + } + } + if len(x.EvmProofBytes) != 0 { + value := protoreflect.ValueOfBytes(x.EvmProofBytes) + if !f(fd_CountProofResult_evm_proof_bytes, 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_CountProofResult) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.CountProofResult.proof": + return x.Proof != nil + case "bandchain.v1.oracle.CountProofResult.evm_proof_bytes": + return len(x.EvmProofBytes) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CountProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CountProofResult 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_CountProofResult) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.CountProofResult.proof": + x.Proof = nil + case "bandchain.v1.oracle.CountProofResult.evm_proof_bytes": + x.EvmProofBytes = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CountProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CountProofResult 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_CountProofResult) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.CountProofResult.proof": + value := x.Proof + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "bandchain.v1.oracle.CountProofResult.evm_proof_bytes": + value := x.EvmProofBytes + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CountProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CountProofResult 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_CountProofResult) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.CountProofResult.proof": + x.Proof = value.Message().Interface().(*CountProof) + case "bandchain.v1.oracle.CountProofResult.evm_proof_bytes": + x.EvmProofBytes = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CountProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CountProofResult 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_CountProofResult) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.CountProofResult.proof": + if x.Proof == nil { + x.Proof = new(CountProof) + } + return protoreflect.ValueOfMessage(x.Proof.ProtoReflect()) + case "bandchain.v1.oracle.CountProofResult.evm_proof_bytes": + panic(fmt.Errorf("field evm_proof_bytes of message bandchain.v1.oracle.CountProofResult is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CountProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CountProofResult 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_CountProofResult) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.CountProofResult.proof": + m := new(CountProof) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "bandchain.v1.oracle.CountProofResult.evm_proof_bytes": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CountProofResult")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CountProofResult 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_CountProofResult) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.CountProofResult", 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_CountProofResult) 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_CountProofResult) 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_CountProofResult) 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_CountProofResult) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*CountProofResult) + 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.Proof != nil { + l = options.Size(x.Proof) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.EvmProofBytes) + 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().(*CountProofResult) + 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.EvmProofBytes) > 0 { + i -= len(x.EvmProofBytes) + copy(dAtA[i:], x.EvmProofBytes) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EvmProofBytes))) + i-- + dAtA[i] = 0x12 + } + if x.Proof != nil { + encoded, err := options.Marshal(x.Proof) + 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().(*CountProofResult) + 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: CountProofResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CountProofResult: 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 Proof", 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.Proof == nil { + x.Proof = &CountProof{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Proof); 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 EvmProofBytes", 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.EvmProofBytes = append(x.EvmProofBytes[:0], dAtA[iNdEx:postIndex]...) + if x.EvmProofBytes == nil { + x.EvmProofBytes = []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_SingleProof protoreflect.MessageDescriptor + fd_SingleProof_block_height protoreflect.FieldDescriptor + fd_SingleProof_oracle_data_proof protoreflect.FieldDescriptor + fd_SingleProof_block_relay_proof protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_SingleProof = File_bandchain_v1_oracle_proof_proto.Messages().ByName("SingleProof") + fd_SingleProof_block_height = md_SingleProof.Fields().ByName("block_height") + fd_SingleProof_oracle_data_proof = md_SingleProof.Fields().ByName("oracle_data_proof") + fd_SingleProof_block_relay_proof = md_SingleProof.Fields().ByName("block_relay_proof") +} + +var _ protoreflect.Message = (*fastReflection_SingleProof)(nil) + +type fastReflection_SingleProof SingleProof + +func (x *SingleProof) ProtoReflect() protoreflect.Message { + return (*fastReflection_SingleProof)(x) +} + +func (x *SingleProof) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_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_SingleProof_messageType fastReflection_SingleProof_messageType +var _ protoreflect.MessageType = fastReflection_SingleProof_messageType{} + +type fastReflection_SingleProof_messageType struct{} + +func (x fastReflection_SingleProof_messageType) Zero() protoreflect.Message { + return (*fastReflection_SingleProof)(nil) +} +func (x fastReflection_SingleProof_messageType) New() protoreflect.Message { + return new(fastReflection_SingleProof) +} +func (x fastReflection_SingleProof_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_SingleProof +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_SingleProof) Descriptor() protoreflect.MessageDescriptor { + return md_SingleProof +} + +// 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_SingleProof) Type() protoreflect.MessageType { + return _fastReflection_SingleProof_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_SingleProof) New() protoreflect.Message { + return new(fastReflection_SingleProof) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_SingleProof) Interface() protoreflect.ProtoMessage { + return (*SingleProof)(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_SingleProof) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BlockHeight != uint64(0) { + value := protoreflect.ValueOfUint64(x.BlockHeight) + if !f(fd_SingleProof_block_height, value) { + return + } + } + if x.OracleDataProof != nil { + value := protoreflect.ValueOfMessage(x.OracleDataProof.ProtoReflect()) + if !f(fd_SingleProof_oracle_data_proof, value) { + return + } + } + if x.BlockRelayProof != nil { + value := protoreflect.ValueOfMessage(x.BlockRelayProof.ProtoReflect()) + if !f(fd_SingleProof_block_relay_proof, 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_SingleProof) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.SingleProof.block_height": + return x.BlockHeight != uint64(0) + case "bandchain.v1.oracle.SingleProof.oracle_data_proof": + return x.OracleDataProof != nil + case "bandchain.v1.oracle.SingleProof.block_relay_proof": + return x.BlockRelayProof != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.SingleProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.SingleProof 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_SingleProof) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.SingleProof.block_height": + x.BlockHeight = uint64(0) + case "bandchain.v1.oracle.SingleProof.oracle_data_proof": + x.OracleDataProof = nil + case "bandchain.v1.oracle.SingleProof.block_relay_proof": + x.BlockRelayProof = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.SingleProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.SingleProof 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_SingleProof) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.SingleProof.block_height": + value := x.BlockHeight + return protoreflect.ValueOfUint64(value) + case "bandchain.v1.oracle.SingleProof.oracle_data_proof": + value := x.OracleDataProof + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "bandchain.v1.oracle.SingleProof.block_relay_proof": + value := x.BlockRelayProof + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.SingleProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.SingleProof 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_SingleProof) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.SingleProof.block_height": + x.BlockHeight = value.Uint() + case "bandchain.v1.oracle.SingleProof.oracle_data_proof": + x.OracleDataProof = value.Message().Interface().(*OracleDataProof) + case "bandchain.v1.oracle.SingleProof.block_relay_proof": + x.BlockRelayProof = value.Message().Interface().(*BlockRelayProof) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.SingleProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.SingleProof 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_SingleProof) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.SingleProof.oracle_data_proof": + if x.OracleDataProof == nil { + x.OracleDataProof = new(OracleDataProof) + } + return protoreflect.ValueOfMessage(x.OracleDataProof.ProtoReflect()) + case "bandchain.v1.oracle.SingleProof.block_relay_proof": + if x.BlockRelayProof == nil { + x.BlockRelayProof = new(BlockRelayProof) + } + return protoreflect.ValueOfMessage(x.BlockRelayProof.ProtoReflect()) + case "bandchain.v1.oracle.SingleProof.block_height": + panic(fmt.Errorf("field block_height of message bandchain.v1.oracle.SingleProof is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.SingleProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.SingleProof 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_SingleProof) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.SingleProof.block_height": + return protoreflect.ValueOfUint64(uint64(0)) + case "bandchain.v1.oracle.SingleProof.oracle_data_proof": + m := new(OracleDataProof) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "bandchain.v1.oracle.SingleProof.block_relay_proof": + m := new(BlockRelayProof) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.SingleProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.SingleProof 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_SingleProof) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.SingleProof", 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_SingleProof) 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_SingleProof) 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_SingleProof) 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_SingleProof) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*SingleProof) + 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.BlockHeight != 0 { + n += 1 + runtime.Sov(uint64(x.BlockHeight)) + } + if x.OracleDataProof != nil { + l = options.Size(x.OracleDataProof) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.BlockRelayProof != nil { + l = options.Size(x.BlockRelayProof) + 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().(*SingleProof) + 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.BlockRelayProof != nil { + encoded, err := options.Marshal(x.BlockRelayProof) + 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] = 0x1a + } + if x.OracleDataProof != nil { + encoded, err := options.Marshal(x.OracleDataProof) + 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.BlockHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockHeight)) + i-- + dAtA[i] = 0x8 + } + 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().(*SingleProof) + 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: SingleProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SingleProof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + x.BlockHeight = 0 + 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++ + x.BlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OracleDataProof", 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.OracleDataProof == nil { + x.OracleDataProof = &OracleDataProof{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.OracleDataProof); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockRelayProof", 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.BlockRelayProof == nil { + x.BlockRelayProof = &BlockRelayProof{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BlockRelayProof); 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 = (*_MultiProof_2_list)(nil) + +type _MultiProof_2_list struct { + list *[]*OracleDataProof +} + +func (x *_MultiProof_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MultiProof_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MultiProof_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*OracleDataProof) + (*x.list)[i] = concreteValue +} + +func (x *_MultiProof_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*OracleDataProof) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MultiProof_2_list) AppendMutable() protoreflect.Value { + v := new(OracleDataProof) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MultiProof_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MultiProof_2_list) NewElement() protoreflect.Value { + v := new(OracleDataProof) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MultiProof_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MultiProof protoreflect.MessageDescriptor + fd_MultiProof_block_height protoreflect.FieldDescriptor + fd_MultiProof_oracle_data_multi_proof protoreflect.FieldDescriptor + fd_MultiProof_block_relay_proof protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_MultiProof = File_bandchain_v1_oracle_proof_proto.Messages().ByName("MultiProof") + fd_MultiProof_block_height = md_MultiProof.Fields().ByName("block_height") + fd_MultiProof_oracle_data_multi_proof = md_MultiProof.Fields().ByName("oracle_data_multi_proof") + fd_MultiProof_block_relay_proof = md_MultiProof.Fields().ByName("block_relay_proof") +} + +var _ protoreflect.Message = (*fastReflection_MultiProof)(nil) + +type fastReflection_MultiProof MultiProof + +func (x *MultiProof) ProtoReflect() protoreflect.Message { + return (*fastReflection_MultiProof)(x) +} + +func (x *MultiProof) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_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_MultiProof_messageType fastReflection_MultiProof_messageType +var _ protoreflect.MessageType = fastReflection_MultiProof_messageType{} + +type fastReflection_MultiProof_messageType struct{} + +func (x fastReflection_MultiProof_messageType) Zero() protoreflect.Message { + return (*fastReflection_MultiProof)(nil) +} +func (x fastReflection_MultiProof_messageType) New() protoreflect.Message { + return new(fastReflection_MultiProof) +} +func (x fastReflection_MultiProof_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MultiProof +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MultiProof) Descriptor() protoreflect.MessageDescriptor { + return md_MultiProof +} + +// 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_MultiProof) Type() protoreflect.MessageType { + return _fastReflection_MultiProof_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MultiProof) New() protoreflect.Message { + return new(fastReflection_MultiProof) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MultiProof) Interface() protoreflect.ProtoMessage { + return (*MultiProof)(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_MultiProof) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BlockHeight != uint64(0) { + value := protoreflect.ValueOfUint64(x.BlockHeight) + if !f(fd_MultiProof_block_height, value) { + return + } + } + if len(x.OracleDataMultiProof) != 0 { + value := protoreflect.ValueOfList(&_MultiProof_2_list{list: &x.OracleDataMultiProof}) + if !f(fd_MultiProof_oracle_data_multi_proof, value) { + return + } + } + if x.BlockRelayProof != nil { + value := protoreflect.ValueOfMessage(x.BlockRelayProof.ProtoReflect()) + if !f(fd_MultiProof_block_relay_proof, 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_MultiProof) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProof.block_height": + return x.BlockHeight != uint64(0) + case "bandchain.v1.oracle.MultiProof.oracle_data_multi_proof": + return len(x.OracleDataMultiProof) != 0 + case "bandchain.v1.oracle.MultiProof.block_relay_proof": + return x.BlockRelayProof != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProof 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_MultiProof) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProof.block_height": + x.BlockHeight = uint64(0) + case "bandchain.v1.oracle.MultiProof.oracle_data_multi_proof": + x.OracleDataMultiProof = nil + case "bandchain.v1.oracle.MultiProof.block_relay_proof": + x.BlockRelayProof = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProof 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_MultiProof) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.MultiProof.block_height": + value := x.BlockHeight + return protoreflect.ValueOfUint64(value) + case "bandchain.v1.oracle.MultiProof.oracle_data_multi_proof": + if len(x.OracleDataMultiProof) == 0 { + return protoreflect.ValueOfList(&_MultiProof_2_list{}) + } + listValue := &_MultiProof_2_list{list: &x.OracleDataMultiProof} + return protoreflect.ValueOfList(listValue) + case "bandchain.v1.oracle.MultiProof.block_relay_proof": + value := x.BlockRelayProof + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProof 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_MultiProof) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProof.block_height": + x.BlockHeight = value.Uint() + case "bandchain.v1.oracle.MultiProof.oracle_data_multi_proof": + lv := value.List() + clv := lv.(*_MultiProof_2_list) + x.OracleDataMultiProof = *clv.list + case "bandchain.v1.oracle.MultiProof.block_relay_proof": + x.BlockRelayProof = value.Message().Interface().(*BlockRelayProof) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProof 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_MultiProof) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProof.oracle_data_multi_proof": + if x.OracleDataMultiProof == nil { + x.OracleDataMultiProof = []*OracleDataProof{} + } + value := &_MultiProof_2_list{list: &x.OracleDataMultiProof} + return protoreflect.ValueOfList(value) + case "bandchain.v1.oracle.MultiProof.block_relay_proof": + if x.BlockRelayProof == nil { + x.BlockRelayProof = new(BlockRelayProof) + } + return protoreflect.ValueOfMessage(x.BlockRelayProof.ProtoReflect()) + case "bandchain.v1.oracle.MultiProof.block_height": + panic(fmt.Errorf("field block_height of message bandchain.v1.oracle.MultiProof is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProof 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_MultiProof) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiProof.block_height": + return protoreflect.ValueOfUint64(uint64(0)) + case "bandchain.v1.oracle.MultiProof.oracle_data_multi_proof": + list := []*OracleDataProof{} + return protoreflect.ValueOfList(&_MultiProof_2_list{list: &list}) + case "bandchain.v1.oracle.MultiProof.block_relay_proof": + m := new(BlockRelayProof) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiProof 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_MultiProof) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.MultiProof", 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_MultiProof) 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_MultiProof) 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_MultiProof) 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_MultiProof) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MultiProof) + 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.BlockHeight != 0 { + n += 1 + runtime.Sov(uint64(x.BlockHeight)) + } + if len(x.OracleDataMultiProof) > 0 { + for _, e := range x.OracleDataMultiProof { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.BlockRelayProof != nil { + l = options.Size(x.BlockRelayProof) + 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().(*MultiProof) + 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.BlockRelayProof != nil { + encoded, err := options.Marshal(x.BlockRelayProof) + 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] = 0x1a + } + if len(x.OracleDataMultiProof) > 0 { + for iNdEx := len(x.OracleDataMultiProof) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.OracleDataMultiProof[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] = 0x12 + } + } + if x.BlockHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockHeight)) + i-- + dAtA[i] = 0x8 + } + 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().(*MultiProof) + 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: MultiProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MultiProof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + x.BlockHeight = 0 + 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++ + x.BlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OracleDataMultiProof", 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.OracleDataMultiProof = append(x.OracleDataMultiProof, &OracleDataProof{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.OracleDataMultiProof[len(x.OracleDataMultiProof)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockRelayProof", 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.BlockRelayProof == nil { + x.BlockRelayProof = &BlockRelayProof{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BlockRelayProof); 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_CountProof protoreflect.MessageDescriptor + fd_CountProof_block_height protoreflect.FieldDescriptor + fd_CountProof_count_proof protoreflect.FieldDescriptor + fd_CountProof_block_relay_proof protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_CountProof = File_bandchain_v1_oracle_proof_proto.Messages().ByName("CountProof") + fd_CountProof_block_height = md_CountProof.Fields().ByName("block_height") + fd_CountProof_count_proof = md_CountProof.Fields().ByName("count_proof") + fd_CountProof_block_relay_proof = md_CountProof.Fields().ByName("block_relay_proof") +} + +var _ protoreflect.Message = (*fastReflection_CountProof)(nil) + +type fastReflection_CountProof CountProof + +func (x *CountProof) ProtoReflect() protoreflect.Message { + return (*fastReflection_CountProof)(x) +} + +func (x *CountProof) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[11] + 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_CountProof_messageType fastReflection_CountProof_messageType +var _ protoreflect.MessageType = fastReflection_CountProof_messageType{} + +type fastReflection_CountProof_messageType struct{} + +func (x fastReflection_CountProof_messageType) Zero() protoreflect.Message { + return (*fastReflection_CountProof)(nil) +} +func (x fastReflection_CountProof_messageType) New() protoreflect.Message { + return new(fastReflection_CountProof) +} +func (x fastReflection_CountProof_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_CountProof +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_CountProof) Descriptor() protoreflect.MessageDescriptor { + return md_CountProof +} + +// 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_CountProof) Type() protoreflect.MessageType { + return _fastReflection_CountProof_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_CountProof) New() protoreflect.Message { + return new(fastReflection_CountProof) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_CountProof) Interface() protoreflect.ProtoMessage { + return (*CountProof)(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_CountProof) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BlockHeight != uint64(0) { + value := protoreflect.ValueOfUint64(x.BlockHeight) + if !f(fd_CountProof_block_height, value) { + return + } + } + if x.CountProof != nil { + value := protoreflect.ValueOfMessage(x.CountProof.ProtoReflect()) + if !f(fd_CountProof_count_proof, value) { + return + } + } + if x.BlockRelayProof != nil { + value := protoreflect.ValueOfMessage(x.BlockRelayProof.ProtoReflect()) + if !f(fd_CountProof_block_relay_proof, 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_CountProof) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.CountProof.block_height": + return x.BlockHeight != uint64(0) + case "bandchain.v1.oracle.CountProof.count_proof": + return x.CountProof != nil + case "bandchain.v1.oracle.CountProof.block_relay_proof": + return x.BlockRelayProof != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CountProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CountProof 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_CountProof) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.CountProof.block_height": + x.BlockHeight = uint64(0) + case "bandchain.v1.oracle.CountProof.count_proof": + x.CountProof = nil + case "bandchain.v1.oracle.CountProof.block_relay_proof": + x.BlockRelayProof = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CountProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CountProof 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_CountProof) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.CountProof.block_height": + value := x.BlockHeight + return protoreflect.ValueOfUint64(value) + case "bandchain.v1.oracle.CountProof.count_proof": + value := x.CountProof + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "bandchain.v1.oracle.CountProof.block_relay_proof": + value := x.BlockRelayProof + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CountProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CountProof 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_CountProof) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.CountProof.block_height": + x.BlockHeight = value.Uint() + case "bandchain.v1.oracle.CountProof.count_proof": + x.CountProof = value.Message().Interface().(*RequestsCountProof) + case "bandchain.v1.oracle.CountProof.block_relay_proof": + x.BlockRelayProof = value.Message().Interface().(*BlockRelayProof) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CountProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CountProof 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_CountProof) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.CountProof.count_proof": + if x.CountProof == nil { + x.CountProof = new(RequestsCountProof) + } + return protoreflect.ValueOfMessage(x.CountProof.ProtoReflect()) + case "bandchain.v1.oracle.CountProof.block_relay_proof": + if x.BlockRelayProof == nil { + x.BlockRelayProof = new(BlockRelayProof) + } + return protoreflect.ValueOfMessage(x.BlockRelayProof.ProtoReflect()) + case "bandchain.v1.oracle.CountProof.block_height": + panic(fmt.Errorf("field block_height of message bandchain.v1.oracle.CountProof is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CountProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CountProof 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_CountProof) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.CountProof.block_height": + return protoreflect.ValueOfUint64(uint64(0)) + case "bandchain.v1.oracle.CountProof.count_proof": + m := new(RequestsCountProof) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "bandchain.v1.oracle.CountProof.block_relay_proof": + m := new(BlockRelayProof) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CountProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CountProof 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_CountProof) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.CountProof", 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_CountProof) 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_CountProof) 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_CountProof) 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_CountProof) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*CountProof) + 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.BlockHeight != 0 { + n += 1 + runtime.Sov(uint64(x.BlockHeight)) + } + if x.CountProof != nil { + l = options.Size(x.CountProof) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.BlockRelayProof != nil { + l = options.Size(x.BlockRelayProof) + 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().(*CountProof) + 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.BlockRelayProof != nil { + encoded, err := options.Marshal(x.BlockRelayProof) + 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] = 0x1a + } + if x.CountProof != nil { + encoded, err := options.Marshal(x.CountProof) + 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.BlockHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockHeight)) + i-- + dAtA[i] = 0x8 + } + 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().(*CountProof) + 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: CountProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CountProof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + x.BlockHeight = 0 + 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++ + x.BlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CountProof", 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.CountProof == nil { + x.CountProof = &RequestsCountProof{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CountProof); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockRelayProof", 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.BlockRelayProof == nil { + x.BlockRelayProof = &BlockRelayProof{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BlockRelayProof); 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 = (*_OracleDataProof_3_list)(nil) + +type _OracleDataProof_3_list struct { + list *[]*IAVLMerklePath +} + +func (x *_OracleDataProof_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_OracleDataProof_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_OracleDataProof_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*IAVLMerklePath) + (*x.list)[i] = concreteValue +} + +func (x *_OracleDataProof_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*IAVLMerklePath) + *x.list = append(*x.list, concreteValue) +} + +func (x *_OracleDataProof_3_list) AppendMutable() protoreflect.Value { + v := new(IAVLMerklePath) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_OracleDataProof_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_OracleDataProof_3_list) NewElement() protoreflect.Value { + v := new(IAVLMerklePath) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_OracleDataProof_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_OracleDataProof protoreflect.MessageDescriptor + fd_OracleDataProof_result protoreflect.FieldDescriptor + fd_OracleDataProof_version protoreflect.FieldDescriptor + fd_OracleDataProof_merkle_paths protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_OracleDataProof = File_bandchain_v1_oracle_proof_proto.Messages().ByName("OracleDataProof") + fd_OracleDataProof_result = md_OracleDataProof.Fields().ByName("result") + fd_OracleDataProof_version = md_OracleDataProof.Fields().ByName("version") + fd_OracleDataProof_merkle_paths = md_OracleDataProof.Fields().ByName("merkle_paths") +} + +var _ protoreflect.Message = (*fastReflection_OracleDataProof)(nil) + +type fastReflection_OracleDataProof OracleDataProof + +func (x *OracleDataProof) ProtoReflect() protoreflect.Message { + return (*fastReflection_OracleDataProof)(x) +} + +func (x *OracleDataProof) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[12] + 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_OracleDataProof_messageType fastReflection_OracleDataProof_messageType +var _ protoreflect.MessageType = fastReflection_OracleDataProof_messageType{} + +type fastReflection_OracleDataProof_messageType struct{} + +func (x fastReflection_OracleDataProof_messageType) Zero() protoreflect.Message { + return (*fastReflection_OracleDataProof)(nil) +} +func (x fastReflection_OracleDataProof_messageType) New() protoreflect.Message { + return new(fastReflection_OracleDataProof) +} +func (x fastReflection_OracleDataProof_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_OracleDataProof +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_OracleDataProof) Descriptor() protoreflect.MessageDescriptor { + return md_OracleDataProof +} + +// 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_OracleDataProof) Type() protoreflect.MessageType { + return _fastReflection_OracleDataProof_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_OracleDataProof) New() protoreflect.Message { + return new(fastReflection_OracleDataProof) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_OracleDataProof) Interface() protoreflect.ProtoMessage { + return (*OracleDataProof)(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_OracleDataProof) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Result != nil { + value := protoreflect.ValueOfMessage(x.Result.ProtoReflect()) + if !f(fd_OracleDataProof_result, value) { + return + } + } + if x.Version != uint64(0) { + value := protoreflect.ValueOfUint64(x.Version) + if !f(fd_OracleDataProof_version, value) { + return + } + } + if len(x.MerklePaths) != 0 { + value := protoreflect.ValueOfList(&_OracleDataProof_3_list{list: &x.MerklePaths}) + if !f(fd_OracleDataProof_merkle_paths, 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_OracleDataProof) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.OracleDataProof.result": + return x.Result != nil + case "bandchain.v1.oracle.OracleDataProof.version": + return x.Version != uint64(0) + case "bandchain.v1.oracle.OracleDataProof.merkle_paths": + return len(x.MerklePaths) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.OracleDataProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.OracleDataProof 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_OracleDataProof) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.OracleDataProof.result": + x.Result = nil + case "bandchain.v1.oracle.OracleDataProof.version": + x.Version = uint64(0) + case "bandchain.v1.oracle.OracleDataProof.merkle_paths": + x.MerklePaths = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.OracleDataProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.OracleDataProof 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_OracleDataProof) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.OracleDataProof.result": + value := x.Result + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "bandchain.v1.oracle.OracleDataProof.version": + value := x.Version + return protoreflect.ValueOfUint64(value) + case "bandchain.v1.oracle.OracleDataProof.merkle_paths": + if len(x.MerklePaths) == 0 { + return protoreflect.ValueOfList(&_OracleDataProof_3_list{}) + } + listValue := &_OracleDataProof_3_list{list: &x.MerklePaths} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.OracleDataProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.OracleDataProof 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_OracleDataProof) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.OracleDataProof.result": + x.Result = value.Message().Interface().(*v1.Result) + case "bandchain.v1.oracle.OracleDataProof.version": + x.Version = value.Uint() + case "bandchain.v1.oracle.OracleDataProof.merkle_paths": + lv := value.List() + clv := lv.(*_OracleDataProof_3_list) + x.MerklePaths = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.OracleDataProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.OracleDataProof 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_OracleDataProof) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.OracleDataProof.result": + if x.Result == nil { + x.Result = new(v1.Result) + } + return protoreflect.ValueOfMessage(x.Result.ProtoReflect()) + case "bandchain.v1.oracle.OracleDataProof.merkle_paths": + if x.MerklePaths == nil { + x.MerklePaths = []*IAVLMerklePath{} + } + value := &_OracleDataProof_3_list{list: &x.MerklePaths} + return protoreflect.ValueOfList(value) + case "bandchain.v1.oracle.OracleDataProof.version": + panic(fmt.Errorf("field version of message bandchain.v1.oracle.OracleDataProof is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.OracleDataProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.OracleDataProof 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_OracleDataProof) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.OracleDataProof.result": + m := new(v1.Result) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "bandchain.v1.oracle.OracleDataProof.version": + return protoreflect.ValueOfUint64(uint64(0)) + case "bandchain.v1.oracle.OracleDataProof.merkle_paths": + list := []*IAVLMerklePath{} + return protoreflect.ValueOfList(&_OracleDataProof_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.OracleDataProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.OracleDataProof 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_OracleDataProof) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.OracleDataProof", 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_OracleDataProof) 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_OracleDataProof) 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_OracleDataProof) 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_OracleDataProof) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*OracleDataProof) + 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.Result != nil { + l = options.Size(x.Result) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Version != 0 { + n += 1 + runtime.Sov(uint64(x.Version)) + } + if len(x.MerklePaths) > 0 { + for _, e := range x.MerklePaths { + 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().(*OracleDataProof) + 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.MerklePaths) > 0 { + for iNdEx := len(x.MerklePaths) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.MerklePaths[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] = 0x1a + } + } + if x.Version != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Version)) + i-- + dAtA[i] = 0x10 + } + if x.Result != nil { + encoded, err := options.Marshal(x.Result) + 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().(*OracleDataProof) + 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: OracleDataProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: OracleDataProof: 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 Result", 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.Result == nil { + x.Result = &v1.Result{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Result); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + x.Version = 0 + 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++ + x.Version |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MerklePaths", 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.MerklePaths = append(x.MerklePaths, &IAVLMerklePath{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MerklePaths[len(x.MerklePaths)-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 ( + md_IAVLMerklePath protoreflect.MessageDescriptor + fd_IAVLMerklePath_is_data_on_right protoreflect.FieldDescriptor + fd_IAVLMerklePath_subtree_height protoreflect.FieldDescriptor + fd_IAVLMerklePath_subtree_size protoreflect.FieldDescriptor + fd_IAVLMerklePath_subtree_version protoreflect.FieldDescriptor + fd_IAVLMerklePath_sibling_hash protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_IAVLMerklePath = File_bandchain_v1_oracle_proof_proto.Messages().ByName("IAVLMerklePath") + fd_IAVLMerklePath_is_data_on_right = md_IAVLMerklePath.Fields().ByName("is_data_on_right") + fd_IAVLMerklePath_subtree_height = md_IAVLMerklePath.Fields().ByName("subtree_height") + fd_IAVLMerklePath_subtree_size = md_IAVLMerklePath.Fields().ByName("subtree_size") + fd_IAVLMerklePath_subtree_version = md_IAVLMerklePath.Fields().ByName("subtree_version") + fd_IAVLMerklePath_sibling_hash = md_IAVLMerklePath.Fields().ByName("sibling_hash") +} + +var _ protoreflect.Message = (*fastReflection_IAVLMerklePath)(nil) + +type fastReflection_IAVLMerklePath IAVLMerklePath + +func (x *IAVLMerklePath) ProtoReflect() protoreflect.Message { + return (*fastReflection_IAVLMerklePath)(x) +} + +func (x *IAVLMerklePath) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[13] + 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_IAVLMerklePath_messageType fastReflection_IAVLMerklePath_messageType +var _ protoreflect.MessageType = fastReflection_IAVLMerklePath_messageType{} + +type fastReflection_IAVLMerklePath_messageType struct{} + +func (x fastReflection_IAVLMerklePath_messageType) Zero() protoreflect.Message { + return (*fastReflection_IAVLMerklePath)(nil) +} +func (x fastReflection_IAVLMerklePath_messageType) New() protoreflect.Message { + return new(fastReflection_IAVLMerklePath) +} +func (x fastReflection_IAVLMerklePath_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_IAVLMerklePath +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_IAVLMerklePath) Descriptor() protoreflect.MessageDescriptor { + return md_IAVLMerklePath +} + +// 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_IAVLMerklePath) Type() protoreflect.MessageType { + return _fastReflection_IAVLMerklePath_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_IAVLMerklePath) New() protoreflect.Message { + return new(fastReflection_IAVLMerklePath) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_IAVLMerklePath) Interface() protoreflect.ProtoMessage { + return (*IAVLMerklePath)(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_IAVLMerklePath) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.IsDataOnRight != false { + value := protoreflect.ValueOfBool(x.IsDataOnRight) + if !f(fd_IAVLMerklePath_is_data_on_right, value) { + return + } + } + if x.SubtreeHeight != uint32(0) { + value := protoreflect.ValueOfUint32(x.SubtreeHeight) + if !f(fd_IAVLMerklePath_subtree_height, value) { + return + } + } + if x.SubtreeSize != uint64(0) { + value := protoreflect.ValueOfUint64(x.SubtreeSize) + if !f(fd_IAVLMerklePath_subtree_size, value) { + return + } + } + if x.SubtreeVersion != uint64(0) { + value := protoreflect.ValueOfUint64(x.SubtreeVersion) + if !f(fd_IAVLMerklePath_subtree_version, value) { + return + } + } + if len(x.SiblingHash) != 0 { + value := protoreflect.ValueOfBytes(x.SiblingHash) + if !f(fd_IAVLMerklePath_sibling_hash, 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_IAVLMerklePath) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.IAVLMerklePath.is_data_on_right": + return x.IsDataOnRight != false + case "bandchain.v1.oracle.IAVLMerklePath.subtree_height": + return x.SubtreeHeight != uint32(0) + case "bandchain.v1.oracle.IAVLMerklePath.subtree_size": + return x.SubtreeSize != uint64(0) + case "bandchain.v1.oracle.IAVLMerklePath.subtree_version": + return x.SubtreeVersion != uint64(0) + case "bandchain.v1.oracle.IAVLMerklePath.sibling_hash": + return len(x.SiblingHash) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.IAVLMerklePath")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.IAVLMerklePath 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_IAVLMerklePath) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.IAVLMerklePath.is_data_on_right": + x.IsDataOnRight = false + case "bandchain.v1.oracle.IAVLMerklePath.subtree_height": + x.SubtreeHeight = uint32(0) + case "bandchain.v1.oracle.IAVLMerklePath.subtree_size": + x.SubtreeSize = uint64(0) + case "bandchain.v1.oracle.IAVLMerklePath.subtree_version": + x.SubtreeVersion = uint64(0) + case "bandchain.v1.oracle.IAVLMerklePath.sibling_hash": + x.SiblingHash = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.IAVLMerklePath")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.IAVLMerklePath 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_IAVLMerklePath) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.IAVLMerklePath.is_data_on_right": + value := x.IsDataOnRight + return protoreflect.ValueOfBool(value) + case "bandchain.v1.oracle.IAVLMerklePath.subtree_height": + value := x.SubtreeHeight + return protoreflect.ValueOfUint32(value) + case "bandchain.v1.oracle.IAVLMerklePath.subtree_size": + value := x.SubtreeSize + return protoreflect.ValueOfUint64(value) + case "bandchain.v1.oracle.IAVLMerklePath.subtree_version": + value := x.SubtreeVersion + return protoreflect.ValueOfUint64(value) + case "bandchain.v1.oracle.IAVLMerklePath.sibling_hash": + value := x.SiblingHash + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.IAVLMerklePath")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.IAVLMerklePath 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_IAVLMerklePath) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.IAVLMerklePath.is_data_on_right": + x.IsDataOnRight = value.Bool() + case "bandchain.v1.oracle.IAVLMerklePath.subtree_height": + x.SubtreeHeight = uint32(value.Uint()) + case "bandchain.v1.oracle.IAVLMerklePath.subtree_size": + x.SubtreeSize = value.Uint() + case "bandchain.v1.oracle.IAVLMerklePath.subtree_version": + x.SubtreeVersion = value.Uint() + case "bandchain.v1.oracle.IAVLMerklePath.sibling_hash": + x.SiblingHash = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.IAVLMerklePath")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.IAVLMerklePath 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_IAVLMerklePath) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.IAVLMerklePath.is_data_on_right": + panic(fmt.Errorf("field is_data_on_right of message bandchain.v1.oracle.IAVLMerklePath is not mutable")) + case "bandchain.v1.oracle.IAVLMerklePath.subtree_height": + panic(fmt.Errorf("field subtree_height of message bandchain.v1.oracle.IAVLMerklePath is not mutable")) + case "bandchain.v1.oracle.IAVLMerklePath.subtree_size": + panic(fmt.Errorf("field subtree_size of message bandchain.v1.oracle.IAVLMerklePath is not mutable")) + case "bandchain.v1.oracle.IAVLMerklePath.subtree_version": + panic(fmt.Errorf("field subtree_version of message bandchain.v1.oracle.IAVLMerklePath is not mutable")) + case "bandchain.v1.oracle.IAVLMerklePath.sibling_hash": + panic(fmt.Errorf("field sibling_hash of message bandchain.v1.oracle.IAVLMerklePath is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.IAVLMerklePath")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.IAVLMerklePath 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_IAVLMerklePath) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.IAVLMerklePath.is_data_on_right": + return protoreflect.ValueOfBool(false) + case "bandchain.v1.oracle.IAVLMerklePath.subtree_height": + return protoreflect.ValueOfUint32(uint32(0)) + case "bandchain.v1.oracle.IAVLMerklePath.subtree_size": + return protoreflect.ValueOfUint64(uint64(0)) + case "bandchain.v1.oracle.IAVLMerklePath.subtree_version": + return protoreflect.ValueOfUint64(uint64(0)) + case "bandchain.v1.oracle.IAVLMerklePath.sibling_hash": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.IAVLMerklePath")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.IAVLMerklePath 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_IAVLMerklePath) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.IAVLMerklePath", 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_IAVLMerklePath) 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_IAVLMerklePath) 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_IAVLMerklePath) 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_IAVLMerklePath) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*IAVLMerklePath) + 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.IsDataOnRight { + n += 2 + } + if x.SubtreeHeight != 0 { + n += 1 + runtime.Sov(uint64(x.SubtreeHeight)) + } + if x.SubtreeSize != 0 { + n += 1 + runtime.Sov(uint64(x.SubtreeSize)) + } + if x.SubtreeVersion != 0 { + n += 1 + runtime.Sov(uint64(x.SubtreeVersion)) + } + l = len(x.SiblingHash) + 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().(*IAVLMerklePath) + 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.SiblingHash) > 0 { + i -= len(x.SiblingHash) + copy(dAtA[i:], x.SiblingHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SiblingHash))) + i-- + dAtA[i] = 0x2a + } + if x.SubtreeVersion != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.SubtreeVersion)) + i-- + dAtA[i] = 0x20 + } + if x.SubtreeSize != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.SubtreeSize)) + i-- + dAtA[i] = 0x18 + } + if x.SubtreeHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.SubtreeHeight)) + i-- + dAtA[i] = 0x10 + } + if x.IsDataOnRight { + i-- + if x.IsDataOnRight { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + 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().(*IAVLMerklePath) + 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: IAVLMerklePath: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: IAVLMerklePath: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IsDataOnRight", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.IsDataOnRight = bool(v != 0) + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SubtreeHeight", wireType) + } + x.SubtreeHeight = 0 + 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++ + x.SubtreeHeight |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SubtreeSize", wireType) + } + x.SubtreeSize = 0 + 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++ + x.SubtreeSize |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SubtreeVersion", wireType) + } + x.SubtreeVersion = 0 + 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++ + x.SubtreeVersion |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SiblingHash", 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.SiblingHash = append(x.SiblingHash[:0], dAtA[iNdEx:postIndex]...) + if x.SiblingHash == nil { + x.SiblingHash = []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 _ protoreflect.List = (*_BlockRelayProof_4_list)(nil) + +type _BlockRelayProof_4_list struct { + list *[]*TMSignature +} + +func (x *_BlockRelayProof_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_BlockRelayProof_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_BlockRelayProof_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*TMSignature) + (*x.list)[i] = concreteValue +} + +func (x *_BlockRelayProof_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*TMSignature) + *x.list = append(*x.list, concreteValue) +} + +func (x *_BlockRelayProof_4_list) AppendMutable() protoreflect.Value { + v := new(TMSignature) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_BlockRelayProof_4_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_BlockRelayProof_4_list) NewElement() protoreflect.Value { + v := new(TMSignature) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_BlockRelayProof_4_list) IsValid() bool { + return x.list != nil +} + +var ( + md_BlockRelayProof protoreflect.MessageDescriptor + fd_BlockRelayProof_multi_store_proof protoreflect.FieldDescriptor + fd_BlockRelayProof_block_header_merkle_parts protoreflect.FieldDescriptor + fd_BlockRelayProof_common_encoded_vote_part protoreflect.FieldDescriptor + fd_BlockRelayProof_signatures protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_BlockRelayProof = File_bandchain_v1_oracle_proof_proto.Messages().ByName("BlockRelayProof") + fd_BlockRelayProof_multi_store_proof = md_BlockRelayProof.Fields().ByName("multi_store_proof") + fd_BlockRelayProof_block_header_merkle_parts = md_BlockRelayProof.Fields().ByName("block_header_merkle_parts") + fd_BlockRelayProof_common_encoded_vote_part = md_BlockRelayProof.Fields().ByName("common_encoded_vote_part") + fd_BlockRelayProof_signatures = md_BlockRelayProof.Fields().ByName("signatures") +} + +var _ protoreflect.Message = (*fastReflection_BlockRelayProof)(nil) + +type fastReflection_BlockRelayProof BlockRelayProof + +func (x *BlockRelayProof) ProtoReflect() protoreflect.Message { + return (*fastReflection_BlockRelayProof)(x) +} + +func (x *BlockRelayProof) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[14] + 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_BlockRelayProof_messageType fastReflection_BlockRelayProof_messageType +var _ protoreflect.MessageType = fastReflection_BlockRelayProof_messageType{} + +type fastReflection_BlockRelayProof_messageType struct{} + +func (x fastReflection_BlockRelayProof_messageType) Zero() protoreflect.Message { + return (*fastReflection_BlockRelayProof)(nil) +} +func (x fastReflection_BlockRelayProof_messageType) New() protoreflect.Message { + return new(fastReflection_BlockRelayProof) +} +func (x fastReflection_BlockRelayProof_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_BlockRelayProof +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_BlockRelayProof) Descriptor() protoreflect.MessageDescriptor { + return md_BlockRelayProof +} + +// 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_BlockRelayProof) Type() protoreflect.MessageType { + return _fastReflection_BlockRelayProof_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_BlockRelayProof) New() protoreflect.Message { + return new(fastReflection_BlockRelayProof) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_BlockRelayProof) Interface() protoreflect.ProtoMessage { + return (*BlockRelayProof)(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_BlockRelayProof) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.MultiStoreProof != nil { + value := protoreflect.ValueOfMessage(x.MultiStoreProof.ProtoReflect()) + if !f(fd_BlockRelayProof_multi_store_proof, value) { + return + } + } + if x.BlockHeaderMerkleParts != nil { + value := protoreflect.ValueOfMessage(x.BlockHeaderMerkleParts.ProtoReflect()) + if !f(fd_BlockRelayProof_block_header_merkle_parts, value) { + return + } + } + if x.CommonEncodedVotePart != nil { + value := protoreflect.ValueOfMessage(x.CommonEncodedVotePart.ProtoReflect()) + if !f(fd_BlockRelayProof_common_encoded_vote_part, value) { + return + } + } + if len(x.Signatures) != 0 { + value := protoreflect.ValueOfList(&_BlockRelayProof_4_list{list: &x.Signatures}) + if !f(fd_BlockRelayProof_signatures, 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_BlockRelayProof) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.BlockRelayProof.multi_store_proof": + return x.MultiStoreProof != nil + case "bandchain.v1.oracle.BlockRelayProof.block_header_merkle_parts": + return x.BlockHeaderMerkleParts != nil + case "bandchain.v1.oracle.BlockRelayProof.common_encoded_vote_part": + return x.CommonEncodedVotePart != nil + case "bandchain.v1.oracle.BlockRelayProof.signatures": + return len(x.Signatures) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.BlockRelayProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.BlockRelayProof 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_BlockRelayProof) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.BlockRelayProof.multi_store_proof": + x.MultiStoreProof = nil + case "bandchain.v1.oracle.BlockRelayProof.block_header_merkle_parts": + x.BlockHeaderMerkleParts = nil + case "bandchain.v1.oracle.BlockRelayProof.common_encoded_vote_part": + x.CommonEncodedVotePart = nil + case "bandchain.v1.oracle.BlockRelayProof.signatures": + x.Signatures = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.BlockRelayProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.BlockRelayProof 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_BlockRelayProof) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.BlockRelayProof.multi_store_proof": + value := x.MultiStoreProof + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "bandchain.v1.oracle.BlockRelayProof.block_header_merkle_parts": + value := x.BlockHeaderMerkleParts + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "bandchain.v1.oracle.BlockRelayProof.common_encoded_vote_part": + value := x.CommonEncodedVotePart + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "bandchain.v1.oracle.BlockRelayProof.signatures": + if len(x.Signatures) == 0 { + return protoreflect.ValueOfList(&_BlockRelayProof_4_list{}) + } + listValue := &_BlockRelayProof_4_list{list: &x.Signatures} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.BlockRelayProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.BlockRelayProof 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_BlockRelayProof) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.BlockRelayProof.multi_store_proof": + x.MultiStoreProof = value.Message().Interface().(*MultiStoreProof) + case "bandchain.v1.oracle.BlockRelayProof.block_header_merkle_parts": + x.BlockHeaderMerkleParts = value.Message().Interface().(*BlockHeaderMerkleParts) + case "bandchain.v1.oracle.BlockRelayProof.common_encoded_vote_part": + x.CommonEncodedVotePart = value.Message().Interface().(*CommonEncodedVotePart) + case "bandchain.v1.oracle.BlockRelayProof.signatures": + lv := value.List() + clv := lv.(*_BlockRelayProof_4_list) + x.Signatures = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.BlockRelayProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.BlockRelayProof 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_BlockRelayProof) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.BlockRelayProof.multi_store_proof": + if x.MultiStoreProof == nil { + x.MultiStoreProof = new(MultiStoreProof) + } + return protoreflect.ValueOfMessage(x.MultiStoreProof.ProtoReflect()) + case "bandchain.v1.oracle.BlockRelayProof.block_header_merkle_parts": + if x.BlockHeaderMerkleParts == nil { + x.BlockHeaderMerkleParts = new(BlockHeaderMerkleParts) + } + return protoreflect.ValueOfMessage(x.BlockHeaderMerkleParts.ProtoReflect()) + case "bandchain.v1.oracle.BlockRelayProof.common_encoded_vote_part": + if x.CommonEncodedVotePart == nil { + x.CommonEncodedVotePart = new(CommonEncodedVotePart) + } + return protoreflect.ValueOfMessage(x.CommonEncodedVotePart.ProtoReflect()) + case "bandchain.v1.oracle.BlockRelayProof.signatures": + if x.Signatures == nil { + x.Signatures = []*TMSignature{} + } + value := &_BlockRelayProof_4_list{list: &x.Signatures} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.BlockRelayProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.BlockRelayProof 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_BlockRelayProof) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.BlockRelayProof.multi_store_proof": + m := new(MultiStoreProof) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "bandchain.v1.oracle.BlockRelayProof.block_header_merkle_parts": + m := new(BlockHeaderMerkleParts) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "bandchain.v1.oracle.BlockRelayProof.common_encoded_vote_part": + m := new(CommonEncodedVotePart) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "bandchain.v1.oracle.BlockRelayProof.signatures": + list := []*TMSignature{} + return protoreflect.ValueOfList(&_BlockRelayProof_4_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.BlockRelayProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.BlockRelayProof 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_BlockRelayProof) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.BlockRelayProof", 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_BlockRelayProof) 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_BlockRelayProof) 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_BlockRelayProof) 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_BlockRelayProof) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*BlockRelayProof) + 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.MultiStoreProof != nil { + l = options.Size(x.MultiStoreProof) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.BlockHeaderMerkleParts != nil { + l = options.Size(x.BlockHeaderMerkleParts) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.CommonEncodedVotePart != nil { + l = options.Size(x.CommonEncodedVotePart) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Signatures) > 0 { + for _, e := range x.Signatures { + 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().(*BlockRelayProof) + 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.Signatures) > 0 { + for iNdEx := len(x.Signatures) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Signatures[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] = 0x22 + } + } + if x.CommonEncodedVotePart != nil { + encoded, err := options.Marshal(x.CommonEncodedVotePart) + 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] = 0x1a + } + if x.BlockHeaderMerkleParts != nil { + encoded, err := options.Marshal(x.BlockHeaderMerkleParts) + 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.MultiStoreProof != nil { + encoded, err := options.Marshal(x.MultiStoreProof) + 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().(*BlockRelayProof) + 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: BlockRelayProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BlockRelayProof: 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 MultiStoreProof", 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.MultiStoreProof == nil { + x.MultiStoreProof = &MultiStoreProof{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MultiStoreProof); 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 BlockHeaderMerkleParts", 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.BlockHeaderMerkleParts == nil { + x.BlockHeaderMerkleParts = &BlockHeaderMerkleParts{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BlockHeaderMerkleParts); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CommonEncodedVotePart", 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.CommonEncodedVotePart == nil { + x.CommonEncodedVotePart = &CommonEncodedVotePart{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CommonEncodedVotePart); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signatures", 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.Signatures = append(x.Signatures, &TMSignature{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Signatures[len(x.Signatures)-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 ( + md_MultiStoreProof protoreflect.MessageDescriptor + fd_MultiStoreProof_oracle_iavl_state_hash protoreflect.FieldDescriptor + fd_MultiStoreProof_params_store_merkle_hash protoreflect.FieldDescriptor + fd_MultiStoreProof_slashing_to_staking_stores_merkle_hash protoreflect.FieldDescriptor + fd_MultiStoreProof_transfer_to_upgrade_stores_merkle_hash protoreflect.FieldDescriptor + fd_MultiStoreProof_auth_to_mint_stores_merkle_hash protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_MultiStoreProof = File_bandchain_v1_oracle_proof_proto.Messages().ByName("MultiStoreProof") + fd_MultiStoreProof_oracle_iavl_state_hash = md_MultiStoreProof.Fields().ByName("oracle_iavl_state_hash") + fd_MultiStoreProof_params_store_merkle_hash = md_MultiStoreProof.Fields().ByName("params_store_merkle_hash") + fd_MultiStoreProof_slashing_to_staking_stores_merkle_hash = md_MultiStoreProof.Fields().ByName("slashing_to_staking_stores_merkle_hash") + fd_MultiStoreProof_transfer_to_upgrade_stores_merkle_hash = md_MultiStoreProof.Fields().ByName("transfer_to_upgrade_stores_merkle_hash") + fd_MultiStoreProof_auth_to_mint_stores_merkle_hash = md_MultiStoreProof.Fields().ByName("auth_to_mint_stores_merkle_hash") +} + +var _ protoreflect.Message = (*fastReflection_MultiStoreProof)(nil) + +type fastReflection_MultiStoreProof MultiStoreProof + +func (x *MultiStoreProof) ProtoReflect() protoreflect.Message { + return (*fastReflection_MultiStoreProof)(x) +} + +func (x *MultiStoreProof) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[15] + 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_MultiStoreProof_messageType fastReflection_MultiStoreProof_messageType +var _ protoreflect.MessageType = fastReflection_MultiStoreProof_messageType{} + +type fastReflection_MultiStoreProof_messageType struct{} + +func (x fastReflection_MultiStoreProof_messageType) Zero() protoreflect.Message { + return (*fastReflection_MultiStoreProof)(nil) +} +func (x fastReflection_MultiStoreProof_messageType) New() protoreflect.Message { + return new(fastReflection_MultiStoreProof) +} +func (x fastReflection_MultiStoreProof_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MultiStoreProof +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MultiStoreProof) Descriptor() protoreflect.MessageDescriptor { + return md_MultiStoreProof +} + +// 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_MultiStoreProof) Type() protoreflect.MessageType { + return _fastReflection_MultiStoreProof_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MultiStoreProof) New() protoreflect.Message { + return new(fastReflection_MultiStoreProof) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MultiStoreProof) Interface() protoreflect.ProtoMessage { + return (*MultiStoreProof)(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_MultiStoreProof) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.OracleIavlStateHash) != 0 { + value := protoreflect.ValueOfBytes(x.OracleIavlStateHash) + if !f(fd_MultiStoreProof_oracle_iavl_state_hash, value) { + return + } + } + if len(x.ParamsStoreMerkleHash) != 0 { + value := protoreflect.ValueOfBytes(x.ParamsStoreMerkleHash) + if !f(fd_MultiStoreProof_params_store_merkle_hash, value) { + return + } + } + if len(x.SlashingToStakingStoresMerkleHash) != 0 { + value := protoreflect.ValueOfBytes(x.SlashingToStakingStoresMerkleHash) + if !f(fd_MultiStoreProof_slashing_to_staking_stores_merkle_hash, value) { + return + } + } + if len(x.TransferToUpgradeStoresMerkleHash) != 0 { + value := protoreflect.ValueOfBytes(x.TransferToUpgradeStoresMerkleHash) + if !f(fd_MultiStoreProof_transfer_to_upgrade_stores_merkle_hash, value) { + return + } + } + if len(x.AuthToMintStoresMerkleHash) != 0 { + value := protoreflect.ValueOfBytes(x.AuthToMintStoresMerkleHash) + if !f(fd_MultiStoreProof_auth_to_mint_stores_merkle_hash, 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_MultiStoreProof) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiStoreProof.oracle_iavl_state_hash": + return len(x.OracleIavlStateHash) != 0 + case "bandchain.v1.oracle.MultiStoreProof.params_store_merkle_hash": + return len(x.ParamsStoreMerkleHash) != 0 + case "bandchain.v1.oracle.MultiStoreProof.slashing_to_staking_stores_merkle_hash": + return len(x.SlashingToStakingStoresMerkleHash) != 0 + case "bandchain.v1.oracle.MultiStoreProof.transfer_to_upgrade_stores_merkle_hash": + return len(x.TransferToUpgradeStoresMerkleHash) != 0 + case "bandchain.v1.oracle.MultiStoreProof.auth_to_mint_stores_merkle_hash": + return len(x.AuthToMintStoresMerkleHash) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiStoreProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiStoreProof 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_MultiStoreProof) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiStoreProof.oracle_iavl_state_hash": + x.OracleIavlStateHash = nil + case "bandchain.v1.oracle.MultiStoreProof.params_store_merkle_hash": + x.ParamsStoreMerkleHash = nil + case "bandchain.v1.oracle.MultiStoreProof.slashing_to_staking_stores_merkle_hash": + x.SlashingToStakingStoresMerkleHash = nil + case "bandchain.v1.oracle.MultiStoreProof.transfer_to_upgrade_stores_merkle_hash": + x.TransferToUpgradeStoresMerkleHash = nil + case "bandchain.v1.oracle.MultiStoreProof.auth_to_mint_stores_merkle_hash": + x.AuthToMintStoresMerkleHash = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiStoreProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiStoreProof 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_MultiStoreProof) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.MultiStoreProof.oracle_iavl_state_hash": + value := x.OracleIavlStateHash + return protoreflect.ValueOfBytes(value) + case "bandchain.v1.oracle.MultiStoreProof.params_store_merkle_hash": + value := x.ParamsStoreMerkleHash + return protoreflect.ValueOfBytes(value) + case "bandchain.v1.oracle.MultiStoreProof.slashing_to_staking_stores_merkle_hash": + value := x.SlashingToStakingStoresMerkleHash + return protoreflect.ValueOfBytes(value) + case "bandchain.v1.oracle.MultiStoreProof.transfer_to_upgrade_stores_merkle_hash": + value := x.TransferToUpgradeStoresMerkleHash + return protoreflect.ValueOfBytes(value) + case "bandchain.v1.oracle.MultiStoreProof.auth_to_mint_stores_merkle_hash": + value := x.AuthToMintStoresMerkleHash + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiStoreProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiStoreProof 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_MultiStoreProof) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiStoreProof.oracle_iavl_state_hash": + x.OracleIavlStateHash = value.Bytes() + case "bandchain.v1.oracle.MultiStoreProof.params_store_merkle_hash": + x.ParamsStoreMerkleHash = value.Bytes() + case "bandchain.v1.oracle.MultiStoreProof.slashing_to_staking_stores_merkle_hash": + x.SlashingToStakingStoresMerkleHash = value.Bytes() + case "bandchain.v1.oracle.MultiStoreProof.transfer_to_upgrade_stores_merkle_hash": + x.TransferToUpgradeStoresMerkleHash = value.Bytes() + case "bandchain.v1.oracle.MultiStoreProof.auth_to_mint_stores_merkle_hash": + x.AuthToMintStoresMerkleHash = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiStoreProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiStoreProof 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_MultiStoreProof) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiStoreProof.oracle_iavl_state_hash": + panic(fmt.Errorf("field oracle_iavl_state_hash of message bandchain.v1.oracle.MultiStoreProof is not mutable")) + case "bandchain.v1.oracle.MultiStoreProof.params_store_merkle_hash": + panic(fmt.Errorf("field params_store_merkle_hash of message bandchain.v1.oracle.MultiStoreProof is not mutable")) + case "bandchain.v1.oracle.MultiStoreProof.slashing_to_staking_stores_merkle_hash": + panic(fmt.Errorf("field slashing_to_staking_stores_merkle_hash of message bandchain.v1.oracle.MultiStoreProof is not mutable")) + case "bandchain.v1.oracle.MultiStoreProof.transfer_to_upgrade_stores_merkle_hash": + panic(fmt.Errorf("field transfer_to_upgrade_stores_merkle_hash of message bandchain.v1.oracle.MultiStoreProof is not mutable")) + case "bandchain.v1.oracle.MultiStoreProof.auth_to_mint_stores_merkle_hash": + panic(fmt.Errorf("field auth_to_mint_stores_merkle_hash of message bandchain.v1.oracle.MultiStoreProof is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiStoreProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiStoreProof 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_MultiStoreProof) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.MultiStoreProof.oracle_iavl_state_hash": + return protoreflect.ValueOfBytes(nil) + case "bandchain.v1.oracle.MultiStoreProof.params_store_merkle_hash": + return protoreflect.ValueOfBytes(nil) + case "bandchain.v1.oracle.MultiStoreProof.slashing_to_staking_stores_merkle_hash": + return protoreflect.ValueOfBytes(nil) + case "bandchain.v1.oracle.MultiStoreProof.transfer_to_upgrade_stores_merkle_hash": + return protoreflect.ValueOfBytes(nil) + case "bandchain.v1.oracle.MultiStoreProof.auth_to_mint_stores_merkle_hash": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.MultiStoreProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.MultiStoreProof 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_MultiStoreProof) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.MultiStoreProof", 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_MultiStoreProof) 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_MultiStoreProof) 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_MultiStoreProof) 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_MultiStoreProof) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MultiStoreProof) + 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.OracleIavlStateHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ParamsStoreMerkleHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.SlashingToStakingStoresMerkleHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.TransferToUpgradeStoresMerkleHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.AuthToMintStoresMerkleHash) + 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().(*MultiStoreProof) + 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.AuthToMintStoresMerkleHash) > 0 { + i -= len(x.AuthToMintStoresMerkleHash) + copy(dAtA[i:], x.AuthToMintStoresMerkleHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AuthToMintStoresMerkleHash))) + i-- + dAtA[i] = 0x2a + } + if len(x.TransferToUpgradeStoresMerkleHash) > 0 { + i -= len(x.TransferToUpgradeStoresMerkleHash) + copy(dAtA[i:], x.TransferToUpgradeStoresMerkleHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TransferToUpgradeStoresMerkleHash))) + i-- + dAtA[i] = 0x22 + } + if len(x.SlashingToStakingStoresMerkleHash) > 0 { + i -= len(x.SlashingToStakingStoresMerkleHash) + copy(dAtA[i:], x.SlashingToStakingStoresMerkleHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SlashingToStakingStoresMerkleHash))) + i-- + dAtA[i] = 0x1a + } + if len(x.ParamsStoreMerkleHash) > 0 { + i -= len(x.ParamsStoreMerkleHash) + copy(dAtA[i:], x.ParamsStoreMerkleHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ParamsStoreMerkleHash))) + i-- + dAtA[i] = 0x12 + } + if len(x.OracleIavlStateHash) > 0 { + i -= len(x.OracleIavlStateHash) + copy(dAtA[i:], x.OracleIavlStateHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OracleIavlStateHash))) + 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().(*MultiStoreProof) + 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: MultiStoreProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MultiStoreProof: 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 OracleIavlStateHash", 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.OracleIavlStateHash = append(x.OracleIavlStateHash[:0], dAtA[iNdEx:postIndex]...) + if x.OracleIavlStateHash == nil { + x.OracleIavlStateHash = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ParamsStoreMerkleHash", 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.ParamsStoreMerkleHash = append(x.ParamsStoreMerkleHash[:0], dAtA[iNdEx:postIndex]...) + if x.ParamsStoreMerkleHash == nil { + x.ParamsStoreMerkleHash = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SlashingToStakingStoresMerkleHash", 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.SlashingToStakingStoresMerkleHash = append(x.SlashingToStakingStoresMerkleHash[:0], dAtA[iNdEx:postIndex]...) + if x.SlashingToStakingStoresMerkleHash == nil { + x.SlashingToStakingStoresMerkleHash = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TransferToUpgradeStoresMerkleHash", 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.TransferToUpgradeStoresMerkleHash = append(x.TransferToUpgradeStoresMerkleHash[:0], dAtA[iNdEx:postIndex]...) + if x.TransferToUpgradeStoresMerkleHash == nil { + x.TransferToUpgradeStoresMerkleHash = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuthToMintStoresMerkleHash", 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.AuthToMintStoresMerkleHash = append(x.AuthToMintStoresMerkleHash[:0], dAtA[iNdEx:postIndex]...) + if x.AuthToMintStoresMerkleHash == nil { + x.AuthToMintStoresMerkleHash = []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_BlockHeaderMerkleParts protoreflect.MessageDescriptor + fd_BlockHeaderMerkleParts_version_and_chain_id_hash protoreflect.FieldDescriptor + fd_BlockHeaderMerkleParts_height protoreflect.FieldDescriptor + fd_BlockHeaderMerkleParts_time_second protoreflect.FieldDescriptor + fd_BlockHeaderMerkleParts_time_nano_second protoreflect.FieldDescriptor + fd_BlockHeaderMerkleParts_last_block_id_and_other protoreflect.FieldDescriptor + fd_BlockHeaderMerkleParts_next_validator_hash_and_consensus_hash protoreflect.FieldDescriptor + fd_BlockHeaderMerkleParts_last_results_hash protoreflect.FieldDescriptor + fd_BlockHeaderMerkleParts_evidence_and_proposer_hash protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_BlockHeaderMerkleParts = File_bandchain_v1_oracle_proof_proto.Messages().ByName("BlockHeaderMerkleParts") + fd_BlockHeaderMerkleParts_version_and_chain_id_hash = md_BlockHeaderMerkleParts.Fields().ByName("version_and_chain_id_hash") + fd_BlockHeaderMerkleParts_height = md_BlockHeaderMerkleParts.Fields().ByName("height") + fd_BlockHeaderMerkleParts_time_second = md_BlockHeaderMerkleParts.Fields().ByName("time_second") + fd_BlockHeaderMerkleParts_time_nano_second = md_BlockHeaderMerkleParts.Fields().ByName("time_nano_second") + fd_BlockHeaderMerkleParts_last_block_id_and_other = md_BlockHeaderMerkleParts.Fields().ByName("last_block_id_and_other") + fd_BlockHeaderMerkleParts_next_validator_hash_and_consensus_hash = md_BlockHeaderMerkleParts.Fields().ByName("next_validator_hash_and_consensus_hash") + fd_BlockHeaderMerkleParts_last_results_hash = md_BlockHeaderMerkleParts.Fields().ByName("last_results_hash") + fd_BlockHeaderMerkleParts_evidence_and_proposer_hash = md_BlockHeaderMerkleParts.Fields().ByName("evidence_and_proposer_hash") +} + +var _ protoreflect.Message = (*fastReflection_BlockHeaderMerkleParts)(nil) + +type fastReflection_BlockHeaderMerkleParts BlockHeaderMerkleParts + +func (x *BlockHeaderMerkleParts) ProtoReflect() protoreflect.Message { + return (*fastReflection_BlockHeaderMerkleParts)(x) +} + +func (x *BlockHeaderMerkleParts) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[16] + 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_BlockHeaderMerkleParts_messageType fastReflection_BlockHeaderMerkleParts_messageType +var _ protoreflect.MessageType = fastReflection_BlockHeaderMerkleParts_messageType{} + +type fastReflection_BlockHeaderMerkleParts_messageType struct{} + +func (x fastReflection_BlockHeaderMerkleParts_messageType) Zero() protoreflect.Message { + return (*fastReflection_BlockHeaderMerkleParts)(nil) +} +func (x fastReflection_BlockHeaderMerkleParts_messageType) New() protoreflect.Message { + return new(fastReflection_BlockHeaderMerkleParts) +} +func (x fastReflection_BlockHeaderMerkleParts_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_BlockHeaderMerkleParts +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_BlockHeaderMerkleParts) Descriptor() protoreflect.MessageDescriptor { + return md_BlockHeaderMerkleParts +} + +// 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_BlockHeaderMerkleParts) Type() protoreflect.MessageType { + return _fastReflection_BlockHeaderMerkleParts_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_BlockHeaderMerkleParts) New() protoreflect.Message { + return new(fastReflection_BlockHeaderMerkleParts) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_BlockHeaderMerkleParts) Interface() protoreflect.ProtoMessage { + return (*BlockHeaderMerkleParts)(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_BlockHeaderMerkleParts) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.VersionAndChainIdHash) != 0 { + value := protoreflect.ValueOfBytes(x.VersionAndChainIdHash) + if !f(fd_BlockHeaderMerkleParts_version_and_chain_id_hash, value) { + return + } + } + if x.Height != uint64(0) { + value := protoreflect.ValueOfUint64(x.Height) + if !f(fd_BlockHeaderMerkleParts_height, value) { + return + } + } + if x.TimeSecond != uint64(0) { + value := protoreflect.ValueOfUint64(x.TimeSecond) + if !f(fd_BlockHeaderMerkleParts_time_second, value) { + return + } + } + if x.TimeNanoSecond != uint32(0) { + value := protoreflect.ValueOfUint32(x.TimeNanoSecond) + if !f(fd_BlockHeaderMerkleParts_time_nano_second, value) { + return + } + } + if len(x.LastBlockIdAndOther) != 0 { + value := protoreflect.ValueOfBytes(x.LastBlockIdAndOther) + if !f(fd_BlockHeaderMerkleParts_last_block_id_and_other, value) { + return + } + } + if len(x.NextValidatorHashAndConsensusHash) != 0 { + value := protoreflect.ValueOfBytes(x.NextValidatorHashAndConsensusHash) + if !f(fd_BlockHeaderMerkleParts_next_validator_hash_and_consensus_hash, value) { + return + } + } + if len(x.LastResultsHash) != 0 { + value := protoreflect.ValueOfBytes(x.LastResultsHash) + if !f(fd_BlockHeaderMerkleParts_last_results_hash, value) { + return + } + } + if len(x.EvidenceAndProposerHash) != 0 { + value := protoreflect.ValueOfBytes(x.EvidenceAndProposerHash) + if !f(fd_BlockHeaderMerkleParts_evidence_and_proposer_hash, 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_BlockHeaderMerkleParts) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.BlockHeaderMerkleParts.version_and_chain_id_hash": + return len(x.VersionAndChainIdHash) != 0 + case "bandchain.v1.oracle.BlockHeaderMerkleParts.height": + return x.Height != uint64(0) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.time_second": + return x.TimeSecond != uint64(0) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.time_nano_second": + return x.TimeNanoSecond != uint32(0) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.last_block_id_and_other": + return len(x.LastBlockIdAndOther) != 0 + case "bandchain.v1.oracle.BlockHeaderMerkleParts.next_validator_hash_and_consensus_hash": + return len(x.NextValidatorHashAndConsensusHash) != 0 + case "bandchain.v1.oracle.BlockHeaderMerkleParts.last_results_hash": + return len(x.LastResultsHash) != 0 + case "bandchain.v1.oracle.BlockHeaderMerkleParts.evidence_and_proposer_hash": + return len(x.EvidenceAndProposerHash) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.BlockHeaderMerkleParts")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.BlockHeaderMerkleParts 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_BlockHeaderMerkleParts) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.BlockHeaderMerkleParts.version_and_chain_id_hash": + x.VersionAndChainIdHash = nil + case "bandchain.v1.oracle.BlockHeaderMerkleParts.height": + x.Height = uint64(0) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.time_second": + x.TimeSecond = uint64(0) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.time_nano_second": + x.TimeNanoSecond = uint32(0) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.last_block_id_and_other": + x.LastBlockIdAndOther = nil + case "bandchain.v1.oracle.BlockHeaderMerkleParts.next_validator_hash_and_consensus_hash": + x.NextValidatorHashAndConsensusHash = nil + case "bandchain.v1.oracle.BlockHeaderMerkleParts.last_results_hash": + x.LastResultsHash = nil + case "bandchain.v1.oracle.BlockHeaderMerkleParts.evidence_and_proposer_hash": + x.EvidenceAndProposerHash = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.BlockHeaderMerkleParts")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.BlockHeaderMerkleParts 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_BlockHeaderMerkleParts) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.BlockHeaderMerkleParts.version_and_chain_id_hash": + value := x.VersionAndChainIdHash + return protoreflect.ValueOfBytes(value) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.height": + value := x.Height + return protoreflect.ValueOfUint64(value) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.time_second": + value := x.TimeSecond + return protoreflect.ValueOfUint64(value) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.time_nano_second": + value := x.TimeNanoSecond + return protoreflect.ValueOfUint32(value) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.last_block_id_and_other": + value := x.LastBlockIdAndOther + return protoreflect.ValueOfBytes(value) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.next_validator_hash_and_consensus_hash": + value := x.NextValidatorHashAndConsensusHash + return protoreflect.ValueOfBytes(value) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.last_results_hash": + value := x.LastResultsHash + return protoreflect.ValueOfBytes(value) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.evidence_and_proposer_hash": + value := x.EvidenceAndProposerHash + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.BlockHeaderMerkleParts")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.BlockHeaderMerkleParts 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_BlockHeaderMerkleParts) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.BlockHeaderMerkleParts.version_and_chain_id_hash": + x.VersionAndChainIdHash = value.Bytes() + case "bandchain.v1.oracle.BlockHeaderMerkleParts.height": + x.Height = value.Uint() + case "bandchain.v1.oracle.BlockHeaderMerkleParts.time_second": + x.TimeSecond = value.Uint() + case "bandchain.v1.oracle.BlockHeaderMerkleParts.time_nano_second": + x.TimeNanoSecond = uint32(value.Uint()) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.last_block_id_and_other": + x.LastBlockIdAndOther = value.Bytes() + case "bandchain.v1.oracle.BlockHeaderMerkleParts.next_validator_hash_and_consensus_hash": + x.NextValidatorHashAndConsensusHash = value.Bytes() + case "bandchain.v1.oracle.BlockHeaderMerkleParts.last_results_hash": + x.LastResultsHash = value.Bytes() + case "bandchain.v1.oracle.BlockHeaderMerkleParts.evidence_and_proposer_hash": + x.EvidenceAndProposerHash = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.BlockHeaderMerkleParts")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.BlockHeaderMerkleParts 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_BlockHeaderMerkleParts) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.BlockHeaderMerkleParts.version_and_chain_id_hash": + panic(fmt.Errorf("field version_and_chain_id_hash of message bandchain.v1.oracle.BlockHeaderMerkleParts is not mutable")) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.height": + panic(fmt.Errorf("field height of message bandchain.v1.oracle.BlockHeaderMerkleParts is not mutable")) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.time_second": + panic(fmt.Errorf("field time_second of message bandchain.v1.oracle.BlockHeaderMerkleParts is not mutable")) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.time_nano_second": + panic(fmt.Errorf("field time_nano_second of message bandchain.v1.oracle.BlockHeaderMerkleParts is not mutable")) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.last_block_id_and_other": + panic(fmt.Errorf("field last_block_id_and_other of message bandchain.v1.oracle.BlockHeaderMerkleParts is not mutable")) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.next_validator_hash_and_consensus_hash": + panic(fmt.Errorf("field next_validator_hash_and_consensus_hash of message bandchain.v1.oracle.BlockHeaderMerkleParts is not mutable")) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.last_results_hash": + panic(fmt.Errorf("field last_results_hash of message bandchain.v1.oracle.BlockHeaderMerkleParts is not mutable")) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.evidence_and_proposer_hash": + panic(fmt.Errorf("field evidence_and_proposer_hash of message bandchain.v1.oracle.BlockHeaderMerkleParts is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.BlockHeaderMerkleParts")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.BlockHeaderMerkleParts 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_BlockHeaderMerkleParts) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.BlockHeaderMerkleParts.version_and_chain_id_hash": + return protoreflect.ValueOfBytes(nil) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.height": + return protoreflect.ValueOfUint64(uint64(0)) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.time_second": + return protoreflect.ValueOfUint64(uint64(0)) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.time_nano_second": + return protoreflect.ValueOfUint32(uint32(0)) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.last_block_id_and_other": + return protoreflect.ValueOfBytes(nil) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.next_validator_hash_and_consensus_hash": + return protoreflect.ValueOfBytes(nil) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.last_results_hash": + return protoreflect.ValueOfBytes(nil) + case "bandchain.v1.oracle.BlockHeaderMerkleParts.evidence_and_proposer_hash": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.BlockHeaderMerkleParts")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.BlockHeaderMerkleParts 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_BlockHeaderMerkleParts) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.BlockHeaderMerkleParts", 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_BlockHeaderMerkleParts) 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_BlockHeaderMerkleParts) 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_BlockHeaderMerkleParts) 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_BlockHeaderMerkleParts) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*BlockHeaderMerkleParts) + 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.VersionAndChainIdHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Height != 0 { + n += 1 + runtime.Sov(uint64(x.Height)) + } + if x.TimeSecond != 0 { + n += 1 + runtime.Sov(uint64(x.TimeSecond)) + } + if x.TimeNanoSecond != 0 { + n += 1 + runtime.Sov(uint64(x.TimeNanoSecond)) + } + l = len(x.LastBlockIdAndOther) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.NextValidatorHashAndConsensusHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.LastResultsHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.EvidenceAndProposerHash) + 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().(*BlockHeaderMerkleParts) + 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.EvidenceAndProposerHash) > 0 { + i -= len(x.EvidenceAndProposerHash) + copy(dAtA[i:], x.EvidenceAndProposerHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EvidenceAndProposerHash))) + i-- + dAtA[i] = 0x42 + } + if len(x.LastResultsHash) > 0 { + i -= len(x.LastResultsHash) + copy(dAtA[i:], x.LastResultsHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.LastResultsHash))) + i-- + dAtA[i] = 0x3a + } + if len(x.NextValidatorHashAndConsensusHash) > 0 { + i -= len(x.NextValidatorHashAndConsensusHash) + copy(dAtA[i:], x.NextValidatorHashAndConsensusHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NextValidatorHashAndConsensusHash))) + i-- + dAtA[i] = 0x32 + } + if len(x.LastBlockIdAndOther) > 0 { + i -= len(x.LastBlockIdAndOther) + copy(dAtA[i:], x.LastBlockIdAndOther) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.LastBlockIdAndOther))) + i-- + dAtA[i] = 0x2a + } + if x.TimeNanoSecond != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TimeNanoSecond)) + i-- + dAtA[i] = 0x20 + } + if x.TimeSecond != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TimeSecond)) + i-- + dAtA[i] = 0x18 + } + if x.Height != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Height)) + i-- + dAtA[i] = 0x10 + } + if len(x.VersionAndChainIdHash) > 0 { + i -= len(x.VersionAndChainIdHash) + copy(dAtA[i:], x.VersionAndChainIdHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VersionAndChainIdHash))) + 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().(*BlockHeaderMerkleParts) + 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: BlockHeaderMerkleParts: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BlockHeaderMerkleParts: 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 VersionAndChainIdHash", 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.VersionAndChainIdHash = append(x.VersionAndChainIdHash[:0], dAtA[iNdEx:postIndex]...) + if x.VersionAndChainIdHash == nil { + x.VersionAndChainIdHash = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + x.Height = 0 + 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++ + x.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TimeSecond", wireType) + } + x.TimeSecond = 0 + 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++ + x.TimeSecond |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TimeNanoSecond", wireType) + } + x.TimeNanoSecond = 0 + 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++ + x.TimeNanoSecond |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastBlockIdAndOther", 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.LastBlockIdAndOther = append(x.LastBlockIdAndOther[:0], dAtA[iNdEx:postIndex]...) + if x.LastBlockIdAndOther == nil { + x.LastBlockIdAndOther = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NextValidatorHashAndConsensusHash", 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.NextValidatorHashAndConsensusHash = append(x.NextValidatorHashAndConsensusHash[:0], dAtA[iNdEx:postIndex]...) + if x.NextValidatorHashAndConsensusHash == nil { + x.NextValidatorHashAndConsensusHash = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastResultsHash", 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.LastResultsHash = append(x.LastResultsHash[:0], dAtA[iNdEx:postIndex]...) + if x.LastResultsHash == nil { + x.LastResultsHash = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EvidenceAndProposerHash", 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.EvidenceAndProposerHash = append(x.EvidenceAndProposerHash[:0], dAtA[iNdEx:postIndex]...) + if x.EvidenceAndProposerHash == nil { + x.EvidenceAndProposerHash = []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_CommonEncodedVotePart protoreflect.MessageDescriptor + fd_CommonEncodedVotePart_signed_data_prefix protoreflect.FieldDescriptor + fd_CommonEncodedVotePart_signed_data_suffix protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_CommonEncodedVotePart = File_bandchain_v1_oracle_proof_proto.Messages().ByName("CommonEncodedVotePart") + fd_CommonEncodedVotePart_signed_data_prefix = md_CommonEncodedVotePart.Fields().ByName("signed_data_prefix") + fd_CommonEncodedVotePart_signed_data_suffix = md_CommonEncodedVotePart.Fields().ByName("signed_data_suffix") +} + +var _ protoreflect.Message = (*fastReflection_CommonEncodedVotePart)(nil) + +type fastReflection_CommonEncodedVotePart CommonEncodedVotePart + +func (x *CommonEncodedVotePart) ProtoReflect() protoreflect.Message { + return (*fastReflection_CommonEncodedVotePart)(x) +} + +func (x *CommonEncodedVotePart) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_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_CommonEncodedVotePart_messageType fastReflection_CommonEncodedVotePart_messageType +var _ protoreflect.MessageType = fastReflection_CommonEncodedVotePart_messageType{} + +type fastReflection_CommonEncodedVotePart_messageType struct{} + +func (x fastReflection_CommonEncodedVotePart_messageType) Zero() protoreflect.Message { + return (*fastReflection_CommonEncodedVotePart)(nil) +} +func (x fastReflection_CommonEncodedVotePart_messageType) New() protoreflect.Message { + return new(fastReflection_CommonEncodedVotePart) +} +func (x fastReflection_CommonEncodedVotePart_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_CommonEncodedVotePart +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_CommonEncodedVotePart) Descriptor() protoreflect.MessageDescriptor { + return md_CommonEncodedVotePart +} + +// 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_CommonEncodedVotePart) Type() protoreflect.MessageType { + return _fastReflection_CommonEncodedVotePart_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_CommonEncodedVotePart) New() protoreflect.Message { + return new(fastReflection_CommonEncodedVotePart) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_CommonEncodedVotePart) Interface() protoreflect.ProtoMessage { + return (*CommonEncodedVotePart)(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_CommonEncodedVotePart) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.SignedDataPrefix) != 0 { + value := protoreflect.ValueOfBytes(x.SignedDataPrefix) + if !f(fd_CommonEncodedVotePart_signed_data_prefix, value) { + return + } + } + if len(x.SignedDataSuffix) != 0 { + value := protoreflect.ValueOfBytes(x.SignedDataSuffix) + if !f(fd_CommonEncodedVotePart_signed_data_suffix, 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_CommonEncodedVotePart) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.CommonEncodedVotePart.signed_data_prefix": + return len(x.SignedDataPrefix) != 0 + case "bandchain.v1.oracle.CommonEncodedVotePart.signed_data_suffix": + return len(x.SignedDataSuffix) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CommonEncodedVotePart")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CommonEncodedVotePart 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_CommonEncodedVotePart) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.CommonEncodedVotePart.signed_data_prefix": + x.SignedDataPrefix = nil + case "bandchain.v1.oracle.CommonEncodedVotePart.signed_data_suffix": + x.SignedDataSuffix = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CommonEncodedVotePart")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CommonEncodedVotePart 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_CommonEncodedVotePart) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.CommonEncodedVotePart.signed_data_prefix": + value := x.SignedDataPrefix + return protoreflect.ValueOfBytes(value) + case "bandchain.v1.oracle.CommonEncodedVotePart.signed_data_suffix": + value := x.SignedDataSuffix + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CommonEncodedVotePart")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CommonEncodedVotePart 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_CommonEncodedVotePart) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.CommonEncodedVotePart.signed_data_prefix": + x.SignedDataPrefix = value.Bytes() + case "bandchain.v1.oracle.CommonEncodedVotePart.signed_data_suffix": + x.SignedDataSuffix = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CommonEncodedVotePart")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CommonEncodedVotePart 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_CommonEncodedVotePart) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.CommonEncodedVotePart.signed_data_prefix": + panic(fmt.Errorf("field signed_data_prefix of message bandchain.v1.oracle.CommonEncodedVotePart is not mutable")) + case "bandchain.v1.oracle.CommonEncodedVotePart.signed_data_suffix": + panic(fmt.Errorf("field signed_data_suffix of message bandchain.v1.oracle.CommonEncodedVotePart is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CommonEncodedVotePart")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CommonEncodedVotePart 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_CommonEncodedVotePart) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.CommonEncodedVotePart.signed_data_prefix": + return protoreflect.ValueOfBytes(nil) + case "bandchain.v1.oracle.CommonEncodedVotePart.signed_data_suffix": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.CommonEncodedVotePart")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.CommonEncodedVotePart 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_CommonEncodedVotePart) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.CommonEncodedVotePart", 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_CommonEncodedVotePart) 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_CommonEncodedVotePart) 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_CommonEncodedVotePart) 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_CommonEncodedVotePart) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*CommonEncodedVotePart) + 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.SignedDataPrefix) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.SignedDataSuffix) + 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().(*CommonEncodedVotePart) + 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.SignedDataSuffix) > 0 { + i -= len(x.SignedDataSuffix) + copy(dAtA[i:], x.SignedDataSuffix) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SignedDataSuffix))) + i-- + dAtA[i] = 0x12 + } + if len(x.SignedDataPrefix) > 0 { + i -= len(x.SignedDataPrefix) + copy(dAtA[i:], x.SignedDataPrefix) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SignedDataPrefix))) + 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().(*CommonEncodedVotePart) + 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: CommonEncodedVotePart: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CommonEncodedVotePart: 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 SignedDataPrefix", 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.SignedDataPrefix = append(x.SignedDataPrefix[:0], dAtA[iNdEx:postIndex]...) + if x.SignedDataPrefix == nil { + x.SignedDataPrefix = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SignedDataSuffix", 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.SignedDataSuffix = append(x.SignedDataSuffix[:0], dAtA[iNdEx:postIndex]...) + if x.SignedDataSuffix == nil { + x.SignedDataSuffix = []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_TMSignature protoreflect.MessageDescriptor + fd_TMSignature_r protoreflect.FieldDescriptor + fd_TMSignature_s protoreflect.FieldDescriptor + fd_TMSignature_v protoreflect.FieldDescriptor + fd_TMSignature_encoded_timestamp protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_TMSignature = File_bandchain_v1_oracle_proof_proto.Messages().ByName("TMSignature") + fd_TMSignature_r = md_TMSignature.Fields().ByName("r") + fd_TMSignature_s = md_TMSignature.Fields().ByName("s") + fd_TMSignature_v = md_TMSignature.Fields().ByName("v") + fd_TMSignature_encoded_timestamp = md_TMSignature.Fields().ByName("encoded_timestamp") +} + +var _ protoreflect.Message = (*fastReflection_TMSignature)(nil) + +type fastReflection_TMSignature TMSignature + +func (x *TMSignature) ProtoReflect() protoreflect.Message { + return (*fastReflection_TMSignature)(x) +} + +func (x *TMSignature) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_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_TMSignature_messageType fastReflection_TMSignature_messageType +var _ protoreflect.MessageType = fastReflection_TMSignature_messageType{} + +type fastReflection_TMSignature_messageType struct{} + +func (x fastReflection_TMSignature_messageType) Zero() protoreflect.Message { + return (*fastReflection_TMSignature)(nil) +} +func (x fastReflection_TMSignature_messageType) New() protoreflect.Message { + return new(fastReflection_TMSignature) +} +func (x fastReflection_TMSignature_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_TMSignature +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_TMSignature) Descriptor() protoreflect.MessageDescriptor { + return md_TMSignature +} + +// 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_TMSignature) Type() protoreflect.MessageType { + return _fastReflection_TMSignature_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_TMSignature) New() protoreflect.Message { + return new(fastReflection_TMSignature) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_TMSignature) Interface() protoreflect.ProtoMessage { + return (*TMSignature)(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_TMSignature) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.R) != 0 { + value := protoreflect.ValueOfBytes(x.R) + if !f(fd_TMSignature_r, value) { + return + } + } + if len(x.S) != 0 { + value := protoreflect.ValueOfBytes(x.S) + if !f(fd_TMSignature_s, value) { + return + } + } + if x.V != uint32(0) { + value := protoreflect.ValueOfUint32(x.V) + if !f(fd_TMSignature_v, value) { + return + } + } + if len(x.EncodedTimestamp) != 0 { + value := protoreflect.ValueOfBytes(x.EncodedTimestamp) + if !f(fd_TMSignature_encoded_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_TMSignature) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.TMSignature.r": + return len(x.R) != 0 + case "bandchain.v1.oracle.TMSignature.s": + return len(x.S) != 0 + case "bandchain.v1.oracle.TMSignature.v": + return x.V != uint32(0) + case "bandchain.v1.oracle.TMSignature.encoded_timestamp": + return len(x.EncodedTimestamp) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.TMSignature")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.TMSignature 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_TMSignature) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.TMSignature.r": + x.R = nil + case "bandchain.v1.oracle.TMSignature.s": + x.S = nil + case "bandchain.v1.oracle.TMSignature.v": + x.V = uint32(0) + case "bandchain.v1.oracle.TMSignature.encoded_timestamp": + x.EncodedTimestamp = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.TMSignature")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.TMSignature 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_TMSignature) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.TMSignature.r": + value := x.R + return protoreflect.ValueOfBytes(value) + case "bandchain.v1.oracle.TMSignature.s": + value := x.S + return protoreflect.ValueOfBytes(value) + case "bandchain.v1.oracle.TMSignature.v": + value := x.V + return protoreflect.ValueOfUint32(value) + case "bandchain.v1.oracle.TMSignature.encoded_timestamp": + value := x.EncodedTimestamp + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.TMSignature")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.TMSignature 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_TMSignature) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.TMSignature.r": + x.R = value.Bytes() + case "bandchain.v1.oracle.TMSignature.s": + x.S = value.Bytes() + case "bandchain.v1.oracle.TMSignature.v": + x.V = uint32(value.Uint()) + case "bandchain.v1.oracle.TMSignature.encoded_timestamp": + x.EncodedTimestamp = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.TMSignature")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.TMSignature 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_TMSignature) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.TMSignature.r": + panic(fmt.Errorf("field r of message bandchain.v1.oracle.TMSignature is not mutable")) + case "bandchain.v1.oracle.TMSignature.s": + panic(fmt.Errorf("field s of message bandchain.v1.oracle.TMSignature is not mutable")) + case "bandchain.v1.oracle.TMSignature.v": + panic(fmt.Errorf("field v of message bandchain.v1.oracle.TMSignature is not mutable")) + case "bandchain.v1.oracle.TMSignature.encoded_timestamp": + panic(fmt.Errorf("field encoded_timestamp of message bandchain.v1.oracle.TMSignature is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.TMSignature")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.TMSignature 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_TMSignature) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.TMSignature.r": + return protoreflect.ValueOfBytes(nil) + case "bandchain.v1.oracle.TMSignature.s": + return protoreflect.ValueOfBytes(nil) + case "bandchain.v1.oracle.TMSignature.v": + return protoreflect.ValueOfUint32(uint32(0)) + case "bandchain.v1.oracle.TMSignature.encoded_timestamp": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.TMSignature")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.TMSignature 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_TMSignature) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.TMSignature", 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_TMSignature) 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_TMSignature) 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_TMSignature) 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_TMSignature) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*TMSignature) + 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.R) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.S) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.V != 0 { + n += 1 + runtime.Sov(uint64(x.V)) + } + l = len(x.EncodedTimestamp) + 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().(*TMSignature) + 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.EncodedTimestamp) > 0 { + i -= len(x.EncodedTimestamp) + copy(dAtA[i:], x.EncodedTimestamp) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EncodedTimestamp))) + i-- + dAtA[i] = 0x22 + } + if x.V != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.V)) + i-- + dAtA[i] = 0x18 + } + if len(x.S) > 0 { + i -= len(x.S) + copy(dAtA[i:], x.S) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.S))) + i-- + dAtA[i] = 0x12 + } + if len(x.R) > 0 { + i -= len(x.R) + copy(dAtA[i:], x.R) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.R))) + 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().(*TMSignature) + 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: TMSignature: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TMSignature: 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 R", 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.R = append(x.R[:0], dAtA[iNdEx:postIndex]...) + if x.R == nil { + x.R = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field S", 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.S = append(x.S[:0], dAtA[iNdEx:postIndex]...) + if x.S == nil { + x.S = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field V", wireType) + } + x.V = 0 + 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++ + x.V |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EncodedTimestamp", 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.EncodedTimestamp = append(x.EncodedTimestamp[:0], dAtA[iNdEx:postIndex]...) + if x.EncodedTimestamp == nil { + x.EncodedTimestamp = []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 _ protoreflect.List = (*_RequestsCountProof_3_list)(nil) + +type _RequestsCountProof_3_list struct { + list *[]*IAVLMerklePath +} + +func (x *_RequestsCountProof_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_RequestsCountProof_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_RequestsCountProof_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*IAVLMerklePath) + (*x.list)[i] = concreteValue +} + +func (x *_RequestsCountProof_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*IAVLMerklePath) + *x.list = append(*x.list, concreteValue) +} + +func (x *_RequestsCountProof_3_list) AppendMutable() protoreflect.Value { + v := new(IAVLMerklePath) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_RequestsCountProof_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_RequestsCountProof_3_list) NewElement() protoreflect.Value { + v := new(IAVLMerklePath) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_RequestsCountProof_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_RequestsCountProof protoreflect.MessageDescriptor + fd_RequestsCountProof_count protoreflect.FieldDescriptor + fd_RequestsCountProof_version protoreflect.FieldDescriptor + fd_RequestsCountProof_merkle_paths protoreflect.FieldDescriptor +) + +func init() { + file_bandchain_v1_oracle_proof_proto_init() + md_RequestsCountProof = File_bandchain_v1_oracle_proof_proto.Messages().ByName("RequestsCountProof") + fd_RequestsCountProof_count = md_RequestsCountProof.Fields().ByName("count") + fd_RequestsCountProof_version = md_RequestsCountProof.Fields().ByName("version") + fd_RequestsCountProof_merkle_paths = md_RequestsCountProof.Fields().ByName("merkle_paths") +} + +var _ protoreflect.Message = (*fastReflection_RequestsCountProof)(nil) + +type fastReflection_RequestsCountProof RequestsCountProof + +func (x *RequestsCountProof) ProtoReflect() protoreflect.Message { + return (*fastReflection_RequestsCountProof)(x) +} + +func (x *RequestsCountProof) slowProtoReflect() protoreflect.Message { + mi := &file_bandchain_v1_oracle_proof_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_RequestsCountProof_messageType fastReflection_RequestsCountProof_messageType +var _ protoreflect.MessageType = fastReflection_RequestsCountProof_messageType{} + +type fastReflection_RequestsCountProof_messageType struct{} + +func (x fastReflection_RequestsCountProof_messageType) Zero() protoreflect.Message { + return (*fastReflection_RequestsCountProof)(nil) +} +func (x fastReflection_RequestsCountProof_messageType) New() protoreflect.Message { + return new(fastReflection_RequestsCountProof) +} +func (x fastReflection_RequestsCountProof_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_RequestsCountProof +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_RequestsCountProof) Descriptor() protoreflect.MessageDescriptor { + return md_RequestsCountProof +} + +// 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_RequestsCountProof) Type() protoreflect.MessageType { + return _fastReflection_RequestsCountProof_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_RequestsCountProof) New() protoreflect.Message { + return new(fastReflection_RequestsCountProof) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_RequestsCountProof) Interface() protoreflect.ProtoMessage { + return (*RequestsCountProof)(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_RequestsCountProof) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Count != uint64(0) { + value := protoreflect.ValueOfUint64(x.Count) + if !f(fd_RequestsCountProof_count, value) { + return + } + } + if x.Version != uint64(0) { + value := protoreflect.ValueOfUint64(x.Version) + if !f(fd_RequestsCountProof_version, value) { + return + } + } + if len(x.MerklePaths) != 0 { + value := protoreflect.ValueOfList(&_RequestsCountProof_3_list{list: &x.MerklePaths}) + if !f(fd_RequestsCountProof_merkle_paths, 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_RequestsCountProof) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "bandchain.v1.oracle.RequestsCountProof.count": + return x.Count != uint64(0) + case "bandchain.v1.oracle.RequestsCountProof.version": + return x.Version != uint64(0) + case "bandchain.v1.oracle.RequestsCountProof.merkle_paths": + return len(x.MerklePaths) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestsCountProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestsCountProof 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_RequestsCountProof) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "bandchain.v1.oracle.RequestsCountProof.count": + x.Count = uint64(0) + case "bandchain.v1.oracle.RequestsCountProof.version": + x.Version = uint64(0) + case "bandchain.v1.oracle.RequestsCountProof.merkle_paths": + x.MerklePaths = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestsCountProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestsCountProof 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_RequestsCountProof) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "bandchain.v1.oracle.RequestsCountProof.count": + value := x.Count + return protoreflect.ValueOfUint64(value) + case "bandchain.v1.oracle.RequestsCountProof.version": + value := x.Version + return protoreflect.ValueOfUint64(value) + case "bandchain.v1.oracle.RequestsCountProof.merkle_paths": + if len(x.MerklePaths) == 0 { + return protoreflect.ValueOfList(&_RequestsCountProof_3_list{}) + } + listValue := &_RequestsCountProof_3_list{list: &x.MerklePaths} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestsCountProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestsCountProof 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_RequestsCountProof) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "bandchain.v1.oracle.RequestsCountProof.count": + x.Count = value.Uint() + case "bandchain.v1.oracle.RequestsCountProof.version": + x.Version = value.Uint() + case "bandchain.v1.oracle.RequestsCountProof.merkle_paths": + lv := value.List() + clv := lv.(*_RequestsCountProof_3_list) + x.MerklePaths = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestsCountProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestsCountProof 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_RequestsCountProof) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.RequestsCountProof.merkle_paths": + if x.MerklePaths == nil { + x.MerklePaths = []*IAVLMerklePath{} + } + value := &_RequestsCountProof_3_list{list: &x.MerklePaths} + return protoreflect.ValueOfList(value) + case "bandchain.v1.oracle.RequestsCountProof.count": + panic(fmt.Errorf("field count of message bandchain.v1.oracle.RequestsCountProof is not mutable")) + case "bandchain.v1.oracle.RequestsCountProof.version": + panic(fmt.Errorf("field version of message bandchain.v1.oracle.RequestsCountProof is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestsCountProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestsCountProof 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_RequestsCountProof) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "bandchain.v1.oracle.RequestsCountProof.count": + return protoreflect.ValueOfUint64(uint64(0)) + case "bandchain.v1.oracle.RequestsCountProof.version": + return protoreflect.ValueOfUint64(uint64(0)) + case "bandchain.v1.oracle.RequestsCountProof.merkle_paths": + list := []*IAVLMerklePath{} + return protoreflect.ValueOfList(&_RequestsCountProof_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: bandchain.v1.oracle.RequestsCountProof")) + } + panic(fmt.Errorf("message bandchain.v1.oracle.RequestsCountProof 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_RequestsCountProof) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in bandchain.v1.oracle.RequestsCountProof", 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_RequestsCountProof) 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_RequestsCountProof) 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_RequestsCountProof) 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_RequestsCountProof) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*RequestsCountProof) + 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.Count != 0 { + n += 1 + runtime.Sov(uint64(x.Count)) + } + if x.Version != 0 { + n += 1 + runtime.Sov(uint64(x.Version)) + } + if len(x.MerklePaths) > 0 { + for _, e := range x.MerklePaths { + 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().(*RequestsCountProof) + 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.MerklePaths) > 0 { + for iNdEx := len(x.MerklePaths) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.MerklePaths[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] = 0x1a + } + } + if x.Version != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Version)) + i-- + dAtA[i] = 0x10 + } + if x.Count != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Count)) + i-- + dAtA[i] = 0x8 + } + 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().(*RequestsCountProof) + 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: RequestsCountProof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RequestsCountProof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + x.Count = 0 + 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++ + x.Count |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + x.Version = 0 + 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++ + x.Version |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MerklePaths", 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.MerklePaths = append(x.MerklePaths, &IAVLMerklePath{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MerklePaths[len(x.MerklePaths)-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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: bandchain/v1/oracle/proof.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ProofRequest is request type for the Service/Proof RPC method. +type ProofRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // RequestID is ID of an oracle request + RequestId uint64 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + // height is block height + Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` +} + +func (x *ProofRequest) Reset() { + *x = ProofRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProofRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProofRequest) ProtoMessage() {} + +// Deprecated: Use ProofRequest.ProtoReflect.Descriptor instead. +func (*ProofRequest) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{0} +} + +func (x *ProofRequest) GetRequestId() uint64 { + if x != nil { + return x.RequestId + } + return 0 +} + +func (x *ProofRequest) GetHeight() int64 { + if x != nil { + return x.Height + } + return 0 +} + +// ProofResponse is response type for the Service/Proof RPC method. +type ProofResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // height is block height + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + // result is the proof + Result *SingleProofResult `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"` +} + +func (x *ProofResponse) Reset() { + *x = ProofResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProofResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProofResponse) ProtoMessage() {} + +// Deprecated: Use ProofResponse.ProtoReflect.Descriptor instead. +func (*ProofResponse) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{1} +} + +func (x *ProofResponse) GetHeight() int64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *ProofResponse) GetResult() *SingleProofResult { + if x != nil { + return x.Result + } + return nil +} + +// MultiProofRequest is request type for the Service/MultiProof RPC method. +type MultiProofRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // request_ids is the list of request IDs + RequestIds []uint64 `protobuf:"varint,1,rep,packed,name=request_ids,json=requestIds,proto3" json:"request_ids,omitempty"` +} + +func (x *MultiProofRequest) Reset() { + *x = MultiProofRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MultiProofRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MultiProofRequest) ProtoMessage() {} + +// Deprecated: Use MultiProofRequest.ProtoReflect.Descriptor instead. +func (*MultiProofRequest) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{2} +} + +func (x *MultiProofRequest) GetRequestIds() []uint64 { + if x != nil { + return x.RequestIds + } + return nil +} + +// MultiProofResponse is response type for the Service/MultiProof RPC method. +type MultiProofResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Result *MultiProofResult `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"` +} + +func (x *MultiProofResponse) Reset() { + *x = MultiProofResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MultiProofResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MultiProofResponse) ProtoMessage() {} + +// Deprecated: Use MultiProofResponse.ProtoReflect.Descriptor instead. +func (*MultiProofResponse) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{3} +} + +func (x *MultiProofResponse) GetHeight() int64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *MultiProofResponse) GetResult() *MultiProofResult { + if x != nil { + return x.Result + } + return nil +} + +// RequestCountProofRequest is request type for the Service/RequestCountProof RPC method. +type RequestCountProofRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RequestCountProofRequest) Reset() { + *x = RequestCountProofRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RequestCountProofRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestCountProofRequest) ProtoMessage() {} + +// Deprecated: Use RequestCountProofRequest.ProtoReflect.Descriptor instead. +func (*RequestCountProofRequest) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{4} +} + +// RequestCountProofResponse is response type for the Service/RequestCountProof RPC method. +type RequestCountProofResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Result *CountProofResult `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"` +} + +func (x *RequestCountProofResponse) Reset() { + *x = RequestCountProofResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RequestCountProofResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestCountProofResponse) ProtoMessage() {} + +// Deprecated: Use RequestCountProofResponse.ProtoReflect.Descriptor instead. +func (*RequestCountProofResponse) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{5} +} + +func (x *RequestCountProofResponse) GetHeight() int64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *RequestCountProofResponse) GetResult() *CountProofResult { + if x != nil { + return x.Result + } + return nil +} + +// SingleProofResponse is the data structure for response of single proof +type SingleProofResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Proof *SingleProof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"` + EvmProofBytes []byte `protobuf:"bytes,2,opt,name=evm_proof_bytes,json=evmProofBytes,proto3" json:"evm_proof_bytes,omitempty"` +} + +func (x *SingleProofResult) Reset() { + *x = SingleProofResult{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SingleProofResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SingleProofResult) ProtoMessage() {} + +// Deprecated: Use SingleProofResult.ProtoReflect.Descriptor instead. +func (*SingleProofResult) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{6} +} + +func (x *SingleProofResult) GetProof() *SingleProof { + if x != nil { + return x.Proof + } + return nil +} + +func (x *SingleProofResult) GetEvmProofBytes() []byte { + if x != nil { + return x.EvmProofBytes + } + return nil +} + +// MultiProofResult is the data structure for response of multi proof +type MultiProofResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Proof *MultiProof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"` + EvmProofBytes []byte `protobuf:"bytes,2,opt,name=evm_proof_bytes,json=evmProofBytes,proto3" json:"evm_proof_bytes,omitempty"` +} + +func (x *MultiProofResult) Reset() { + *x = MultiProofResult{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MultiProofResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MultiProofResult) ProtoMessage() {} + +// Deprecated: Use MultiProofResult.ProtoReflect.Descriptor instead. +func (*MultiProofResult) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{7} +} + +func (x *MultiProofResult) GetProof() *MultiProof { + if x != nil { + return x.Proof + } + return nil +} + +func (x *MultiProofResult) GetEvmProofBytes() []byte { + if x != nil { + return x.EvmProofBytes + } + return nil +} + +// CountProofResult is the data structure for response of count proof +type CountProofResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Proof *CountProof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"` + EvmProofBytes []byte `protobuf:"bytes,2,opt,name=evm_proof_bytes,json=evmProofBytes,proto3" json:"evm_proof_bytes,omitempty"` +} + +func (x *CountProofResult) Reset() { + *x = CountProofResult{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountProofResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountProofResult) ProtoMessage() {} + +// Deprecated: Use CountProofResult.ProtoReflect.Descriptor instead. +func (*CountProofResult) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{8} +} + +func (x *CountProofResult) GetProof() *CountProof { + if x != nil { + return x.Proof + } + return nil +} + +func (x *CountProofResult) GetEvmProofBytes() []byte { + if x != nil { + return x.EvmProofBytes + } + return nil +} + +// SingleProof contains block height, oracle data proof and block relay proof +type SingleProof struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + OracleDataProof *OracleDataProof `protobuf:"bytes,2,opt,name=oracle_data_proof,json=oracleDataProof,proto3" json:"oracle_data_proof,omitempty"` + BlockRelayProof *BlockRelayProof `protobuf:"bytes,3,opt,name=block_relay_proof,json=blockRelayProof,proto3" json:"block_relay_proof,omitempty"` +} + +func (x *SingleProof) Reset() { + *x = SingleProof{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SingleProof) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SingleProof) ProtoMessage() {} + +// Deprecated: Use SingleProof.ProtoReflect.Descriptor instead. +func (*SingleProof) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{9} +} + +func (x *SingleProof) GetBlockHeight() uint64 { + if x != nil { + return x.BlockHeight + } + return 0 +} + +func (x *SingleProof) GetOracleDataProof() *OracleDataProof { + if x != nil { + return x.OracleDataProof + } + return nil +} + +func (x *SingleProof) GetBlockRelayProof() *BlockRelayProof { + if x != nil { + return x.BlockRelayProof + } + return nil +} + +// MultiProof contains block height, list of oracle data proof and block relay proof +type MultiProof struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + OracleDataMultiProof []*OracleDataProof `protobuf:"bytes,2,rep,name=oracle_data_multi_proof,json=oracleDataMultiProof,proto3" json:"oracle_data_multi_proof,omitempty"` + BlockRelayProof *BlockRelayProof `protobuf:"bytes,3,opt,name=block_relay_proof,json=blockRelayProof,proto3" json:"block_relay_proof,omitempty"` +} + +func (x *MultiProof) Reset() { + *x = MultiProof{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MultiProof) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MultiProof) ProtoMessage() {} + +// Deprecated: Use MultiProof.ProtoReflect.Descriptor instead. +func (*MultiProof) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{10} +} + +func (x *MultiProof) GetBlockHeight() uint64 { + if x != nil { + return x.BlockHeight + } + return 0 +} + +func (x *MultiProof) GetOracleDataMultiProof() []*OracleDataProof { + if x != nil { + return x.OracleDataMultiProof + } + return nil +} + +func (x *MultiProof) GetBlockRelayProof() *BlockRelayProof { + if x != nil { + return x.BlockRelayProof + } + return nil +} + +// CountProof contains block height, count proof and block relay proof +type CountProof struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + CountProof *RequestsCountProof `protobuf:"bytes,2,opt,name=count_proof,json=countProof,proto3" json:"count_proof,omitempty"` + BlockRelayProof *BlockRelayProof `protobuf:"bytes,3,opt,name=block_relay_proof,json=blockRelayProof,proto3" json:"block_relay_proof,omitempty"` +} + +func (x *CountProof) Reset() { + *x = CountProof{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountProof) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountProof) ProtoMessage() {} + +// Deprecated: Use CountProof.ProtoReflect.Descriptor instead. +func (*CountProof) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{11} +} + +func (x *CountProof) GetBlockHeight() uint64 { + if x != nil { + return x.BlockHeight + } + return 0 +} + +func (x *CountProof) GetCountProof() *RequestsCountProof { + if x != nil { + return x.CountProof + } + return nil +} + +func (x *CountProof) GetBlockRelayProof() *BlockRelayProof { + if x != nil { + return x.BlockRelayProof + } + return nil +} + +// OracleDataProof contains result, version and merkle paths +type OracleDataProof struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Result *v1.Result `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` + Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + MerklePaths []*IAVLMerklePath `protobuf:"bytes,3,rep,name=merkle_paths,json=merklePaths,proto3" json:"merkle_paths,omitempty"` +} + +func (x *OracleDataProof) Reset() { + *x = OracleDataProof{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OracleDataProof) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OracleDataProof) ProtoMessage() {} + +// Deprecated: Use OracleDataProof.ProtoReflect.Descriptor instead. +func (*OracleDataProof) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{12} +} + +func (x *OracleDataProof) GetResult() *v1.Result { + if x != nil { + return x.Result + } + return nil +} + +func (x *OracleDataProof) GetVersion() uint64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *OracleDataProof) GetMerklePaths() []*IAVLMerklePath { + if x != nil { + return x.MerklePaths + } + return nil +} + +// IAVLMerklePath represents a Merkle step to a leaf data node in an iAVL tree. +type IAVLMerklePath struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsDataOnRight bool `protobuf:"varint,1,opt,name=is_data_on_right,json=isDataOnRight,proto3" json:"is_data_on_right,omitempty"` + SubtreeHeight uint32 `protobuf:"varint,2,opt,name=subtree_height,json=subtreeHeight,proto3" json:"subtree_height,omitempty"` + SubtreeSize uint64 `protobuf:"varint,3,opt,name=subtree_size,json=subtreeSize,proto3" json:"subtree_size,omitempty"` + SubtreeVersion uint64 `protobuf:"varint,4,opt,name=subtree_version,json=subtreeVersion,proto3" json:"subtree_version,omitempty"` + SiblingHash []byte `protobuf:"bytes,5,opt,name=sibling_hash,json=siblingHash,proto3" json:"sibling_hash,omitempty"` +} + +func (x *IAVLMerklePath) Reset() { + *x = IAVLMerklePath{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IAVLMerklePath) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IAVLMerklePath) ProtoMessage() {} + +// Deprecated: Use IAVLMerklePath.ProtoReflect.Descriptor instead. +func (*IAVLMerklePath) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{13} +} + +func (x *IAVLMerklePath) GetIsDataOnRight() bool { + if x != nil { + return x.IsDataOnRight + } + return false +} + +func (x *IAVLMerklePath) GetSubtreeHeight() uint32 { + if x != nil { + return x.SubtreeHeight + } + return 0 +} + +func (x *IAVLMerklePath) GetSubtreeSize() uint64 { + if x != nil { + return x.SubtreeSize + } + return 0 +} + +func (x *IAVLMerklePath) GetSubtreeVersion() uint64 { + if x != nil { + return x.SubtreeVersion + } + return 0 +} + +func (x *IAVLMerklePath) GetSiblingHash() []byte { + if x != nil { + return x.SiblingHash + } + return nil +} + +// BlockRelayProof contains multi store proof, block header merkle parts, common encoded part and signatures +type BlockRelayProof struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MultiStoreProof *MultiStoreProof `protobuf:"bytes,1,opt,name=multi_store_proof,json=multiStoreProof,proto3" json:"multi_store_proof,omitempty"` + BlockHeaderMerkleParts *BlockHeaderMerkleParts `protobuf:"bytes,2,opt,name=block_header_merkle_parts,json=blockHeaderMerkleParts,proto3" json:"block_header_merkle_parts,omitempty"` + CommonEncodedVotePart *CommonEncodedVotePart `protobuf:"bytes,3,opt,name=common_encoded_vote_part,json=commonEncodedVotePart,proto3" json:"common_encoded_vote_part,omitempty"` + Signatures []*TMSignature `protobuf:"bytes,4,rep,name=signatures,proto3" json:"signatures,omitempty"` +} + +func (x *BlockRelayProof) Reset() { + *x = BlockRelayProof{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockRelayProof) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockRelayProof) ProtoMessage() {} + +// Deprecated: Use BlockRelayProof.ProtoReflect.Descriptor instead. +func (*BlockRelayProof) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{14} +} + +func (x *BlockRelayProof) GetMultiStoreProof() *MultiStoreProof { + if x != nil { + return x.MultiStoreProof + } + return nil +} + +func (x *BlockRelayProof) GetBlockHeaderMerkleParts() *BlockHeaderMerkleParts { + if x != nil { + return x.BlockHeaderMerkleParts + } + return nil +} + +func (x *BlockRelayProof) GetCommonEncodedVotePart() *CommonEncodedVotePart { + if x != nil { + return x.CommonEncodedVotePart + } + return nil +} + +func (x *BlockRelayProof) GetSignatures() []*TMSignature { + if x != nil { + return x.Signatures + } + return nil +} + +// MultiStoreProof stores a compact of other Cosmos-SDK modules' storage hash in multistore to +// compute (in combination with oracle store hash) Tendermint's application state hash at a given block. +// +// ____________________[AppHash]____________________ +// / \ +// ___________[N19]____________ ______[N20]_______ +// / \ / \ +// _____[N15]_____ ____[N16]______ __[N17]__ __[N18]__ +// / \ / \ / \ / \ +// __[N8]_ __[N9]_ _[N10]_ _[N11]_ [N12] [N13] [K] [L] +// / \ / \ / \ / \ / \ / \ +// [N0] [N1] [N2] [N3] [N4] [N5] [N6] [N7] [G] [H] [I] [J] +// / \ / \ / \ / \ / \ / \ / \ / \ +// [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [A] [B] [C] [D] [E] [F] +// +// [0] - acc (auth) [1] - authz [2] - bank [3] - capability [4] - consensus [5] - crisis +// [6] - dist [7] - evidence [8] - feegrant [9] - feeibc [A] - globalfee [B] - gov +// [C] - group [D] - ibccore [E] - icahost [F] - mint [G] - oracle [H] - params +// [I] - slashing [J] - staking [K] - transfer [L] - upgrade +// +// Notice that NOT all leaves of the Merkle tree are needed in order to compute the Merkle +// root hash, since we only want to validate the correctness of [F] In fact, only +// [E], [N6], [N10], [N15], and [N20] are needed in order to compute [AppHash]. +type MultiStoreProof struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OracleIavlStateHash []byte `protobuf:"bytes,1,opt,name=oracle_iavl_state_hash,json=oracleIavlStateHash,proto3" json:"oracle_iavl_state_hash,omitempty"` + ParamsStoreMerkleHash []byte `protobuf:"bytes,2,opt,name=params_store_merkle_hash,json=paramsStoreMerkleHash,proto3" json:"params_store_merkle_hash,omitempty"` + SlashingToStakingStoresMerkleHash []byte `protobuf:"bytes,3,opt,name=slashing_to_staking_stores_merkle_hash,json=slashingToStakingStoresMerkleHash,proto3" json:"slashing_to_staking_stores_merkle_hash,omitempty"` + TransferToUpgradeStoresMerkleHash []byte `protobuf:"bytes,4,opt,name=transfer_to_upgrade_stores_merkle_hash,json=transferToUpgradeStoresMerkleHash,proto3" json:"transfer_to_upgrade_stores_merkle_hash,omitempty"` + AuthToMintStoresMerkleHash []byte `protobuf:"bytes,5,opt,name=auth_to_mint_stores_merkle_hash,json=authToMintStoresMerkleHash,proto3" json:"auth_to_mint_stores_merkle_hash,omitempty"` +} + +func (x *MultiStoreProof) Reset() { + *x = MultiStoreProof{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MultiStoreProof) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MultiStoreProof) ProtoMessage() {} + +// Deprecated: Use MultiStoreProof.ProtoReflect.Descriptor instead. +func (*MultiStoreProof) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{15} +} + +func (x *MultiStoreProof) GetOracleIavlStateHash() []byte { + if x != nil { + return x.OracleIavlStateHash + } + return nil +} + +func (x *MultiStoreProof) GetParamsStoreMerkleHash() []byte { + if x != nil { + return x.ParamsStoreMerkleHash + } + return nil +} + +func (x *MultiStoreProof) GetSlashingToStakingStoresMerkleHash() []byte { + if x != nil { + return x.SlashingToStakingStoresMerkleHash + } + return nil +} + +func (x *MultiStoreProof) GetTransferToUpgradeStoresMerkleHash() []byte { + if x != nil { + return x.TransferToUpgradeStoresMerkleHash + } + return nil +} + +func (x *MultiStoreProof) GetAuthToMintStoresMerkleHash() []byte { + if x != nil { + return x.AuthToMintStoresMerkleHash + } + return nil +} + +// BlockHeaderMerkleParts stores a group of hashes using for computing Tendermint's block +// header hash from app hash, and height. +// +// In Tendermint, a block header hash is the Merkle hash of a binary tree with 14 leaf nodes. +// Each node encodes a data piece of the blockchain. The notable data leaves are: [A] app_hash, +// [2] height. All data pieces are combined into one 32-byte hash to be signed +// by block validators. The structure of the Merkle tree is shown below. +// +// [BlockHeader] +// / \ +// [3A] [3B] +// / \ / \ +// [2A] [2B] [2C] [2D] +// / \ / \ / \ / \ +// [1A] [1B] [1C] [1D] [1E] [1F] [C] [D] +// / \ / \ / \ / \ / \ / \ +// [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [A] [B] +// +// [0] - version [1] - chain_id [2] - height [3] - time +// [4] - last_block_id [5] - last_commit_hash [6] - data_hash [7] - validators_hash +// [8] - next_validators_hash [9] - consensus_hash [A] - app_hash [B] - last_results_hash +// [C] - evidence_hash [D] - proposer_address +// +// Notice that NOT all leaves of the Merkle tree are needed in order to compute the Merkle +// root hash, since we only want to validate the correctness of [2], [3], and [A]. In fact, only +// [1A], [2B], [1E], [B], and [2D] are needed in order to compute [BlockHeader]. +type BlockHeaderMerkleParts struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + VersionAndChainIdHash []byte `protobuf:"bytes,1,opt,name=version_and_chain_id_hash,json=versionAndChainIdHash,proto3" json:"version_and_chain_id_hash,omitempty"` + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + TimeSecond uint64 `protobuf:"varint,3,opt,name=time_second,json=timeSecond,proto3" json:"time_second,omitempty"` + TimeNanoSecond uint32 `protobuf:"varint,4,opt,name=time_nano_second,json=timeNanoSecond,proto3" json:"time_nano_second,omitempty"` + LastBlockIdAndOther []byte `protobuf:"bytes,5,opt,name=last_block_id_and_other,json=lastBlockIdAndOther,proto3" json:"last_block_id_and_other,omitempty"` + NextValidatorHashAndConsensusHash []byte `protobuf:"bytes,6,opt,name=next_validator_hash_and_consensus_hash,json=nextValidatorHashAndConsensusHash,proto3" json:"next_validator_hash_and_consensus_hash,omitempty"` + LastResultsHash []byte `protobuf:"bytes,7,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` + EvidenceAndProposerHash []byte `protobuf:"bytes,8,opt,name=evidence_and_proposer_hash,json=evidenceAndProposerHash,proto3" json:"evidence_and_proposer_hash,omitempty"` +} + +func (x *BlockHeaderMerkleParts) Reset() { + *x = BlockHeaderMerkleParts{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockHeaderMerkleParts) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockHeaderMerkleParts) ProtoMessage() {} + +// Deprecated: Use BlockHeaderMerkleParts.ProtoReflect.Descriptor instead. +func (*BlockHeaderMerkleParts) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{16} +} + +func (x *BlockHeaderMerkleParts) GetVersionAndChainIdHash() []byte { + if x != nil { + return x.VersionAndChainIdHash + } + return nil +} + +func (x *BlockHeaderMerkleParts) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *BlockHeaderMerkleParts) GetTimeSecond() uint64 { + if x != nil { + return x.TimeSecond + } + return 0 +} + +func (x *BlockHeaderMerkleParts) GetTimeNanoSecond() uint32 { + if x != nil { + return x.TimeNanoSecond + } + return 0 +} + +func (x *BlockHeaderMerkleParts) GetLastBlockIdAndOther() []byte { + if x != nil { + return x.LastBlockIdAndOther + } + return nil +} + +func (x *BlockHeaderMerkleParts) GetNextValidatorHashAndConsensusHash() []byte { + if x != nil { + return x.NextValidatorHashAndConsensusHash + } + return nil +} + +func (x *BlockHeaderMerkleParts) GetLastResultsHash() []byte { + if x != nil { + return x.LastResultsHash + } + return nil +} + +func (x *BlockHeaderMerkleParts) GetEvidenceAndProposerHash() []byte { + if x != nil { + return x.EvidenceAndProposerHash + } + return nil +} + +// CommonEncodedVotePart represents the common part of encoded vote +type CommonEncodedVotePart struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SignedDataPrefix []byte `protobuf:"bytes,1,opt,name=signed_data_prefix,json=signedDataPrefix,proto3" json:"signed_data_prefix,omitempty"` + SignedDataSuffix []byte `protobuf:"bytes,2,opt,name=signed_data_suffix,json=signedDataSuffix,proto3" json:"signed_data_suffix,omitempty"` +} + +func (x *CommonEncodedVotePart) Reset() { + *x = CommonEncodedVotePart{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommonEncodedVotePart) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommonEncodedVotePart) ProtoMessage() {} + +// Deprecated: Use CommonEncodedVotePart.ProtoReflect.Descriptor instead. +func (*CommonEncodedVotePart) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{17} +} + +func (x *CommonEncodedVotePart) GetSignedDataPrefix() []byte { + if x != nil { + return x.SignedDataPrefix + } + return nil +} + +func (x *CommonEncodedVotePart) GetSignedDataSuffix() []byte { + if x != nil { + return x.SignedDataSuffix + } + return nil +} + +// TMSignature contains all details of validator signature for performing signer recovery for ECDSA +// secp256k1 signature. Note that this struct is written specifically for signature signed on +// Tendermint's precommit data, which includes the block hash and some additional information prepended +// and appended to the block hash. The prepended part (prefix) and the appended part (suffix) are +// different for each signer (including signature size, machine clock, validator index, etc). +type TMSignature struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + R []byte `protobuf:"bytes,1,opt,name=r,proto3" json:"r,omitempty"` + S []byte `protobuf:"bytes,2,opt,name=s,proto3" json:"s,omitempty"` + V uint32 `protobuf:"varint,3,opt,name=v,proto3" json:"v,omitempty"` + EncodedTimestamp []byte `protobuf:"bytes,4,opt,name=encoded_timestamp,json=encodedTimestamp,proto3" json:"encoded_timestamp,omitempty"` +} + +func (x *TMSignature) Reset() { + *x = TMSignature{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TMSignature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TMSignature) ProtoMessage() {} + +// Deprecated: Use TMSignature.ProtoReflect.Descriptor instead. +func (*TMSignature) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{18} +} + +func (x *TMSignature) GetR() []byte { + if x != nil { + return x.R + } + return nil +} + +func (x *TMSignature) GetS() []byte { + if x != nil { + return x.S + } + return nil +} + +func (x *TMSignature) GetV() uint32 { + if x != nil { + return x.V + } + return 0 +} + +func (x *TMSignature) GetEncodedTimestamp() []byte { + if x != nil { + return x.EncodedTimestamp + } + return nil +} + +// RequestsCountProof contains count, version and merkle paths +type RequestsCountProof struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count uint64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + MerklePaths []*IAVLMerklePath `protobuf:"bytes,3,rep,name=merkle_paths,json=merklePaths,proto3" json:"merkle_paths,omitempty"` +} + +func (x *RequestsCountProof) Reset() { + *x = RequestsCountProof{} + if protoimpl.UnsafeEnabled { + mi := &file_bandchain_v1_oracle_proof_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RequestsCountProof) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestsCountProof) ProtoMessage() {} + +// Deprecated: Use RequestsCountProof.ProtoReflect.Descriptor instead. +func (*RequestsCountProof) Descriptor() ([]byte, []int) { + return file_bandchain_v1_oracle_proof_proto_rawDescGZIP(), []int{19} +} + +func (x *RequestsCountProof) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *RequestsCountProof) GetVersion() uint64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *RequestsCountProof) GetMerklePaths() []*IAVLMerklePath { + if x != nil { + return x.MerklePaths + } + return nil +} + +var File_bandchain_v1_oracle_proof_proto protoreflect.FileDescriptor + +var file_bandchain_v1_oracle_proof_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x13, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x6f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x45, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x6d, 0x0a, 0x0d, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x12, 0x44, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, + 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x34, 0x0a, 0x11, 0x4d, 0x75, 0x6c, 0x74, + 0x69, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, + 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x04, 0x52, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x73, 0x22, 0x71, + 0x0a, 0x12, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x43, 0x0a, 0x06, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, + 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x22, 0x1a, 0x0a, 0x18, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x78, 0x0a, + 0x19, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x12, 0x43, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, + 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xaf, 0x01, 0x0a, 0x11, 0x53, 0x69, 0x6e, 0x67, + 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3c, 0x0a, + 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62, + 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x5c, 0x0a, 0x0f, 0x65, + 0x76, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, 0xde, 0x1f, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, + 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x0d, 0x65, 0x76, 0x6d, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xad, 0x01, 0x0a, 0x10, 0x4d, 0x75, + 0x6c, 0x74, 0x69, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3b, + 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x5c, 0x0a, 0x0f, 0x65, + 0x76, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, 0xde, 0x1f, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, + 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x0d, 0x65, 0x76, 0x6d, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xad, 0x01, 0x0a, 0x10, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3b, + 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x5c, 0x0a, 0x0f, 0x65, + 0x76, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, 0xde, 0x1f, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, + 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x0d, 0x65, 0x76, 0x6d, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xe0, 0x01, 0x0a, 0x0b, 0x53, 0x69, + 0x6e, 0x67, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x56, 0x0a, 0x11, + 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x4f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x0f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x56, 0x0a, 0x11, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x65, + 0x6c, 0x61, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x61, 0x79, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0xea, 0x01, 0x0a, + 0x0a, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x21, 0x0a, 0x0c, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x61, + 0x0a, 0x17, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6d, 0x75, + 0x6c, 0x74, 0x69, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x14, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x12, 0x56, 0x0a, 0x11, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, + 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x62, + 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, + 0x65, 0x6c, 0x61, 0x79, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0xd7, 0x01, 0x0a, 0x0a, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x4e, 0x0a, 0x0b, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, + 0x0a, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x56, 0x0a, 0x11, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x22, 0xaa, 0x01, 0x0a, 0x0f, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x44, 0x61, + 0x74, 0x61, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2f, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, + 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x4c, 0x0a, 0x0c, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, + 0x68, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x49, + 0x41, 0x56, 0x4c, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x0b, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x73, + 0x22, 0x85, 0x02, 0x0a, 0x0e, 0x49, 0x41, 0x56, 0x4c, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, + 0x61, 0x74, 0x68, 0x12, 0x27, 0x0a, 0x10, 0x69, 0x73, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6f, + 0x6e, 0x5f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, + 0x73, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x6e, 0x52, 0x69, 0x67, 0x68, 0x74, 0x12, 0x25, 0x0a, 0x0e, + 0x73, 0x75, 0x62, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x73, 0x75, 0x62, 0x74, 0x72, 0x65, 0x65, 0x48, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x75, 0x62, 0x74, 0x72, + 0x65, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x74, 0x72, 0x65, + 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0e, 0x73, 0x75, 0x62, 0x74, 0x72, 0x65, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x57, 0x0a, 0x0c, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, 0xde, 0x1f, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, + 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x0b, 0x73, 0x69, 0x62, + 0x6c, 0x69, 0x6e, 0x67, 0x48, 0x61, 0x73, 0x68, 0x22, 0x8a, 0x03, 0x0a, 0x0f, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x56, 0x0a, 0x11, + 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x4d, 0x75, + 0x6c, 0x74, 0x69, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x0f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x6c, 0x0a, 0x19, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x74, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, + 0x61, 0x72, 0x74, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x16, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x61, 0x72, + 0x74, 0x73, 0x12, 0x69, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x64, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x50, 0x61, 0x72, 0x74, + 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x45, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x46, 0x0a, + 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x54, 0x4d, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x92, 0x05, 0x0a, 0x0f, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x80, 0x01, 0x0a, 0x16, 0x6f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x69, 0x61, 0x76, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x4b, 0xe2, 0xde, 0x1f, 0x13, + 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x49, 0x41, 0x56, 0x4c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x48, + 0x61, 0x73, 0x68, 0xfa, 0xde, 0x1f, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, + 0x62, 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x48, + 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x13, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x49, + 0x61, 0x76, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x6d, 0x0a, 0x18, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6d, 0x65, 0x72, + 0x6b, 0x6c, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, + 0xfa, 0xde, 0x1f, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, + 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x52, 0x15, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x87, 0x01, 0x0a, 0x26, + 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x5f, 0x6d, 0x65, 0x72, 0x6b, 0x6c, + 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, 0xde, + 0x1f, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, + 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x6c, + 0x69, 0x62, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x52, 0x21, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x53, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x4d, 0x65, 0x72, 0x6b, 0x6c, + 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x87, 0x01, 0x0a, 0x26, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x5f, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x73, 0x5f, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, 0xde, 0x1f, 0x30, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, + 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x21, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x54, 0x6f, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x73, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, + 0x79, 0x0a, 0x1f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x74, 0x6f, 0x5f, 0x6d, 0x69, 0x6e, 0x74, 0x5f, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x5f, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, 0xde, 0x1f, 0x30, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, + 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x1a, + 0x61, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x4d, 0x69, 0x6e, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x73, + 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, 0x22, 0xb6, 0x05, 0x0a, 0x16, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, + 0x50, 0x61, 0x72, 0x74, 0x73, 0x12, 0x6e, 0x0a, 0x19, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, 0xde, 0x1f, 0x30, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, + 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x15, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, + 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1f, 0x0a, + 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x12, 0x28, + 0x0a, 0x10, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x5f, 0x73, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x4e, 0x61, + 0x6e, 0x6f, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x12, 0x6a, 0x0a, 0x17, 0x6c, 0x61, 0x73, 0x74, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x6f, 0x74, + 0x68, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, 0xde, 0x1f, 0x30, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, + 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, + 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, + 0x13, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x41, 0x6e, 0x64, 0x4f, + 0x74, 0x68, 0x65, 0x72, 0x12, 0x87, 0x01, 0x0a, 0x26, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x61, 0x6e, 0x64, + 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, 0xde, 0x1f, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, + 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x21, 0x6e, 0x65, 0x78, + 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x61, 0x73, 0x68, 0x41, 0x6e, + 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x60, + 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, 0xde, 0x1f, 0x30, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, + 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, + 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, + 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x71, 0x0a, 0x1a, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x61, 0x6e, 0x64, + 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, 0xde, 0x1f, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, + 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x17, 0x65, 0x76, 0x69, 0x64, + 0x65, 0x6e, 0x63, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x48, + 0x61, 0x73, 0x68, 0x22, 0xdf, 0x01, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x45, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x62, 0x0a, + 0x12, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x65, + 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, 0xde, 0x1f, 0x30, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, + 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, + 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, + 0x10, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x12, 0x62, 0x0a, 0x12, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, + 0x5f, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, + 0xde, 0x1f, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, + 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, + 0x6c, 0x69, 0x62, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x52, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x53, + 0x75, 0x66, 0x66, 0x69, 0x78, 0x22, 0x86, 0x02, 0x0a, 0x0b, 0x54, 0x4d, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x42, 0x0a, 0x01, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x34, 0xfa, 0xde, 0x1f, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, + 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x48, 0x65, + 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x01, 0x72, 0x12, 0x42, 0x0a, 0x01, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, 0xde, 0x1f, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, + 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x01, 0x73, 0x12, 0x0c, 0x0a, + 0x01, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x01, 0x76, 0x12, 0x61, 0x0a, 0x11, 0x65, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x34, 0xfa, 0xde, 0x1f, 0x30, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, + 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x2e, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x10, 0x65, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x92, + 0x01, 0x0a, 0x12, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x4c, 0x0a, 0x0c, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x5f, + 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x61, + 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0x2e, 0x49, 0x41, 0x56, 0x4c, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, + 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0b, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x61, + 0x74, 0x68, 0x73, 0x32, 0xbc, 0x03, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x7f, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x21, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x62, 0x61, + 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x2f, 0x7b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x7d, + 0x12, 0x87, 0x01, 0x0a, 0x0a, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, + 0x26, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x4d, 0x75, + 0x6c, 0x74, 0x69, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x6d, + 0x75, 0x6c, 0x74, 0x69, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0xa5, 0x01, 0x0a, 0x11, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x12, 0x2d, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2e, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x6f, + 0x6f, 0x66, 0x42, 0xcd, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x42, 0x0a, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x38, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, + 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0xa2, 0x02, 0x03, 0x42, 0x56, 0x4f, 0xaa, 0x02, 0x13, 0x42, + 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x56, 0x31, 0x2e, 0x4f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0xca, 0x02, 0x13, 0x42, 0x61, 0x6e, 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x56, + 0x31, 0x5c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0xe2, 0x02, 0x1f, 0x42, 0x61, 0x6e, 0x64, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x42, 0x61, 0x6e, + 0x64, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x3a, 0x3a, 0x4f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_bandchain_v1_oracle_proof_proto_rawDescOnce sync.Once + file_bandchain_v1_oracle_proof_proto_rawDescData = file_bandchain_v1_oracle_proof_proto_rawDesc +) + +func file_bandchain_v1_oracle_proof_proto_rawDescGZIP() []byte { + file_bandchain_v1_oracle_proof_proto_rawDescOnce.Do(func() { + file_bandchain_v1_oracle_proof_proto_rawDescData = protoimpl.X.CompressGZIP(file_bandchain_v1_oracle_proof_proto_rawDescData) + }) + return file_bandchain_v1_oracle_proof_proto_rawDescData +} + +var file_bandchain_v1_oracle_proof_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_bandchain_v1_oracle_proof_proto_goTypes = []interface{}{ + (*ProofRequest)(nil), // 0: bandchain.v1.oracle.ProofRequest + (*ProofResponse)(nil), // 1: bandchain.v1.oracle.ProofResponse + (*MultiProofRequest)(nil), // 2: bandchain.v1.oracle.MultiProofRequest + (*MultiProofResponse)(nil), // 3: bandchain.v1.oracle.MultiProofResponse + (*RequestCountProofRequest)(nil), // 4: bandchain.v1.oracle.RequestCountProofRequest + (*RequestCountProofResponse)(nil), // 5: bandchain.v1.oracle.RequestCountProofResponse + (*SingleProofResult)(nil), // 6: bandchain.v1.oracle.SingleProofResult + (*MultiProofResult)(nil), // 7: bandchain.v1.oracle.MultiProofResult + (*CountProofResult)(nil), // 8: bandchain.v1.oracle.CountProofResult + (*SingleProof)(nil), // 9: bandchain.v1.oracle.SingleProof + (*MultiProof)(nil), // 10: bandchain.v1.oracle.MultiProof + (*CountProof)(nil), // 11: bandchain.v1.oracle.CountProof + (*OracleDataProof)(nil), // 12: bandchain.v1.oracle.OracleDataProof + (*IAVLMerklePath)(nil), // 13: bandchain.v1.oracle.IAVLMerklePath + (*BlockRelayProof)(nil), // 14: bandchain.v1.oracle.BlockRelayProof + (*MultiStoreProof)(nil), // 15: bandchain.v1.oracle.MultiStoreProof + (*BlockHeaderMerkleParts)(nil), // 16: bandchain.v1.oracle.BlockHeaderMerkleParts + (*CommonEncodedVotePart)(nil), // 17: bandchain.v1.oracle.CommonEncodedVotePart + (*TMSignature)(nil), // 18: bandchain.v1.oracle.TMSignature + (*RequestsCountProof)(nil), // 19: bandchain.v1.oracle.RequestsCountProof + (*v1.Result)(nil), // 20: oracle.v1.Result +} +var file_bandchain_v1_oracle_proof_proto_depIdxs = []int32{ + 6, // 0: bandchain.v1.oracle.ProofResponse.result:type_name -> bandchain.v1.oracle.SingleProofResult + 7, // 1: bandchain.v1.oracle.MultiProofResponse.result:type_name -> bandchain.v1.oracle.MultiProofResult + 8, // 2: bandchain.v1.oracle.RequestCountProofResponse.result:type_name -> bandchain.v1.oracle.CountProofResult + 9, // 3: bandchain.v1.oracle.SingleProofResult.proof:type_name -> bandchain.v1.oracle.SingleProof + 10, // 4: bandchain.v1.oracle.MultiProofResult.proof:type_name -> bandchain.v1.oracle.MultiProof + 11, // 5: bandchain.v1.oracle.CountProofResult.proof:type_name -> bandchain.v1.oracle.CountProof + 12, // 6: bandchain.v1.oracle.SingleProof.oracle_data_proof:type_name -> bandchain.v1.oracle.OracleDataProof + 14, // 7: bandchain.v1.oracle.SingleProof.block_relay_proof:type_name -> bandchain.v1.oracle.BlockRelayProof + 12, // 8: bandchain.v1.oracle.MultiProof.oracle_data_multi_proof:type_name -> bandchain.v1.oracle.OracleDataProof + 14, // 9: bandchain.v1.oracle.MultiProof.block_relay_proof:type_name -> bandchain.v1.oracle.BlockRelayProof + 19, // 10: bandchain.v1.oracle.CountProof.count_proof:type_name -> bandchain.v1.oracle.RequestsCountProof + 14, // 11: bandchain.v1.oracle.CountProof.block_relay_proof:type_name -> bandchain.v1.oracle.BlockRelayProof + 20, // 12: bandchain.v1.oracle.OracleDataProof.result:type_name -> oracle.v1.Result + 13, // 13: bandchain.v1.oracle.OracleDataProof.merkle_paths:type_name -> bandchain.v1.oracle.IAVLMerklePath + 15, // 14: bandchain.v1.oracle.BlockRelayProof.multi_store_proof:type_name -> bandchain.v1.oracle.MultiStoreProof + 16, // 15: bandchain.v1.oracle.BlockRelayProof.block_header_merkle_parts:type_name -> bandchain.v1.oracle.BlockHeaderMerkleParts + 17, // 16: bandchain.v1.oracle.BlockRelayProof.common_encoded_vote_part:type_name -> bandchain.v1.oracle.CommonEncodedVotePart + 18, // 17: bandchain.v1.oracle.BlockRelayProof.signatures:type_name -> bandchain.v1.oracle.TMSignature + 13, // 18: bandchain.v1.oracle.RequestsCountProof.merkle_paths:type_name -> bandchain.v1.oracle.IAVLMerklePath + 0, // 19: bandchain.v1.oracle.Service.Proof:input_type -> bandchain.v1.oracle.ProofRequest + 2, // 20: bandchain.v1.oracle.Service.MultiProof:input_type -> bandchain.v1.oracle.MultiProofRequest + 4, // 21: bandchain.v1.oracle.Service.RequestCountProof:input_type -> bandchain.v1.oracle.RequestCountProofRequest + 1, // 22: bandchain.v1.oracle.Service.Proof:output_type -> bandchain.v1.oracle.ProofResponse + 3, // 23: bandchain.v1.oracle.Service.MultiProof:output_type -> bandchain.v1.oracle.MultiProofResponse + 5, // 24: bandchain.v1.oracle.Service.RequestCountProof:output_type -> bandchain.v1.oracle.RequestCountProofResponse + 22, // [22:25] is the sub-list for method output_type + 19, // [19:22] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name +} + +func init() { file_bandchain_v1_oracle_proof_proto_init() } +func file_bandchain_v1_oracle_proof_proto_init() { + if File_bandchain_v1_oracle_proof_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_bandchain_v1_oracle_proof_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProofRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProofResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MultiProofRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MultiProofResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RequestCountProofRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RequestCountProofResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SingleProofResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MultiProofResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountProofResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SingleProof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MultiProof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountProof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OracleDataProof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IAVLMerklePath); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockRelayProof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MultiStoreProof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockHeaderMerkleParts); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommonEncodedVotePart); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TMSignature); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_bandchain_v1_oracle_proof_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RequestsCountProof); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_bandchain_v1_oracle_proof_proto_rawDesc, + NumEnums: 0, + NumMessages: 20, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_bandchain_v1_oracle_proof_proto_goTypes, + DependencyIndexes: file_bandchain_v1_oracle_proof_proto_depIdxs, + MessageInfos: file_bandchain_v1_oracle_proof_proto_msgTypes, + }.Build() + File_bandchain_v1_oracle_proof_proto = out.File + file_bandchain_v1_oracle_proof_proto_rawDesc = nil + file_bandchain_v1_oracle_proof_proto_goTypes = nil + file_bandchain_v1_oracle_proof_proto_depIdxs = nil +} diff --git a/api/bandchain/v1/oracle/proof_grpc.pb.go b/api/bandchain/v1/oracle/proof_grpc.pb.go new file mode 100644 index 000000000..d7c14bc70 --- /dev/null +++ b/api/bandchain/v1/oracle/proof_grpc.pb.go @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: bandchain/v1/oracle/proof.proto + +package oracle + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Service_Proof_FullMethodName = "/bandchain.v1.oracle.Service/Proof" + Service_MultiProof_FullMethodName = "/bandchain.v1.oracle.Service/MultiProof" + Service_RequestCountProof_FullMethodName = "/bandchain.v1.oracle.Service/RequestCountProof" +) + +// ServiceClient is the client API for Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ServiceClient interface { + // Proof queries the proof for given request ID + Proof(ctx context.Context, in *ProofRequest, opts ...grpc.CallOption) (*ProofResponse, error) + // MultiProof queries multiple proofs for given list of request IDs + MultiProof(ctx context.Context, in *MultiProofRequest, opts ...grpc.CallOption) (*MultiProofResponse, error) + // RequestCountProof queries the count proof + RequestCountProof(ctx context.Context, in *RequestCountProofRequest, opts ...grpc.CallOption) (*RequestCountProofResponse, error) +} + +type serviceClient struct { + cc grpc.ClientConnInterface +} + +func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient { + return &serviceClient{cc} +} + +func (c *serviceClient) Proof(ctx context.Context, in *ProofRequest, opts ...grpc.CallOption) (*ProofResponse, error) { + out := new(ProofResponse) + err := c.cc.Invoke(ctx, Service_Proof_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) MultiProof(ctx context.Context, in *MultiProofRequest, opts ...grpc.CallOption) (*MultiProofResponse, error) { + out := new(MultiProofResponse) + err := c.cc.Invoke(ctx, Service_MultiProof_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) RequestCountProof(ctx context.Context, in *RequestCountProofRequest, opts ...grpc.CallOption) (*RequestCountProofResponse, error) { + out := new(RequestCountProofResponse) + err := c.cc.Invoke(ctx, Service_RequestCountProof_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ServiceServer is the server API for Service service. +// All implementations must embed UnimplementedServiceServer +// for forward compatibility +type ServiceServer interface { + // Proof queries the proof for given request ID + Proof(context.Context, *ProofRequest) (*ProofResponse, error) + // MultiProof queries multiple proofs for given list of request IDs + MultiProof(context.Context, *MultiProofRequest) (*MultiProofResponse, error) + // RequestCountProof queries the count proof + RequestCountProof(context.Context, *RequestCountProofRequest) (*RequestCountProofResponse, error) + mustEmbedUnimplementedServiceServer() +} + +// UnimplementedServiceServer must be embedded to have forward compatible implementations. +type UnimplementedServiceServer struct { +} + +func (UnimplementedServiceServer) Proof(context.Context, *ProofRequest) (*ProofResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Proof not implemented") +} +func (UnimplementedServiceServer) MultiProof(context.Context, *MultiProofRequest) (*MultiProofResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MultiProof not implemented") +} +func (UnimplementedServiceServer) RequestCountProof(context.Context, *RequestCountProofRequest) (*RequestCountProofResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RequestCountProof not implemented") +} +func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {} + +// UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ServiceServer will +// result in compilation errors. +type UnsafeServiceServer interface { + mustEmbedUnimplementedServiceServer() +} + +func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) { + s.RegisterService(&Service_ServiceDesc, srv) +} + +func _Service_Proof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProofRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Proof(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Service_Proof_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Proof(ctx, req.(*ProofRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_MultiProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MultiProofRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).MultiProof(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Service_MultiProof_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).MultiProof(ctx, req.(*MultiProofRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_RequestCountProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestCountProofRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).RequestCountProof(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Service_RequestCountProof_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).RequestCountProof(ctx, req.(*RequestCountProofRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Service_ServiceDesc is the grpc.ServiceDesc for Service service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Service_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "bandchain.v1.oracle.Service", + HandlerType: (*ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Proof", + Handler: _Service_Proof_Handler, + }, + { + MethodName: "MultiProof", + Handler: _Service_MultiProof_Handler, + }, + { + MethodName: "RequestCountProof", + Handler: _Service_RequestCountProof_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "bandchain/v1/oracle/proof.proto", +} diff --git a/api/globalfee/v1beta1/genesis.pulsar.go b/api/globalfee/v1beta1/genesis.pulsar.go new file mode 100644 index 000000000..8e16131ff --- /dev/null +++ b/api/globalfee/v1beta1/genesis.pulsar.go @@ -0,0 +1,1158 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package globalfeev1beta1 + +import ( + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor +) + +func init() { + file_globalfee_v1beta1_genesis_proto_init() + md_GenesisState = File_globalfee_v1beta1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_globalfee_v1beta1_genesis_proto_msgTypes[0] + 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_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// 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_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(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_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, 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_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "globalfee.v1beta1.GenesisState.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message globalfee.v1beta1.GenesisState 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_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "globalfee.v1beta1.GenesisState.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message globalfee.v1beta1.GenesisState 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_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "globalfee.v1beta1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message globalfee.v1beta1.GenesisState 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_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "globalfee.v1beta1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message globalfee.v1beta1.GenesisState 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_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "globalfee.v1beta1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message globalfee.v1beta1.GenesisState 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_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "globalfee.v1beta1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message globalfee.v1beta1.GenesisState 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_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in globalfee.v1beta1.GenesisState", 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_GenesisState) 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_GenesisState) 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_GenesisState) 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_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + 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.Params != nil { + l = options.Size(x.Params) + 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().(*GenesisState) + 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.Params != nil { + encoded, err := options.Marshal(x.Params) + 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().(*GenesisState) + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: 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 Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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 = (*_Params_1_list)(nil) + +type _Params_1_list struct { + list *[]*v1beta1.DecCoin +} + +func (x *_Params_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Params_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.DecCoin) + (*x.list)[i] = concreteValue +} + +func (x *_Params_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.DecCoin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_1_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.DecCoin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Params_1_list) NewElement() protoreflect.Value { + v := new(v1beta1.DecCoin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Params protoreflect.MessageDescriptor + fd_Params_minimum_gas_prices protoreflect.FieldDescriptor +) + +func init() { + file_globalfee_v1beta1_genesis_proto_init() + md_Params = File_globalfee_v1beta1_genesis_proto.Messages().ByName("Params") + fd_Params_minimum_gas_prices = md_Params.Fields().ByName("minimum_gas_prices") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_globalfee_v1beta1_genesis_proto_msgTypes[1] + 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_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// 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_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(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_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.MinimumGasPrices) != 0 { + value := protoreflect.ValueOfList(&_Params_1_list{list: &x.MinimumGasPrices}) + if !f(fd_Params_minimum_gas_prices, 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_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "globalfee.v1beta1.Params.minimum_gas_prices": + return len(x.MinimumGasPrices) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.Params")) + } + panic(fmt.Errorf("message globalfee.v1beta1.Params 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_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "globalfee.v1beta1.Params.minimum_gas_prices": + x.MinimumGasPrices = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.Params")) + } + panic(fmt.Errorf("message globalfee.v1beta1.Params 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_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "globalfee.v1beta1.Params.minimum_gas_prices": + if len(x.MinimumGasPrices) == 0 { + return protoreflect.ValueOfList(&_Params_1_list{}) + } + listValue := &_Params_1_list{list: &x.MinimumGasPrices} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.Params")) + } + panic(fmt.Errorf("message globalfee.v1beta1.Params 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_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "globalfee.v1beta1.Params.minimum_gas_prices": + lv := value.List() + clv := lv.(*_Params_1_list) + x.MinimumGasPrices = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.Params")) + } + panic(fmt.Errorf("message globalfee.v1beta1.Params 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_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "globalfee.v1beta1.Params.minimum_gas_prices": + if x.MinimumGasPrices == nil { + x.MinimumGasPrices = []*v1beta1.DecCoin{} + } + value := &_Params_1_list{list: &x.MinimumGasPrices} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.Params")) + } + panic(fmt.Errorf("message globalfee.v1beta1.Params 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_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "globalfee.v1beta1.Params.minimum_gas_prices": + list := []*v1beta1.DecCoin{} + return protoreflect.ValueOfList(&_Params_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.Params")) + } + panic(fmt.Errorf("message globalfee.v1beta1.Params 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_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in globalfee.v1beta1.Params", 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_Params) 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_Params) 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_Params) 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_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + 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.MinimumGasPrices) > 0 { + for _, e := range x.MinimumGasPrices { + 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().(*Params) + 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.MinimumGasPrices) > 0 { + for iNdEx := len(x.MinimumGasPrices) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.MinimumGasPrices[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().(*Params) + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: 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 MinimumGasPrices", 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.MinimumGasPrices = append(x.MinimumGasPrices, &v1beta1.DecCoin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MinimumGasPrices[len(x.MinimumGasPrices)-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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: globalfee/v1beta1/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GenesisState - initial state of module +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Params of this module + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_globalfee_v1beta1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_globalfee_v1beta1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// Params defines the set of module parameters. +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Minimum stores the minimum gas price(s) for all TX on the chain. + // When multiple coins are defined then they are accepted alternatively. + // The list must be sorted by denoms asc. No duplicate denoms or zero amount + // values allowed. For more information see + // https://docs.cosmos.network/main/modules/auth#concepts + MinimumGasPrices []*v1beta1.DecCoin `protobuf:"bytes,1,rep,name=minimum_gas_prices,json=minimumGasPrices,proto3" json:"minimum_gas_prices,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_globalfee_v1beta1_genesis_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_globalfee_v1beta1_genesis_proto_rawDescGZIP(), []int{1} +} + +func (x *Params) GetMinimumGasPrices() []*v1beta1.DecCoin { + if x != nil { + return x.MinimumGasPrices + } + return nil +} + +var File_globalfee_v1beta1_genesis_proto protoreflect.FileDescriptor + +var file_globalfee_v1beta1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x11, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x67, 0x6f, 0x67, 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, 0x22, 0x5b, 0x0a, 0x0c, 0x47, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x18, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x10, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xc7, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0xbc, 0x01, 0x0a, 0x12, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x67, + 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x70, 0xc8, + 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x1c, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x67, + 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, + 0x70, 0x74, 0x79, 0xf2, 0xde, 0x1f, 0x19, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e, + 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x22, + 0xaa, 0xdf, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, + 0x10, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x73, 0x42, 0xd3, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x47, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x3b, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x47, 0x58, 0x58, 0xaa, 0x02, 0x11, 0x47, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, + 0x11, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xe2, 0x02, 0x1d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x5c, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x12, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_globalfee_v1beta1_genesis_proto_rawDescOnce sync.Once + file_globalfee_v1beta1_genesis_proto_rawDescData = file_globalfee_v1beta1_genesis_proto_rawDesc +) + +func file_globalfee_v1beta1_genesis_proto_rawDescGZIP() []byte { + file_globalfee_v1beta1_genesis_proto_rawDescOnce.Do(func() { + file_globalfee_v1beta1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_globalfee_v1beta1_genesis_proto_rawDescData) + }) + return file_globalfee_v1beta1_genesis_proto_rawDescData +} + +var file_globalfee_v1beta1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_globalfee_v1beta1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: globalfee.v1beta1.GenesisState + (*Params)(nil), // 1: globalfee.v1beta1.Params + (*v1beta1.DecCoin)(nil), // 2: cosmos.base.v1beta1.DecCoin +} +var file_globalfee_v1beta1_genesis_proto_depIdxs = []int32{ + 1, // 0: globalfee.v1beta1.GenesisState.params:type_name -> globalfee.v1beta1.Params + 2, // 1: globalfee.v1beta1.Params.minimum_gas_prices:type_name -> cosmos.base.v1beta1.DecCoin + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_globalfee_v1beta1_genesis_proto_init() } +func file_globalfee_v1beta1_genesis_proto_init() { + if File_globalfee_v1beta1_genesis_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_globalfee_v1beta1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_globalfee_v1beta1_genesis_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_globalfee_v1beta1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_globalfee_v1beta1_genesis_proto_goTypes, + DependencyIndexes: file_globalfee_v1beta1_genesis_proto_depIdxs, + MessageInfos: file_globalfee_v1beta1_genesis_proto_msgTypes, + }.Build() + File_globalfee_v1beta1_genesis_proto = out.File + file_globalfee_v1beta1_genesis_proto_rawDesc = nil + file_globalfee_v1beta1_genesis_proto_goTypes = nil + file_globalfee_v1beta1_genesis_proto_depIdxs = nil +} diff --git a/api/globalfee/v1beta1/query.pulsar.go b/api/globalfee/v1beta1/query.pulsar.go new file mode 100644 index 000000000..408295825 --- /dev/null +++ b/api/globalfee/v1beta1/query.pulsar.go @@ -0,0 +1,1006 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package globalfeev1beta1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryParamsRequest protoreflect.MessageDescriptor +) + +func init() { + file_globalfee_v1beta1_query_proto_init() + md_QueryParamsRequest = File_globalfee_v1beta1_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_globalfee_v1beta1_query_proto_msgTypes[0] + 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_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// 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_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(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_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.QueryParamsRequest")) + } + panic(fmt.Errorf("message globalfee.v1beta1.QueryParamsRequest 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_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.QueryParamsRequest")) + } + panic(fmt.Errorf("message globalfee.v1beta1.QueryParamsRequest 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_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.QueryParamsRequest")) + } + panic(fmt.Errorf("message globalfee.v1beta1.QueryParamsRequest 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_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.QueryParamsRequest")) + } + panic(fmt.Errorf("message globalfee.v1beta1.QueryParamsRequest 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_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.QueryParamsRequest")) + } + panic(fmt.Errorf("message globalfee.v1beta1.QueryParamsRequest 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_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.QueryParamsRequest")) + } + panic(fmt.Errorf("message globalfee.v1beta1.QueryParamsRequest 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_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in globalfee.v1beta1.QueryParamsRequest", 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + 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.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().(*QueryParamsRequest) + 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 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().(*QueryParamsRequest) + 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_globalfee_v1beta1_query_proto_init() + md_QueryParamsResponse = File_globalfee_v1beta1_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_globalfee_v1beta1_query_proto_msgTypes[1] + 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_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// 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_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(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_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, 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_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "globalfee.v1beta1.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.QueryParamsResponse")) + } + panic(fmt.Errorf("message globalfee.v1beta1.QueryParamsResponse 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_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "globalfee.v1beta1.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.QueryParamsResponse")) + } + panic(fmt.Errorf("message globalfee.v1beta1.QueryParamsResponse 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_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "globalfee.v1beta1.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.QueryParamsResponse")) + } + panic(fmt.Errorf("message globalfee.v1beta1.QueryParamsResponse 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_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "globalfee.v1beta1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.QueryParamsResponse")) + } + panic(fmt.Errorf("message globalfee.v1beta1.QueryParamsResponse 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_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "globalfee.v1beta1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.QueryParamsResponse")) + } + panic(fmt.Errorf("message globalfee.v1beta1.QueryParamsResponse 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_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "globalfee.v1beta1.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.QueryParamsResponse")) + } + panic(fmt.Errorf("message globalfee.v1beta1.QueryParamsResponse 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_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in globalfee.v1beta1.QueryParamsResponse", 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_QueryParamsResponse) 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_QueryParamsResponse) 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_QueryParamsResponse) 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_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + 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.Params != nil { + l = options.Size(x.Params) + 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().(*QueryParamsResponse) + 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.Params != nil { + encoded, err := options.Marshal(x.Params) + 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().(*QueryParamsResponse) + 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: 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 Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: globalfee/v1beta1/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_globalfee_v1beta1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_globalfee_v1beta1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // pagination defines an optional pagination for the request. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_globalfee_v1beta1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_globalfee_v1beta1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +var File_globalfee_v1beta1_query_proto protoreflect.FileDescriptor + +var file_globalfee_v1beta1_query_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x11, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, + 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, + 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4e, 0x0a, + 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, + 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x83, 0x01, + 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x7a, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x25, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x67, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x42, 0xd1, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6c, 0x6f, 0x62, + 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x47, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x3b, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x47, 0x58, 0x58, 0xaa, 0x02, 0x11, 0x47, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, + 0x11, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xe2, 0x02, 0x1d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x5c, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x12, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_globalfee_v1beta1_query_proto_rawDescOnce sync.Once + file_globalfee_v1beta1_query_proto_rawDescData = file_globalfee_v1beta1_query_proto_rawDesc +) + +func file_globalfee_v1beta1_query_proto_rawDescGZIP() []byte { + file_globalfee_v1beta1_query_proto_rawDescOnce.Do(func() { + file_globalfee_v1beta1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_globalfee_v1beta1_query_proto_rawDescData) + }) + return file_globalfee_v1beta1_query_proto_rawDescData +} + +var file_globalfee_v1beta1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_globalfee_v1beta1_query_proto_goTypes = []interface{}{ + (*QueryParamsRequest)(nil), // 0: globalfee.v1beta1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: globalfee.v1beta1.QueryParamsResponse + (*Params)(nil), // 2: globalfee.v1beta1.Params +} +var file_globalfee_v1beta1_query_proto_depIdxs = []int32{ + 2, // 0: globalfee.v1beta1.QueryParamsResponse.params:type_name -> globalfee.v1beta1.Params + 0, // 1: globalfee.v1beta1.Query.Params:input_type -> globalfee.v1beta1.QueryParamsRequest + 1, // 2: globalfee.v1beta1.Query.Params:output_type -> globalfee.v1beta1.QueryParamsResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_globalfee_v1beta1_query_proto_init() } +func file_globalfee_v1beta1_query_proto_init() { + if File_globalfee_v1beta1_query_proto != nil { + return + } + file_globalfee_v1beta1_genesis_proto_init() + if !protoimpl.UnsafeEnabled { + file_globalfee_v1beta1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_globalfee_v1beta1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_globalfee_v1beta1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_globalfee_v1beta1_query_proto_goTypes, + DependencyIndexes: file_globalfee_v1beta1_query_proto_depIdxs, + MessageInfos: file_globalfee_v1beta1_query_proto_msgTypes, + }.Build() + File_globalfee_v1beta1_query_proto = out.File + file_globalfee_v1beta1_query_proto_rawDesc = nil + file_globalfee_v1beta1_query_proto_goTypes = nil + file_globalfee_v1beta1_query_proto_depIdxs = nil +} diff --git a/api/globalfee/v1beta1/query_grpc.pb.go b/api/globalfee/v1beta1/query_grpc.pb.go new file mode 100644 index 000000000..c21c5aee0 --- /dev/null +++ b/api/globalfee/v1beta1/query_grpc.pb.go @@ -0,0 +1,111 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: globalfee/v1beta1/query.proto + +package globalfeev1beta1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Query_Params_FullMethodName = "/globalfee.v1beta1.Query/Params" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryClient interface { + // Params queries parameters of globalfee module + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +type QueryServer interface { + // Params queries parameters of globalfee module + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "globalfee.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "globalfee/v1beta1/query.proto", +} diff --git a/api/globalfee/v1beta1/tx.pulsar.go b/api/globalfee/v1beta1/tx.pulsar.go new file mode 100644 index 000000000..459202ce7 --- /dev/null +++ b/api/globalfee/v1beta1/tx.pulsar.go @@ -0,0 +1,1092 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package globalfeev1beta1 + +import ( + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_globalfee_v1beta1_tx_proto_init() + md_MsgUpdateParams = File_globalfee_v1beta1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_globalfee_v1beta1_tx_proto_msgTypes[0] + 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_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// 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_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(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_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, 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_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "globalfee.v1beta1.MsgUpdateParams.authority": + return x.Authority != "" + case "globalfee.v1beta1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.MsgUpdateParams")) + } + panic(fmt.Errorf("message globalfee.v1beta1.MsgUpdateParams 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_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "globalfee.v1beta1.MsgUpdateParams.authority": + x.Authority = "" + case "globalfee.v1beta1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.MsgUpdateParams")) + } + panic(fmt.Errorf("message globalfee.v1beta1.MsgUpdateParams 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_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "globalfee.v1beta1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "globalfee.v1beta1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.MsgUpdateParams")) + } + panic(fmt.Errorf("message globalfee.v1beta1.MsgUpdateParams 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_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "globalfee.v1beta1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "globalfee.v1beta1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.MsgUpdateParams")) + } + panic(fmt.Errorf("message globalfee.v1beta1.MsgUpdateParams 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_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "globalfee.v1beta1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "globalfee.v1beta1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message globalfee.v1beta1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.MsgUpdateParams")) + } + panic(fmt.Errorf("message globalfee.v1beta1.MsgUpdateParams 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_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "globalfee.v1beta1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "globalfee.v1beta1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.MsgUpdateParams")) + } + panic(fmt.Errorf("message globalfee.v1beta1.MsgUpdateParams 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_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in globalfee.v1beta1.MsgUpdateParams", 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + 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.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + 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().(*MsgUpdateParams) + 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.Params != nil { + encoded, err := options.Marshal(x.Params) + 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 len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + 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().(*MsgUpdateParams) + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: 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 Authority", 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.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_globalfee_v1beta1_tx_proto_init() + md_MsgUpdateParamsResponse = File_globalfee_v1beta1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_globalfee_v1beta1_tx_proto_msgTypes[1] + 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_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// 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_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(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_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message globalfee.v1beta1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message globalfee.v1beta1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message globalfee.v1beta1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message globalfee.v1beta1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message globalfee.v1beta1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: globalfee.v1beta1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message globalfee.v1beta1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in globalfee.v1beta1.MsgUpdateParamsResponse", 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + 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.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().(*MsgUpdateParamsResponse) + 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 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().(*MsgUpdateParamsResponse) + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: globalfee/v1beta1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/globalfee parameters to update. + // + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_globalfee_v1beta1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_globalfee_v1beta1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_globalfee_v1beta1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_globalfee_v1beta1_tx_proto_rawDescGZIP(), []int{1} +} + +var File_globalfee_v1beta1_tx_proto protoreflect.FileDescriptor + +var file_globalfee_v1beta1_tx_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x67, 0x6c, + 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, + 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 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, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x67, 0x65, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x92, 0x01, 0x0a, 0x0f, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, + 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x37, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, + 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, + 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, + 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x6c, 0x0a, 0x03, 0x4d, 0x73, + 0x67, 0x12, 0x5e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x22, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xce, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, + 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x47, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x47, 0x58, 0x58, 0xaa, 0x02, 0x11, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xca, 0x02, 0x11, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, 0x5c, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, + 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x66, 0x65, 0x65, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_globalfee_v1beta1_tx_proto_rawDescOnce sync.Once + file_globalfee_v1beta1_tx_proto_rawDescData = file_globalfee_v1beta1_tx_proto_rawDesc +) + +func file_globalfee_v1beta1_tx_proto_rawDescGZIP() []byte { + file_globalfee_v1beta1_tx_proto_rawDescOnce.Do(func() { + file_globalfee_v1beta1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_globalfee_v1beta1_tx_proto_rawDescData) + }) + return file_globalfee_v1beta1_tx_proto_rawDescData +} + +var file_globalfee_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_globalfee_v1beta1_tx_proto_goTypes = []interface{}{ + (*MsgUpdateParams)(nil), // 0: globalfee.v1beta1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: globalfee.v1beta1.MsgUpdateParamsResponse + (*Params)(nil), // 2: globalfee.v1beta1.Params +} +var file_globalfee_v1beta1_tx_proto_depIdxs = []int32{ + 2, // 0: globalfee.v1beta1.MsgUpdateParams.params:type_name -> globalfee.v1beta1.Params + 0, // 1: globalfee.v1beta1.Msg.UpdateParams:input_type -> globalfee.v1beta1.MsgUpdateParams + 1, // 2: globalfee.v1beta1.Msg.UpdateParams:output_type -> globalfee.v1beta1.MsgUpdateParamsResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_globalfee_v1beta1_tx_proto_init() } +func file_globalfee_v1beta1_tx_proto_init() { + if File_globalfee_v1beta1_tx_proto != nil { + return + } + file_globalfee_v1beta1_genesis_proto_init() + if !protoimpl.UnsafeEnabled { + file_globalfee_v1beta1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_globalfee_v1beta1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_globalfee_v1beta1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_globalfee_v1beta1_tx_proto_goTypes, + DependencyIndexes: file_globalfee_v1beta1_tx_proto_depIdxs, + MessageInfos: file_globalfee_v1beta1_tx_proto_msgTypes, + }.Build() + File_globalfee_v1beta1_tx_proto = out.File + file_globalfee_v1beta1_tx_proto_rawDesc = nil + file_globalfee_v1beta1_tx_proto_goTypes = nil + file_globalfee_v1beta1_tx_proto_depIdxs = nil +} diff --git a/api/globalfee/v1beta1/tx_grpc.pb.go b/api/globalfee/v1beta1/tx_grpc.pb.go new file mode 100644 index 000000000..45a54a83a --- /dev/null +++ b/api/globalfee/v1beta1/tx_grpc.pb.go @@ -0,0 +1,117 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: globalfee/v1beta1/tx.proto + +package globalfeev1beta1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Msg_UpdateParams_FullMethodName = "/globalfee.v1beta1.Msg/UpdateParams" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a governance operation for updating the x/globalfee module + // parameters. + // + // Since: cosmos-sdk 0.47 + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +type MsgServer interface { + // UpdateParams defines a governance operation for updating the x/globalfee module + // parameters. + // + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "globalfee.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "globalfee/v1beta1/tx.proto", +} diff --git a/api/oracle/v1/genesis.pulsar.go b/api/oracle/v1/genesis.pulsar.go new file mode 100644 index 000000000..07cbb7939 --- /dev/null +++ b/api/oracle/v1/genesis.pulsar.go @@ -0,0 +1,896 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package oraclev1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_GenesisState_2_list)(nil) + +type _GenesisState_2_list struct { + list *[]*DataSource +} + +func (x *_GenesisState_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DataSource) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DataSource) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value { + v := new(DataSource) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_2_list) NewElement() protoreflect.Value { + v := new(DataSource) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_GenesisState_3_list)(nil) + +type _GenesisState_3_list struct { + list *[]*OracleScript +} + +func (x *_GenesisState_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*OracleScript) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*OracleScript) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_3_list) AppendMutable() protoreflect.Value { + v := new(OracleScript) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_3_list) NewElement() protoreflect.Value { + v := new(OracleScript) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor + fd_GenesisState_data_sources protoreflect.FieldDescriptor + fd_GenesisState_oracle_scripts protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_genesis_proto_init() + md_GenesisState = File_oracle_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") + fd_GenesisState_data_sources = md_GenesisState.Fields().ByName("data_sources") + fd_GenesisState_oracle_scripts = md_GenesisState.Fields().ByName("oracle_scripts") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_genesis_proto_msgTypes[0] + 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_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// 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_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(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_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, value) { + return + } + } + if len(x.DataSources) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.DataSources}) + if !f(fd_GenesisState_data_sources, value) { + return + } + } + if len(x.OracleScripts) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_3_list{list: &x.OracleScripts}) + if !f(fd_GenesisState_oracle_scripts, 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_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.GenesisState.params": + return x.Params != nil + case "oracle.v1.GenesisState.data_sources": + return len(x.DataSources) != 0 + case "oracle.v1.GenesisState.oracle_scripts": + return len(x.OracleScripts) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.GenesisState")) + } + panic(fmt.Errorf("message oracle.v1.GenesisState 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_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.GenesisState.params": + x.Params = nil + case "oracle.v1.GenesisState.data_sources": + x.DataSources = nil + case "oracle.v1.GenesisState.oracle_scripts": + x.OracleScripts = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.GenesisState")) + } + panic(fmt.Errorf("message oracle.v1.GenesisState 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_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "oracle.v1.GenesisState.data_sources": + if len(x.DataSources) == 0 { + return protoreflect.ValueOfList(&_GenesisState_2_list{}) + } + listValue := &_GenesisState_2_list{list: &x.DataSources} + return protoreflect.ValueOfList(listValue) + case "oracle.v1.GenesisState.oracle_scripts": + if len(x.OracleScripts) == 0 { + return protoreflect.ValueOfList(&_GenesisState_3_list{}) + } + listValue := &_GenesisState_3_list{list: &x.OracleScripts} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.GenesisState")) + } + panic(fmt.Errorf("message oracle.v1.GenesisState 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_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + case "oracle.v1.GenesisState.data_sources": + lv := value.List() + clv := lv.(*_GenesisState_2_list) + x.DataSources = *clv.list + case "oracle.v1.GenesisState.oracle_scripts": + lv := value.List() + clv := lv.(*_GenesisState_3_list) + x.OracleScripts = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.GenesisState")) + } + panic(fmt.Errorf("message oracle.v1.GenesisState 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_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "oracle.v1.GenesisState.data_sources": + if x.DataSources == nil { + x.DataSources = []*DataSource{} + } + value := &_GenesisState_2_list{list: &x.DataSources} + return protoreflect.ValueOfList(value) + case "oracle.v1.GenesisState.oracle_scripts": + if x.OracleScripts == nil { + x.OracleScripts = []*OracleScript{} + } + value := &_GenesisState_3_list{list: &x.OracleScripts} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.GenesisState")) + } + panic(fmt.Errorf("message oracle.v1.GenesisState 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_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "oracle.v1.GenesisState.data_sources": + list := []*DataSource{} + return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) + case "oracle.v1.GenesisState.oracle_scripts": + list := []*OracleScript{} + return protoreflect.ValueOfList(&_GenesisState_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.GenesisState")) + } + panic(fmt.Errorf("message oracle.v1.GenesisState 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_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.GenesisState", 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_GenesisState) 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_GenesisState) 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_GenesisState) 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_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + 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.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.DataSources) > 0 { + for _, e := range x.DataSources { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.OracleScripts) > 0 { + for _, e := range x.OracleScripts { + 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().(*GenesisState) + 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.OracleScripts) > 0 { + for iNdEx := len(x.OracleScripts) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.OracleScripts[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] = 0x1a + } + } + if len(x.DataSources) > 0 { + for iNdEx := len(x.DataSources) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.DataSources[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] = 0x12 + } + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + 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().(*GenesisState) + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: 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 Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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 DataSources", 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.DataSources = append(x.DataSources, &DataSource{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.DataSources[len(x.DataSources)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OracleScripts", 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.OracleScripts = append(x.OracleScripts, &OracleScript{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.OracleScripts[len(x.OracleScripts)-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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: oracle/v1/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GenesisState defines the oracle module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Params defines all the parameters of the module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + // DataSources are data sources to be installed during genesis phase. + DataSources []*DataSource `protobuf:"bytes,2,rep,name=data_sources,json=dataSources,proto3" json:"data_sources,omitempty"` + // OracleScripts are list of oracle scripts to be installed during genesis phase. + OracleScripts []*OracleScript `protobuf:"bytes,3,rep,name=oracle_scripts,json=oracleScripts,proto3" json:"oracle_scripts,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_oracle_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +func (x *GenesisState) GetDataSources() []*DataSource { + if x != nil { + return x.DataSources + } + return nil +} + +func (x *GenesisState) GetOracleScripts() []*OracleScript { + if x != nil { + return x.OracleScripts + } + return nil +} + +var File_oracle_v1_genesis_proto protoreflect.FileDescriptor + +var file_oracle_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, + 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x6f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xc5, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x3e, 0x0a, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x0e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0d, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x73, 0x42, 0x9b, 0x01, 0x0a, 0x0d, 0x63, + 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_oracle_v1_genesis_proto_rawDescOnce sync.Once + file_oracle_v1_genesis_proto_rawDescData = file_oracle_v1_genesis_proto_rawDesc +) + +func file_oracle_v1_genesis_proto_rawDescGZIP() []byte { + file_oracle_v1_genesis_proto_rawDescOnce.Do(func() { + file_oracle_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_oracle_v1_genesis_proto_rawDescData) + }) + return file_oracle_v1_genesis_proto_rawDescData +} + +var file_oracle_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_oracle_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: oracle.v1.GenesisState + (*Params)(nil), // 1: oracle.v1.Params + (*DataSource)(nil), // 2: oracle.v1.DataSource + (*OracleScript)(nil), // 3: oracle.v1.OracleScript +} +var file_oracle_v1_genesis_proto_depIdxs = []int32{ + 1, // 0: oracle.v1.GenesisState.params:type_name -> oracle.v1.Params + 2, // 1: oracle.v1.GenesisState.data_sources:type_name -> oracle.v1.DataSource + 3, // 2: oracle.v1.GenesisState.oracle_scripts:type_name -> oracle.v1.OracleScript + 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_oracle_v1_genesis_proto_init() } +func file_oracle_v1_genesis_proto_init() { + if File_oracle_v1_genesis_proto != nil { + return + } + file_oracle_v1_oracle_proto_init() + if !protoimpl.UnsafeEnabled { + file_oracle_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_oracle_v1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_oracle_v1_genesis_proto_goTypes, + DependencyIndexes: file_oracle_v1_genesis_proto_depIdxs, + MessageInfos: file_oracle_v1_genesis_proto_msgTypes, + }.Build() + File_oracle_v1_genesis_proto = out.File + file_oracle_v1_genesis_proto_rawDesc = nil + file_oracle_v1_genesis_proto_goTypes = nil + file_oracle_v1_genesis_proto_depIdxs = nil +} diff --git a/api/oracle/v1/oracle.pulsar.go b/api/oracle/v1/oracle.pulsar.go new file mode 100644 index 000000000..dc9975bac --- /dev/null +++ b/api/oracle/v1/oracle.pulsar.go @@ -0,0 +1,13290 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package oraclev1 + +import ( + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_DataSource_6_list)(nil) + +type _DataSource_6_list struct { + list *[]*v1beta1.Coin +} + +func (x *_DataSource_6_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DataSource_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_DataSource_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_DataSource_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_DataSource_6_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DataSource_6_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_DataSource_6_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DataSource_6_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DataSource protoreflect.MessageDescriptor + fd_DataSource_owner protoreflect.FieldDescriptor + fd_DataSource_name protoreflect.FieldDescriptor + fd_DataSource_description protoreflect.FieldDescriptor + fd_DataSource_filename protoreflect.FieldDescriptor + fd_DataSource_treasury protoreflect.FieldDescriptor + fd_DataSource_fee protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_DataSource = File_oracle_v1_oracle_proto.Messages().ByName("DataSource") + fd_DataSource_owner = md_DataSource.Fields().ByName("owner") + fd_DataSource_name = md_DataSource.Fields().ByName("name") + fd_DataSource_description = md_DataSource.Fields().ByName("description") + fd_DataSource_filename = md_DataSource.Fields().ByName("filename") + fd_DataSource_treasury = md_DataSource.Fields().ByName("treasury") + fd_DataSource_fee = md_DataSource.Fields().ByName("fee") +} + +var _ protoreflect.Message = (*fastReflection_DataSource)(nil) + +type fastReflection_DataSource DataSource + +func (x *DataSource) ProtoReflect() protoreflect.Message { + return (*fastReflection_DataSource)(x) +} + +func (x *DataSource) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_proto_msgTypes[0] + 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_DataSource_messageType fastReflection_DataSource_messageType +var _ protoreflect.MessageType = fastReflection_DataSource_messageType{} + +type fastReflection_DataSource_messageType struct{} + +func (x fastReflection_DataSource_messageType) Zero() protoreflect.Message { + return (*fastReflection_DataSource)(nil) +} +func (x fastReflection_DataSource_messageType) New() protoreflect.Message { + return new(fastReflection_DataSource) +} +func (x fastReflection_DataSource_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DataSource +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DataSource) Descriptor() protoreflect.MessageDescriptor { + return md_DataSource +} + +// 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_DataSource) Type() protoreflect.MessageType { + return _fastReflection_DataSource_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DataSource) New() protoreflect.Message { + return new(fastReflection_DataSource) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DataSource) Interface() protoreflect.ProtoMessage { + return (*DataSource)(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_DataSource) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Owner != "" { + value := protoreflect.ValueOfString(x.Owner) + if !f(fd_DataSource_owner, value) { + return + } + } + if x.Name != "" { + value := protoreflect.ValueOfString(x.Name) + if !f(fd_DataSource_name, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_DataSource_description, value) { + return + } + } + if x.Filename != "" { + value := protoreflect.ValueOfString(x.Filename) + if !f(fd_DataSource_filename, value) { + return + } + } + if x.Treasury != "" { + value := protoreflect.ValueOfString(x.Treasury) + if !f(fd_DataSource_treasury, value) { + return + } + } + if len(x.Fee) != 0 { + value := protoreflect.ValueOfList(&_DataSource_6_list{list: &x.Fee}) + if !f(fd_DataSource_fee, 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_DataSource) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.DataSource.owner": + return x.Owner != "" + case "oracle.v1.DataSource.name": + return x.Name != "" + case "oracle.v1.DataSource.description": + return x.Description != "" + case "oracle.v1.DataSource.filename": + return x.Filename != "" + case "oracle.v1.DataSource.treasury": + return x.Treasury != "" + case "oracle.v1.DataSource.fee": + return len(x.Fee) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.DataSource")) + } + panic(fmt.Errorf("message oracle.v1.DataSource 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_DataSource) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.DataSource.owner": + x.Owner = "" + case "oracle.v1.DataSource.name": + x.Name = "" + case "oracle.v1.DataSource.description": + x.Description = "" + case "oracle.v1.DataSource.filename": + x.Filename = "" + case "oracle.v1.DataSource.treasury": + x.Treasury = "" + case "oracle.v1.DataSource.fee": + x.Fee = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.DataSource")) + } + panic(fmt.Errorf("message oracle.v1.DataSource 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_DataSource) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.DataSource.owner": + value := x.Owner + return protoreflect.ValueOfString(value) + case "oracle.v1.DataSource.name": + value := x.Name + return protoreflect.ValueOfString(value) + case "oracle.v1.DataSource.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "oracle.v1.DataSource.filename": + value := x.Filename + return protoreflect.ValueOfString(value) + case "oracle.v1.DataSource.treasury": + value := x.Treasury + return protoreflect.ValueOfString(value) + case "oracle.v1.DataSource.fee": + if len(x.Fee) == 0 { + return protoreflect.ValueOfList(&_DataSource_6_list{}) + } + listValue := &_DataSource_6_list{list: &x.Fee} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.DataSource")) + } + panic(fmt.Errorf("message oracle.v1.DataSource 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_DataSource) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.DataSource.owner": + x.Owner = value.Interface().(string) + case "oracle.v1.DataSource.name": + x.Name = value.Interface().(string) + case "oracle.v1.DataSource.description": + x.Description = value.Interface().(string) + case "oracle.v1.DataSource.filename": + x.Filename = value.Interface().(string) + case "oracle.v1.DataSource.treasury": + x.Treasury = value.Interface().(string) + case "oracle.v1.DataSource.fee": + lv := value.List() + clv := lv.(*_DataSource_6_list) + x.Fee = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.DataSource")) + } + panic(fmt.Errorf("message oracle.v1.DataSource 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_DataSource) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.DataSource.fee": + if x.Fee == nil { + x.Fee = []*v1beta1.Coin{} + } + value := &_DataSource_6_list{list: &x.Fee} + return protoreflect.ValueOfList(value) + case "oracle.v1.DataSource.owner": + panic(fmt.Errorf("field owner of message oracle.v1.DataSource is not mutable")) + case "oracle.v1.DataSource.name": + panic(fmt.Errorf("field name of message oracle.v1.DataSource is not mutable")) + case "oracle.v1.DataSource.description": + panic(fmt.Errorf("field description of message oracle.v1.DataSource is not mutable")) + case "oracle.v1.DataSource.filename": + panic(fmt.Errorf("field filename of message oracle.v1.DataSource is not mutable")) + case "oracle.v1.DataSource.treasury": + panic(fmt.Errorf("field treasury of message oracle.v1.DataSource is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.DataSource")) + } + panic(fmt.Errorf("message oracle.v1.DataSource 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_DataSource) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.DataSource.owner": + return protoreflect.ValueOfString("") + case "oracle.v1.DataSource.name": + return protoreflect.ValueOfString("") + case "oracle.v1.DataSource.description": + return protoreflect.ValueOfString("") + case "oracle.v1.DataSource.filename": + return protoreflect.ValueOfString("") + case "oracle.v1.DataSource.treasury": + return protoreflect.ValueOfString("") + case "oracle.v1.DataSource.fee": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_DataSource_6_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.DataSource")) + } + panic(fmt.Errorf("message oracle.v1.DataSource 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_DataSource) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.DataSource", 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_DataSource) 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_DataSource) 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_DataSource) 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_DataSource) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DataSource) + 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.Owner) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Name) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Filename) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Treasury) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Fee) > 0 { + for _, e := range x.Fee { + 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().(*DataSource) + 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.Fee) > 0 { + for iNdEx := len(x.Fee) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Fee[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] = 0x32 + } + } + if len(x.Treasury) > 0 { + i -= len(x.Treasury) + copy(dAtA[i:], x.Treasury) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Treasury))) + i-- + dAtA[i] = 0x2a + } + if len(x.Filename) > 0 { + i -= len(x.Filename) + copy(dAtA[i:], x.Filename) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Filename))) + i-- + dAtA[i] = 0x22 + } + if len(x.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x1a + } + if len(x.Name) > 0 { + i -= len(x.Name) + copy(dAtA[i:], x.Name) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) + i-- + dAtA[i] = 0x12 + } + if len(x.Owner) > 0 { + i -= len(x.Owner) + copy(dAtA[i:], x.Owner) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Owner))) + 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().(*DataSource) + 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: DataSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DataSource: 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 Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Name", 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.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Filename", 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.Filename = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Treasury", 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.Treasury = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Fee", 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.Fee = append(x.Fee, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Fee[len(x.Fee)-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 ( + md_OracleScript protoreflect.MessageDescriptor + fd_OracleScript_owner protoreflect.FieldDescriptor + fd_OracleScript_name protoreflect.FieldDescriptor + fd_OracleScript_description protoreflect.FieldDescriptor + fd_OracleScript_filename protoreflect.FieldDescriptor + fd_OracleScript_schema protoreflect.FieldDescriptor + fd_OracleScript_source_code_url protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_OracleScript = File_oracle_v1_oracle_proto.Messages().ByName("OracleScript") + fd_OracleScript_owner = md_OracleScript.Fields().ByName("owner") + fd_OracleScript_name = md_OracleScript.Fields().ByName("name") + fd_OracleScript_description = md_OracleScript.Fields().ByName("description") + fd_OracleScript_filename = md_OracleScript.Fields().ByName("filename") + fd_OracleScript_schema = md_OracleScript.Fields().ByName("schema") + fd_OracleScript_source_code_url = md_OracleScript.Fields().ByName("source_code_url") +} + +var _ protoreflect.Message = (*fastReflection_OracleScript)(nil) + +type fastReflection_OracleScript OracleScript + +func (x *OracleScript) ProtoReflect() protoreflect.Message { + return (*fastReflection_OracleScript)(x) +} + +func (x *OracleScript) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_proto_msgTypes[1] + 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_OracleScript_messageType fastReflection_OracleScript_messageType +var _ protoreflect.MessageType = fastReflection_OracleScript_messageType{} + +type fastReflection_OracleScript_messageType struct{} + +func (x fastReflection_OracleScript_messageType) Zero() protoreflect.Message { + return (*fastReflection_OracleScript)(nil) +} +func (x fastReflection_OracleScript_messageType) New() protoreflect.Message { + return new(fastReflection_OracleScript) +} +func (x fastReflection_OracleScript_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_OracleScript +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_OracleScript) Descriptor() protoreflect.MessageDescriptor { + return md_OracleScript +} + +// 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_OracleScript) Type() protoreflect.MessageType { + return _fastReflection_OracleScript_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_OracleScript) New() protoreflect.Message { + return new(fastReflection_OracleScript) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_OracleScript) Interface() protoreflect.ProtoMessage { + return (*OracleScript)(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_OracleScript) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Owner != "" { + value := protoreflect.ValueOfString(x.Owner) + if !f(fd_OracleScript_owner, value) { + return + } + } + if x.Name != "" { + value := protoreflect.ValueOfString(x.Name) + if !f(fd_OracleScript_name, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_OracleScript_description, value) { + return + } + } + if x.Filename != "" { + value := protoreflect.ValueOfString(x.Filename) + if !f(fd_OracleScript_filename, value) { + return + } + } + if x.Schema != "" { + value := protoreflect.ValueOfString(x.Schema) + if !f(fd_OracleScript_schema, value) { + return + } + } + if x.SourceCodeUrl != "" { + value := protoreflect.ValueOfString(x.SourceCodeUrl) + if !f(fd_OracleScript_source_code_url, 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_OracleScript) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.OracleScript.owner": + return x.Owner != "" + case "oracle.v1.OracleScript.name": + return x.Name != "" + case "oracle.v1.OracleScript.description": + return x.Description != "" + case "oracle.v1.OracleScript.filename": + return x.Filename != "" + case "oracle.v1.OracleScript.schema": + return x.Schema != "" + case "oracle.v1.OracleScript.source_code_url": + return x.SourceCodeUrl != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleScript")) + } + panic(fmt.Errorf("message oracle.v1.OracleScript 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_OracleScript) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.OracleScript.owner": + x.Owner = "" + case "oracle.v1.OracleScript.name": + x.Name = "" + case "oracle.v1.OracleScript.description": + x.Description = "" + case "oracle.v1.OracleScript.filename": + x.Filename = "" + case "oracle.v1.OracleScript.schema": + x.Schema = "" + case "oracle.v1.OracleScript.source_code_url": + x.SourceCodeUrl = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleScript")) + } + panic(fmt.Errorf("message oracle.v1.OracleScript 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_OracleScript) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.OracleScript.owner": + value := x.Owner + return protoreflect.ValueOfString(value) + case "oracle.v1.OracleScript.name": + value := x.Name + return protoreflect.ValueOfString(value) + case "oracle.v1.OracleScript.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "oracle.v1.OracleScript.filename": + value := x.Filename + return protoreflect.ValueOfString(value) + case "oracle.v1.OracleScript.schema": + value := x.Schema + return protoreflect.ValueOfString(value) + case "oracle.v1.OracleScript.source_code_url": + value := x.SourceCodeUrl + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleScript")) + } + panic(fmt.Errorf("message oracle.v1.OracleScript 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_OracleScript) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.OracleScript.owner": + x.Owner = value.Interface().(string) + case "oracle.v1.OracleScript.name": + x.Name = value.Interface().(string) + case "oracle.v1.OracleScript.description": + x.Description = value.Interface().(string) + case "oracle.v1.OracleScript.filename": + x.Filename = value.Interface().(string) + case "oracle.v1.OracleScript.schema": + x.Schema = value.Interface().(string) + case "oracle.v1.OracleScript.source_code_url": + x.SourceCodeUrl = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleScript")) + } + panic(fmt.Errorf("message oracle.v1.OracleScript 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_OracleScript) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.OracleScript.owner": + panic(fmt.Errorf("field owner of message oracle.v1.OracleScript is not mutable")) + case "oracle.v1.OracleScript.name": + panic(fmt.Errorf("field name of message oracle.v1.OracleScript is not mutable")) + case "oracle.v1.OracleScript.description": + panic(fmt.Errorf("field description of message oracle.v1.OracleScript is not mutable")) + case "oracle.v1.OracleScript.filename": + panic(fmt.Errorf("field filename of message oracle.v1.OracleScript is not mutable")) + case "oracle.v1.OracleScript.schema": + panic(fmt.Errorf("field schema of message oracle.v1.OracleScript is not mutable")) + case "oracle.v1.OracleScript.source_code_url": + panic(fmt.Errorf("field source_code_url of message oracle.v1.OracleScript is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleScript")) + } + panic(fmt.Errorf("message oracle.v1.OracleScript 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_OracleScript) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.OracleScript.owner": + return protoreflect.ValueOfString("") + case "oracle.v1.OracleScript.name": + return protoreflect.ValueOfString("") + case "oracle.v1.OracleScript.description": + return protoreflect.ValueOfString("") + case "oracle.v1.OracleScript.filename": + return protoreflect.ValueOfString("") + case "oracle.v1.OracleScript.schema": + return protoreflect.ValueOfString("") + case "oracle.v1.OracleScript.source_code_url": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleScript")) + } + panic(fmt.Errorf("message oracle.v1.OracleScript 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_OracleScript) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.OracleScript", 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_OracleScript) 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_OracleScript) 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_OracleScript) 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_OracleScript) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*OracleScript) + 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.Owner) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Name) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Filename) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Schema) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.SourceCodeUrl) + 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().(*OracleScript) + 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.SourceCodeUrl) > 0 { + i -= len(x.SourceCodeUrl) + copy(dAtA[i:], x.SourceCodeUrl) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SourceCodeUrl))) + i-- + dAtA[i] = 0x32 + } + if len(x.Schema) > 0 { + i -= len(x.Schema) + copy(dAtA[i:], x.Schema) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Schema))) + i-- + dAtA[i] = 0x2a + } + if len(x.Filename) > 0 { + i -= len(x.Filename) + copy(dAtA[i:], x.Filename) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Filename))) + i-- + dAtA[i] = 0x22 + } + if len(x.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x1a + } + if len(x.Name) > 0 { + i -= len(x.Name) + copy(dAtA[i:], x.Name) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) + i-- + dAtA[i] = 0x12 + } + if len(x.Owner) > 0 { + i -= len(x.Owner) + copy(dAtA[i:], x.Owner) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Owner))) + 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().(*OracleScript) + 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: OracleScript: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: OracleScript: 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 Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Name", 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.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Filename", 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.Filename = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Schema", 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.Schema = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SourceCodeUrl", 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.SourceCodeUrl = 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_RawRequest protoreflect.MessageDescriptor + fd_RawRequest_external_id protoreflect.FieldDescriptor + fd_RawRequest_data_source_id protoreflect.FieldDescriptor + fd_RawRequest_calldata protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_RawRequest = File_oracle_v1_oracle_proto.Messages().ByName("RawRequest") + fd_RawRequest_external_id = md_RawRequest.Fields().ByName("external_id") + fd_RawRequest_data_source_id = md_RawRequest.Fields().ByName("data_source_id") + fd_RawRequest_calldata = md_RawRequest.Fields().ByName("calldata") +} + +var _ protoreflect.Message = (*fastReflection_RawRequest)(nil) + +type fastReflection_RawRequest RawRequest + +func (x *RawRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_RawRequest)(x) +} + +func (x *RawRequest) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_proto_msgTypes[2] + 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_RawRequest_messageType fastReflection_RawRequest_messageType +var _ protoreflect.MessageType = fastReflection_RawRequest_messageType{} + +type fastReflection_RawRequest_messageType struct{} + +func (x fastReflection_RawRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_RawRequest)(nil) +} +func (x fastReflection_RawRequest_messageType) New() protoreflect.Message { + return new(fastReflection_RawRequest) +} +func (x fastReflection_RawRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_RawRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_RawRequest) Descriptor() protoreflect.MessageDescriptor { + return md_RawRequest +} + +// 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_RawRequest) Type() protoreflect.MessageType { + return _fastReflection_RawRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_RawRequest) New() protoreflect.Message { + return new(fastReflection_RawRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_RawRequest) Interface() protoreflect.ProtoMessage { + return (*RawRequest)(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_RawRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ExternalId != uint64(0) { + value := protoreflect.ValueOfUint64(x.ExternalId) + if !f(fd_RawRequest_external_id, value) { + return + } + } + if x.DataSourceId != uint64(0) { + value := protoreflect.ValueOfUint64(x.DataSourceId) + if !f(fd_RawRequest_data_source_id, value) { + return + } + } + if len(x.Calldata) != 0 { + value := protoreflect.ValueOfBytes(x.Calldata) + if !f(fd_RawRequest_calldata, 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_RawRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.RawRequest.external_id": + return x.ExternalId != uint64(0) + case "oracle.v1.RawRequest.data_source_id": + return x.DataSourceId != uint64(0) + case "oracle.v1.RawRequest.calldata": + return len(x.Calldata) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RawRequest")) + } + panic(fmt.Errorf("message oracle.v1.RawRequest 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_RawRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.RawRequest.external_id": + x.ExternalId = uint64(0) + case "oracle.v1.RawRequest.data_source_id": + x.DataSourceId = uint64(0) + case "oracle.v1.RawRequest.calldata": + x.Calldata = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RawRequest")) + } + panic(fmt.Errorf("message oracle.v1.RawRequest 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_RawRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.RawRequest.external_id": + value := x.ExternalId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.RawRequest.data_source_id": + value := x.DataSourceId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.RawRequest.calldata": + value := x.Calldata + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RawRequest")) + } + panic(fmt.Errorf("message oracle.v1.RawRequest 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_RawRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.RawRequest.external_id": + x.ExternalId = value.Uint() + case "oracle.v1.RawRequest.data_source_id": + x.DataSourceId = value.Uint() + case "oracle.v1.RawRequest.calldata": + x.Calldata = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RawRequest")) + } + panic(fmt.Errorf("message oracle.v1.RawRequest 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_RawRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.RawRequest.external_id": + panic(fmt.Errorf("field external_id of message oracle.v1.RawRequest is not mutable")) + case "oracle.v1.RawRequest.data_source_id": + panic(fmt.Errorf("field data_source_id of message oracle.v1.RawRequest is not mutable")) + case "oracle.v1.RawRequest.calldata": + panic(fmt.Errorf("field calldata of message oracle.v1.RawRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RawRequest")) + } + panic(fmt.Errorf("message oracle.v1.RawRequest 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_RawRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.RawRequest.external_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.RawRequest.data_source_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.RawRequest.calldata": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RawRequest")) + } + panic(fmt.Errorf("message oracle.v1.RawRequest 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_RawRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.RawRequest", 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_RawRequest) 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_RawRequest) 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_RawRequest) 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_RawRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*RawRequest) + 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.ExternalId != 0 { + n += 1 + runtime.Sov(uint64(x.ExternalId)) + } + if x.DataSourceId != 0 { + n += 1 + runtime.Sov(uint64(x.DataSourceId)) + } + l = len(x.Calldata) + 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().(*RawRequest) + 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.Calldata) > 0 { + i -= len(x.Calldata) + copy(dAtA[i:], x.Calldata) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Calldata))) + i-- + dAtA[i] = 0x1a + } + if x.DataSourceId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.DataSourceId)) + i-- + dAtA[i] = 0x10 + } + if x.ExternalId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExternalId)) + i-- + dAtA[i] = 0x8 + } + 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().(*RawRequest) + 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: RawRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RawRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType) + } + x.ExternalId = 0 + 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++ + x.ExternalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DataSourceId", wireType) + } + x.DataSourceId = 0 + 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++ + x.DataSourceId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Calldata", 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.Calldata = append(x.Calldata[:0], dAtA[iNdEx:postIndex]...) + if x.Calldata == nil { + x.Calldata = []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_RawReport protoreflect.MessageDescriptor + fd_RawReport_external_id protoreflect.FieldDescriptor + fd_RawReport_exit_code protoreflect.FieldDescriptor + fd_RawReport_data protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_RawReport = File_oracle_v1_oracle_proto.Messages().ByName("RawReport") + fd_RawReport_external_id = md_RawReport.Fields().ByName("external_id") + fd_RawReport_exit_code = md_RawReport.Fields().ByName("exit_code") + fd_RawReport_data = md_RawReport.Fields().ByName("data") +} + +var _ protoreflect.Message = (*fastReflection_RawReport)(nil) + +type fastReflection_RawReport RawReport + +func (x *RawReport) ProtoReflect() protoreflect.Message { + return (*fastReflection_RawReport)(x) +} + +func (x *RawReport) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_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_RawReport_messageType fastReflection_RawReport_messageType +var _ protoreflect.MessageType = fastReflection_RawReport_messageType{} + +type fastReflection_RawReport_messageType struct{} + +func (x fastReflection_RawReport_messageType) Zero() protoreflect.Message { + return (*fastReflection_RawReport)(nil) +} +func (x fastReflection_RawReport_messageType) New() protoreflect.Message { + return new(fastReflection_RawReport) +} +func (x fastReflection_RawReport_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_RawReport +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_RawReport) Descriptor() protoreflect.MessageDescriptor { + return md_RawReport +} + +// 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_RawReport) Type() protoreflect.MessageType { + return _fastReflection_RawReport_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_RawReport) New() protoreflect.Message { + return new(fastReflection_RawReport) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_RawReport) Interface() protoreflect.ProtoMessage { + return (*RawReport)(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_RawReport) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ExternalId != uint64(0) { + value := protoreflect.ValueOfUint64(x.ExternalId) + if !f(fd_RawReport_external_id, value) { + return + } + } + if x.ExitCode != uint32(0) { + value := protoreflect.ValueOfUint32(x.ExitCode) + if !f(fd_RawReport_exit_code, value) { + return + } + } + if len(x.Data) != 0 { + value := protoreflect.ValueOfBytes(x.Data) + if !f(fd_RawReport_data, 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_RawReport) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.RawReport.external_id": + return x.ExternalId != uint64(0) + case "oracle.v1.RawReport.exit_code": + return x.ExitCode != uint32(0) + case "oracle.v1.RawReport.data": + return len(x.Data) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RawReport")) + } + panic(fmt.Errorf("message oracle.v1.RawReport 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_RawReport) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.RawReport.external_id": + x.ExternalId = uint64(0) + case "oracle.v1.RawReport.exit_code": + x.ExitCode = uint32(0) + case "oracle.v1.RawReport.data": + x.Data = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RawReport")) + } + panic(fmt.Errorf("message oracle.v1.RawReport 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_RawReport) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.RawReport.external_id": + value := x.ExternalId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.RawReport.exit_code": + value := x.ExitCode + return protoreflect.ValueOfUint32(value) + case "oracle.v1.RawReport.data": + value := x.Data + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RawReport")) + } + panic(fmt.Errorf("message oracle.v1.RawReport 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_RawReport) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.RawReport.external_id": + x.ExternalId = value.Uint() + case "oracle.v1.RawReport.exit_code": + x.ExitCode = uint32(value.Uint()) + case "oracle.v1.RawReport.data": + x.Data = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RawReport")) + } + panic(fmt.Errorf("message oracle.v1.RawReport 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_RawReport) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.RawReport.external_id": + panic(fmt.Errorf("field external_id of message oracle.v1.RawReport is not mutable")) + case "oracle.v1.RawReport.exit_code": + panic(fmt.Errorf("field exit_code of message oracle.v1.RawReport is not mutable")) + case "oracle.v1.RawReport.data": + panic(fmt.Errorf("field data of message oracle.v1.RawReport is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RawReport")) + } + panic(fmt.Errorf("message oracle.v1.RawReport 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_RawReport) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.RawReport.external_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.RawReport.exit_code": + return protoreflect.ValueOfUint32(uint32(0)) + case "oracle.v1.RawReport.data": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RawReport")) + } + panic(fmt.Errorf("message oracle.v1.RawReport 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_RawReport) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.RawReport", 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_RawReport) 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_RawReport) 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_RawReport) 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_RawReport) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*RawReport) + 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.ExternalId != 0 { + n += 1 + runtime.Sov(uint64(x.ExternalId)) + } + if x.ExitCode != 0 { + n += 1 + runtime.Sov(uint64(x.ExitCode)) + } + l = len(x.Data) + 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().(*RawReport) + 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.Data) > 0 { + i -= len(x.Data) + copy(dAtA[i:], x.Data) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) + i-- + dAtA[i] = 0x1a + } + if x.ExitCode != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExitCode)) + i-- + dAtA[i] = 0x10 + } + if x.ExternalId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExternalId)) + i-- + dAtA[i] = 0x8 + } + 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().(*RawReport) + 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: RawReport: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RawReport: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType) + } + x.ExternalId = 0 + 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++ + x.ExternalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExitCode", wireType) + } + x.ExitCode = 0 + 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++ + x.ExitCode |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Data", 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.Data = append(x.Data[:0], dAtA[iNdEx:postIndex]...) + if x.Data == nil { + x.Data = []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 _ protoreflect.List = (*_Request_3_list)(nil) + +type _Request_3_list struct { + list *[]string +} + +func (x *_Request_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Request_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Request_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Request_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Request_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Request at list field RequestedValidators as it is not of Message kind")) +} + +func (x *_Request_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Request_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Request_3_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Request_8_list)(nil) + +type _Request_8_list struct { + list *[]*RawRequest +} + +func (x *_Request_8_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Request_8_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Request_8_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*RawRequest) + (*x.list)[i] = concreteValue +} + +func (x *_Request_8_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*RawRequest) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Request_8_list) AppendMutable() protoreflect.Value { + v := new(RawRequest) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Request_8_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Request_8_list) NewElement() protoreflect.Value { + v := new(RawRequest) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Request_8_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Request protoreflect.MessageDescriptor + fd_Request_oracle_script_id protoreflect.FieldDescriptor + fd_Request_calldata protoreflect.FieldDescriptor + fd_Request_requested_validators protoreflect.FieldDescriptor + fd_Request_min_count protoreflect.FieldDescriptor + fd_Request_request_height protoreflect.FieldDescriptor + fd_Request_request_time protoreflect.FieldDescriptor + fd_Request_client_id protoreflect.FieldDescriptor + fd_Request_raw_requests protoreflect.FieldDescriptor + fd_Request_ibc_channel protoreflect.FieldDescriptor + fd_Request_execute_gas protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_Request = File_oracle_v1_oracle_proto.Messages().ByName("Request") + fd_Request_oracle_script_id = md_Request.Fields().ByName("oracle_script_id") + fd_Request_calldata = md_Request.Fields().ByName("calldata") + fd_Request_requested_validators = md_Request.Fields().ByName("requested_validators") + fd_Request_min_count = md_Request.Fields().ByName("min_count") + fd_Request_request_height = md_Request.Fields().ByName("request_height") + fd_Request_request_time = md_Request.Fields().ByName("request_time") + fd_Request_client_id = md_Request.Fields().ByName("client_id") + fd_Request_raw_requests = md_Request.Fields().ByName("raw_requests") + fd_Request_ibc_channel = md_Request.Fields().ByName("ibc_channel") + fd_Request_execute_gas = md_Request.Fields().ByName("execute_gas") +} + +var _ protoreflect.Message = (*fastReflection_Request)(nil) + +type fastReflection_Request Request + +func (x *Request) ProtoReflect() protoreflect.Message { + return (*fastReflection_Request)(x) +} + +func (x *Request) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_proto_msgTypes[4] + 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_Request_messageType fastReflection_Request_messageType +var _ protoreflect.MessageType = fastReflection_Request_messageType{} + +type fastReflection_Request_messageType struct{} + +func (x fastReflection_Request_messageType) Zero() protoreflect.Message { + return (*fastReflection_Request)(nil) +} +func (x fastReflection_Request_messageType) New() protoreflect.Message { + return new(fastReflection_Request) +} +func (x fastReflection_Request_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Request +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Request) Descriptor() protoreflect.MessageDescriptor { + return md_Request +} + +// 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_Request) Type() protoreflect.MessageType { + return _fastReflection_Request_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Request) New() protoreflect.Message { + return new(fastReflection_Request) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Request) Interface() protoreflect.ProtoMessage { + return (*Request)(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_Request) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.OracleScriptId != uint64(0) { + value := protoreflect.ValueOfUint64(x.OracleScriptId) + if !f(fd_Request_oracle_script_id, value) { + return + } + } + if len(x.Calldata) != 0 { + value := protoreflect.ValueOfBytes(x.Calldata) + if !f(fd_Request_calldata, value) { + return + } + } + if len(x.RequestedValidators) != 0 { + value := protoreflect.ValueOfList(&_Request_3_list{list: &x.RequestedValidators}) + if !f(fd_Request_requested_validators, value) { + return + } + } + if x.MinCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.MinCount) + if !f(fd_Request_min_count, value) { + return + } + } + if x.RequestHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.RequestHeight) + if !f(fd_Request_request_height, value) { + return + } + } + if x.RequestTime != int64(0) { + value := protoreflect.ValueOfInt64(x.RequestTime) + if !f(fd_Request_request_time, value) { + return + } + } + if x.ClientId != "" { + value := protoreflect.ValueOfString(x.ClientId) + if !f(fd_Request_client_id, value) { + return + } + } + if len(x.RawRequests) != 0 { + value := protoreflect.ValueOfList(&_Request_8_list{list: &x.RawRequests}) + if !f(fd_Request_raw_requests, value) { + return + } + } + if x.IbcChannel != nil { + value := protoreflect.ValueOfMessage(x.IbcChannel.ProtoReflect()) + if !f(fd_Request_ibc_channel, value) { + return + } + } + if x.ExecuteGas != uint64(0) { + value := protoreflect.ValueOfUint64(x.ExecuteGas) + if !f(fd_Request_execute_gas, 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_Request) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.Request.oracle_script_id": + return x.OracleScriptId != uint64(0) + case "oracle.v1.Request.calldata": + return len(x.Calldata) != 0 + case "oracle.v1.Request.requested_validators": + return len(x.RequestedValidators) != 0 + case "oracle.v1.Request.min_count": + return x.MinCount != uint64(0) + case "oracle.v1.Request.request_height": + return x.RequestHeight != int64(0) + case "oracle.v1.Request.request_time": + return x.RequestTime != int64(0) + case "oracle.v1.Request.client_id": + return x.ClientId != "" + case "oracle.v1.Request.raw_requests": + return len(x.RawRequests) != 0 + case "oracle.v1.Request.ibc_channel": + return x.IbcChannel != nil + case "oracle.v1.Request.execute_gas": + return x.ExecuteGas != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Request")) + } + panic(fmt.Errorf("message oracle.v1.Request 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_Request) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.Request.oracle_script_id": + x.OracleScriptId = uint64(0) + case "oracle.v1.Request.calldata": + x.Calldata = nil + case "oracle.v1.Request.requested_validators": + x.RequestedValidators = nil + case "oracle.v1.Request.min_count": + x.MinCount = uint64(0) + case "oracle.v1.Request.request_height": + x.RequestHeight = int64(0) + case "oracle.v1.Request.request_time": + x.RequestTime = int64(0) + case "oracle.v1.Request.client_id": + x.ClientId = "" + case "oracle.v1.Request.raw_requests": + x.RawRequests = nil + case "oracle.v1.Request.ibc_channel": + x.IbcChannel = nil + case "oracle.v1.Request.execute_gas": + x.ExecuteGas = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Request")) + } + panic(fmt.Errorf("message oracle.v1.Request 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_Request) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.Request.oracle_script_id": + value := x.OracleScriptId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Request.calldata": + value := x.Calldata + return protoreflect.ValueOfBytes(value) + case "oracle.v1.Request.requested_validators": + if len(x.RequestedValidators) == 0 { + return protoreflect.ValueOfList(&_Request_3_list{}) + } + listValue := &_Request_3_list{list: &x.RequestedValidators} + return protoreflect.ValueOfList(listValue) + case "oracle.v1.Request.min_count": + value := x.MinCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Request.request_height": + value := x.RequestHeight + return protoreflect.ValueOfInt64(value) + case "oracle.v1.Request.request_time": + value := x.RequestTime + return protoreflect.ValueOfInt64(value) + case "oracle.v1.Request.client_id": + value := x.ClientId + return protoreflect.ValueOfString(value) + case "oracle.v1.Request.raw_requests": + if len(x.RawRequests) == 0 { + return protoreflect.ValueOfList(&_Request_8_list{}) + } + listValue := &_Request_8_list{list: &x.RawRequests} + return protoreflect.ValueOfList(listValue) + case "oracle.v1.Request.ibc_channel": + value := x.IbcChannel + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "oracle.v1.Request.execute_gas": + value := x.ExecuteGas + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Request")) + } + panic(fmt.Errorf("message oracle.v1.Request 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_Request) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.Request.oracle_script_id": + x.OracleScriptId = value.Uint() + case "oracle.v1.Request.calldata": + x.Calldata = value.Bytes() + case "oracle.v1.Request.requested_validators": + lv := value.List() + clv := lv.(*_Request_3_list) + x.RequestedValidators = *clv.list + case "oracle.v1.Request.min_count": + x.MinCount = value.Uint() + case "oracle.v1.Request.request_height": + x.RequestHeight = value.Int() + case "oracle.v1.Request.request_time": + x.RequestTime = value.Int() + case "oracle.v1.Request.client_id": + x.ClientId = value.Interface().(string) + case "oracle.v1.Request.raw_requests": + lv := value.List() + clv := lv.(*_Request_8_list) + x.RawRequests = *clv.list + case "oracle.v1.Request.ibc_channel": + x.IbcChannel = value.Message().Interface().(*IBCChannel) + case "oracle.v1.Request.execute_gas": + x.ExecuteGas = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Request")) + } + panic(fmt.Errorf("message oracle.v1.Request 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_Request) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.Request.requested_validators": + if x.RequestedValidators == nil { + x.RequestedValidators = []string{} + } + value := &_Request_3_list{list: &x.RequestedValidators} + return protoreflect.ValueOfList(value) + case "oracle.v1.Request.raw_requests": + if x.RawRequests == nil { + x.RawRequests = []*RawRequest{} + } + value := &_Request_8_list{list: &x.RawRequests} + return protoreflect.ValueOfList(value) + case "oracle.v1.Request.ibc_channel": + if x.IbcChannel == nil { + x.IbcChannel = new(IBCChannel) + } + return protoreflect.ValueOfMessage(x.IbcChannel.ProtoReflect()) + case "oracle.v1.Request.oracle_script_id": + panic(fmt.Errorf("field oracle_script_id of message oracle.v1.Request is not mutable")) + case "oracle.v1.Request.calldata": + panic(fmt.Errorf("field calldata of message oracle.v1.Request is not mutable")) + case "oracle.v1.Request.min_count": + panic(fmt.Errorf("field min_count of message oracle.v1.Request is not mutable")) + case "oracle.v1.Request.request_height": + panic(fmt.Errorf("field request_height of message oracle.v1.Request is not mutable")) + case "oracle.v1.Request.request_time": + panic(fmt.Errorf("field request_time of message oracle.v1.Request is not mutable")) + case "oracle.v1.Request.client_id": + panic(fmt.Errorf("field client_id of message oracle.v1.Request is not mutable")) + case "oracle.v1.Request.execute_gas": + panic(fmt.Errorf("field execute_gas of message oracle.v1.Request is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Request")) + } + panic(fmt.Errorf("message oracle.v1.Request 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_Request) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.Request.oracle_script_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Request.calldata": + return protoreflect.ValueOfBytes(nil) + case "oracle.v1.Request.requested_validators": + list := []string{} + return protoreflect.ValueOfList(&_Request_3_list{list: &list}) + case "oracle.v1.Request.min_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Request.request_height": + return protoreflect.ValueOfInt64(int64(0)) + case "oracle.v1.Request.request_time": + return protoreflect.ValueOfInt64(int64(0)) + case "oracle.v1.Request.client_id": + return protoreflect.ValueOfString("") + case "oracle.v1.Request.raw_requests": + list := []*RawRequest{} + return protoreflect.ValueOfList(&_Request_8_list{list: &list}) + case "oracle.v1.Request.ibc_channel": + m := new(IBCChannel) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "oracle.v1.Request.execute_gas": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Request")) + } + panic(fmt.Errorf("message oracle.v1.Request 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_Request) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.Request", 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_Request) 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_Request) 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_Request) 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_Request) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Request) + 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.OracleScriptId != 0 { + n += 1 + runtime.Sov(uint64(x.OracleScriptId)) + } + l = len(x.Calldata) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.RequestedValidators) > 0 { + for _, s := range x.RequestedValidators { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.MinCount != 0 { + n += 1 + runtime.Sov(uint64(x.MinCount)) + } + if x.RequestHeight != 0 { + n += 1 + runtime.Sov(uint64(x.RequestHeight)) + } + if x.RequestTime != 0 { + n += 1 + runtime.Sov(uint64(x.RequestTime)) + } + l = len(x.ClientId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.RawRequests) > 0 { + for _, e := range x.RawRequests { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.IbcChannel != nil { + l = options.Size(x.IbcChannel) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ExecuteGas != 0 { + n += 1 + runtime.Sov(uint64(x.ExecuteGas)) + } + 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().(*Request) + 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.ExecuteGas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExecuteGas)) + i-- + dAtA[i] = 0x50 + } + if x.IbcChannel != nil { + encoded, err := options.Marshal(x.IbcChannel) + 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] = 0x4a + } + if len(x.RawRequests) > 0 { + for iNdEx := len(x.RawRequests) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.RawRequests[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] = 0x42 + } + } + if len(x.ClientId) > 0 { + i -= len(x.ClientId) + copy(dAtA[i:], x.ClientId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ClientId))) + i-- + dAtA[i] = 0x3a + } + if x.RequestTime != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RequestTime)) + i-- + dAtA[i] = 0x30 + } + if x.RequestHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RequestHeight)) + i-- + dAtA[i] = 0x28 + } + if x.MinCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MinCount)) + i-- + dAtA[i] = 0x20 + } + if len(x.RequestedValidators) > 0 { + for iNdEx := len(x.RequestedValidators) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.RequestedValidators[iNdEx]) + copy(dAtA[i:], x.RequestedValidators[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RequestedValidators[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.Calldata) > 0 { + i -= len(x.Calldata) + copy(dAtA[i:], x.Calldata) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Calldata))) + i-- + dAtA[i] = 0x12 + } + if x.OracleScriptId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.OracleScriptId)) + i-- + dAtA[i] = 0x8 + } + 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().(*Request) + 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: Request: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Request: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OracleScriptId", wireType) + } + x.OracleScriptId = 0 + 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++ + x.OracleScriptId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Calldata", 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.Calldata = append(x.Calldata[:0], dAtA[iNdEx:postIndex]...) + if x.Calldata == nil { + x.Calldata = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestedValidators", 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.RequestedValidators = append(x.RequestedValidators, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinCount", wireType) + } + x.MinCount = 0 + 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++ + x.MinCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestHeight", wireType) + } + x.RequestHeight = 0 + 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++ + x.RequestHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestTime", wireType) + } + x.RequestTime = 0 + 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++ + x.RequestTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClientId", 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.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RawRequests", 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.RawRequests = append(x.RawRequests, &RawRequest{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RawRequests[len(x.RawRequests)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IbcChannel", 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.IbcChannel == nil { + x.IbcChannel = &IBCChannel{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.IbcChannel); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExecuteGas", wireType) + } + x.ExecuteGas = 0 + 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++ + x.ExecuteGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 = (*_Report_3_list)(nil) + +type _Report_3_list struct { + list *[]*RawReport +} + +func (x *_Report_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Report_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Report_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*RawReport) + (*x.list)[i] = concreteValue +} + +func (x *_Report_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*RawReport) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Report_3_list) AppendMutable() protoreflect.Value { + v := new(RawReport) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Report_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Report_3_list) NewElement() protoreflect.Value { + v := new(RawReport) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Report_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Report protoreflect.MessageDescriptor + fd_Report_validator protoreflect.FieldDescriptor + fd_Report_in_before_resolve protoreflect.FieldDescriptor + fd_Report_raw_reports protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_Report = File_oracle_v1_oracle_proto.Messages().ByName("Report") + fd_Report_validator = md_Report.Fields().ByName("validator") + fd_Report_in_before_resolve = md_Report.Fields().ByName("in_before_resolve") + fd_Report_raw_reports = md_Report.Fields().ByName("raw_reports") +} + +var _ protoreflect.Message = (*fastReflection_Report)(nil) + +type fastReflection_Report Report + +func (x *Report) ProtoReflect() protoreflect.Message { + return (*fastReflection_Report)(x) +} + +func (x *Report) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_proto_msgTypes[5] + 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_Report_messageType fastReflection_Report_messageType +var _ protoreflect.MessageType = fastReflection_Report_messageType{} + +type fastReflection_Report_messageType struct{} + +func (x fastReflection_Report_messageType) Zero() protoreflect.Message { + return (*fastReflection_Report)(nil) +} +func (x fastReflection_Report_messageType) New() protoreflect.Message { + return new(fastReflection_Report) +} +func (x fastReflection_Report_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Report +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Report) Descriptor() protoreflect.MessageDescriptor { + return md_Report +} + +// 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_Report) Type() protoreflect.MessageType { + return _fastReflection_Report_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Report) New() protoreflect.Message { + return new(fastReflection_Report) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Report) Interface() protoreflect.ProtoMessage { + return (*Report)(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_Report) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Validator != "" { + value := protoreflect.ValueOfString(x.Validator) + if !f(fd_Report_validator, value) { + return + } + } + if x.InBeforeResolve != false { + value := protoreflect.ValueOfBool(x.InBeforeResolve) + if !f(fd_Report_in_before_resolve, value) { + return + } + } + if len(x.RawReports) != 0 { + value := protoreflect.ValueOfList(&_Report_3_list{list: &x.RawReports}) + if !f(fd_Report_raw_reports, 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_Report) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.Report.validator": + return x.Validator != "" + case "oracle.v1.Report.in_before_resolve": + return x.InBeforeResolve != false + case "oracle.v1.Report.raw_reports": + return len(x.RawReports) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Report")) + } + panic(fmt.Errorf("message oracle.v1.Report 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_Report) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.Report.validator": + x.Validator = "" + case "oracle.v1.Report.in_before_resolve": + x.InBeforeResolve = false + case "oracle.v1.Report.raw_reports": + x.RawReports = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Report")) + } + panic(fmt.Errorf("message oracle.v1.Report 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_Report) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.Report.validator": + value := x.Validator + return protoreflect.ValueOfString(value) + case "oracle.v1.Report.in_before_resolve": + value := x.InBeforeResolve + return protoreflect.ValueOfBool(value) + case "oracle.v1.Report.raw_reports": + if len(x.RawReports) == 0 { + return protoreflect.ValueOfList(&_Report_3_list{}) + } + listValue := &_Report_3_list{list: &x.RawReports} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Report")) + } + panic(fmt.Errorf("message oracle.v1.Report 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_Report) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.Report.validator": + x.Validator = value.Interface().(string) + case "oracle.v1.Report.in_before_resolve": + x.InBeforeResolve = value.Bool() + case "oracle.v1.Report.raw_reports": + lv := value.List() + clv := lv.(*_Report_3_list) + x.RawReports = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Report")) + } + panic(fmt.Errorf("message oracle.v1.Report 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_Report) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.Report.raw_reports": + if x.RawReports == nil { + x.RawReports = []*RawReport{} + } + value := &_Report_3_list{list: &x.RawReports} + return protoreflect.ValueOfList(value) + case "oracle.v1.Report.validator": + panic(fmt.Errorf("field validator of message oracle.v1.Report is not mutable")) + case "oracle.v1.Report.in_before_resolve": + panic(fmt.Errorf("field in_before_resolve of message oracle.v1.Report is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Report")) + } + panic(fmt.Errorf("message oracle.v1.Report 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_Report) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.Report.validator": + return protoreflect.ValueOfString("") + case "oracle.v1.Report.in_before_resolve": + return protoreflect.ValueOfBool(false) + case "oracle.v1.Report.raw_reports": + list := []*RawReport{} + return protoreflect.ValueOfList(&_Report_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Report")) + } + panic(fmt.Errorf("message oracle.v1.Report 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_Report) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.Report", 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_Report) 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_Report) 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_Report) 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_Report) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Report) + 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.Validator) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.InBeforeResolve { + n += 2 + } + if len(x.RawReports) > 0 { + for _, e := range x.RawReports { + 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().(*Report) + 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.RawReports) > 0 { + for iNdEx := len(x.RawReports) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.RawReports[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] = 0x1a + } + } + if x.InBeforeResolve { + i-- + if x.InBeforeResolve { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(x.Validator) > 0 { + i -= len(x.Validator) + copy(dAtA[i:], x.Validator) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Validator))) + 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().(*Report) + 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: Report: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Report: 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 Validator", 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.Validator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InBeforeResolve", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.InBeforeResolve = bool(v != 0) + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RawReports", 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.RawReports = append(x.RawReports, &RawReport{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RawReports[len(x.RawReports)-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 = (*_OracleRequestPacketData_6_list)(nil) + +type _OracleRequestPacketData_6_list struct { + list *[]*v1beta1.Coin +} + +func (x *_OracleRequestPacketData_6_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_OracleRequestPacketData_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_OracleRequestPacketData_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_OracleRequestPacketData_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_OracleRequestPacketData_6_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_OracleRequestPacketData_6_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_OracleRequestPacketData_6_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_OracleRequestPacketData_6_list) IsValid() bool { + return x.list != nil +} + +var ( + md_OracleRequestPacketData protoreflect.MessageDescriptor + fd_OracleRequestPacketData_client_id protoreflect.FieldDescriptor + fd_OracleRequestPacketData_oracle_script_id protoreflect.FieldDescriptor + fd_OracleRequestPacketData_calldata protoreflect.FieldDescriptor + fd_OracleRequestPacketData_ask_count protoreflect.FieldDescriptor + fd_OracleRequestPacketData_min_count protoreflect.FieldDescriptor + fd_OracleRequestPacketData_fee_limit protoreflect.FieldDescriptor + fd_OracleRequestPacketData_prepare_gas protoreflect.FieldDescriptor + fd_OracleRequestPacketData_execute_gas protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_OracleRequestPacketData = File_oracle_v1_oracle_proto.Messages().ByName("OracleRequestPacketData") + fd_OracleRequestPacketData_client_id = md_OracleRequestPacketData.Fields().ByName("client_id") + fd_OracleRequestPacketData_oracle_script_id = md_OracleRequestPacketData.Fields().ByName("oracle_script_id") + fd_OracleRequestPacketData_calldata = md_OracleRequestPacketData.Fields().ByName("calldata") + fd_OracleRequestPacketData_ask_count = md_OracleRequestPacketData.Fields().ByName("ask_count") + fd_OracleRequestPacketData_min_count = md_OracleRequestPacketData.Fields().ByName("min_count") + fd_OracleRequestPacketData_fee_limit = md_OracleRequestPacketData.Fields().ByName("fee_limit") + fd_OracleRequestPacketData_prepare_gas = md_OracleRequestPacketData.Fields().ByName("prepare_gas") + fd_OracleRequestPacketData_execute_gas = md_OracleRequestPacketData.Fields().ByName("execute_gas") +} + +var _ protoreflect.Message = (*fastReflection_OracleRequestPacketData)(nil) + +type fastReflection_OracleRequestPacketData OracleRequestPacketData + +func (x *OracleRequestPacketData) ProtoReflect() protoreflect.Message { + return (*fastReflection_OracleRequestPacketData)(x) +} + +func (x *OracleRequestPacketData) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_proto_msgTypes[6] + 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_OracleRequestPacketData_messageType fastReflection_OracleRequestPacketData_messageType +var _ protoreflect.MessageType = fastReflection_OracleRequestPacketData_messageType{} + +type fastReflection_OracleRequestPacketData_messageType struct{} + +func (x fastReflection_OracleRequestPacketData_messageType) Zero() protoreflect.Message { + return (*fastReflection_OracleRequestPacketData)(nil) +} +func (x fastReflection_OracleRequestPacketData_messageType) New() protoreflect.Message { + return new(fastReflection_OracleRequestPacketData) +} +func (x fastReflection_OracleRequestPacketData_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_OracleRequestPacketData +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_OracleRequestPacketData) Descriptor() protoreflect.MessageDescriptor { + return md_OracleRequestPacketData +} + +// 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_OracleRequestPacketData) Type() protoreflect.MessageType { + return _fastReflection_OracleRequestPacketData_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_OracleRequestPacketData) New() protoreflect.Message { + return new(fastReflection_OracleRequestPacketData) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_OracleRequestPacketData) Interface() protoreflect.ProtoMessage { + return (*OracleRequestPacketData)(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_OracleRequestPacketData) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ClientId != "" { + value := protoreflect.ValueOfString(x.ClientId) + if !f(fd_OracleRequestPacketData_client_id, value) { + return + } + } + if x.OracleScriptId != uint64(0) { + value := protoreflect.ValueOfUint64(x.OracleScriptId) + if !f(fd_OracleRequestPacketData_oracle_script_id, value) { + return + } + } + if len(x.Calldata) != 0 { + value := protoreflect.ValueOfBytes(x.Calldata) + if !f(fd_OracleRequestPacketData_calldata, value) { + return + } + } + if x.AskCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.AskCount) + if !f(fd_OracleRequestPacketData_ask_count, value) { + return + } + } + if x.MinCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.MinCount) + if !f(fd_OracleRequestPacketData_min_count, value) { + return + } + } + if len(x.FeeLimit) != 0 { + value := protoreflect.ValueOfList(&_OracleRequestPacketData_6_list{list: &x.FeeLimit}) + if !f(fd_OracleRequestPacketData_fee_limit, value) { + return + } + } + if x.PrepareGas != uint64(0) { + value := protoreflect.ValueOfUint64(x.PrepareGas) + if !f(fd_OracleRequestPacketData_prepare_gas, value) { + return + } + } + if x.ExecuteGas != uint64(0) { + value := protoreflect.ValueOfUint64(x.ExecuteGas) + if !f(fd_OracleRequestPacketData_execute_gas, 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_OracleRequestPacketData) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.OracleRequestPacketData.client_id": + return x.ClientId != "" + case "oracle.v1.OracleRequestPacketData.oracle_script_id": + return x.OracleScriptId != uint64(0) + case "oracle.v1.OracleRequestPacketData.calldata": + return len(x.Calldata) != 0 + case "oracle.v1.OracleRequestPacketData.ask_count": + return x.AskCount != uint64(0) + case "oracle.v1.OracleRequestPacketData.min_count": + return x.MinCount != uint64(0) + case "oracle.v1.OracleRequestPacketData.fee_limit": + return len(x.FeeLimit) != 0 + case "oracle.v1.OracleRequestPacketData.prepare_gas": + return x.PrepareGas != uint64(0) + case "oracle.v1.OracleRequestPacketData.execute_gas": + return x.ExecuteGas != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleRequestPacketData")) + } + panic(fmt.Errorf("message oracle.v1.OracleRequestPacketData 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_OracleRequestPacketData) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.OracleRequestPacketData.client_id": + x.ClientId = "" + case "oracle.v1.OracleRequestPacketData.oracle_script_id": + x.OracleScriptId = uint64(0) + case "oracle.v1.OracleRequestPacketData.calldata": + x.Calldata = nil + case "oracle.v1.OracleRequestPacketData.ask_count": + x.AskCount = uint64(0) + case "oracle.v1.OracleRequestPacketData.min_count": + x.MinCount = uint64(0) + case "oracle.v1.OracleRequestPacketData.fee_limit": + x.FeeLimit = nil + case "oracle.v1.OracleRequestPacketData.prepare_gas": + x.PrepareGas = uint64(0) + case "oracle.v1.OracleRequestPacketData.execute_gas": + x.ExecuteGas = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleRequestPacketData")) + } + panic(fmt.Errorf("message oracle.v1.OracleRequestPacketData 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_OracleRequestPacketData) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.OracleRequestPacketData.client_id": + value := x.ClientId + return protoreflect.ValueOfString(value) + case "oracle.v1.OracleRequestPacketData.oracle_script_id": + value := x.OracleScriptId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.OracleRequestPacketData.calldata": + value := x.Calldata + return protoreflect.ValueOfBytes(value) + case "oracle.v1.OracleRequestPacketData.ask_count": + value := x.AskCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.OracleRequestPacketData.min_count": + value := x.MinCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.OracleRequestPacketData.fee_limit": + if len(x.FeeLimit) == 0 { + return protoreflect.ValueOfList(&_OracleRequestPacketData_6_list{}) + } + listValue := &_OracleRequestPacketData_6_list{list: &x.FeeLimit} + return protoreflect.ValueOfList(listValue) + case "oracle.v1.OracleRequestPacketData.prepare_gas": + value := x.PrepareGas + return protoreflect.ValueOfUint64(value) + case "oracle.v1.OracleRequestPacketData.execute_gas": + value := x.ExecuteGas + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleRequestPacketData")) + } + panic(fmt.Errorf("message oracle.v1.OracleRequestPacketData 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_OracleRequestPacketData) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.OracleRequestPacketData.client_id": + x.ClientId = value.Interface().(string) + case "oracle.v1.OracleRequestPacketData.oracle_script_id": + x.OracleScriptId = value.Uint() + case "oracle.v1.OracleRequestPacketData.calldata": + x.Calldata = value.Bytes() + case "oracle.v1.OracleRequestPacketData.ask_count": + x.AskCount = value.Uint() + case "oracle.v1.OracleRequestPacketData.min_count": + x.MinCount = value.Uint() + case "oracle.v1.OracleRequestPacketData.fee_limit": + lv := value.List() + clv := lv.(*_OracleRequestPacketData_6_list) + x.FeeLimit = *clv.list + case "oracle.v1.OracleRequestPacketData.prepare_gas": + x.PrepareGas = value.Uint() + case "oracle.v1.OracleRequestPacketData.execute_gas": + x.ExecuteGas = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleRequestPacketData")) + } + panic(fmt.Errorf("message oracle.v1.OracleRequestPacketData 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_OracleRequestPacketData) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.OracleRequestPacketData.fee_limit": + if x.FeeLimit == nil { + x.FeeLimit = []*v1beta1.Coin{} + } + value := &_OracleRequestPacketData_6_list{list: &x.FeeLimit} + return protoreflect.ValueOfList(value) + case "oracle.v1.OracleRequestPacketData.client_id": + panic(fmt.Errorf("field client_id of message oracle.v1.OracleRequestPacketData is not mutable")) + case "oracle.v1.OracleRequestPacketData.oracle_script_id": + panic(fmt.Errorf("field oracle_script_id of message oracle.v1.OracleRequestPacketData is not mutable")) + case "oracle.v1.OracleRequestPacketData.calldata": + panic(fmt.Errorf("field calldata of message oracle.v1.OracleRequestPacketData is not mutable")) + case "oracle.v1.OracleRequestPacketData.ask_count": + panic(fmt.Errorf("field ask_count of message oracle.v1.OracleRequestPacketData is not mutable")) + case "oracle.v1.OracleRequestPacketData.min_count": + panic(fmt.Errorf("field min_count of message oracle.v1.OracleRequestPacketData is not mutable")) + case "oracle.v1.OracleRequestPacketData.prepare_gas": + panic(fmt.Errorf("field prepare_gas of message oracle.v1.OracleRequestPacketData is not mutable")) + case "oracle.v1.OracleRequestPacketData.execute_gas": + panic(fmt.Errorf("field execute_gas of message oracle.v1.OracleRequestPacketData is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleRequestPacketData")) + } + panic(fmt.Errorf("message oracle.v1.OracleRequestPacketData 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_OracleRequestPacketData) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.OracleRequestPacketData.client_id": + return protoreflect.ValueOfString("") + case "oracle.v1.OracleRequestPacketData.oracle_script_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.OracleRequestPacketData.calldata": + return protoreflect.ValueOfBytes(nil) + case "oracle.v1.OracleRequestPacketData.ask_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.OracleRequestPacketData.min_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.OracleRequestPacketData.fee_limit": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_OracleRequestPacketData_6_list{list: &list}) + case "oracle.v1.OracleRequestPacketData.prepare_gas": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.OracleRequestPacketData.execute_gas": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleRequestPacketData")) + } + panic(fmt.Errorf("message oracle.v1.OracleRequestPacketData 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_OracleRequestPacketData) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.OracleRequestPacketData", 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_OracleRequestPacketData) 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_OracleRequestPacketData) 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_OracleRequestPacketData) 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_OracleRequestPacketData) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*OracleRequestPacketData) + 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.ClientId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.OracleScriptId != 0 { + n += 1 + runtime.Sov(uint64(x.OracleScriptId)) + } + l = len(x.Calldata) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.AskCount != 0 { + n += 1 + runtime.Sov(uint64(x.AskCount)) + } + if x.MinCount != 0 { + n += 1 + runtime.Sov(uint64(x.MinCount)) + } + if len(x.FeeLimit) > 0 { + for _, e := range x.FeeLimit { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.PrepareGas != 0 { + n += 1 + runtime.Sov(uint64(x.PrepareGas)) + } + if x.ExecuteGas != 0 { + n += 1 + runtime.Sov(uint64(x.ExecuteGas)) + } + 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().(*OracleRequestPacketData) + 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.ExecuteGas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExecuteGas)) + i-- + dAtA[i] = 0x40 + } + if x.PrepareGas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.PrepareGas)) + i-- + dAtA[i] = 0x38 + } + if len(x.FeeLimit) > 0 { + for iNdEx := len(x.FeeLimit) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.FeeLimit[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] = 0x32 + } + } + if x.MinCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MinCount)) + i-- + dAtA[i] = 0x28 + } + if x.AskCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AskCount)) + i-- + dAtA[i] = 0x20 + } + if len(x.Calldata) > 0 { + i -= len(x.Calldata) + copy(dAtA[i:], x.Calldata) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Calldata))) + i-- + dAtA[i] = 0x1a + } + if x.OracleScriptId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.OracleScriptId)) + i-- + dAtA[i] = 0x10 + } + if len(x.ClientId) > 0 { + i -= len(x.ClientId) + copy(dAtA[i:], x.ClientId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ClientId))) + 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().(*OracleRequestPacketData) + 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: OracleRequestPacketData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: OracleRequestPacketData: 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 ClientId", 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.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OracleScriptId", wireType) + } + x.OracleScriptId = 0 + 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++ + x.OracleScriptId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Calldata", 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.Calldata = append(x.Calldata[:0], dAtA[iNdEx:postIndex]...) + if x.Calldata == nil { + x.Calldata = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AskCount", wireType) + } + x.AskCount = 0 + 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++ + x.AskCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinCount", wireType) + } + x.MinCount = 0 + 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++ + x.MinCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FeeLimit", 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.FeeLimit = append(x.FeeLimit, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.FeeLimit[len(x.FeeLimit)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PrepareGas", wireType) + } + x.PrepareGas = 0 + 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++ + x.PrepareGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExecuteGas", wireType) + } + x.ExecuteGas = 0 + 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++ + x.ExecuteGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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_OracleRequestPacketAcknowledgement protoreflect.MessageDescriptor + fd_OracleRequestPacketAcknowledgement_request_id protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_OracleRequestPacketAcknowledgement = File_oracle_v1_oracle_proto.Messages().ByName("OracleRequestPacketAcknowledgement") + fd_OracleRequestPacketAcknowledgement_request_id = md_OracleRequestPacketAcknowledgement.Fields().ByName("request_id") +} + +var _ protoreflect.Message = (*fastReflection_OracleRequestPacketAcknowledgement)(nil) + +type fastReflection_OracleRequestPacketAcknowledgement OracleRequestPacketAcknowledgement + +func (x *OracleRequestPacketAcknowledgement) ProtoReflect() protoreflect.Message { + return (*fastReflection_OracleRequestPacketAcknowledgement)(x) +} + +func (x *OracleRequestPacketAcknowledgement) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_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_OracleRequestPacketAcknowledgement_messageType fastReflection_OracleRequestPacketAcknowledgement_messageType +var _ protoreflect.MessageType = fastReflection_OracleRequestPacketAcknowledgement_messageType{} + +type fastReflection_OracleRequestPacketAcknowledgement_messageType struct{} + +func (x fastReflection_OracleRequestPacketAcknowledgement_messageType) Zero() protoreflect.Message { + return (*fastReflection_OracleRequestPacketAcknowledgement)(nil) +} +func (x fastReflection_OracleRequestPacketAcknowledgement_messageType) New() protoreflect.Message { + return new(fastReflection_OracleRequestPacketAcknowledgement) +} +func (x fastReflection_OracleRequestPacketAcknowledgement_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_OracleRequestPacketAcknowledgement +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_OracleRequestPacketAcknowledgement) Descriptor() protoreflect.MessageDescriptor { + return md_OracleRequestPacketAcknowledgement +} + +// 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_OracleRequestPacketAcknowledgement) Type() protoreflect.MessageType { + return _fastReflection_OracleRequestPacketAcknowledgement_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_OracleRequestPacketAcknowledgement) New() protoreflect.Message { + return new(fastReflection_OracleRequestPacketAcknowledgement) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_OracleRequestPacketAcknowledgement) Interface() protoreflect.ProtoMessage { + return (*OracleRequestPacketAcknowledgement)(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_OracleRequestPacketAcknowledgement) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.RequestId != uint64(0) { + value := protoreflect.ValueOfUint64(x.RequestId) + if !f(fd_OracleRequestPacketAcknowledgement_request_id, 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_OracleRequestPacketAcknowledgement) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.OracleRequestPacketAcknowledgement.request_id": + return x.RequestId != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleRequestPacketAcknowledgement")) + } + panic(fmt.Errorf("message oracle.v1.OracleRequestPacketAcknowledgement 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_OracleRequestPacketAcknowledgement) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.OracleRequestPacketAcknowledgement.request_id": + x.RequestId = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleRequestPacketAcknowledgement")) + } + panic(fmt.Errorf("message oracle.v1.OracleRequestPacketAcknowledgement 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_OracleRequestPacketAcknowledgement) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.OracleRequestPacketAcknowledgement.request_id": + value := x.RequestId + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleRequestPacketAcknowledgement")) + } + panic(fmt.Errorf("message oracle.v1.OracleRequestPacketAcknowledgement 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_OracleRequestPacketAcknowledgement) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.OracleRequestPacketAcknowledgement.request_id": + x.RequestId = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleRequestPacketAcknowledgement")) + } + panic(fmt.Errorf("message oracle.v1.OracleRequestPacketAcknowledgement 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_OracleRequestPacketAcknowledgement) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.OracleRequestPacketAcknowledgement.request_id": + panic(fmt.Errorf("field request_id of message oracle.v1.OracleRequestPacketAcknowledgement is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleRequestPacketAcknowledgement")) + } + panic(fmt.Errorf("message oracle.v1.OracleRequestPacketAcknowledgement 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_OracleRequestPacketAcknowledgement) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.OracleRequestPacketAcknowledgement.request_id": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleRequestPacketAcknowledgement")) + } + panic(fmt.Errorf("message oracle.v1.OracleRequestPacketAcknowledgement 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_OracleRequestPacketAcknowledgement) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.OracleRequestPacketAcknowledgement", 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_OracleRequestPacketAcknowledgement) 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_OracleRequestPacketAcknowledgement) 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_OracleRequestPacketAcknowledgement) 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_OracleRequestPacketAcknowledgement) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*OracleRequestPacketAcknowledgement) + 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.RequestId != 0 { + n += 1 + runtime.Sov(uint64(x.RequestId)) + } + 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().(*OracleRequestPacketAcknowledgement) + 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.RequestId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RequestId)) + i-- + dAtA[i] = 0x8 + } + 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().(*OracleRequestPacketAcknowledgement) + 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: OracleRequestPacketAcknowledgement: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: OracleRequestPacketAcknowledgement: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) + } + x.RequestId = 0 + 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++ + x.RequestId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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_OracleResponsePacketData protoreflect.MessageDescriptor + fd_OracleResponsePacketData_client_id protoreflect.FieldDescriptor + fd_OracleResponsePacketData_request_id protoreflect.FieldDescriptor + fd_OracleResponsePacketData_ans_count protoreflect.FieldDescriptor + fd_OracleResponsePacketData_request_time protoreflect.FieldDescriptor + fd_OracleResponsePacketData_resolve_time protoreflect.FieldDescriptor + fd_OracleResponsePacketData_resolve_status protoreflect.FieldDescriptor + fd_OracleResponsePacketData_result protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_OracleResponsePacketData = File_oracle_v1_oracle_proto.Messages().ByName("OracleResponsePacketData") + fd_OracleResponsePacketData_client_id = md_OracleResponsePacketData.Fields().ByName("client_id") + fd_OracleResponsePacketData_request_id = md_OracleResponsePacketData.Fields().ByName("request_id") + fd_OracleResponsePacketData_ans_count = md_OracleResponsePacketData.Fields().ByName("ans_count") + fd_OracleResponsePacketData_request_time = md_OracleResponsePacketData.Fields().ByName("request_time") + fd_OracleResponsePacketData_resolve_time = md_OracleResponsePacketData.Fields().ByName("resolve_time") + fd_OracleResponsePacketData_resolve_status = md_OracleResponsePacketData.Fields().ByName("resolve_status") + fd_OracleResponsePacketData_result = md_OracleResponsePacketData.Fields().ByName("result") +} + +var _ protoreflect.Message = (*fastReflection_OracleResponsePacketData)(nil) + +type fastReflection_OracleResponsePacketData OracleResponsePacketData + +func (x *OracleResponsePacketData) ProtoReflect() protoreflect.Message { + return (*fastReflection_OracleResponsePacketData)(x) +} + +func (x *OracleResponsePacketData) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_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_OracleResponsePacketData_messageType fastReflection_OracleResponsePacketData_messageType +var _ protoreflect.MessageType = fastReflection_OracleResponsePacketData_messageType{} + +type fastReflection_OracleResponsePacketData_messageType struct{} + +func (x fastReflection_OracleResponsePacketData_messageType) Zero() protoreflect.Message { + return (*fastReflection_OracleResponsePacketData)(nil) +} +func (x fastReflection_OracleResponsePacketData_messageType) New() protoreflect.Message { + return new(fastReflection_OracleResponsePacketData) +} +func (x fastReflection_OracleResponsePacketData_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_OracleResponsePacketData +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_OracleResponsePacketData) Descriptor() protoreflect.MessageDescriptor { + return md_OracleResponsePacketData +} + +// 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_OracleResponsePacketData) Type() protoreflect.MessageType { + return _fastReflection_OracleResponsePacketData_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_OracleResponsePacketData) New() protoreflect.Message { + return new(fastReflection_OracleResponsePacketData) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_OracleResponsePacketData) Interface() protoreflect.ProtoMessage { + return (*OracleResponsePacketData)(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_OracleResponsePacketData) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ClientId != "" { + value := protoreflect.ValueOfString(x.ClientId) + if !f(fd_OracleResponsePacketData_client_id, value) { + return + } + } + if x.RequestId != uint64(0) { + value := protoreflect.ValueOfUint64(x.RequestId) + if !f(fd_OracleResponsePacketData_request_id, value) { + return + } + } + if x.AnsCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.AnsCount) + if !f(fd_OracleResponsePacketData_ans_count, value) { + return + } + } + if x.RequestTime != int64(0) { + value := protoreflect.ValueOfInt64(x.RequestTime) + if !f(fd_OracleResponsePacketData_request_time, value) { + return + } + } + if x.ResolveTime != int64(0) { + value := protoreflect.ValueOfInt64(x.ResolveTime) + if !f(fd_OracleResponsePacketData_resolve_time, value) { + return + } + } + if x.ResolveStatus != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.ResolveStatus)) + if !f(fd_OracleResponsePacketData_resolve_status, value) { + return + } + } + if len(x.Result) != 0 { + value := protoreflect.ValueOfBytes(x.Result) + if !f(fd_OracleResponsePacketData_result, 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_OracleResponsePacketData) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.OracleResponsePacketData.client_id": + return x.ClientId != "" + case "oracle.v1.OracleResponsePacketData.request_id": + return x.RequestId != uint64(0) + case "oracle.v1.OracleResponsePacketData.ans_count": + return x.AnsCount != uint64(0) + case "oracle.v1.OracleResponsePacketData.request_time": + return x.RequestTime != int64(0) + case "oracle.v1.OracleResponsePacketData.resolve_time": + return x.ResolveTime != int64(0) + case "oracle.v1.OracleResponsePacketData.resolve_status": + return x.ResolveStatus != 0 + case "oracle.v1.OracleResponsePacketData.result": + return len(x.Result) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleResponsePacketData")) + } + panic(fmt.Errorf("message oracle.v1.OracleResponsePacketData 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_OracleResponsePacketData) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.OracleResponsePacketData.client_id": + x.ClientId = "" + case "oracle.v1.OracleResponsePacketData.request_id": + x.RequestId = uint64(0) + case "oracle.v1.OracleResponsePacketData.ans_count": + x.AnsCount = uint64(0) + case "oracle.v1.OracleResponsePacketData.request_time": + x.RequestTime = int64(0) + case "oracle.v1.OracleResponsePacketData.resolve_time": + x.ResolveTime = int64(0) + case "oracle.v1.OracleResponsePacketData.resolve_status": + x.ResolveStatus = 0 + case "oracle.v1.OracleResponsePacketData.result": + x.Result = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleResponsePacketData")) + } + panic(fmt.Errorf("message oracle.v1.OracleResponsePacketData 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_OracleResponsePacketData) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.OracleResponsePacketData.client_id": + value := x.ClientId + return protoreflect.ValueOfString(value) + case "oracle.v1.OracleResponsePacketData.request_id": + value := x.RequestId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.OracleResponsePacketData.ans_count": + value := x.AnsCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.OracleResponsePacketData.request_time": + value := x.RequestTime + return protoreflect.ValueOfInt64(value) + case "oracle.v1.OracleResponsePacketData.resolve_time": + value := x.ResolveTime + return protoreflect.ValueOfInt64(value) + case "oracle.v1.OracleResponsePacketData.resolve_status": + value := x.ResolveStatus + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "oracle.v1.OracleResponsePacketData.result": + value := x.Result + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleResponsePacketData")) + } + panic(fmt.Errorf("message oracle.v1.OracleResponsePacketData 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_OracleResponsePacketData) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.OracleResponsePacketData.client_id": + x.ClientId = value.Interface().(string) + case "oracle.v1.OracleResponsePacketData.request_id": + x.RequestId = value.Uint() + case "oracle.v1.OracleResponsePacketData.ans_count": + x.AnsCount = value.Uint() + case "oracle.v1.OracleResponsePacketData.request_time": + x.RequestTime = value.Int() + case "oracle.v1.OracleResponsePacketData.resolve_time": + x.ResolveTime = value.Int() + case "oracle.v1.OracleResponsePacketData.resolve_status": + x.ResolveStatus = (ResolveStatus)(value.Enum()) + case "oracle.v1.OracleResponsePacketData.result": + x.Result = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleResponsePacketData")) + } + panic(fmt.Errorf("message oracle.v1.OracleResponsePacketData 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_OracleResponsePacketData) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.OracleResponsePacketData.client_id": + panic(fmt.Errorf("field client_id of message oracle.v1.OracleResponsePacketData is not mutable")) + case "oracle.v1.OracleResponsePacketData.request_id": + panic(fmt.Errorf("field request_id of message oracle.v1.OracleResponsePacketData is not mutable")) + case "oracle.v1.OracleResponsePacketData.ans_count": + panic(fmt.Errorf("field ans_count of message oracle.v1.OracleResponsePacketData is not mutable")) + case "oracle.v1.OracleResponsePacketData.request_time": + panic(fmt.Errorf("field request_time of message oracle.v1.OracleResponsePacketData is not mutable")) + case "oracle.v1.OracleResponsePacketData.resolve_time": + panic(fmt.Errorf("field resolve_time of message oracle.v1.OracleResponsePacketData is not mutable")) + case "oracle.v1.OracleResponsePacketData.resolve_status": + panic(fmt.Errorf("field resolve_status of message oracle.v1.OracleResponsePacketData is not mutable")) + case "oracle.v1.OracleResponsePacketData.result": + panic(fmt.Errorf("field result of message oracle.v1.OracleResponsePacketData is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleResponsePacketData")) + } + panic(fmt.Errorf("message oracle.v1.OracleResponsePacketData 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_OracleResponsePacketData) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.OracleResponsePacketData.client_id": + return protoreflect.ValueOfString("") + case "oracle.v1.OracleResponsePacketData.request_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.OracleResponsePacketData.ans_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.OracleResponsePacketData.request_time": + return protoreflect.ValueOfInt64(int64(0)) + case "oracle.v1.OracleResponsePacketData.resolve_time": + return protoreflect.ValueOfInt64(int64(0)) + case "oracle.v1.OracleResponsePacketData.resolve_status": + return protoreflect.ValueOfEnum(0) + case "oracle.v1.OracleResponsePacketData.result": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.OracleResponsePacketData")) + } + panic(fmt.Errorf("message oracle.v1.OracleResponsePacketData 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_OracleResponsePacketData) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.OracleResponsePacketData", 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_OracleResponsePacketData) 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_OracleResponsePacketData) 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_OracleResponsePacketData) 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_OracleResponsePacketData) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*OracleResponsePacketData) + 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.ClientId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.RequestId != 0 { + n += 1 + runtime.Sov(uint64(x.RequestId)) + } + if x.AnsCount != 0 { + n += 1 + runtime.Sov(uint64(x.AnsCount)) + } + if x.RequestTime != 0 { + n += 1 + runtime.Sov(uint64(x.RequestTime)) + } + if x.ResolveTime != 0 { + n += 1 + runtime.Sov(uint64(x.ResolveTime)) + } + if x.ResolveStatus != 0 { + n += 1 + runtime.Sov(uint64(x.ResolveStatus)) + } + l = len(x.Result) + 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().(*OracleResponsePacketData) + 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.Result) > 0 { + i -= len(x.Result) + copy(dAtA[i:], x.Result) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Result))) + i-- + dAtA[i] = 0x3a + } + if x.ResolveStatus != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ResolveStatus)) + i-- + dAtA[i] = 0x30 + } + if x.ResolveTime != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ResolveTime)) + i-- + dAtA[i] = 0x28 + } + if x.RequestTime != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RequestTime)) + i-- + dAtA[i] = 0x20 + } + if x.AnsCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AnsCount)) + i-- + dAtA[i] = 0x18 + } + if x.RequestId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RequestId)) + i-- + dAtA[i] = 0x10 + } + if len(x.ClientId) > 0 { + i -= len(x.ClientId) + copy(dAtA[i:], x.ClientId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ClientId))) + 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().(*OracleResponsePacketData) + 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: OracleResponsePacketData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: OracleResponsePacketData: 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 ClientId", 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.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) + } + x.RequestId = 0 + 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++ + x.RequestId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AnsCount", wireType) + } + x.AnsCount = 0 + 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++ + x.AnsCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestTime", wireType) + } + x.RequestTime = 0 + 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++ + x.RequestTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ResolveTime", wireType) + } + x.ResolveTime = 0 + 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++ + x.ResolveTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ResolveStatus", wireType) + } + x.ResolveStatus = 0 + 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++ + x.ResolveStatus |= ResolveStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Result", 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.Result = append(x.Result[:0], dAtA[iNdEx:postIndex]...) + if x.Result == nil { + x.Result = []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_Result protoreflect.MessageDescriptor + fd_Result_client_id protoreflect.FieldDescriptor + fd_Result_oracle_script_id protoreflect.FieldDescriptor + fd_Result_calldata protoreflect.FieldDescriptor + fd_Result_ask_count protoreflect.FieldDescriptor + fd_Result_min_count protoreflect.FieldDescriptor + fd_Result_request_id protoreflect.FieldDescriptor + fd_Result_ans_count protoreflect.FieldDescriptor + fd_Result_request_time protoreflect.FieldDescriptor + fd_Result_resolve_time protoreflect.FieldDescriptor + fd_Result_resolve_status protoreflect.FieldDescriptor + fd_Result_result protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_Result = File_oracle_v1_oracle_proto.Messages().ByName("Result") + fd_Result_client_id = md_Result.Fields().ByName("client_id") + fd_Result_oracle_script_id = md_Result.Fields().ByName("oracle_script_id") + fd_Result_calldata = md_Result.Fields().ByName("calldata") + fd_Result_ask_count = md_Result.Fields().ByName("ask_count") + fd_Result_min_count = md_Result.Fields().ByName("min_count") + fd_Result_request_id = md_Result.Fields().ByName("request_id") + fd_Result_ans_count = md_Result.Fields().ByName("ans_count") + fd_Result_request_time = md_Result.Fields().ByName("request_time") + fd_Result_resolve_time = md_Result.Fields().ByName("resolve_time") + fd_Result_resolve_status = md_Result.Fields().ByName("resolve_status") + fd_Result_result = md_Result.Fields().ByName("result") +} + +var _ protoreflect.Message = (*fastReflection_Result)(nil) + +type fastReflection_Result Result + +func (x *Result) ProtoReflect() protoreflect.Message { + return (*fastReflection_Result)(x) +} + +func (x *Result) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_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_Result_messageType fastReflection_Result_messageType +var _ protoreflect.MessageType = fastReflection_Result_messageType{} + +type fastReflection_Result_messageType struct{} + +func (x fastReflection_Result_messageType) Zero() protoreflect.Message { + return (*fastReflection_Result)(nil) +} +func (x fastReflection_Result_messageType) New() protoreflect.Message { + return new(fastReflection_Result) +} +func (x fastReflection_Result_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Result +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Result) Descriptor() protoreflect.MessageDescriptor { + return md_Result +} + +// 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_Result) Type() protoreflect.MessageType { + return _fastReflection_Result_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Result) New() protoreflect.Message { + return new(fastReflection_Result) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Result) Interface() protoreflect.ProtoMessage { + return (*Result)(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_Result) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ClientId != "" { + value := protoreflect.ValueOfString(x.ClientId) + if !f(fd_Result_client_id, value) { + return + } + } + if x.OracleScriptId != uint64(0) { + value := protoreflect.ValueOfUint64(x.OracleScriptId) + if !f(fd_Result_oracle_script_id, value) { + return + } + } + if len(x.Calldata) != 0 { + value := protoreflect.ValueOfBytes(x.Calldata) + if !f(fd_Result_calldata, value) { + return + } + } + if x.AskCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.AskCount) + if !f(fd_Result_ask_count, value) { + return + } + } + if x.MinCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.MinCount) + if !f(fd_Result_min_count, value) { + return + } + } + if x.RequestId != uint64(0) { + value := protoreflect.ValueOfUint64(x.RequestId) + if !f(fd_Result_request_id, value) { + return + } + } + if x.AnsCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.AnsCount) + if !f(fd_Result_ans_count, value) { + return + } + } + if x.RequestTime != int64(0) { + value := protoreflect.ValueOfInt64(x.RequestTime) + if !f(fd_Result_request_time, value) { + return + } + } + if x.ResolveTime != int64(0) { + value := protoreflect.ValueOfInt64(x.ResolveTime) + if !f(fd_Result_resolve_time, value) { + return + } + } + if x.ResolveStatus != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.ResolveStatus)) + if !f(fd_Result_resolve_status, value) { + return + } + } + if len(x.Result) != 0 { + value := protoreflect.ValueOfBytes(x.Result) + if !f(fd_Result_result, 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_Result) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.Result.client_id": + return x.ClientId != "" + case "oracle.v1.Result.oracle_script_id": + return x.OracleScriptId != uint64(0) + case "oracle.v1.Result.calldata": + return len(x.Calldata) != 0 + case "oracle.v1.Result.ask_count": + return x.AskCount != uint64(0) + case "oracle.v1.Result.min_count": + return x.MinCount != uint64(0) + case "oracle.v1.Result.request_id": + return x.RequestId != uint64(0) + case "oracle.v1.Result.ans_count": + return x.AnsCount != uint64(0) + case "oracle.v1.Result.request_time": + return x.RequestTime != int64(0) + case "oracle.v1.Result.resolve_time": + return x.ResolveTime != int64(0) + case "oracle.v1.Result.resolve_status": + return x.ResolveStatus != 0 + case "oracle.v1.Result.result": + return len(x.Result) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Result")) + } + panic(fmt.Errorf("message oracle.v1.Result 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_Result) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.Result.client_id": + x.ClientId = "" + case "oracle.v1.Result.oracle_script_id": + x.OracleScriptId = uint64(0) + case "oracle.v1.Result.calldata": + x.Calldata = nil + case "oracle.v1.Result.ask_count": + x.AskCount = uint64(0) + case "oracle.v1.Result.min_count": + x.MinCount = uint64(0) + case "oracle.v1.Result.request_id": + x.RequestId = uint64(0) + case "oracle.v1.Result.ans_count": + x.AnsCount = uint64(0) + case "oracle.v1.Result.request_time": + x.RequestTime = int64(0) + case "oracle.v1.Result.resolve_time": + x.ResolveTime = int64(0) + case "oracle.v1.Result.resolve_status": + x.ResolveStatus = 0 + case "oracle.v1.Result.result": + x.Result = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Result")) + } + panic(fmt.Errorf("message oracle.v1.Result 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_Result) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.Result.client_id": + value := x.ClientId + return protoreflect.ValueOfString(value) + case "oracle.v1.Result.oracle_script_id": + value := x.OracleScriptId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Result.calldata": + value := x.Calldata + return protoreflect.ValueOfBytes(value) + case "oracle.v1.Result.ask_count": + value := x.AskCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Result.min_count": + value := x.MinCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Result.request_id": + value := x.RequestId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Result.ans_count": + value := x.AnsCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Result.request_time": + value := x.RequestTime + return protoreflect.ValueOfInt64(value) + case "oracle.v1.Result.resolve_time": + value := x.ResolveTime + return protoreflect.ValueOfInt64(value) + case "oracle.v1.Result.resolve_status": + value := x.ResolveStatus + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "oracle.v1.Result.result": + value := x.Result + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Result")) + } + panic(fmt.Errorf("message oracle.v1.Result 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_Result) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.Result.client_id": + x.ClientId = value.Interface().(string) + case "oracle.v1.Result.oracle_script_id": + x.OracleScriptId = value.Uint() + case "oracle.v1.Result.calldata": + x.Calldata = value.Bytes() + case "oracle.v1.Result.ask_count": + x.AskCount = value.Uint() + case "oracle.v1.Result.min_count": + x.MinCount = value.Uint() + case "oracle.v1.Result.request_id": + x.RequestId = value.Uint() + case "oracle.v1.Result.ans_count": + x.AnsCount = value.Uint() + case "oracle.v1.Result.request_time": + x.RequestTime = value.Int() + case "oracle.v1.Result.resolve_time": + x.ResolveTime = value.Int() + case "oracle.v1.Result.resolve_status": + x.ResolveStatus = (ResolveStatus)(value.Enum()) + case "oracle.v1.Result.result": + x.Result = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Result")) + } + panic(fmt.Errorf("message oracle.v1.Result 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_Result) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.Result.client_id": + panic(fmt.Errorf("field client_id of message oracle.v1.Result is not mutable")) + case "oracle.v1.Result.oracle_script_id": + panic(fmt.Errorf("field oracle_script_id of message oracle.v1.Result is not mutable")) + case "oracle.v1.Result.calldata": + panic(fmt.Errorf("field calldata of message oracle.v1.Result is not mutable")) + case "oracle.v1.Result.ask_count": + panic(fmt.Errorf("field ask_count of message oracle.v1.Result is not mutable")) + case "oracle.v1.Result.min_count": + panic(fmt.Errorf("field min_count of message oracle.v1.Result is not mutable")) + case "oracle.v1.Result.request_id": + panic(fmt.Errorf("field request_id of message oracle.v1.Result is not mutable")) + case "oracle.v1.Result.ans_count": + panic(fmt.Errorf("field ans_count of message oracle.v1.Result is not mutable")) + case "oracle.v1.Result.request_time": + panic(fmt.Errorf("field request_time of message oracle.v1.Result is not mutable")) + case "oracle.v1.Result.resolve_time": + panic(fmt.Errorf("field resolve_time of message oracle.v1.Result is not mutable")) + case "oracle.v1.Result.resolve_status": + panic(fmt.Errorf("field resolve_status of message oracle.v1.Result is not mutable")) + case "oracle.v1.Result.result": + panic(fmt.Errorf("field result of message oracle.v1.Result is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Result")) + } + panic(fmt.Errorf("message oracle.v1.Result 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_Result) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.Result.client_id": + return protoreflect.ValueOfString("") + case "oracle.v1.Result.oracle_script_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Result.calldata": + return protoreflect.ValueOfBytes(nil) + case "oracle.v1.Result.ask_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Result.min_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Result.request_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Result.ans_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Result.request_time": + return protoreflect.ValueOfInt64(int64(0)) + case "oracle.v1.Result.resolve_time": + return protoreflect.ValueOfInt64(int64(0)) + case "oracle.v1.Result.resolve_status": + return protoreflect.ValueOfEnum(0) + case "oracle.v1.Result.result": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Result")) + } + panic(fmt.Errorf("message oracle.v1.Result 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_Result) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.Result", 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_Result) 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_Result) 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_Result) 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_Result) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Result) + 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.ClientId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.OracleScriptId != 0 { + n += 1 + runtime.Sov(uint64(x.OracleScriptId)) + } + l = len(x.Calldata) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.AskCount != 0 { + n += 1 + runtime.Sov(uint64(x.AskCount)) + } + if x.MinCount != 0 { + n += 1 + runtime.Sov(uint64(x.MinCount)) + } + if x.RequestId != 0 { + n += 1 + runtime.Sov(uint64(x.RequestId)) + } + if x.AnsCount != 0 { + n += 1 + runtime.Sov(uint64(x.AnsCount)) + } + if x.RequestTime != 0 { + n += 1 + runtime.Sov(uint64(x.RequestTime)) + } + if x.ResolveTime != 0 { + n += 1 + runtime.Sov(uint64(x.ResolveTime)) + } + if x.ResolveStatus != 0 { + n += 1 + runtime.Sov(uint64(x.ResolveStatus)) + } + l = len(x.Result) + 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().(*Result) + 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.Result) > 0 { + i -= len(x.Result) + copy(dAtA[i:], x.Result) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Result))) + i-- + dAtA[i] = 0x5a + } + if x.ResolveStatus != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ResolveStatus)) + i-- + dAtA[i] = 0x50 + } + if x.ResolveTime != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ResolveTime)) + i-- + dAtA[i] = 0x48 + } + if x.RequestTime != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RequestTime)) + i-- + dAtA[i] = 0x40 + } + if x.AnsCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AnsCount)) + i-- + dAtA[i] = 0x38 + } + if x.RequestId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RequestId)) + i-- + dAtA[i] = 0x30 + } + if x.MinCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MinCount)) + i-- + dAtA[i] = 0x28 + } + if x.AskCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AskCount)) + i-- + dAtA[i] = 0x20 + } + if len(x.Calldata) > 0 { + i -= len(x.Calldata) + copy(dAtA[i:], x.Calldata) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Calldata))) + i-- + dAtA[i] = 0x1a + } + if x.OracleScriptId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.OracleScriptId)) + i-- + dAtA[i] = 0x10 + } + if len(x.ClientId) > 0 { + i -= len(x.ClientId) + copy(dAtA[i:], x.ClientId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ClientId))) + 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().(*Result) + 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: Result: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Result: 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 ClientId", 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.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OracleScriptId", wireType) + } + x.OracleScriptId = 0 + 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++ + x.OracleScriptId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Calldata", 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.Calldata = append(x.Calldata[:0], dAtA[iNdEx:postIndex]...) + if x.Calldata == nil { + x.Calldata = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AskCount", wireType) + } + x.AskCount = 0 + 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++ + x.AskCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinCount", wireType) + } + x.MinCount = 0 + 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++ + x.MinCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) + } + x.RequestId = 0 + 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++ + x.RequestId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AnsCount", wireType) + } + x.AnsCount = 0 + 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++ + x.AnsCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestTime", wireType) + } + x.RequestTime = 0 + 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++ + x.RequestTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ResolveTime", wireType) + } + x.ResolveTime = 0 + 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++ + x.ResolveTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ResolveStatus", wireType) + } + x.ResolveStatus = 0 + 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++ + x.ResolveStatus |= ResolveStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Result", 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.Result = append(x.Result[:0], dAtA[iNdEx:postIndex]...) + if x.Result == nil { + x.Result = []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_ValidatorStatus protoreflect.MessageDescriptor + fd_ValidatorStatus_is_active protoreflect.FieldDescriptor + fd_ValidatorStatus_since protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_ValidatorStatus = File_oracle_v1_oracle_proto.Messages().ByName("ValidatorStatus") + fd_ValidatorStatus_is_active = md_ValidatorStatus.Fields().ByName("is_active") + fd_ValidatorStatus_since = md_ValidatorStatus.Fields().ByName("since") +} + +var _ protoreflect.Message = (*fastReflection_ValidatorStatus)(nil) + +type fastReflection_ValidatorStatus ValidatorStatus + +func (x *ValidatorStatus) ProtoReflect() protoreflect.Message { + return (*fastReflection_ValidatorStatus)(x) +} + +func (x *ValidatorStatus) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_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_ValidatorStatus_messageType fastReflection_ValidatorStatus_messageType +var _ protoreflect.MessageType = fastReflection_ValidatorStatus_messageType{} + +type fastReflection_ValidatorStatus_messageType struct{} + +func (x fastReflection_ValidatorStatus_messageType) Zero() protoreflect.Message { + return (*fastReflection_ValidatorStatus)(nil) +} +func (x fastReflection_ValidatorStatus_messageType) New() protoreflect.Message { + return new(fastReflection_ValidatorStatus) +} +func (x fastReflection_ValidatorStatus_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorStatus +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ValidatorStatus) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorStatus +} + +// 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_ValidatorStatus) Type() protoreflect.MessageType { + return _fastReflection_ValidatorStatus_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ValidatorStatus) New() protoreflect.Message { + return new(fastReflection_ValidatorStatus) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ValidatorStatus) Interface() protoreflect.ProtoMessage { + return (*ValidatorStatus)(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_ValidatorStatus) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.IsActive != false { + value := protoreflect.ValueOfBool(x.IsActive) + if !f(fd_ValidatorStatus_is_active, value) { + return + } + } + if x.Since != nil { + value := protoreflect.ValueOfMessage(x.Since.ProtoReflect()) + if !f(fd_ValidatorStatus_since, 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_ValidatorStatus) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.ValidatorStatus.is_active": + return x.IsActive != false + case "oracle.v1.ValidatorStatus.since": + return x.Since != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.ValidatorStatus")) + } + panic(fmt.Errorf("message oracle.v1.ValidatorStatus 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_ValidatorStatus) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.ValidatorStatus.is_active": + x.IsActive = false + case "oracle.v1.ValidatorStatus.since": + x.Since = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.ValidatorStatus")) + } + panic(fmt.Errorf("message oracle.v1.ValidatorStatus 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_ValidatorStatus) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.ValidatorStatus.is_active": + value := x.IsActive + return protoreflect.ValueOfBool(value) + case "oracle.v1.ValidatorStatus.since": + value := x.Since + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.ValidatorStatus")) + } + panic(fmt.Errorf("message oracle.v1.ValidatorStatus 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_ValidatorStatus) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.ValidatorStatus.is_active": + x.IsActive = value.Bool() + case "oracle.v1.ValidatorStatus.since": + x.Since = value.Message().Interface().(*timestamppb.Timestamp) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.ValidatorStatus")) + } + panic(fmt.Errorf("message oracle.v1.ValidatorStatus 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_ValidatorStatus) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.ValidatorStatus.since": + if x.Since == nil { + x.Since = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.Since.ProtoReflect()) + case "oracle.v1.ValidatorStatus.is_active": + panic(fmt.Errorf("field is_active of message oracle.v1.ValidatorStatus is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.ValidatorStatus")) + } + panic(fmt.Errorf("message oracle.v1.ValidatorStatus 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_ValidatorStatus) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.ValidatorStatus.is_active": + return protoreflect.ValueOfBool(false) + case "oracle.v1.ValidatorStatus.since": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.ValidatorStatus")) + } + panic(fmt.Errorf("message oracle.v1.ValidatorStatus 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_ValidatorStatus) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.ValidatorStatus", 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_ValidatorStatus) 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_ValidatorStatus) 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_ValidatorStatus) 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_ValidatorStatus) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ValidatorStatus) + 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.IsActive { + n += 2 + } + if x.Since != nil { + l = options.Size(x.Since) + 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().(*ValidatorStatus) + 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.Since != nil { + encoded, err := options.Marshal(x.Since) + 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.IsActive { + i-- + if x.IsActive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + 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().(*ValidatorStatus) + 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: ValidatorStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ValidatorStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IsActive", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.IsActive = bool(v != 0) + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Since", 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.Since == nil { + x.Since = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Since); 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_ActiveValidator protoreflect.MessageDescriptor + fd_ActiveValidator_address protoreflect.FieldDescriptor + fd_ActiveValidator_power protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_ActiveValidator = File_oracle_v1_oracle_proto.Messages().ByName("ActiveValidator") + fd_ActiveValidator_address = md_ActiveValidator.Fields().ByName("address") + fd_ActiveValidator_power = md_ActiveValidator.Fields().ByName("power") +} + +var _ protoreflect.Message = (*fastReflection_ActiveValidator)(nil) + +type fastReflection_ActiveValidator ActiveValidator + +func (x *ActiveValidator) ProtoReflect() protoreflect.Message { + return (*fastReflection_ActiveValidator)(x) +} + +func (x *ActiveValidator) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_proto_msgTypes[11] + 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_ActiveValidator_messageType fastReflection_ActiveValidator_messageType +var _ protoreflect.MessageType = fastReflection_ActiveValidator_messageType{} + +type fastReflection_ActiveValidator_messageType struct{} + +func (x fastReflection_ActiveValidator_messageType) Zero() protoreflect.Message { + return (*fastReflection_ActiveValidator)(nil) +} +func (x fastReflection_ActiveValidator_messageType) New() protoreflect.Message { + return new(fastReflection_ActiveValidator) +} +func (x fastReflection_ActiveValidator_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ActiveValidator +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ActiveValidator) Descriptor() protoreflect.MessageDescriptor { + return md_ActiveValidator +} + +// 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_ActiveValidator) Type() protoreflect.MessageType { + return _fastReflection_ActiveValidator_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ActiveValidator) New() protoreflect.Message { + return new(fastReflection_ActiveValidator) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ActiveValidator) Interface() protoreflect.ProtoMessage { + return (*ActiveValidator)(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_ActiveValidator) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_ActiveValidator_address, value) { + return + } + } + if x.Power != uint64(0) { + value := protoreflect.ValueOfUint64(x.Power) + if !f(fd_ActiveValidator_power, 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_ActiveValidator) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.ActiveValidator.address": + return x.Address != "" + case "oracle.v1.ActiveValidator.power": + return x.Power != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.ActiveValidator")) + } + panic(fmt.Errorf("message oracle.v1.ActiveValidator 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_ActiveValidator) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.ActiveValidator.address": + x.Address = "" + case "oracle.v1.ActiveValidator.power": + x.Power = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.ActiveValidator")) + } + panic(fmt.Errorf("message oracle.v1.ActiveValidator 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_ActiveValidator) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.ActiveValidator.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "oracle.v1.ActiveValidator.power": + value := x.Power + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.ActiveValidator")) + } + panic(fmt.Errorf("message oracle.v1.ActiveValidator 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_ActiveValidator) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.ActiveValidator.address": + x.Address = value.Interface().(string) + case "oracle.v1.ActiveValidator.power": + x.Power = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.ActiveValidator")) + } + panic(fmt.Errorf("message oracle.v1.ActiveValidator 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_ActiveValidator) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.ActiveValidator.address": + panic(fmt.Errorf("field address of message oracle.v1.ActiveValidator is not mutable")) + case "oracle.v1.ActiveValidator.power": + panic(fmt.Errorf("field power of message oracle.v1.ActiveValidator is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.ActiveValidator")) + } + panic(fmt.Errorf("message oracle.v1.ActiveValidator 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_ActiveValidator) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.ActiveValidator.address": + return protoreflect.ValueOfString("") + case "oracle.v1.ActiveValidator.power": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.ActiveValidator")) + } + panic(fmt.Errorf("message oracle.v1.ActiveValidator 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_ActiveValidator) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.ActiveValidator", 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_ActiveValidator) 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_ActiveValidator) 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_ActiveValidator) 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_ActiveValidator) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ActiveValidator) + 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.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Power != 0 { + n += 1 + runtime.Sov(uint64(x.Power)) + } + 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().(*ActiveValidator) + 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.Power != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Power)) + i-- + dAtA[i] = 0x10 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + 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().(*ActiveValidator) + 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: ActiveValidator: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ActiveValidator: 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 Address", 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Power", wireType) + } + x.Power = 0 + 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++ + x.Power |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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_Params protoreflect.MessageDescriptor + fd_Params_max_raw_request_count protoreflect.FieldDescriptor + fd_Params_max_ask_count protoreflect.FieldDescriptor + fd_Params_max_calldata_size protoreflect.FieldDescriptor + fd_Params_max_report_data_size protoreflect.FieldDescriptor + fd_Params_expiration_block_count protoreflect.FieldDescriptor + fd_Params_base_owasm_gas protoreflect.FieldDescriptor + fd_Params_per_validator_request_gas protoreflect.FieldDescriptor + fd_Params_sampling_try_count protoreflect.FieldDescriptor + fd_Params_oracle_reward_percentage protoreflect.FieldDescriptor + fd_Params_inactive_penalty_duration protoreflect.FieldDescriptor + fd_Params_ibc_request_enabled protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_Params = File_oracle_v1_oracle_proto.Messages().ByName("Params") + fd_Params_max_raw_request_count = md_Params.Fields().ByName("max_raw_request_count") + fd_Params_max_ask_count = md_Params.Fields().ByName("max_ask_count") + fd_Params_max_calldata_size = md_Params.Fields().ByName("max_calldata_size") + fd_Params_max_report_data_size = md_Params.Fields().ByName("max_report_data_size") + fd_Params_expiration_block_count = md_Params.Fields().ByName("expiration_block_count") + fd_Params_base_owasm_gas = md_Params.Fields().ByName("base_owasm_gas") + fd_Params_per_validator_request_gas = md_Params.Fields().ByName("per_validator_request_gas") + fd_Params_sampling_try_count = md_Params.Fields().ByName("sampling_try_count") + fd_Params_oracle_reward_percentage = md_Params.Fields().ByName("oracle_reward_percentage") + fd_Params_inactive_penalty_duration = md_Params.Fields().ByName("inactive_penalty_duration") + fd_Params_ibc_request_enabled = md_Params.Fields().ByName("ibc_request_enabled") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_proto_msgTypes[12] + 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_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// 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_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(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_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.MaxRawRequestCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.MaxRawRequestCount) + if !f(fd_Params_max_raw_request_count, value) { + return + } + } + if x.MaxAskCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.MaxAskCount) + if !f(fd_Params_max_ask_count, value) { + return + } + } + if x.MaxCalldataSize != uint64(0) { + value := protoreflect.ValueOfUint64(x.MaxCalldataSize) + if !f(fd_Params_max_calldata_size, value) { + return + } + } + if x.MaxReportDataSize != uint64(0) { + value := protoreflect.ValueOfUint64(x.MaxReportDataSize) + if !f(fd_Params_max_report_data_size, value) { + return + } + } + if x.ExpirationBlockCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.ExpirationBlockCount) + if !f(fd_Params_expiration_block_count, value) { + return + } + } + if x.BaseOwasmGas != uint64(0) { + value := protoreflect.ValueOfUint64(x.BaseOwasmGas) + if !f(fd_Params_base_owasm_gas, value) { + return + } + } + if x.PerValidatorRequestGas != uint64(0) { + value := protoreflect.ValueOfUint64(x.PerValidatorRequestGas) + if !f(fd_Params_per_validator_request_gas, value) { + return + } + } + if x.SamplingTryCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.SamplingTryCount) + if !f(fd_Params_sampling_try_count, value) { + return + } + } + if x.OracleRewardPercentage != uint64(0) { + value := protoreflect.ValueOfUint64(x.OracleRewardPercentage) + if !f(fd_Params_oracle_reward_percentage, value) { + return + } + } + if x.InactivePenaltyDuration != uint64(0) { + value := protoreflect.ValueOfUint64(x.InactivePenaltyDuration) + if !f(fd_Params_inactive_penalty_duration, value) { + return + } + } + if x.IbcRequestEnabled != false { + value := protoreflect.ValueOfBool(x.IbcRequestEnabled) + if !f(fd_Params_ibc_request_enabled, 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_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.Params.max_raw_request_count": + return x.MaxRawRequestCount != uint64(0) + case "oracle.v1.Params.max_ask_count": + return x.MaxAskCount != uint64(0) + case "oracle.v1.Params.max_calldata_size": + return x.MaxCalldataSize != uint64(0) + case "oracle.v1.Params.max_report_data_size": + return x.MaxReportDataSize != uint64(0) + case "oracle.v1.Params.expiration_block_count": + return x.ExpirationBlockCount != uint64(0) + case "oracle.v1.Params.base_owasm_gas": + return x.BaseOwasmGas != uint64(0) + case "oracle.v1.Params.per_validator_request_gas": + return x.PerValidatorRequestGas != uint64(0) + case "oracle.v1.Params.sampling_try_count": + return x.SamplingTryCount != uint64(0) + case "oracle.v1.Params.oracle_reward_percentage": + return x.OracleRewardPercentage != uint64(0) + case "oracle.v1.Params.inactive_penalty_duration": + return x.InactivePenaltyDuration != uint64(0) + case "oracle.v1.Params.ibc_request_enabled": + return x.IbcRequestEnabled != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Params")) + } + panic(fmt.Errorf("message oracle.v1.Params 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_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.Params.max_raw_request_count": + x.MaxRawRequestCount = uint64(0) + case "oracle.v1.Params.max_ask_count": + x.MaxAskCount = uint64(0) + case "oracle.v1.Params.max_calldata_size": + x.MaxCalldataSize = uint64(0) + case "oracle.v1.Params.max_report_data_size": + x.MaxReportDataSize = uint64(0) + case "oracle.v1.Params.expiration_block_count": + x.ExpirationBlockCount = uint64(0) + case "oracle.v1.Params.base_owasm_gas": + x.BaseOwasmGas = uint64(0) + case "oracle.v1.Params.per_validator_request_gas": + x.PerValidatorRequestGas = uint64(0) + case "oracle.v1.Params.sampling_try_count": + x.SamplingTryCount = uint64(0) + case "oracle.v1.Params.oracle_reward_percentage": + x.OracleRewardPercentage = uint64(0) + case "oracle.v1.Params.inactive_penalty_duration": + x.InactivePenaltyDuration = uint64(0) + case "oracle.v1.Params.ibc_request_enabled": + x.IbcRequestEnabled = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Params")) + } + panic(fmt.Errorf("message oracle.v1.Params 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_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.Params.max_raw_request_count": + value := x.MaxRawRequestCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Params.max_ask_count": + value := x.MaxAskCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Params.max_calldata_size": + value := x.MaxCalldataSize + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Params.max_report_data_size": + value := x.MaxReportDataSize + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Params.expiration_block_count": + value := x.ExpirationBlockCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Params.base_owasm_gas": + value := x.BaseOwasmGas + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Params.per_validator_request_gas": + value := x.PerValidatorRequestGas + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Params.sampling_try_count": + value := x.SamplingTryCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Params.oracle_reward_percentage": + value := x.OracleRewardPercentage + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Params.inactive_penalty_duration": + value := x.InactivePenaltyDuration + return protoreflect.ValueOfUint64(value) + case "oracle.v1.Params.ibc_request_enabled": + value := x.IbcRequestEnabled + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Params")) + } + panic(fmt.Errorf("message oracle.v1.Params 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_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.Params.max_raw_request_count": + x.MaxRawRequestCount = value.Uint() + case "oracle.v1.Params.max_ask_count": + x.MaxAskCount = value.Uint() + case "oracle.v1.Params.max_calldata_size": + x.MaxCalldataSize = value.Uint() + case "oracle.v1.Params.max_report_data_size": + x.MaxReportDataSize = value.Uint() + case "oracle.v1.Params.expiration_block_count": + x.ExpirationBlockCount = value.Uint() + case "oracle.v1.Params.base_owasm_gas": + x.BaseOwasmGas = value.Uint() + case "oracle.v1.Params.per_validator_request_gas": + x.PerValidatorRequestGas = value.Uint() + case "oracle.v1.Params.sampling_try_count": + x.SamplingTryCount = value.Uint() + case "oracle.v1.Params.oracle_reward_percentage": + x.OracleRewardPercentage = value.Uint() + case "oracle.v1.Params.inactive_penalty_duration": + x.InactivePenaltyDuration = value.Uint() + case "oracle.v1.Params.ibc_request_enabled": + x.IbcRequestEnabled = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Params")) + } + panic(fmt.Errorf("message oracle.v1.Params 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_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.Params.max_raw_request_count": + panic(fmt.Errorf("field max_raw_request_count of message oracle.v1.Params is not mutable")) + case "oracle.v1.Params.max_ask_count": + panic(fmt.Errorf("field max_ask_count of message oracle.v1.Params is not mutable")) + case "oracle.v1.Params.max_calldata_size": + panic(fmt.Errorf("field max_calldata_size of message oracle.v1.Params is not mutable")) + case "oracle.v1.Params.max_report_data_size": + panic(fmt.Errorf("field max_report_data_size of message oracle.v1.Params is not mutable")) + case "oracle.v1.Params.expiration_block_count": + panic(fmt.Errorf("field expiration_block_count of message oracle.v1.Params is not mutable")) + case "oracle.v1.Params.base_owasm_gas": + panic(fmt.Errorf("field base_owasm_gas of message oracle.v1.Params is not mutable")) + case "oracle.v1.Params.per_validator_request_gas": + panic(fmt.Errorf("field per_validator_request_gas of message oracle.v1.Params is not mutable")) + case "oracle.v1.Params.sampling_try_count": + panic(fmt.Errorf("field sampling_try_count of message oracle.v1.Params is not mutable")) + case "oracle.v1.Params.oracle_reward_percentage": + panic(fmt.Errorf("field oracle_reward_percentage of message oracle.v1.Params is not mutable")) + case "oracle.v1.Params.inactive_penalty_duration": + panic(fmt.Errorf("field inactive_penalty_duration of message oracle.v1.Params is not mutable")) + case "oracle.v1.Params.ibc_request_enabled": + panic(fmt.Errorf("field ibc_request_enabled of message oracle.v1.Params is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Params")) + } + panic(fmt.Errorf("message oracle.v1.Params 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_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.Params.max_raw_request_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Params.max_ask_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Params.max_calldata_size": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Params.max_report_data_size": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Params.expiration_block_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Params.base_owasm_gas": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Params.per_validator_request_gas": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Params.sampling_try_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Params.oracle_reward_percentage": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Params.inactive_penalty_duration": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.Params.ibc_request_enabled": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Params")) + } + panic(fmt.Errorf("message oracle.v1.Params 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_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.Params", 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_Params) 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_Params) 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_Params) 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_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + 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.MaxRawRequestCount != 0 { + n += 1 + runtime.Sov(uint64(x.MaxRawRequestCount)) + } + if x.MaxAskCount != 0 { + n += 1 + runtime.Sov(uint64(x.MaxAskCount)) + } + if x.MaxCalldataSize != 0 { + n += 1 + runtime.Sov(uint64(x.MaxCalldataSize)) + } + if x.MaxReportDataSize != 0 { + n += 1 + runtime.Sov(uint64(x.MaxReportDataSize)) + } + if x.ExpirationBlockCount != 0 { + n += 1 + runtime.Sov(uint64(x.ExpirationBlockCount)) + } + if x.BaseOwasmGas != 0 { + n += 1 + runtime.Sov(uint64(x.BaseOwasmGas)) + } + if x.PerValidatorRequestGas != 0 { + n += 1 + runtime.Sov(uint64(x.PerValidatorRequestGas)) + } + if x.SamplingTryCount != 0 { + n += 1 + runtime.Sov(uint64(x.SamplingTryCount)) + } + if x.OracleRewardPercentage != 0 { + n += 1 + runtime.Sov(uint64(x.OracleRewardPercentage)) + } + if x.InactivePenaltyDuration != 0 { + n += 1 + runtime.Sov(uint64(x.InactivePenaltyDuration)) + } + if x.IbcRequestEnabled { + n += 2 + } + 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().(*Params) + 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.IbcRequestEnabled { + i-- + if x.IbcRequestEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if x.InactivePenaltyDuration != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.InactivePenaltyDuration)) + i-- + dAtA[i] = 0x50 + } + if x.OracleRewardPercentage != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.OracleRewardPercentage)) + i-- + dAtA[i] = 0x48 + } + if x.SamplingTryCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.SamplingTryCount)) + i-- + dAtA[i] = 0x40 + } + if x.PerValidatorRequestGas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.PerValidatorRequestGas)) + i-- + dAtA[i] = 0x38 + } + if x.BaseOwasmGas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BaseOwasmGas)) + i-- + dAtA[i] = 0x30 + } + if x.ExpirationBlockCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExpirationBlockCount)) + i-- + dAtA[i] = 0x28 + } + if x.MaxReportDataSize != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxReportDataSize)) + i-- + dAtA[i] = 0x20 + } + if x.MaxCalldataSize != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxCalldataSize)) + i-- + dAtA[i] = 0x18 + } + if x.MaxAskCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxAskCount)) + i-- + dAtA[i] = 0x10 + } + if x.MaxRawRequestCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxRawRequestCount)) + i-- + dAtA[i] = 0x8 + } + 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().(*Params) + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxRawRequestCount", wireType) + } + x.MaxRawRequestCount = 0 + 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++ + x.MaxRawRequestCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxAskCount", wireType) + } + x.MaxAskCount = 0 + 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++ + x.MaxAskCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxCalldataSize", wireType) + } + x.MaxCalldataSize = 0 + 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++ + x.MaxCalldataSize |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxReportDataSize", wireType) + } + x.MaxReportDataSize = 0 + 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++ + x.MaxReportDataSize |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExpirationBlockCount", wireType) + } + x.ExpirationBlockCount = 0 + 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++ + x.ExpirationBlockCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BaseOwasmGas", wireType) + } + x.BaseOwasmGas = 0 + 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++ + x.BaseOwasmGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PerValidatorRequestGas", wireType) + } + x.PerValidatorRequestGas = 0 + 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++ + x.PerValidatorRequestGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SamplingTryCount", wireType) + } + x.SamplingTryCount = 0 + 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++ + x.SamplingTryCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OracleRewardPercentage", wireType) + } + x.OracleRewardPercentage = 0 + 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++ + x.OracleRewardPercentage |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InactivePenaltyDuration", wireType) + } + x.InactivePenaltyDuration = 0 + 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++ + x.InactivePenaltyDuration |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IbcRequestEnabled", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.IbcRequestEnabled = bool(v != 0) + 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 = (*_PendingResolveList_1_list)(nil) + +type _PendingResolveList_1_list struct { + list *[]uint64 +} + +func (x *_PendingResolveList_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_PendingResolveList_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfUint64((*x.list)[i]) +} + +func (x *_PendingResolveList_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Uint() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_PendingResolveList_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Uint() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_PendingResolveList_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message PendingResolveList at list field RequestIds as it is not of Message kind")) +} + +func (x *_PendingResolveList_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_PendingResolveList_1_list) NewElement() protoreflect.Value { + v := uint64(0) + return protoreflect.ValueOfUint64(v) +} + +func (x *_PendingResolveList_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_PendingResolveList protoreflect.MessageDescriptor + fd_PendingResolveList_request_ids protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_PendingResolveList = File_oracle_v1_oracle_proto.Messages().ByName("PendingResolveList") + fd_PendingResolveList_request_ids = md_PendingResolveList.Fields().ByName("request_ids") +} + +var _ protoreflect.Message = (*fastReflection_PendingResolveList)(nil) + +type fastReflection_PendingResolveList PendingResolveList + +func (x *PendingResolveList) ProtoReflect() protoreflect.Message { + return (*fastReflection_PendingResolveList)(x) +} + +func (x *PendingResolveList) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_proto_msgTypes[13] + 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_PendingResolveList_messageType fastReflection_PendingResolveList_messageType +var _ protoreflect.MessageType = fastReflection_PendingResolveList_messageType{} + +type fastReflection_PendingResolveList_messageType struct{} + +func (x fastReflection_PendingResolveList_messageType) Zero() protoreflect.Message { + return (*fastReflection_PendingResolveList)(nil) +} +func (x fastReflection_PendingResolveList_messageType) New() protoreflect.Message { + return new(fastReflection_PendingResolveList) +} +func (x fastReflection_PendingResolveList_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_PendingResolveList +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_PendingResolveList) Descriptor() protoreflect.MessageDescriptor { + return md_PendingResolveList +} + +// 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_PendingResolveList) Type() protoreflect.MessageType { + return _fastReflection_PendingResolveList_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_PendingResolveList) New() protoreflect.Message { + return new(fastReflection_PendingResolveList) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_PendingResolveList) Interface() protoreflect.ProtoMessage { + return (*PendingResolveList)(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_PendingResolveList) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.RequestIds) != 0 { + value := protoreflect.ValueOfList(&_PendingResolveList_1_list{list: &x.RequestIds}) + if !f(fd_PendingResolveList_request_ids, 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_PendingResolveList) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.PendingResolveList.request_ids": + return len(x.RequestIds) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.PendingResolveList")) + } + panic(fmt.Errorf("message oracle.v1.PendingResolveList 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_PendingResolveList) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.PendingResolveList.request_ids": + x.RequestIds = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.PendingResolveList")) + } + panic(fmt.Errorf("message oracle.v1.PendingResolveList 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_PendingResolveList) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.PendingResolveList.request_ids": + if len(x.RequestIds) == 0 { + return protoreflect.ValueOfList(&_PendingResolveList_1_list{}) + } + listValue := &_PendingResolveList_1_list{list: &x.RequestIds} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.PendingResolveList")) + } + panic(fmt.Errorf("message oracle.v1.PendingResolveList 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_PendingResolveList) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.PendingResolveList.request_ids": + lv := value.List() + clv := lv.(*_PendingResolveList_1_list) + x.RequestIds = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.PendingResolveList")) + } + panic(fmt.Errorf("message oracle.v1.PendingResolveList 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_PendingResolveList) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.PendingResolveList.request_ids": + if x.RequestIds == nil { + x.RequestIds = []uint64{} + } + value := &_PendingResolveList_1_list{list: &x.RequestIds} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.PendingResolveList")) + } + panic(fmt.Errorf("message oracle.v1.PendingResolveList 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_PendingResolveList) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.PendingResolveList.request_ids": + list := []uint64{} + return protoreflect.ValueOfList(&_PendingResolveList_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.PendingResolveList")) + } + panic(fmt.Errorf("message oracle.v1.PendingResolveList 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_PendingResolveList) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.PendingResolveList", 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_PendingResolveList) 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_PendingResolveList) 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_PendingResolveList) 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_PendingResolveList) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*PendingResolveList) + 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.RequestIds) > 0 { + l = 0 + for _, e := range x.RequestIds { + l += runtime.Sov(uint64(e)) + } + n += 1 + runtime.Sov(uint64(l)) + 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().(*PendingResolveList) + 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.RequestIds) > 0 { + var pksize2 int + for _, num := range x.RequestIds { + pksize2 += runtime.Sov(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num := range x.RequestIds { + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ + } + i = runtime.EncodeVarint(dAtA, i, uint64(pksize2)) + 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().(*PendingResolveList) + 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: PendingResolveList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PendingResolveList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v 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++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.RequestIds = append(x.RequestIds, v) + } else if wireType == 2 { + var packedLen 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++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + packedLen + 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 + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(x.RequestIds) == 0 { + x.RequestIds = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v 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++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.RequestIds = append(x.RequestIds, v) + } + } else { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestIds", wireType) + } + 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_IBCChannel protoreflect.MessageDescriptor + fd_IBCChannel_port_id protoreflect.FieldDescriptor + fd_IBCChannel_channel_id protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_IBCChannel = File_oracle_v1_oracle_proto.Messages().ByName("IBCChannel") + fd_IBCChannel_port_id = md_IBCChannel.Fields().ByName("port_id") + fd_IBCChannel_channel_id = md_IBCChannel.Fields().ByName("channel_id") +} + +var _ protoreflect.Message = (*fastReflection_IBCChannel)(nil) + +type fastReflection_IBCChannel IBCChannel + +func (x *IBCChannel) ProtoReflect() protoreflect.Message { + return (*fastReflection_IBCChannel)(x) +} + +func (x *IBCChannel) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_proto_msgTypes[14] + 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_IBCChannel_messageType fastReflection_IBCChannel_messageType +var _ protoreflect.MessageType = fastReflection_IBCChannel_messageType{} + +type fastReflection_IBCChannel_messageType struct{} + +func (x fastReflection_IBCChannel_messageType) Zero() protoreflect.Message { + return (*fastReflection_IBCChannel)(nil) +} +func (x fastReflection_IBCChannel_messageType) New() protoreflect.Message { + return new(fastReflection_IBCChannel) +} +func (x fastReflection_IBCChannel_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_IBCChannel +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_IBCChannel) Descriptor() protoreflect.MessageDescriptor { + return md_IBCChannel +} + +// 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_IBCChannel) Type() protoreflect.MessageType { + return _fastReflection_IBCChannel_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_IBCChannel) New() protoreflect.Message { + return new(fastReflection_IBCChannel) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_IBCChannel) Interface() protoreflect.ProtoMessage { + return (*IBCChannel)(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_IBCChannel) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.PortId != "" { + value := protoreflect.ValueOfString(x.PortId) + if !f(fd_IBCChannel_port_id, value) { + return + } + } + if x.ChannelId != "" { + value := protoreflect.ValueOfString(x.ChannelId) + if !f(fd_IBCChannel_channel_id, 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_IBCChannel) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.IBCChannel.port_id": + return x.PortId != "" + case "oracle.v1.IBCChannel.channel_id": + return x.ChannelId != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.IBCChannel")) + } + panic(fmt.Errorf("message oracle.v1.IBCChannel 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_IBCChannel) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.IBCChannel.port_id": + x.PortId = "" + case "oracle.v1.IBCChannel.channel_id": + x.ChannelId = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.IBCChannel")) + } + panic(fmt.Errorf("message oracle.v1.IBCChannel 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_IBCChannel) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.IBCChannel.port_id": + value := x.PortId + return protoreflect.ValueOfString(value) + case "oracle.v1.IBCChannel.channel_id": + value := x.ChannelId + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.IBCChannel")) + } + panic(fmt.Errorf("message oracle.v1.IBCChannel 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_IBCChannel) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.IBCChannel.port_id": + x.PortId = value.Interface().(string) + case "oracle.v1.IBCChannel.channel_id": + x.ChannelId = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.IBCChannel")) + } + panic(fmt.Errorf("message oracle.v1.IBCChannel 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_IBCChannel) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.IBCChannel.port_id": + panic(fmt.Errorf("field port_id of message oracle.v1.IBCChannel is not mutable")) + case "oracle.v1.IBCChannel.channel_id": + panic(fmt.Errorf("field channel_id of message oracle.v1.IBCChannel is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.IBCChannel")) + } + panic(fmt.Errorf("message oracle.v1.IBCChannel 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_IBCChannel) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.IBCChannel.port_id": + return protoreflect.ValueOfString("") + case "oracle.v1.IBCChannel.channel_id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.IBCChannel")) + } + panic(fmt.Errorf("message oracle.v1.IBCChannel 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_IBCChannel) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.IBCChannel", 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_IBCChannel) 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_IBCChannel) 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_IBCChannel) 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_IBCChannel) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*IBCChannel) + 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.PortId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ChannelId) + 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().(*IBCChannel) + 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.ChannelId) > 0 { + i -= len(x.ChannelId) + copy(dAtA[i:], x.ChannelId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(x.PortId) > 0 { + i -= len(x.PortId) + copy(dAtA[i:], x.PortId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PortId))) + 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().(*IBCChannel) + 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: IBCChannel: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: IBCChannel: 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 PortId", 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.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChannelId", 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.ChannelId = 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_RequestVerification protoreflect.MessageDescriptor + fd_RequestVerification_chain_id protoreflect.FieldDescriptor + fd_RequestVerification_validator protoreflect.FieldDescriptor + fd_RequestVerification_request_id protoreflect.FieldDescriptor + fd_RequestVerification_external_id protoreflect.FieldDescriptor + fd_RequestVerification_data_source_id protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_RequestVerification = File_oracle_v1_oracle_proto.Messages().ByName("RequestVerification") + fd_RequestVerification_chain_id = md_RequestVerification.Fields().ByName("chain_id") + fd_RequestVerification_validator = md_RequestVerification.Fields().ByName("validator") + fd_RequestVerification_request_id = md_RequestVerification.Fields().ByName("request_id") + fd_RequestVerification_external_id = md_RequestVerification.Fields().ByName("external_id") + fd_RequestVerification_data_source_id = md_RequestVerification.Fields().ByName("data_source_id") +} + +var _ protoreflect.Message = (*fastReflection_RequestVerification)(nil) + +type fastReflection_RequestVerification RequestVerification + +func (x *RequestVerification) ProtoReflect() protoreflect.Message { + return (*fastReflection_RequestVerification)(x) +} + +func (x *RequestVerification) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_proto_msgTypes[15] + 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_RequestVerification_messageType fastReflection_RequestVerification_messageType +var _ protoreflect.MessageType = fastReflection_RequestVerification_messageType{} + +type fastReflection_RequestVerification_messageType struct{} + +func (x fastReflection_RequestVerification_messageType) Zero() protoreflect.Message { + return (*fastReflection_RequestVerification)(nil) +} +func (x fastReflection_RequestVerification_messageType) New() protoreflect.Message { + return new(fastReflection_RequestVerification) +} +func (x fastReflection_RequestVerification_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_RequestVerification +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_RequestVerification) Descriptor() protoreflect.MessageDescriptor { + return md_RequestVerification +} + +// 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_RequestVerification) Type() protoreflect.MessageType { + return _fastReflection_RequestVerification_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_RequestVerification) New() protoreflect.Message { + return new(fastReflection_RequestVerification) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_RequestVerification) Interface() protoreflect.ProtoMessage { + return (*RequestVerification)(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_RequestVerification) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ChainId != "" { + value := protoreflect.ValueOfString(x.ChainId) + if !f(fd_RequestVerification_chain_id, value) { + return + } + } + if x.Validator != "" { + value := protoreflect.ValueOfString(x.Validator) + if !f(fd_RequestVerification_validator, value) { + return + } + } + if x.RequestId != uint64(0) { + value := protoreflect.ValueOfUint64(x.RequestId) + if !f(fd_RequestVerification_request_id, value) { + return + } + } + if x.ExternalId != uint64(0) { + value := protoreflect.ValueOfUint64(x.ExternalId) + if !f(fd_RequestVerification_external_id, value) { + return + } + } + if x.DataSourceId != uint64(0) { + value := protoreflect.ValueOfUint64(x.DataSourceId) + if !f(fd_RequestVerification_data_source_id, 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_RequestVerification) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.RequestVerification.chain_id": + return x.ChainId != "" + case "oracle.v1.RequestVerification.validator": + return x.Validator != "" + case "oracle.v1.RequestVerification.request_id": + return x.RequestId != uint64(0) + case "oracle.v1.RequestVerification.external_id": + return x.ExternalId != uint64(0) + case "oracle.v1.RequestVerification.data_source_id": + return x.DataSourceId != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RequestVerification")) + } + panic(fmt.Errorf("message oracle.v1.RequestVerification 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_RequestVerification) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.RequestVerification.chain_id": + x.ChainId = "" + case "oracle.v1.RequestVerification.validator": + x.Validator = "" + case "oracle.v1.RequestVerification.request_id": + x.RequestId = uint64(0) + case "oracle.v1.RequestVerification.external_id": + x.ExternalId = uint64(0) + case "oracle.v1.RequestVerification.data_source_id": + x.DataSourceId = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RequestVerification")) + } + panic(fmt.Errorf("message oracle.v1.RequestVerification 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_RequestVerification) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.RequestVerification.chain_id": + value := x.ChainId + return protoreflect.ValueOfString(value) + case "oracle.v1.RequestVerification.validator": + value := x.Validator + return protoreflect.ValueOfString(value) + case "oracle.v1.RequestVerification.request_id": + value := x.RequestId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.RequestVerification.external_id": + value := x.ExternalId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.RequestVerification.data_source_id": + value := x.DataSourceId + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RequestVerification")) + } + panic(fmt.Errorf("message oracle.v1.RequestVerification 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_RequestVerification) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.RequestVerification.chain_id": + x.ChainId = value.Interface().(string) + case "oracle.v1.RequestVerification.validator": + x.Validator = value.Interface().(string) + case "oracle.v1.RequestVerification.request_id": + x.RequestId = value.Uint() + case "oracle.v1.RequestVerification.external_id": + x.ExternalId = value.Uint() + case "oracle.v1.RequestVerification.data_source_id": + x.DataSourceId = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RequestVerification")) + } + panic(fmt.Errorf("message oracle.v1.RequestVerification 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_RequestVerification) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.RequestVerification.chain_id": + panic(fmt.Errorf("field chain_id of message oracle.v1.RequestVerification is not mutable")) + case "oracle.v1.RequestVerification.validator": + panic(fmt.Errorf("field validator of message oracle.v1.RequestVerification is not mutable")) + case "oracle.v1.RequestVerification.request_id": + panic(fmt.Errorf("field request_id of message oracle.v1.RequestVerification is not mutable")) + case "oracle.v1.RequestVerification.external_id": + panic(fmt.Errorf("field external_id of message oracle.v1.RequestVerification is not mutable")) + case "oracle.v1.RequestVerification.data_source_id": + panic(fmt.Errorf("field data_source_id of message oracle.v1.RequestVerification is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RequestVerification")) + } + panic(fmt.Errorf("message oracle.v1.RequestVerification 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_RequestVerification) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.RequestVerification.chain_id": + return protoreflect.ValueOfString("") + case "oracle.v1.RequestVerification.validator": + return protoreflect.ValueOfString("") + case "oracle.v1.RequestVerification.request_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.RequestVerification.external_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.RequestVerification.data_source_id": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.RequestVerification")) + } + panic(fmt.Errorf("message oracle.v1.RequestVerification 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_RequestVerification) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.RequestVerification", 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_RequestVerification) 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_RequestVerification) 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_RequestVerification) 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_RequestVerification) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*RequestVerification) + 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.ChainId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Validator) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.RequestId != 0 { + n += 1 + runtime.Sov(uint64(x.RequestId)) + } + if x.ExternalId != 0 { + n += 1 + runtime.Sov(uint64(x.ExternalId)) + } + if x.DataSourceId != 0 { + n += 1 + runtime.Sov(uint64(x.DataSourceId)) + } + 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().(*RequestVerification) + 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.DataSourceId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.DataSourceId)) + i-- + dAtA[i] = 0x28 + } + if x.ExternalId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExternalId)) + i-- + dAtA[i] = 0x20 + } + if x.RequestId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RequestId)) + i-- + dAtA[i] = 0x18 + } + if len(x.Validator) > 0 { + i -= len(x.Validator) + copy(dAtA[i:], x.Validator) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Validator))) + i-- + dAtA[i] = 0x12 + } + if len(x.ChainId) > 0 { + i -= len(x.ChainId) + copy(dAtA[i:], x.ChainId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) + 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().(*RequestVerification) + 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: RequestVerification: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RequestVerification: 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 ChainId", 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.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Validator", 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.Validator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) + } + x.RequestId = 0 + 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++ + x.RequestId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType) + } + x.ExternalId = 0 + 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++ + x.ExternalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DataSourceId", wireType) + } + x.DataSourceId = 0 + 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++ + x.DataSourceId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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_PriceResult protoreflect.MessageDescriptor + fd_PriceResult_symbol protoreflect.FieldDescriptor + fd_PriceResult_multiplier protoreflect.FieldDescriptor + fd_PriceResult_px protoreflect.FieldDescriptor + fd_PriceResult_request_id protoreflect.FieldDescriptor + fd_PriceResult_resolve_time protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_oracle_proto_init() + md_PriceResult = File_oracle_v1_oracle_proto.Messages().ByName("PriceResult") + fd_PriceResult_symbol = md_PriceResult.Fields().ByName("symbol") + fd_PriceResult_multiplier = md_PriceResult.Fields().ByName("multiplier") + fd_PriceResult_px = md_PriceResult.Fields().ByName("px") + fd_PriceResult_request_id = md_PriceResult.Fields().ByName("request_id") + fd_PriceResult_resolve_time = md_PriceResult.Fields().ByName("resolve_time") +} + +var _ protoreflect.Message = (*fastReflection_PriceResult)(nil) + +type fastReflection_PriceResult PriceResult + +func (x *PriceResult) ProtoReflect() protoreflect.Message { + return (*fastReflection_PriceResult)(x) +} + +func (x *PriceResult) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_oracle_proto_msgTypes[16] + 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_PriceResult_messageType fastReflection_PriceResult_messageType +var _ protoreflect.MessageType = fastReflection_PriceResult_messageType{} + +type fastReflection_PriceResult_messageType struct{} + +func (x fastReflection_PriceResult_messageType) Zero() protoreflect.Message { + return (*fastReflection_PriceResult)(nil) +} +func (x fastReflection_PriceResult_messageType) New() protoreflect.Message { + return new(fastReflection_PriceResult) +} +func (x fastReflection_PriceResult_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_PriceResult +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_PriceResult) Descriptor() protoreflect.MessageDescriptor { + return md_PriceResult +} + +// 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_PriceResult) Type() protoreflect.MessageType { + return _fastReflection_PriceResult_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_PriceResult) New() protoreflect.Message { + return new(fastReflection_PriceResult) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_PriceResult) Interface() protoreflect.ProtoMessage { + return (*PriceResult)(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_PriceResult) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Symbol != "" { + value := protoreflect.ValueOfString(x.Symbol) + if !f(fd_PriceResult_symbol, value) { + return + } + } + if x.Multiplier != uint64(0) { + value := protoreflect.ValueOfUint64(x.Multiplier) + if !f(fd_PriceResult_multiplier, value) { + return + } + } + if x.Px != uint64(0) { + value := protoreflect.ValueOfUint64(x.Px) + if !f(fd_PriceResult_px, value) { + return + } + } + if x.RequestId != uint64(0) { + value := protoreflect.ValueOfUint64(x.RequestId) + if !f(fd_PriceResult_request_id, value) { + return + } + } + if x.ResolveTime != int64(0) { + value := protoreflect.ValueOfInt64(x.ResolveTime) + if !f(fd_PriceResult_resolve_time, 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_PriceResult) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.PriceResult.symbol": + return x.Symbol != "" + case "oracle.v1.PriceResult.multiplier": + return x.Multiplier != uint64(0) + case "oracle.v1.PriceResult.px": + return x.Px != uint64(0) + case "oracle.v1.PriceResult.request_id": + return x.RequestId != uint64(0) + case "oracle.v1.PriceResult.resolve_time": + return x.ResolveTime != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.PriceResult")) + } + panic(fmt.Errorf("message oracle.v1.PriceResult 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_PriceResult) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.PriceResult.symbol": + x.Symbol = "" + case "oracle.v1.PriceResult.multiplier": + x.Multiplier = uint64(0) + case "oracle.v1.PriceResult.px": + x.Px = uint64(0) + case "oracle.v1.PriceResult.request_id": + x.RequestId = uint64(0) + case "oracle.v1.PriceResult.resolve_time": + x.ResolveTime = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.PriceResult")) + } + panic(fmt.Errorf("message oracle.v1.PriceResult 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_PriceResult) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.PriceResult.symbol": + value := x.Symbol + return protoreflect.ValueOfString(value) + case "oracle.v1.PriceResult.multiplier": + value := x.Multiplier + return protoreflect.ValueOfUint64(value) + case "oracle.v1.PriceResult.px": + value := x.Px + return protoreflect.ValueOfUint64(value) + case "oracle.v1.PriceResult.request_id": + value := x.RequestId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.PriceResult.resolve_time": + value := x.ResolveTime + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.PriceResult")) + } + panic(fmt.Errorf("message oracle.v1.PriceResult 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_PriceResult) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.PriceResult.symbol": + x.Symbol = value.Interface().(string) + case "oracle.v1.PriceResult.multiplier": + x.Multiplier = value.Uint() + case "oracle.v1.PriceResult.px": + x.Px = value.Uint() + case "oracle.v1.PriceResult.request_id": + x.RequestId = value.Uint() + case "oracle.v1.PriceResult.resolve_time": + x.ResolveTime = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.PriceResult")) + } + panic(fmt.Errorf("message oracle.v1.PriceResult 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_PriceResult) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.PriceResult.symbol": + panic(fmt.Errorf("field symbol of message oracle.v1.PriceResult is not mutable")) + case "oracle.v1.PriceResult.multiplier": + panic(fmt.Errorf("field multiplier of message oracle.v1.PriceResult is not mutable")) + case "oracle.v1.PriceResult.px": + panic(fmt.Errorf("field px of message oracle.v1.PriceResult is not mutable")) + case "oracle.v1.PriceResult.request_id": + panic(fmt.Errorf("field request_id of message oracle.v1.PriceResult is not mutable")) + case "oracle.v1.PriceResult.resolve_time": + panic(fmt.Errorf("field resolve_time of message oracle.v1.PriceResult is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.PriceResult")) + } + panic(fmt.Errorf("message oracle.v1.PriceResult 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_PriceResult) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.PriceResult.symbol": + return protoreflect.ValueOfString("") + case "oracle.v1.PriceResult.multiplier": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.PriceResult.px": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.PriceResult.request_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.PriceResult.resolve_time": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.PriceResult")) + } + panic(fmt.Errorf("message oracle.v1.PriceResult 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_PriceResult) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.PriceResult", 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_PriceResult) 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_PriceResult) 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_PriceResult) 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_PriceResult) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*PriceResult) + 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.Symbol) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Multiplier != 0 { + n += 1 + runtime.Sov(uint64(x.Multiplier)) + } + if x.Px != 0 { + n += 1 + runtime.Sov(uint64(x.Px)) + } + if x.RequestId != 0 { + n += 1 + runtime.Sov(uint64(x.RequestId)) + } + if x.ResolveTime != 0 { + n += 1 + runtime.Sov(uint64(x.ResolveTime)) + } + 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().(*PriceResult) + 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.ResolveTime != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ResolveTime)) + i-- + dAtA[i] = 0x28 + } + if x.RequestId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RequestId)) + i-- + dAtA[i] = 0x20 + } + if x.Px != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Px)) + i-- + dAtA[i] = 0x18 + } + if x.Multiplier != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Multiplier)) + i-- + dAtA[i] = 0x10 + } + if len(x.Symbol) > 0 { + i -= len(x.Symbol) + copy(dAtA[i:], x.Symbol) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Symbol))) + 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().(*PriceResult) + 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: PriceResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PriceResult: 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 Symbol", 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.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Multiplier", wireType) + } + x.Multiplier = 0 + 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++ + x.Multiplier |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Px", wireType) + } + x.Px = 0 + 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++ + x.Px |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) + } + x.RequestId = 0 + 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++ + x.RequestId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ResolveTime", wireType) + } + x.ResolveTime = 0 + 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++ + x.ResolveTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: oracle/v1/oracle.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ResolveStatus encodes the status of an oracle request. +type ResolveStatus int32 + +const ( + // Open - the request is not yet resolved. + ResolveStatus_RESOLVE_STATUS_OPEN_UNSPECIFIED ResolveStatus = 0 + // Success - the request has been resolved successfully with no errors. + ResolveStatus_RESOLVE_STATUS_SUCCESS ResolveStatus = 1 + // Failure - an error occured during the request's resolve call. + ResolveStatus_RESOLVE_STATUS_FAILURE ResolveStatus = 2 + // Expired - the request does not get enough reports from validator within the + // timeframe. + ResolveStatus_RESOLVE_STATUS_EXPIRED ResolveStatus = 3 +) + +// Enum value maps for ResolveStatus. +var ( + ResolveStatus_name = map[int32]string{ + 0: "RESOLVE_STATUS_OPEN_UNSPECIFIED", + 1: "RESOLVE_STATUS_SUCCESS", + 2: "RESOLVE_STATUS_FAILURE", + 3: "RESOLVE_STATUS_EXPIRED", + } + ResolveStatus_value = map[string]int32{ + "RESOLVE_STATUS_OPEN_UNSPECIFIED": 0, + "RESOLVE_STATUS_SUCCESS": 1, + "RESOLVE_STATUS_FAILURE": 2, + "RESOLVE_STATUS_EXPIRED": 3, + } +) + +func (x ResolveStatus) Enum() *ResolveStatus { + p := new(ResolveStatus) + *p = x + return p +} + +func (x ResolveStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ResolveStatus) Descriptor() protoreflect.EnumDescriptor { + return file_oracle_v1_oracle_proto_enumTypes[0].Descriptor() +} + +func (ResolveStatus) Type() protoreflect.EnumType { + return &file_oracle_v1_oracle_proto_enumTypes[0] +} + +func (x ResolveStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ResolveStatus.Descriptor instead. +func (ResolveStatus) EnumDescriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{0} +} + +// DataSource is the data structure for storing data sources in the storage. +type DataSource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Owner is an address of the account who own the data source + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + // Name is data source name used for display + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Description is data source description used for display + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // Filename is string of file name used as reference for locating + // data source file stored in bandchain nodes + Filename string `protobuf:"bytes,4,opt,name=filename,proto3" json:"filename,omitempty"` + // Treasury is the account address who receive data source fee from requester. + Treasury string `protobuf:"bytes,5,opt,name=treasury,proto3" json:"treasury,omitempty"` + // Fee is the data source fee per ask_count that data provider will receive + // from requester. + Fee []*v1beta1.Coin `protobuf:"bytes,6,rep,name=fee,proto3" json:"fee,omitempty"` +} + +func (x *DataSource) Reset() { + *x = DataSource{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataSource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataSource) ProtoMessage() {} + +// Deprecated: Use DataSource.ProtoReflect.Descriptor instead. +func (*DataSource) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{0} +} + +func (x *DataSource) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *DataSource) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DataSource) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *DataSource) GetFilename() string { + if x != nil { + return x.Filename + } + return "" +} + +func (x *DataSource) GetTreasury() string { + if x != nil { + return x.Treasury + } + return "" +} + +func (x *DataSource) GetFee() []*v1beta1.Coin { + if x != nil { + return x.Fee + } + return nil +} + +// OracleScript is the data structure for storing oracle scripts in the storage. +type OracleScript struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Owner is an address of the account who own the oracle script + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + // Name is oracle script name used for display + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Description is oracle script description used for display + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // Filename is string of file name used as reference for locating + // compiled oracle script WASM file stored in bandchain nodes + Filename string `protobuf:"bytes,4,opt,name=filename,proto3" json:"filename,omitempty"` + // Schema is the schema of the oracle script input/output + // which is formatted in OBI format e.g. + // "{symbol:string,multiplier:u64}/{px:u64}" + Schema string `protobuf:"bytes,5,opt,name=schema,proto3" json:"schema,omitempty"` + // SourceCodeURL is the URL of oracle script's source code. + // It is recommendded to store source code on IPFS and get its URL to preserve + // decentralization. + SourceCodeUrl string `protobuf:"bytes,6,opt,name=source_code_url,json=sourceCodeUrl,proto3" json:"source_code_url,omitempty"` +} + +func (x *OracleScript) Reset() { + *x = OracleScript{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OracleScript) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OracleScript) ProtoMessage() {} + +// Deprecated: Use OracleScript.ProtoReflect.Descriptor instead. +func (*OracleScript) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{1} +} + +func (x *OracleScript) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *OracleScript) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *OracleScript) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *OracleScript) GetFilename() string { + if x != nil { + return x.Filename + } + return "" +} + +func (x *OracleScript) GetSchema() string { + if x != nil { + return x.Schema + } + return "" +} + +func (x *OracleScript) GetSourceCodeUrl() string { + if x != nil { + return x.SourceCodeUrl + } + return "" +} + +// RawRequest is the data structure for storing raw requests in the storage. +type RawRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ExternalID is an ID of the raw request + ExternalId uint64 `protobuf:"varint,1,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` + // DataSourceID is an ID of data source script that relates to the raw request + DataSourceId uint64 `protobuf:"varint,2,opt,name=data_source_id,json=dataSourceId,proto3" json:"data_source_id,omitempty"` + // Calldata is the data used as argument params for executing data source + // script + Calldata []byte `protobuf:"bytes,3,opt,name=calldata,proto3" json:"calldata,omitempty"` +} + +func (x *RawRequest) Reset() { + *x = RawRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RawRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RawRequest) ProtoMessage() {} + +// Deprecated: Use RawRequest.ProtoReflect.Descriptor instead. +func (*RawRequest) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{2} +} + +func (x *RawRequest) GetExternalId() uint64 { + if x != nil { + return x.ExternalId + } + return 0 +} + +func (x *RawRequest) GetDataSourceId() uint64 { + if x != nil { + return x.DataSourceId + } + return 0 +} + +func (x *RawRequest) GetCalldata() []byte { + if x != nil { + return x.Calldata + } + return nil +} + +// RawRequest is the data structure for storing raw reporter in the storage. +type RawReport struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ExternalID is an ID of the raw request + ExternalId uint64 `protobuf:"varint,1,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` + // ExitCode is status code provided by validators to specify error, if any. + // Exit code is usually filled by the exit code returned from execution of + // specified data source script. With code 0 means there is no error. + ExitCode uint32 `protobuf:"varint,2,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` + // Data is raw result provided by validators. + // It is usually filled by the result from execution of specified data source + // script. + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *RawReport) Reset() { + *x = RawReport{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RawReport) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RawReport) ProtoMessage() {} + +// Deprecated: Use RawReport.ProtoReflect.Descriptor instead. +func (*RawReport) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{3} +} + +func (x *RawReport) GetExternalId() uint64 { + if x != nil { + return x.ExternalId + } + return 0 +} + +func (x *RawReport) GetExitCode() uint32 { + if x != nil { + return x.ExitCode + } + return 0 +} + +func (x *RawReport) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +// Request is the data structure for storing requests in the storage. +type Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // OracleScriptID is ID of an oracle script + OracleScriptId uint64 `protobuf:"varint,1,opt,name=oracle_script_id,json=oracleScriptId,proto3" json:"oracle_script_id,omitempty"` + // Calldata is the data used as argument params for the oracle script + Calldata []byte `protobuf:"bytes,2,opt,name=calldata,proto3" json:"calldata,omitempty"` + // RequestedValidators is a list of validator addresses that are assigned for + // fulfilling the request + RequestedValidators []string `protobuf:"bytes,3,rep,name=requested_validators,json=requestedValidators,proto3" json:"requested_validators,omitempty"` + // MinCount is minimum number of validators required for fulfilling the + // request + MinCount uint64 `protobuf:"varint,4,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty"` + // RequestHeight is block height that the request has been created + RequestHeight int64 `protobuf:"varint,5,opt,name=request_height,json=requestHeight,proto3" json:"request_height,omitempty"` + // RequestTime is timestamp of the chain's block which contains the request + RequestTime int64 `protobuf:"varint,6,opt,name=request_time,json=requestTime,proto3" json:"request_time,omitempty"` + // ClientID is arbitrary id provided by requester. + // It is used by client-side for referencing the request + ClientId string `protobuf:"bytes,7,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + // RawRequests is a list of raw requests specified by execution of oracle + // script + RawRequests []*RawRequest `protobuf:"bytes,8,rep,name=raw_requests,json=rawRequests,proto3" json:"raw_requests,omitempty"` + // IBCChannel is an IBC channel info of the other chain, which contains a + // channel and a port to allow bandchain connect to that chain. This field + // allows other chain be able to request data from bandchain via IBC. + IbcChannel *IBCChannel `protobuf:"bytes,9,opt,name=ibc_channel,json=ibcChannel,proto3" json:"ibc_channel,omitempty"` + // ExecuteGas is amount of gas to reserve for executing + ExecuteGas uint64 `protobuf:"varint,10,opt,name=execute_gas,json=executeGas,proto3" json:"execute_gas,omitempty"` +} + +func (x *Request) Reset() { + *x = Request{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Request) ProtoMessage() {} + +// Deprecated: Use Request.ProtoReflect.Descriptor instead. +func (*Request) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{4} +} + +func (x *Request) GetOracleScriptId() uint64 { + if x != nil { + return x.OracleScriptId + } + return 0 +} + +func (x *Request) GetCalldata() []byte { + if x != nil { + return x.Calldata + } + return nil +} + +func (x *Request) GetRequestedValidators() []string { + if x != nil { + return x.RequestedValidators + } + return nil +} + +func (x *Request) GetMinCount() uint64 { + if x != nil { + return x.MinCount + } + return 0 +} + +func (x *Request) GetRequestHeight() int64 { + if x != nil { + return x.RequestHeight + } + return 0 +} + +func (x *Request) GetRequestTime() int64 { + if x != nil { + return x.RequestTime + } + return 0 +} + +func (x *Request) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *Request) GetRawRequests() []*RawRequest { + if x != nil { + return x.RawRequests + } + return nil +} + +func (x *Request) GetIbcChannel() *IBCChannel { + if x != nil { + return x.IbcChannel + } + return nil +} + +func (x *Request) GetExecuteGas() uint64 { + if x != nil { + return x.ExecuteGas + } + return 0 +} + +// Report is the data structure for storing reports in the storage. +type Report struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Validator is a validator address who submit the report + Validator string `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator,omitempty"` + // InBeforeResolve indicates whether the report is submitted before the + // request resolved + InBeforeResolve bool `protobuf:"varint,2,opt,name=in_before_resolve,json=inBeforeResolve,proto3" json:"in_before_resolve,omitempty"` + // RawReports is list of raw reports provided by the validator. + // Each raw report has different external ID + RawReports []*RawReport `protobuf:"bytes,3,rep,name=raw_reports,json=rawReports,proto3" json:"raw_reports,omitempty"` +} + +func (x *Report) Reset() { + *x = Report{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Report) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Report) ProtoMessage() {} + +// Deprecated: Use Report.ProtoReflect.Descriptor instead. +func (*Report) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{5} +} + +func (x *Report) GetValidator() string { + if x != nil { + return x.Validator + } + return "" +} + +func (x *Report) GetInBeforeResolve() bool { + if x != nil { + return x.InBeforeResolve + } + return false +} + +func (x *Report) GetRawReports() []*RawReport { + if x != nil { + return x.RawReports + } + return nil +} + +// OracleRequestPacketData encodes an oracle request sent from other blockchains +// to BandChain. +type OracleRequestPacketData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ClientID is the unique identifier of this oracle request, as specified by + // the client. This same unique ID will be sent back to the requester with the + // oracle response. + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + // OracleScriptID is the unique identifier of the oracle script to be + // executed. + OracleScriptId uint64 `protobuf:"varint,2,opt,name=oracle_script_id,json=oracleScriptId,proto3" json:"oracle_script_id,omitempty"` + // Calldata is the OBI-encoded calldata bytes available for oracle executor to + // read. + Calldata []byte `protobuf:"bytes,3,opt,name=calldata,proto3" json:"calldata,omitempty"` + // AskCount is the number of validators that are requested to respond to this + // oracle request. Higher value means more security, at a higher gas cost. + AskCount uint64 `protobuf:"varint,4,opt,name=ask_count,json=askCount,proto3" json:"ask_count,omitempty"` + // MinCount is the minimum number of validators necessary for the request to + // proceed to the execution phase. Higher value means more security, at the + // cost of liveness. + MinCount uint64 `protobuf:"varint,5,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty"` + // FeeLimit is the maximum tokens that will be paid to all data source + // providers. + FeeLimit []*v1beta1.Coin `protobuf:"bytes,6,rep,name=fee_limit,json=feeLimit,proto3" json:"fee_limit,omitempty"` + // PrepareGas is amount of gas to pay to prepare raw requests + PrepareGas uint64 `protobuf:"varint,7,opt,name=prepare_gas,json=prepareGas,proto3" json:"prepare_gas,omitempty"` + // ExecuteGas is amount of gas to reserve for executing + ExecuteGas uint64 `protobuf:"varint,8,opt,name=execute_gas,json=executeGas,proto3" json:"execute_gas,omitempty"` +} + +func (x *OracleRequestPacketData) Reset() { + *x = OracleRequestPacketData{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OracleRequestPacketData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OracleRequestPacketData) ProtoMessage() {} + +// Deprecated: Use OracleRequestPacketData.ProtoReflect.Descriptor instead. +func (*OracleRequestPacketData) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{6} +} + +func (x *OracleRequestPacketData) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *OracleRequestPacketData) GetOracleScriptId() uint64 { + if x != nil { + return x.OracleScriptId + } + return 0 +} + +func (x *OracleRequestPacketData) GetCalldata() []byte { + if x != nil { + return x.Calldata + } + return nil +} + +func (x *OracleRequestPacketData) GetAskCount() uint64 { + if x != nil { + return x.AskCount + } + return 0 +} + +func (x *OracleRequestPacketData) GetMinCount() uint64 { + if x != nil { + return x.MinCount + } + return 0 +} + +func (x *OracleRequestPacketData) GetFeeLimit() []*v1beta1.Coin { + if x != nil { + return x.FeeLimit + } + return nil +} + +func (x *OracleRequestPacketData) GetPrepareGas() uint64 { + if x != nil { + return x.PrepareGas + } + return 0 +} + +func (x *OracleRequestPacketData) GetExecuteGas() uint64 { + if x != nil { + return x.ExecuteGas + } + return 0 +} + +// OracleRequestPacketAcknowledgement encodes an oracle request acknowledgement +// send back to requester chain. +type OracleRequestPacketAcknowledgement struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // RequestID is BandChain's unique identifier for this oracle request. + RequestId uint64 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` +} + +func (x *OracleRequestPacketAcknowledgement) Reset() { + *x = OracleRequestPacketAcknowledgement{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OracleRequestPacketAcknowledgement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OracleRequestPacketAcknowledgement) ProtoMessage() {} + +// Deprecated: Use OracleRequestPacketAcknowledgement.ProtoReflect.Descriptor instead. +func (*OracleRequestPacketAcknowledgement) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{7} +} + +func (x *OracleRequestPacketAcknowledgement) GetRequestId() uint64 { + if x != nil { + return x.RequestId + } + return 0 +} + +// OracleResponsePacketData encodes an oracle response from BandChain to the +// requester. +type OracleResponsePacketData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ClientID is the unique identifier matched with that of the oracle request + // packet. + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + // RequestID is BandChain's unique identifier for this oracle request. + RequestId uint64 `protobuf:"varint,2,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + // AnsCount is the number of validators among to the asked validators that + // actually responded to this oracle request prior to this oracle request + // being resolved. + AnsCount uint64 `protobuf:"varint,3,opt,name=ans_count,json=ansCount,proto3" json:"ans_count,omitempty"` + // RequestTime is the UNIX epoch time at which the request was sent to + // BandChain. + RequestTime int64 `protobuf:"varint,4,opt,name=request_time,json=requestTime,proto3" json:"request_time,omitempty"` + // ResolveTime is the UNIX epoch time at which the request was resolved to the + // final result. + ResolveTime int64 `protobuf:"varint,5,opt,name=resolve_time,json=resolveTime,proto3" json:"resolve_time,omitempty"` + // ResolveStatus is the status of this oracle request, which can be OK, + // FAILURE, or EXPIRED. + ResolveStatus ResolveStatus `protobuf:"varint,6,opt,name=resolve_status,json=resolveStatus,proto3,enum=oracle.v1.ResolveStatus" json:"resolve_status,omitempty"` + // Result is the final aggregated value encoded in OBI format. Only available + // if status if OK. + Result []byte `protobuf:"bytes,7,opt,name=result,proto3" json:"result,omitempty"` +} + +func (x *OracleResponsePacketData) Reset() { + *x = OracleResponsePacketData{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OracleResponsePacketData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OracleResponsePacketData) ProtoMessage() {} + +// Deprecated: Use OracleResponsePacketData.ProtoReflect.Descriptor instead. +func (*OracleResponsePacketData) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{8} +} + +func (x *OracleResponsePacketData) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *OracleResponsePacketData) GetRequestId() uint64 { + if x != nil { + return x.RequestId + } + return 0 +} + +func (x *OracleResponsePacketData) GetAnsCount() uint64 { + if x != nil { + return x.AnsCount + } + return 0 +} + +func (x *OracleResponsePacketData) GetRequestTime() int64 { + if x != nil { + return x.RequestTime + } + return 0 +} + +func (x *OracleResponsePacketData) GetResolveTime() int64 { + if x != nil { + return x.ResolveTime + } + return 0 +} + +func (x *OracleResponsePacketData) GetResolveStatus() ResolveStatus { + if x != nil { + return x.ResolveStatus + } + return ResolveStatus_RESOLVE_STATUS_OPEN_UNSPECIFIED +} + +func (x *OracleResponsePacketData) GetResult() []byte { + if x != nil { + return x.Result + } + return nil +} + +// Result encodes a result of request and store in chain +type Result struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ClientID is the unique identifier of this oracle request, as specified by + // the client. This same unique ID will be sent back to the requester with the + // oracle response. + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + // OracleScriptID is the unique identifier of the oracle script to be + // executed. + OracleScriptId uint64 `protobuf:"varint,2,opt,name=oracle_script_id,json=oracleScriptId,proto3" json:"oracle_script_id,omitempty"` + // Calldata is the calldata bytes available for oracle executor to read. + Calldata []byte `protobuf:"bytes,3,opt,name=calldata,proto3" json:"calldata,omitempty"` + // AskCount is the number of validators that are requested to respond to this + // oracle request. Higher value means more security, at a higher gas cost. + AskCount uint64 `protobuf:"varint,4,opt,name=ask_count,json=askCount,proto3" json:"ask_count,omitempty"` + // MinCount is the minimum number of validators necessary for the request to + // proceed to the execution phase. Higher value means more security, at the + // cost of liveness. + MinCount uint64 `protobuf:"varint,5,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty"` + // RequestID is BandChain's unique identifier for this oracle request. + RequestId uint64 `protobuf:"varint,6,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + // AnsCount is the number of validators among to the asked validators that + // actually responded to this oracle request prior to this oracle request + // being resolved. + AnsCount uint64 `protobuf:"varint,7,opt,name=ans_count,json=ansCount,proto3" json:"ans_count,omitempty"` + // RequestTime is the UNIX epoch time at which the request was sent to + // BandChain. + RequestTime int64 `protobuf:"varint,8,opt,name=request_time,json=requestTime,proto3" json:"request_time,omitempty"` + // ResolveTime is the UNIX epoch time at which the request was resolved to the + // final result. + ResolveTime int64 `protobuf:"varint,9,opt,name=resolve_time,json=resolveTime,proto3" json:"resolve_time,omitempty"` + // ResolveStatus is the status of this oracle request, which can be OK, + // FAILURE, or EXPIRED. + ResolveStatus ResolveStatus `protobuf:"varint,10,opt,name=resolve_status,json=resolveStatus,proto3,enum=oracle.v1.ResolveStatus" json:"resolve_status,omitempty"` + // Result is the final aggregated value only available if status if OK. + Result []byte `protobuf:"bytes,11,opt,name=result,proto3" json:"result,omitempty"` +} + +func (x *Result) Reset() { + *x = Result{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Result) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Result) ProtoMessage() {} + +// Deprecated: Use Result.ProtoReflect.Descriptor instead. +func (*Result) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{9} +} + +func (x *Result) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *Result) GetOracleScriptId() uint64 { + if x != nil { + return x.OracleScriptId + } + return 0 +} + +func (x *Result) GetCalldata() []byte { + if x != nil { + return x.Calldata + } + return nil +} + +func (x *Result) GetAskCount() uint64 { + if x != nil { + return x.AskCount + } + return 0 +} + +func (x *Result) GetMinCount() uint64 { + if x != nil { + return x.MinCount + } + return 0 +} + +func (x *Result) GetRequestId() uint64 { + if x != nil { + return x.RequestId + } + return 0 +} + +func (x *Result) GetAnsCount() uint64 { + if x != nil { + return x.AnsCount + } + return 0 +} + +func (x *Result) GetRequestTime() int64 { + if x != nil { + return x.RequestTime + } + return 0 +} + +func (x *Result) GetResolveTime() int64 { + if x != nil { + return x.ResolveTime + } + return 0 +} + +func (x *Result) GetResolveStatus() ResolveStatus { + if x != nil { + return x.ResolveStatus + } + return ResolveStatus_RESOLVE_STATUS_OPEN_UNSPECIFIED +} + +func (x *Result) GetResult() []byte { + if x != nil { + return x.Result + } + return nil +} + +// ValidatorStatus maintains whether a validator is an active oracle provider. +type ValidatorStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // IsActive is a boolean indicating active status of validator. + // The validator will be deactivated when they are unable to send reports + // to fulfill oracle request before the request expired. + IsActive bool `protobuf:"varint,1,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"` + // Since is a block timestamp when validator has been activated/deactivated + Since *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=since,proto3" json:"since,omitempty"` +} + +func (x *ValidatorStatus) Reset() { + *x = ValidatorStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidatorStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidatorStatus) ProtoMessage() {} + +// Deprecated: Use ValidatorStatus.ProtoReflect.Descriptor instead. +func (*ValidatorStatus) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{10} +} + +func (x *ValidatorStatus) GetIsActive() bool { + if x != nil { + return x.IsActive + } + return false +} + +func (x *ValidatorStatus) GetSince() *timestamppb.Timestamp { + if x != nil { + return x.Since + } + return nil +} + +// ActiveValidator is information of currently active validator +type ActiveValidator struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Address is a validator address + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // Power is an amount of token that the validator is holding + Power uint64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` +} + +func (x *ActiveValidator) Reset() { + *x = ActiveValidator{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActiveValidator) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActiveValidator) ProtoMessage() {} + +// Deprecated: Use ActiveValidator.ProtoReflect.Descriptor instead. +func (*ActiveValidator) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{11} +} + +func (x *ActiveValidator) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *ActiveValidator) GetPower() uint64 { + if x != nil { + return x.Power + } + return 0 +} + +// Params is the data structure that keeps the parameters of the oracle module. +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // MaxRawRequestCount is the maximum number of data source raw requests a + // request can make. + MaxRawRequestCount uint64 `protobuf:"varint,1,opt,name=max_raw_request_count,json=maxRawRequestCount,proto3" json:"max_raw_request_count,omitempty"` + // MaxAskCount is the maximum number of validators a request can target. + MaxAskCount uint64 `protobuf:"varint,2,opt,name=max_ask_count,json=maxAskCount,proto3" json:"max_ask_count,omitempty"` + // MaxCalldataSize is the maximum size limit of calldata (bytes) in a request. + MaxCalldataSize uint64 `protobuf:"varint,3,opt,name=max_calldata_size,json=maxCalldataSize,proto3" json:"max_calldata_size,omitempty"` + // MaxReportDataSize is the maximum size limit of report data (bytes) in a + // report. + MaxReportDataSize uint64 `protobuf:"varint,4,opt,name=max_report_data_size,json=maxReportDataSize,proto3" json:"max_report_data_size,omitempty"` + // ExpirationBlockCount is the number of blocks a request stays valid before + // it gets expired due to insufficient reports. + ExpirationBlockCount uint64 `protobuf:"varint,5,opt,name=expiration_block_count,json=expirationBlockCount,proto3" json:"expiration_block_count,omitempty"` + // BaseOwasmGas is the base amount of Cosmos-SDK gas charged for owasm + // execution. + BaseOwasmGas uint64 `protobuf:"varint,6,opt,name=base_owasm_gas,json=baseOwasmGas,proto3" json:"base_owasm_gas,omitempty"` + // PerValidatorRequestGas is the amount of Cosmos-SDK gas charged per + // requested validator. + PerValidatorRequestGas uint64 `protobuf:"varint,7,opt,name=per_validator_request_gas,json=perValidatorRequestGas,proto3" json:"per_validator_request_gas,omitempty"` + // SamplingTryCount the number of validator sampling tries to pick the highest + // voting power subset of validators to perform an oracle task. + SamplingTryCount uint64 `protobuf:"varint,8,opt,name=sampling_try_count,json=samplingTryCount,proto3" json:"sampling_try_count,omitempty"` + // OracleRewardPercentage is the percentage of block rewards allocated to + // active oracle validators. + OracleRewardPercentage uint64 `protobuf:"varint,9,opt,name=oracle_reward_percentage,json=oracleRewardPercentage,proto3" json:"oracle_reward_percentage,omitempty"` + // InactivePenaltyDuration is the duration period where a validator cannot + // activate back after missing an oracle report. + InactivePenaltyDuration uint64 `protobuf:"varint,10,opt,name=inactive_penalty_duration,json=inactivePenaltyDuration,proto3" json:"inactive_penalty_duration,omitempty"` + // IBCRequestEnabled is a flag indicating whether sending oracle request via + // IBC is allowed + IbcRequestEnabled bool `protobuf:"varint,11,opt,name=ibc_request_enabled,json=ibcRequestEnabled,proto3" json:"ibc_request_enabled,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{12} +} + +func (x *Params) GetMaxRawRequestCount() uint64 { + if x != nil { + return x.MaxRawRequestCount + } + return 0 +} + +func (x *Params) GetMaxAskCount() uint64 { + if x != nil { + return x.MaxAskCount + } + return 0 +} + +func (x *Params) GetMaxCalldataSize() uint64 { + if x != nil { + return x.MaxCalldataSize + } + return 0 +} + +func (x *Params) GetMaxReportDataSize() uint64 { + if x != nil { + return x.MaxReportDataSize + } + return 0 +} + +func (x *Params) GetExpirationBlockCount() uint64 { + if x != nil { + return x.ExpirationBlockCount + } + return 0 +} + +func (x *Params) GetBaseOwasmGas() uint64 { + if x != nil { + return x.BaseOwasmGas + } + return 0 +} + +func (x *Params) GetPerValidatorRequestGas() uint64 { + if x != nil { + return x.PerValidatorRequestGas + } + return 0 +} + +func (x *Params) GetSamplingTryCount() uint64 { + if x != nil { + return x.SamplingTryCount + } + return 0 +} + +func (x *Params) GetOracleRewardPercentage() uint64 { + if x != nil { + return x.OracleRewardPercentage + } + return 0 +} + +func (x *Params) GetInactivePenaltyDuration() uint64 { + if x != nil { + return x.InactivePenaltyDuration + } + return 0 +} + +func (x *Params) GetIbcRequestEnabled() bool { + if x != nil { + return x.IbcRequestEnabled + } + return false +} + +// PendingResolveList is a list of requests that are waiting to be resolved +type PendingResolveList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // RequestIDs is a list of request IDs that are waiting to be resolved + RequestIds []uint64 `protobuf:"varint,1,rep,packed,name=request_ids,json=requestIds,proto3" json:"request_ids,omitempty"` +} + +func (x *PendingResolveList) Reset() { + *x = PendingResolveList{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PendingResolveList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PendingResolveList) ProtoMessage() {} + +// Deprecated: Use PendingResolveList.ProtoReflect.Descriptor instead. +func (*PendingResolveList) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{13} +} + +func (x *PendingResolveList) GetRequestIds() []uint64 { + if x != nil { + return x.RequestIds + } + return nil +} + +// IBCChannel is information of IBC protocol to allow communicating with other +// chain +type IBCChannel struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // PortID is port ID used for sending response packet when request is + // resolved. + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"` + // ChannelID is channel ID used for sending response packet when request is + // resolved. + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` +} + +func (x *IBCChannel) Reset() { + *x = IBCChannel{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IBCChannel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IBCChannel) ProtoMessage() {} + +// Deprecated: Use IBCChannel.ProtoReflect.Descriptor instead. +func (*IBCChannel) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{14} +} + +func (x *IBCChannel) GetPortId() string { + if x != nil { + return x.PortId + } + return "" +} + +func (x *IBCChannel) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +// RequestVerification is a message that is constructed and signed by a reporter +// to be used as a part of verification of oracle request. +type RequestVerification struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ChainID is the ID of targeted chain + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // Validator is an validator address + Validator string `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator,omitempty"` + // RequestID is the targeted request ID + RequestId uint64 `protobuf:"varint,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + // ExternalID is the oracle's external ID of data source + ExternalId uint64 `protobuf:"varint,4,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` + // DataSourceID is the ID of data source + DataSourceId uint64 `protobuf:"varint,5,opt,name=data_source_id,json=dataSourceId,proto3" json:"data_source_id,omitempty"` +} + +func (x *RequestVerification) Reset() { + *x = RequestVerification{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RequestVerification) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestVerification) ProtoMessage() {} + +// Deprecated: Use RequestVerification.ProtoReflect.Descriptor instead. +func (*RequestVerification) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{15} +} + +func (x *RequestVerification) GetChainId() string { + if x != nil { + return x.ChainId + } + return "" +} + +func (x *RequestVerification) GetValidator() string { + if x != nil { + return x.Validator + } + return "" +} + +func (x *RequestVerification) GetRequestId() uint64 { + if x != nil { + return x.RequestId + } + return 0 +} + +func (x *RequestVerification) GetExternalId() uint64 { + if x != nil { + return x.ExternalId + } + return 0 +} + +func (x *RequestVerification) GetDataSourceId() uint64 { + if x != nil { + return x.DataSourceId + } + return 0 +} + +// PriceResult is a result from standard price reference +type PriceResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Symbol is unit of data indicating what the data is. It is price currencies + // for this case. + Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` + // Multiplier is a number used for left-shifting value to eliminate decimal + // digits + Multiplier uint64 `protobuf:"varint,2,opt,name=multiplier,proto3" json:"multiplier,omitempty"` + // Px is the actual data, which is rate number multiplied by the multiplier. + Px uint64 `protobuf:"varint,3,opt,name=px,proto3" json:"px,omitempty"` + // RequestID is oracle request ID that contains this price + RequestId uint64 `protobuf:"varint,4,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + // ResolveTime is epoch timestamp indicating the time when the request had + // been resolved + ResolveTime int64 `protobuf:"varint,5,opt,name=resolve_time,json=resolveTime,proto3" json:"resolve_time,omitempty"` +} + +func (x *PriceResult) Reset() { + *x = PriceResult{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_oracle_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PriceResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PriceResult) ProtoMessage() {} + +// Deprecated: Use PriceResult.ProtoReflect.Descriptor instead. +func (*PriceResult) Descriptor() ([]byte, []int) { + return file_oracle_v1_oracle_proto_rawDescGZIP(), []int{16} +} + +func (x *PriceResult) GetSymbol() string { + if x != nil { + return x.Symbol + } + return "" +} + +func (x *PriceResult) GetMultiplier() uint64 { + if x != nil { + return x.Multiplier + } + return 0 +} + +func (x *PriceResult) GetPx() uint64 { + if x != nil { + return x.Px + } + return 0 +} + +func (x *PriceResult) GetRequestId() uint64 { + if x != nil { + return x.RequestId + } + return 0 +} + +func (x *PriceResult) GetResolveTime() int64 { + if x != nil { + return x.ResolveTime + } + return 0 +} + +var File_oracle_v1_oracle_proto protoreflect.FileDescriptor + +var file_oracle_v1_oracle_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, + 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 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, 0x22, 0xf5, 0x01, 0x0a, 0x0a, 0x44, + 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x79, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x79, 0x12, 0x5d, 0x0a, + 0x03, 0x66, 0x65, 0x65, 0x18, 0x06, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x03, 0x66, 0x65, 0x65, 0x3a, 0x04, 0xe8, 0xa0, + 0x1f, 0x01, 0x22, 0xcf, 0x01, 0x0a, 0x0c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x12, 0x39, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x6f, + 0x64, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x11, 0xe2, 0xde, + 0x1f, 0x0d, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x55, 0x52, 0x4c, 0x52, + 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x55, 0x72, 0x6c, 0x3a, 0x04, + 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xb5, 0x01, 0x0a, 0x0a, 0x52, 0x61, 0x77, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1c, 0xe2, 0xde, 0x1f, 0x0a, 0x45, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x44, 0xfa, 0xde, 0x1f, 0x0a, 0x45, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x44, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x49, 0x64, 0x12, 0x46, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x20, 0xe2, 0xde, 0x1f, 0x0c, + 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0xfa, 0xde, 0x1f, 0x0c, + 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0x52, 0x0c, 0x64, 0x61, + 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, + 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x61, + 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x81, 0x01, 0x0a, + 0x09, 0x52, 0x61, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x3d, 0x0a, 0x0b, 0x65, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x1c, 0xe2, 0xde, 0x1f, 0x0a, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x44, 0xfa, + 0xde, 0x1f, 0x0a, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x44, 0x52, 0x0a, 0x65, + 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x78, 0x69, + 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65, 0x78, + 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, + 0x22, 0xe9, 0x03, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x10, + 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x24, 0xe2, 0xde, 0x1f, 0x0e, 0x4f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x49, 0x44, 0xfa, 0xde, 0x1f, 0x0e, 0x4f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x49, 0x44, 0x52, 0x0e, 0x6f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, + 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, + 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x12, 0x31, 0x0a, 0x14, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, + 0x64, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, + 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, + 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, + 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xe2, 0xde, 0x1f, 0x08, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x49, 0x44, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x3e, 0x0a, + 0x0c, 0x72, 0x61, 0x77, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x52, 0x61, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, + 0x52, 0x0b, 0x72, 0x61, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x46, 0x0a, + 0x0b, 0x69, 0x62, 0x63, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, + 0x42, 0x43, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x42, 0x0e, 0xe2, 0xde, 0x1f, 0x0a, 0x49, + 0x42, 0x43, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x0a, 0x69, 0x62, 0x63, 0x43, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, + 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x65, 0x47, 0x61, 0x73, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x95, 0x01, 0x0a, + 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x69, 0x6e, 0x5f, 0x62, 0x65, 0x66, 0x6f, + 0x72, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0f, 0x69, 0x6e, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, + 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x72, 0x61, 0x77, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x61, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x0a, 0x72, 0x61, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x3a, 0x04, + 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x9c, 0x03, 0x0a, 0x17, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x29, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x0c, 0xe2, 0xde, 0x1f, 0x08, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, + 0x44, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x10, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x24, 0xe2, 0xde, 0x1f, 0x0e, 0x4f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x49, 0x44, 0xfa, 0xde, 0x1f, 0x0e, 0x4f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x49, 0x44, 0x52, 0x0e, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, + 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, + 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x73, 0x6b, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x61, 0x73, 0x6b, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x68, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, + 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, + 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, + 0x73, 0x52, 0x08, 0x66, 0x65, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, + 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0a, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x47, 0x61, 0x73, 0x12, 0x1f, 0x0a, 0x0b, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0a, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x47, 0x61, 0x73, 0x3a, 0x04, 0xe8, + 0xa0, 0x1f, 0x01, 0x22, 0x65, 0x0a, 0x22, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x41, 0x63, 0x6b, 0x6e, 0x6f, 0x77, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1a, 0xe2, + 0xde, 0x1f, 0x09, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0xfa, 0xde, 0x1f, 0x09, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x49, 0x64, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xc2, 0x02, 0x0a, 0x18, 0x4f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x63, + 0x6b, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xe2, 0xde, 0x1f, 0x08, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x49, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1a, 0xe2, 0xde, 0x1f, 0x09, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x49, 0x44, 0xfa, 0xde, 0x1f, 0x09, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x49, 0x44, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, + 0x09, 0x61, 0x6e, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x08, 0x61, 0x6e, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x21, 0x0a, + 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x12, 0x3f, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, + 0xd6, 0x03, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x29, 0x0a, 0x09, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xe2, + 0xde, 0x1f, 0x08, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x52, 0x08, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x10, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x24, 0xe2, 0xde, 0x1f, 0x0e, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x49, 0x44, 0xfa, 0xde, 0x1f, 0x0e, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x49, 0x44, 0x52, 0x0e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x73, 0x6b, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, + 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x1a, 0xe2, 0xde, 0x1f, 0x09, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0xfa, 0xde, + 0x1f, 0x09, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x52, 0x09, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x6e, 0x73, 0x5f, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x61, 0x6e, 0x73, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, + 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x65, + 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x0e, 0x72, 0x65, 0x73, + 0x6f, 0x6c, 0x76, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x18, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, + 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0d, 0x72, 0x65, 0x73, + 0x6f, 0x6c, 0x76, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x70, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, + 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x3a, 0x0a, 0x05, 0x73, 0x69, 0x6e, 0x63, + 0x65, 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, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x05, 0x73, + 0x69, 0x6e, 0x63, 0x65, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x41, 0x0a, 0x0f, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x22, 0xc8, 0x04, + 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x31, 0x0a, 0x15, 0x6d, 0x61, 0x78, 0x5f, + 0x72, 0x61, 0x77, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x52, 0x61, 0x77, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x6d, + 0x61, 0x78, 0x5f, 0x61, 0x73, 0x6b, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x41, 0x73, 0x6b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x2a, 0x0a, 0x11, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x5f, + 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x43, + 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x2f, 0x0a, 0x14, 0x6d, + 0x61, 0x78, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x6d, 0x61, 0x78, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x44, 0x61, 0x74, 0x61, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x34, 0x0a, 0x16, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6f, 0x77, 0x61, 0x73, 0x6d, + 0x5f, 0x67, 0x61, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x62, 0x61, 0x73, 0x65, + 0x4f, 0x77, 0x61, 0x73, 0x6d, 0x47, 0x61, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x70, 0x65, 0x72, 0x5f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x70, 0x65, 0x72, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x47, 0x61, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x69, 0x6e, 0x67, 0x5f, + 0x74, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x10, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x69, 0x6e, 0x67, 0x54, 0x72, 0x79, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x38, 0x0a, 0x18, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x16, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x3a, 0x0a, 0x19, 0x69, + 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x70, 0x65, 0x6e, 0x61, 0x6c, 0x74, 0x79, 0x5f, + 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, + 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x50, 0x65, 0x6e, 0x61, 0x6c, 0x74, 0x79, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x62, 0x63, 0x5f, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x08, 0x42, 0x15, 0xe2, 0xde, 0x1f, 0x11, 0x49, 0x42, 0x43, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x11, 0x69, 0x62, 0x63, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x08, + 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x3b, 0x0a, 0x12, 0x50, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1f, + 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x04, 0x52, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x73, 0x3a, + 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x4a, 0x0a, 0x0a, 0x49, 0x42, 0x43, 0x43, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, + 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, + 0x01, 0x22, 0xa3, 0x02, 0x0a, 0x13, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x08, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0b, 0xe2, 0xde, 0x1f, + 0x07, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, + 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, + 0x39, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x1a, 0xe2, 0xde, 0x1f, 0x09, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x49, 0x44, 0xfa, 0xde, 0x1f, 0x09, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x52, + 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x3d, 0x0a, 0x0b, 0x65, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x1c, 0xe2, 0xde, 0x1f, 0x0a, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x44, 0xfa, + 0xde, 0x1f, 0x0a, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x44, 0x52, 0x0a, 0x65, + 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x0e, 0x64, 0x61, 0x74, + 0x61, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x20, 0xe2, 0xde, 0x1f, 0x0c, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x49, 0x44, 0xfa, 0xde, 0x1f, 0x0c, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x49, 0x44, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, + 0x64, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xb3, 0x01, 0x0a, 0x0b, 0x50, 0x72, 0x69, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, + 0x1e, 0x0a, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, + 0x0e, 0x0a, 0x02, 0x70, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x70, 0x78, 0x12, + 0x39, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x1a, 0xe2, 0xde, 0x1f, 0x09, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x49, 0x44, 0xfa, 0xde, 0x1f, 0x09, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x52, + 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, + 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x2a, 0xfb, 0x01, + 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x3c, 0x0a, 0x1f, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x4f, 0x50, 0x45, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x1a, 0x17, 0x8a, 0x9d, 0x20, 0x13, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, + 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x50, 0x45, 0x4e, 0x12, 0x36, 0x0a, + 0x16, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, + 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x1a, 0x1a, 0x8a, 0x9d, 0x20, 0x16, 0x52, + 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x55, + 0x43, 0x43, 0x45, 0x53, 0x53, 0x12, 0x36, 0x0a, 0x16, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, + 0x02, 0x1a, 0x1a, 0x8a, 0x9d, 0x20, 0x16, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x12, 0x36, 0x0a, + 0x16, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, + 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x03, 0x1a, 0x1a, 0x8a, 0x9d, 0x20, 0x16, 0x52, + 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x58, + 0x50, 0x49, 0x52, 0x45, 0x44, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x42, 0x9a, 0x01, 0x0a, 0x0d, + 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_oracle_v1_oracle_proto_rawDescOnce sync.Once + file_oracle_v1_oracle_proto_rawDescData = file_oracle_v1_oracle_proto_rawDesc +) + +func file_oracle_v1_oracle_proto_rawDescGZIP() []byte { + file_oracle_v1_oracle_proto_rawDescOnce.Do(func() { + file_oracle_v1_oracle_proto_rawDescData = protoimpl.X.CompressGZIP(file_oracle_v1_oracle_proto_rawDescData) + }) + return file_oracle_v1_oracle_proto_rawDescData +} + +var file_oracle_v1_oracle_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_oracle_v1_oracle_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_oracle_v1_oracle_proto_goTypes = []interface{}{ + (ResolveStatus)(0), // 0: oracle.v1.ResolveStatus + (*DataSource)(nil), // 1: oracle.v1.DataSource + (*OracleScript)(nil), // 2: oracle.v1.OracleScript + (*RawRequest)(nil), // 3: oracle.v1.RawRequest + (*RawReport)(nil), // 4: oracle.v1.RawReport + (*Request)(nil), // 5: oracle.v1.Request + (*Report)(nil), // 6: oracle.v1.Report + (*OracleRequestPacketData)(nil), // 7: oracle.v1.OracleRequestPacketData + (*OracleRequestPacketAcknowledgement)(nil), // 8: oracle.v1.OracleRequestPacketAcknowledgement + (*OracleResponsePacketData)(nil), // 9: oracle.v1.OracleResponsePacketData + (*Result)(nil), // 10: oracle.v1.Result + (*ValidatorStatus)(nil), // 11: oracle.v1.ValidatorStatus + (*ActiveValidator)(nil), // 12: oracle.v1.ActiveValidator + (*Params)(nil), // 13: oracle.v1.Params + (*PendingResolveList)(nil), // 14: oracle.v1.PendingResolveList + (*IBCChannel)(nil), // 15: oracle.v1.IBCChannel + (*RequestVerification)(nil), // 16: oracle.v1.RequestVerification + (*PriceResult)(nil), // 17: oracle.v1.PriceResult + (*v1beta1.Coin)(nil), // 18: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 19: google.protobuf.Timestamp +} +var file_oracle_v1_oracle_proto_depIdxs = []int32{ + 18, // 0: oracle.v1.DataSource.fee:type_name -> cosmos.base.v1beta1.Coin + 3, // 1: oracle.v1.Request.raw_requests:type_name -> oracle.v1.RawRequest + 15, // 2: oracle.v1.Request.ibc_channel:type_name -> oracle.v1.IBCChannel + 4, // 3: oracle.v1.Report.raw_reports:type_name -> oracle.v1.RawReport + 18, // 4: oracle.v1.OracleRequestPacketData.fee_limit:type_name -> cosmos.base.v1beta1.Coin + 0, // 5: oracle.v1.OracleResponsePacketData.resolve_status:type_name -> oracle.v1.ResolveStatus + 0, // 6: oracle.v1.Result.resolve_status:type_name -> oracle.v1.ResolveStatus + 19, // 7: oracle.v1.ValidatorStatus.since:type_name -> google.protobuf.Timestamp + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_oracle_v1_oracle_proto_init() } +func file_oracle_v1_oracle_proto_init() { + if File_oracle_v1_oracle_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_oracle_v1_oracle_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataSource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OracleScript); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RawRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RawReport); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Report); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OracleRequestPacketData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OracleRequestPacketAcknowledgement); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OracleResponsePacketData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Result); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidatorStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActiveValidator); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PendingResolveList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IBCChannel); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RequestVerification); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_oracle_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PriceResult); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_oracle_v1_oracle_proto_rawDesc, + NumEnums: 1, + NumMessages: 17, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_oracle_v1_oracle_proto_goTypes, + DependencyIndexes: file_oracle_v1_oracle_proto_depIdxs, + EnumInfos: file_oracle_v1_oracle_proto_enumTypes, + MessageInfos: file_oracle_v1_oracle_proto_msgTypes, + }.Build() + File_oracle_v1_oracle_proto = out.File + file_oracle_v1_oracle_proto_rawDesc = nil + file_oracle_v1_oracle_proto_goTypes = nil + file_oracle_v1_oracle_proto_depIdxs = nil +} diff --git a/api/oracle/v1/query.pulsar.go b/api/oracle/v1/query.pulsar.go new file mode 100644 index 000000000..6a921f838 --- /dev/null +++ b/api/oracle/v1/query.pulsar.go @@ -0,0 +1,15267 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package oraclev1 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryCountsRequest protoreflect.MessageDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryCountsRequest = File_oracle_v1_query_proto.Messages().ByName("QueryCountsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryCountsRequest)(nil) + +type fastReflection_QueryCountsRequest QueryCountsRequest + +func (x *QueryCountsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCountsRequest)(x) +} + +func (x *QueryCountsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[0] + 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_QueryCountsRequest_messageType fastReflection_QueryCountsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryCountsRequest_messageType{} + +type fastReflection_QueryCountsRequest_messageType struct{} + +func (x fastReflection_QueryCountsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCountsRequest)(nil) +} +func (x fastReflection_QueryCountsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCountsRequest) +} +func (x fastReflection_QueryCountsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCountsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCountsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCountsRequest +} + +// 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_QueryCountsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryCountsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCountsRequest) New() protoreflect.Message { + return new(fastReflection_QueryCountsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCountsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryCountsRequest)(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_QueryCountsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_QueryCountsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryCountsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryCountsRequest 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_QueryCountsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryCountsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryCountsRequest 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_QueryCountsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryCountsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryCountsRequest 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_QueryCountsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryCountsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryCountsRequest 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_QueryCountsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryCountsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryCountsRequest 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_QueryCountsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryCountsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryCountsRequest 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_QueryCountsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryCountsRequest", 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_QueryCountsRequest) 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_QueryCountsRequest) 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_QueryCountsRequest) 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_QueryCountsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCountsRequest) + 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.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().(*QueryCountsRequest) + 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 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().(*QueryCountsRequest) + 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: QueryCountsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCountsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_QueryCountsResponse protoreflect.MessageDescriptor + fd_QueryCountsResponse_data_source_count protoreflect.FieldDescriptor + fd_QueryCountsResponse_oracle_script_count protoreflect.FieldDescriptor + fd_QueryCountsResponse_request_count protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryCountsResponse = File_oracle_v1_query_proto.Messages().ByName("QueryCountsResponse") + fd_QueryCountsResponse_data_source_count = md_QueryCountsResponse.Fields().ByName("data_source_count") + fd_QueryCountsResponse_oracle_script_count = md_QueryCountsResponse.Fields().ByName("oracle_script_count") + fd_QueryCountsResponse_request_count = md_QueryCountsResponse.Fields().ByName("request_count") +} + +var _ protoreflect.Message = (*fastReflection_QueryCountsResponse)(nil) + +type fastReflection_QueryCountsResponse QueryCountsResponse + +func (x *QueryCountsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCountsResponse)(x) +} + +func (x *QueryCountsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[1] + 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_QueryCountsResponse_messageType fastReflection_QueryCountsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryCountsResponse_messageType{} + +type fastReflection_QueryCountsResponse_messageType struct{} + +func (x fastReflection_QueryCountsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCountsResponse)(nil) +} +func (x fastReflection_QueryCountsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCountsResponse) +} +func (x fastReflection_QueryCountsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCountsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCountsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCountsResponse +} + +// 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_QueryCountsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryCountsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCountsResponse) New() protoreflect.Message { + return new(fastReflection_QueryCountsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCountsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryCountsResponse)(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_QueryCountsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.DataSourceCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.DataSourceCount) + if !f(fd_QueryCountsResponse_data_source_count, value) { + return + } + } + if x.OracleScriptCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.OracleScriptCount) + if !f(fd_QueryCountsResponse_oracle_script_count, value) { + return + } + } + if x.RequestCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.RequestCount) + if !f(fd_QueryCountsResponse_request_count, 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_QueryCountsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryCountsResponse.data_source_count": + return x.DataSourceCount != uint64(0) + case "oracle.v1.QueryCountsResponse.oracle_script_count": + return x.OracleScriptCount != uint64(0) + case "oracle.v1.QueryCountsResponse.request_count": + return x.RequestCount != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryCountsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryCountsResponse 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_QueryCountsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryCountsResponse.data_source_count": + x.DataSourceCount = uint64(0) + case "oracle.v1.QueryCountsResponse.oracle_script_count": + x.OracleScriptCount = uint64(0) + case "oracle.v1.QueryCountsResponse.request_count": + x.RequestCount = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryCountsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryCountsResponse 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_QueryCountsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryCountsResponse.data_source_count": + value := x.DataSourceCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.QueryCountsResponse.oracle_script_count": + value := x.OracleScriptCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.QueryCountsResponse.request_count": + value := x.RequestCount + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryCountsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryCountsResponse 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_QueryCountsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryCountsResponse.data_source_count": + x.DataSourceCount = value.Uint() + case "oracle.v1.QueryCountsResponse.oracle_script_count": + x.OracleScriptCount = value.Uint() + case "oracle.v1.QueryCountsResponse.request_count": + x.RequestCount = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryCountsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryCountsResponse 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_QueryCountsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryCountsResponse.data_source_count": + panic(fmt.Errorf("field data_source_count of message oracle.v1.QueryCountsResponse is not mutable")) + case "oracle.v1.QueryCountsResponse.oracle_script_count": + panic(fmt.Errorf("field oracle_script_count of message oracle.v1.QueryCountsResponse is not mutable")) + case "oracle.v1.QueryCountsResponse.request_count": + panic(fmt.Errorf("field request_count of message oracle.v1.QueryCountsResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryCountsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryCountsResponse 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_QueryCountsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryCountsResponse.data_source_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.QueryCountsResponse.oracle_script_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.QueryCountsResponse.request_count": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryCountsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryCountsResponse 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_QueryCountsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryCountsResponse", 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_QueryCountsResponse) 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_QueryCountsResponse) 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_QueryCountsResponse) 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_QueryCountsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCountsResponse) + 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.DataSourceCount != 0 { + n += 1 + runtime.Sov(uint64(x.DataSourceCount)) + } + if x.OracleScriptCount != 0 { + n += 1 + runtime.Sov(uint64(x.OracleScriptCount)) + } + if x.RequestCount != 0 { + n += 1 + runtime.Sov(uint64(x.RequestCount)) + } + 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().(*QueryCountsResponse) + 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.RequestCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RequestCount)) + i-- + dAtA[i] = 0x18 + } + if x.OracleScriptCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.OracleScriptCount)) + i-- + dAtA[i] = 0x10 + } + if x.DataSourceCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.DataSourceCount)) + i-- + dAtA[i] = 0x8 + } + 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().(*QueryCountsResponse) + 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: QueryCountsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCountsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DataSourceCount", wireType) + } + x.DataSourceCount = 0 + 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++ + x.DataSourceCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OracleScriptCount", wireType) + } + x.OracleScriptCount = 0 + 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++ + x.OracleScriptCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestCount", wireType) + } + x.RequestCount = 0 + 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++ + x.RequestCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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_QueryDataRequest protoreflect.MessageDescriptor + fd_QueryDataRequest_data_hash protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryDataRequest = File_oracle_v1_query_proto.Messages().ByName("QueryDataRequest") + fd_QueryDataRequest_data_hash = md_QueryDataRequest.Fields().ByName("data_hash") +} + +var _ protoreflect.Message = (*fastReflection_QueryDataRequest)(nil) + +type fastReflection_QueryDataRequest QueryDataRequest + +func (x *QueryDataRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDataRequest)(x) +} + +func (x *QueryDataRequest) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[2] + 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_QueryDataRequest_messageType fastReflection_QueryDataRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryDataRequest_messageType{} + +type fastReflection_QueryDataRequest_messageType struct{} + +func (x fastReflection_QueryDataRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDataRequest)(nil) +} +func (x fastReflection_QueryDataRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDataRequest) +} +func (x fastReflection_QueryDataRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDataRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryDataRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDataRequest +} + +// 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_QueryDataRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryDataRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryDataRequest) New() protoreflect.Message { + return new(fastReflection_QueryDataRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryDataRequest) Interface() protoreflect.ProtoMessage { + return (*QueryDataRequest)(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_QueryDataRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.DataHash != "" { + value := protoreflect.ValueOfString(x.DataHash) + if !f(fd_QueryDataRequest_data_hash, 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_QueryDataRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryDataRequest.data_hash": + return x.DataHash != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataRequest 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_QueryDataRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryDataRequest.data_hash": + x.DataHash = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataRequest 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_QueryDataRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryDataRequest.data_hash": + value := x.DataHash + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataRequest 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_QueryDataRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryDataRequest.data_hash": + x.DataHash = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataRequest 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_QueryDataRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryDataRequest.data_hash": + panic(fmt.Errorf("field data_hash of message oracle.v1.QueryDataRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataRequest 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_QueryDataRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryDataRequest.data_hash": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataRequest 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_QueryDataRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryDataRequest", 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_QueryDataRequest) 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_QueryDataRequest) 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_QueryDataRequest) 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_QueryDataRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryDataRequest) + 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.DataHash) + 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().(*QueryDataRequest) + 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.DataHash) > 0 { + i -= len(x.DataHash) + copy(dAtA[i:], x.DataHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DataHash))) + 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().(*QueryDataRequest) + 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: QueryDataRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDataRequest: 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 DataHash", 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.DataHash = 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_QueryDataResponse protoreflect.MessageDescriptor + fd_QueryDataResponse_data protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryDataResponse = File_oracle_v1_query_proto.Messages().ByName("QueryDataResponse") + fd_QueryDataResponse_data = md_QueryDataResponse.Fields().ByName("data") +} + +var _ protoreflect.Message = (*fastReflection_QueryDataResponse)(nil) + +type fastReflection_QueryDataResponse QueryDataResponse + +func (x *QueryDataResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDataResponse)(x) +} + +func (x *QueryDataResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_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_QueryDataResponse_messageType fastReflection_QueryDataResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryDataResponse_messageType{} + +type fastReflection_QueryDataResponse_messageType struct{} + +func (x fastReflection_QueryDataResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDataResponse)(nil) +} +func (x fastReflection_QueryDataResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDataResponse) +} +func (x fastReflection_QueryDataResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDataResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryDataResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDataResponse +} + +// 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_QueryDataResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryDataResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryDataResponse) New() protoreflect.Message { + return new(fastReflection_QueryDataResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryDataResponse) Interface() protoreflect.ProtoMessage { + return (*QueryDataResponse)(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_QueryDataResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Data) != 0 { + value := protoreflect.ValueOfBytes(x.Data) + if !f(fd_QueryDataResponse_data, 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_QueryDataResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryDataResponse.data": + return len(x.Data) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataResponse 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_QueryDataResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryDataResponse.data": + x.Data = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataResponse 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_QueryDataResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryDataResponse.data": + value := x.Data + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataResponse 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_QueryDataResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryDataResponse.data": + x.Data = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataResponse 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_QueryDataResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryDataResponse.data": + panic(fmt.Errorf("field data of message oracle.v1.QueryDataResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataResponse 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_QueryDataResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryDataResponse.data": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataResponse 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_QueryDataResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryDataResponse", 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_QueryDataResponse) 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_QueryDataResponse) 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_QueryDataResponse) 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_QueryDataResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryDataResponse) + 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.Data) + 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().(*QueryDataResponse) + 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.Data) > 0 { + i -= len(x.Data) + copy(dAtA[i:], x.Data) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) + 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().(*QueryDataResponse) + 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: QueryDataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDataResponse: 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 Data", 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.Data = append(x.Data[:0], dAtA[iNdEx:postIndex]...) + if x.Data == nil { + x.Data = []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_QueryDataSourceRequest protoreflect.MessageDescriptor + fd_QueryDataSourceRequest_data_source_id protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryDataSourceRequest = File_oracle_v1_query_proto.Messages().ByName("QueryDataSourceRequest") + fd_QueryDataSourceRequest_data_source_id = md_QueryDataSourceRequest.Fields().ByName("data_source_id") +} + +var _ protoreflect.Message = (*fastReflection_QueryDataSourceRequest)(nil) + +type fastReflection_QueryDataSourceRequest QueryDataSourceRequest + +func (x *QueryDataSourceRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDataSourceRequest)(x) +} + +func (x *QueryDataSourceRequest) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[4] + 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_QueryDataSourceRequest_messageType fastReflection_QueryDataSourceRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryDataSourceRequest_messageType{} + +type fastReflection_QueryDataSourceRequest_messageType struct{} + +func (x fastReflection_QueryDataSourceRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDataSourceRequest)(nil) +} +func (x fastReflection_QueryDataSourceRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDataSourceRequest) +} +func (x fastReflection_QueryDataSourceRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDataSourceRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryDataSourceRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDataSourceRequest +} + +// 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_QueryDataSourceRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryDataSourceRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryDataSourceRequest) New() protoreflect.Message { + return new(fastReflection_QueryDataSourceRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryDataSourceRequest) Interface() protoreflect.ProtoMessage { + return (*QueryDataSourceRequest)(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_QueryDataSourceRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.DataSourceId != uint64(0) { + value := protoreflect.ValueOfUint64(x.DataSourceId) + if !f(fd_QueryDataSourceRequest_data_source_id, 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_QueryDataSourceRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryDataSourceRequest.data_source_id": + return x.DataSourceId != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataSourceRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataSourceRequest 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_QueryDataSourceRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryDataSourceRequest.data_source_id": + x.DataSourceId = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataSourceRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataSourceRequest 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_QueryDataSourceRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryDataSourceRequest.data_source_id": + value := x.DataSourceId + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataSourceRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataSourceRequest 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_QueryDataSourceRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryDataSourceRequest.data_source_id": + x.DataSourceId = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataSourceRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataSourceRequest 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_QueryDataSourceRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryDataSourceRequest.data_source_id": + panic(fmt.Errorf("field data_source_id of message oracle.v1.QueryDataSourceRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataSourceRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataSourceRequest 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_QueryDataSourceRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryDataSourceRequest.data_source_id": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataSourceRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataSourceRequest 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_QueryDataSourceRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryDataSourceRequest", 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_QueryDataSourceRequest) 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_QueryDataSourceRequest) 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_QueryDataSourceRequest) 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_QueryDataSourceRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryDataSourceRequest) + 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.DataSourceId != 0 { + n += 1 + runtime.Sov(uint64(x.DataSourceId)) + } + 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().(*QueryDataSourceRequest) + 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.DataSourceId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.DataSourceId)) + i-- + dAtA[i] = 0x8 + } + 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().(*QueryDataSourceRequest) + 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: QueryDataSourceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDataSourceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DataSourceId", wireType) + } + x.DataSourceId = 0 + 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++ + x.DataSourceId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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_QueryDataSourceResponse protoreflect.MessageDescriptor + fd_QueryDataSourceResponse_data_source protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryDataSourceResponse = File_oracle_v1_query_proto.Messages().ByName("QueryDataSourceResponse") + fd_QueryDataSourceResponse_data_source = md_QueryDataSourceResponse.Fields().ByName("data_source") +} + +var _ protoreflect.Message = (*fastReflection_QueryDataSourceResponse)(nil) + +type fastReflection_QueryDataSourceResponse QueryDataSourceResponse + +func (x *QueryDataSourceResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDataSourceResponse)(x) +} + +func (x *QueryDataSourceResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[5] + 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_QueryDataSourceResponse_messageType fastReflection_QueryDataSourceResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryDataSourceResponse_messageType{} + +type fastReflection_QueryDataSourceResponse_messageType struct{} + +func (x fastReflection_QueryDataSourceResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDataSourceResponse)(nil) +} +func (x fastReflection_QueryDataSourceResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDataSourceResponse) +} +func (x fastReflection_QueryDataSourceResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDataSourceResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryDataSourceResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDataSourceResponse +} + +// 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_QueryDataSourceResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryDataSourceResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryDataSourceResponse) New() protoreflect.Message { + return new(fastReflection_QueryDataSourceResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryDataSourceResponse) Interface() protoreflect.ProtoMessage { + return (*QueryDataSourceResponse)(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_QueryDataSourceResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.DataSource != nil { + value := protoreflect.ValueOfMessage(x.DataSource.ProtoReflect()) + if !f(fd_QueryDataSourceResponse_data_source, 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_QueryDataSourceResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryDataSourceResponse.data_source": + return x.DataSource != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataSourceResponse 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_QueryDataSourceResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryDataSourceResponse.data_source": + x.DataSource = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataSourceResponse 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_QueryDataSourceResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryDataSourceResponse.data_source": + value := x.DataSource + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataSourceResponse 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_QueryDataSourceResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryDataSourceResponse.data_source": + x.DataSource = value.Message().Interface().(*DataSource) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataSourceResponse 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_QueryDataSourceResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryDataSourceResponse.data_source": + if x.DataSource == nil { + x.DataSource = new(DataSource) + } + return protoreflect.ValueOfMessage(x.DataSource.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataSourceResponse 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_QueryDataSourceResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryDataSourceResponse.data_source": + m := new(DataSource) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryDataSourceResponse 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_QueryDataSourceResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryDataSourceResponse", 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_QueryDataSourceResponse) 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_QueryDataSourceResponse) 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_QueryDataSourceResponse) 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_QueryDataSourceResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryDataSourceResponse) + 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.DataSource != nil { + l = options.Size(x.DataSource) + 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().(*QueryDataSourceResponse) + 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.DataSource != nil { + encoded, err := options.Marshal(x.DataSource) + 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().(*QueryDataSourceResponse) + 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: QueryDataSourceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDataSourceResponse: 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 DataSource", 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.DataSource == nil { + x.DataSource = &DataSource{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.DataSource); 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_QueryOracleScriptRequest protoreflect.MessageDescriptor + fd_QueryOracleScriptRequest_oracle_script_id protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryOracleScriptRequest = File_oracle_v1_query_proto.Messages().ByName("QueryOracleScriptRequest") + fd_QueryOracleScriptRequest_oracle_script_id = md_QueryOracleScriptRequest.Fields().ByName("oracle_script_id") +} + +var _ protoreflect.Message = (*fastReflection_QueryOracleScriptRequest)(nil) + +type fastReflection_QueryOracleScriptRequest QueryOracleScriptRequest + +func (x *QueryOracleScriptRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryOracleScriptRequest)(x) +} + +func (x *QueryOracleScriptRequest) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[6] + 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_QueryOracleScriptRequest_messageType fastReflection_QueryOracleScriptRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryOracleScriptRequest_messageType{} + +type fastReflection_QueryOracleScriptRequest_messageType struct{} + +func (x fastReflection_QueryOracleScriptRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryOracleScriptRequest)(nil) +} +func (x fastReflection_QueryOracleScriptRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryOracleScriptRequest) +} +func (x fastReflection_QueryOracleScriptRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryOracleScriptRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryOracleScriptRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryOracleScriptRequest +} + +// 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_QueryOracleScriptRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryOracleScriptRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryOracleScriptRequest) New() protoreflect.Message { + return new(fastReflection_QueryOracleScriptRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryOracleScriptRequest) Interface() protoreflect.ProtoMessage { + return (*QueryOracleScriptRequest)(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_QueryOracleScriptRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.OracleScriptId != uint64(0) { + value := protoreflect.ValueOfUint64(x.OracleScriptId) + if !f(fd_QueryOracleScriptRequest_oracle_script_id, 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_QueryOracleScriptRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryOracleScriptRequest.oracle_script_id": + return x.OracleScriptId != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryOracleScriptRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryOracleScriptRequest 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_QueryOracleScriptRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryOracleScriptRequest.oracle_script_id": + x.OracleScriptId = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryOracleScriptRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryOracleScriptRequest 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_QueryOracleScriptRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryOracleScriptRequest.oracle_script_id": + value := x.OracleScriptId + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryOracleScriptRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryOracleScriptRequest 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_QueryOracleScriptRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryOracleScriptRequest.oracle_script_id": + x.OracleScriptId = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryOracleScriptRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryOracleScriptRequest 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_QueryOracleScriptRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryOracleScriptRequest.oracle_script_id": + panic(fmt.Errorf("field oracle_script_id of message oracle.v1.QueryOracleScriptRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryOracleScriptRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryOracleScriptRequest 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_QueryOracleScriptRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryOracleScriptRequest.oracle_script_id": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryOracleScriptRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryOracleScriptRequest 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_QueryOracleScriptRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryOracleScriptRequest", 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_QueryOracleScriptRequest) 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_QueryOracleScriptRequest) 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_QueryOracleScriptRequest) 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_QueryOracleScriptRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryOracleScriptRequest) + 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.OracleScriptId != 0 { + n += 1 + runtime.Sov(uint64(x.OracleScriptId)) + } + 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().(*QueryOracleScriptRequest) + 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.OracleScriptId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.OracleScriptId)) + i-- + dAtA[i] = 0x8 + } + 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().(*QueryOracleScriptRequest) + 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: QueryOracleScriptRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryOracleScriptRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OracleScriptId", wireType) + } + x.OracleScriptId = 0 + 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++ + x.OracleScriptId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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_QueryOracleScriptResponse protoreflect.MessageDescriptor + fd_QueryOracleScriptResponse_oracle_script protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryOracleScriptResponse = File_oracle_v1_query_proto.Messages().ByName("QueryOracleScriptResponse") + fd_QueryOracleScriptResponse_oracle_script = md_QueryOracleScriptResponse.Fields().ByName("oracle_script") +} + +var _ protoreflect.Message = (*fastReflection_QueryOracleScriptResponse)(nil) + +type fastReflection_QueryOracleScriptResponse QueryOracleScriptResponse + +func (x *QueryOracleScriptResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryOracleScriptResponse)(x) +} + +func (x *QueryOracleScriptResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_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_QueryOracleScriptResponse_messageType fastReflection_QueryOracleScriptResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryOracleScriptResponse_messageType{} + +type fastReflection_QueryOracleScriptResponse_messageType struct{} + +func (x fastReflection_QueryOracleScriptResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryOracleScriptResponse)(nil) +} +func (x fastReflection_QueryOracleScriptResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryOracleScriptResponse) +} +func (x fastReflection_QueryOracleScriptResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryOracleScriptResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryOracleScriptResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryOracleScriptResponse +} + +// 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_QueryOracleScriptResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryOracleScriptResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryOracleScriptResponse) New() protoreflect.Message { + return new(fastReflection_QueryOracleScriptResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryOracleScriptResponse) Interface() protoreflect.ProtoMessage { + return (*QueryOracleScriptResponse)(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_QueryOracleScriptResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.OracleScript != nil { + value := protoreflect.ValueOfMessage(x.OracleScript.ProtoReflect()) + if !f(fd_QueryOracleScriptResponse_oracle_script, 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_QueryOracleScriptResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryOracleScriptResponse.oracle_script": + return x.OracleScript != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryOracleScriptResponse 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_QueryOracleScriptResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryOracleScriptResponse.oracle_script": + x.OracleScript = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryOracleScriptResponse 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_QueryOracleScriptResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryOracleScriptResponse.oracle_script": + value := x.OracleScript + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryOracleScriptResponse 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_QueryOracleScriptResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryOracleScriptResponse.oracle_script": + x.OracleScript = value.Message().Interface().(*OracleScript) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryOracleScriptResponse 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_QueryOracleScriptResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryOracleScriptResponse.oracle_script": + if x.OracleScript == nil { + x.OracleScript = new(OracleScript) + } + return protoreflect.ValueOfMessage(x.OracleScript.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryOracleScriptResponse 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_QueryOracleScriptResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryOracleScriptResponse.oracle_script": + m := new(OracleScript) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryOracleScriptResponse 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_QueryOracleScriptResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryOracleScriptResponse", 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_QueryOracleScriptResponse) 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_QueryOracleScriptResponse) 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_QueryOracleScriptResponse) 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_QueryOracleScriptResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryOracleScriptResponse) + 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.OracleScript != nil { + l = options.Size(x.OracleScript) + 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().(*QueryOracleScriptResponse) + 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.OracleScript != nil { + encoded, err := options.Marshal(x.OracleScript) + 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().(*QueryOracleScriptResponse) + 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: QueryOracleScriptResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryOracleScriptResponse: 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 OracleScript", 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.OracleScript == nil { + x.OracleScript = &OracleScript{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.OracleScript); 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_QueryRequestRequest protoreflect.MessageDescriptor + fd_QueryRequestRequest_request_id protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryRequestRequest = File_oracle_v1_query_proto.Messages().ByName("QueryRequestRequest") + fd_QueryRequestRequest_request_id = md_QueryRequestRequest.Fields().ByName("request_id") +} + +var _ protoreflect.Message = (*fastReflection_QueryRequestRequest)(nil) + +type fastReflection_QueryRequestRequest QueryRequestRequest + +func (x *QueryRequestRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRequestRequest)(x) +} + +func (x *QueryRequestRequest) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_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_QueryRequestRequest_messageType fastReflection_QueryRequestRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryRequestRequest_messageType{} + +type fastReflection_QueryRequestRequest_messageType struct{} + +func (x fastReflection_QueryRequestRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRequestRequest)(nil) +} +func (x fastReflection_QueryRequestRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRequestRequest) +} +func (x fastReflection_QueryRequestRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryRequestRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestRequest +} + +// 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_QueryRequestRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryRequestRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRequestRequest) New() protoreflect.Message { + return new(fastReflection_QueryRequestRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRequestRequest) Interface() protoreflect.ProtoMessage { + return (*QueryRequestRequest)(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_QueryRequestRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.RequestId != uint64(0) { + value := protoreflect.ValueOfUint64(x.RequestId) + if !f(fd_QueryRequestRequest_request_id, 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_QueryRequestRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryRequestRequest.request_id": + return x.RequestId != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestRequest 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_QueryRequestRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryRequestRequest.request_id": + x.RequestId = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestRequest 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_QueryRequestRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryRequestRequest.request_id": + value := x.RequestId + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestRequest 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_QueryRequestRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryRequestRequest.request_id": + x.RequestId = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestRequest 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_QueryRequestRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestRequest.request_id": + panic(fmt.Errorf("field request_id of message oracle.v1.QueryRequestRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestRequest 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_QueryRequestRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestRequest.request_id": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestRequest 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_QueryRequestRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryRequestRequest", 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_QueryRequestRequest) 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_QueryRequestRequest) 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_QueryRequestRequest) 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_QueryRequestRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRequestRequest) + 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.RequestId != 0 { + n += 1 + runtime.Sov(uint64(x.RequestId)) + } + 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().(*QueryRequestRequest) + 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.RequestId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RequestId)) + i-- + dAtA[i] = 0x8 + } + 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().(*QueryRequestRequest) + 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: QueryRequestRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRequestRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) + } + x.RequestId = 0 + 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++ + x.RequestId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 = (*_QueryRequestResponse_2_list)(nil) + +type _QueryRequestResponse_2_list struct { + list *[]*Report +} + +func (x *_QueryRequestResponse_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryRequestResponse_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryRequestResponse_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Report) + (*x.list)[i] = concreteValue +} + +func (x *_QueryRequestResponse_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Report) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryRequestResponse_2_list) AppendMutable() protoreflect.Value { + v := new(Report) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryRequestResponse_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryRequestResponse_2_list) NewElement() protoreflect.Value { + v := new(Report) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryRequestResponse_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryRequestResponse protoreflect.MessageDescriptor + fd_QueryRequestResponse_request protoreflect.FieldDescriptor + fd_QueryRequestResponse_reports protoreflect.FieldDescriptor + fd_QueryRequestResponse_result protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryRequestResponse = File_oracle_v1_query_proto.Messages().ByName("QueryRequestResponse") + fd_QueryRequestResponse_request = md_QueryRequestResponse.Fields().ByName("request") + fd_QueryRequestResponse_reports = md_QueryRequestResponse.Fields().ByName("reports") + fd_QueryRequestResponse_result = md_QueryRequestResponse.Fields().ByName("result") +} + +var _ protoreflect.Message = (*fastReflection_QueryRequestResponse)(nil) + +type fastReflection_QueryRequestResponse QueryRequestResponse + +func (x *QueryRequestResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRequestResponse)(x) +} + +func (x *QueryRequestResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_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_QueryRequestResponse_messageType fastReflection_QueryRequestResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryRequestResponse_messageType{} + +type fastReflection_QueryRequestResponse_messageType struct{} + +func (x fastReflection_QueryRequestResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRequestResponse)(nil) +} +func (x fastReflection_QueryRequestResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRequestResponse) +} +func (x fastReflection_QueryRequestResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryRequestResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestResponse +} + +// 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_QueryRequestResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryRequestResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRequestResponse) New() protoreflect.Message { + return new(fastReflection_QueryRequestResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRequestResponse) Interface() protoreflect.ProtoMessage { + return (*QueryRequestResponse)(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_QueryRequestResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Request != nil { + value := protoreflect.ValueOfMessage(x.Request.ProtoReflect()) + if !f(fd_QueryRequestResponse_request, value) { + return + } + } + if len(x.Reports) != 0 { + value := protoreflect.ValueOfList(&_QueryRequestResponse_2_list{list: &x.Reports}) + if !f(fd_QueryRequestResponse_reports, value) { + return + } + } + if x.Result != nil { + value := protoreflect.ValueOfMessage(x.Result.ProtoReflect()) + if !f(fd_QueryRequestResponse_result, 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_QueryRequestResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryRequestResponse.request": + return x.Request != nil + case "oracle.v1.QueryRequestResponse.reports": + return len(x.Reports) != 0 + case "oracle.v1.QueryRequestResponse.result": + return x.Result != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestResponse 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_QueryRequestResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryRequestResponse.request": + x.Request = nil + case "oracle.v1.QueryRequestResponse.reports": + x.Reports = nil + case "oracle.v1.QueryRequestResponse.result": + x.Result = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestResponse 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_QueryRequestResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryRequestResponse.request": + value := x.Request + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "oracle.v1.QueryRequestResponse.reports": + if len(x.Reports) == 0 { + return protoreflect.ValueOfList(&_QueryRequestResponse_2_list{}) + } + listValue := &_QueryRequestResponse_2_list{list: &x.Reports} + return protoreflect.ValueOfList(listValue) + case "oracle.v1.QueryRequestResponse.result": + value := x.Result + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestResponse 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_QueryRequestResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryRequestResponse.request": + x.Request = value.Message().Interface().(*Request) + case "oracle.v1.QueryRequestResponse.reports": + lv := value.List() + clv := lv.(*_QueryRequestResponse_2_list) + x.Reports = *clv.list + case "oracle.v1.QueryRequestResponse.result": + x.Result = value.Message().Interface().(*Result) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestResponse 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_QueryRequestResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestResponse.request": + if x.Request == nil { + x.Request = new(Request) + } + return protoreflect.ValueOfMessage(x.Request.ProtoReflect()) + case "oracle.v1.QueryRequestResponse.reports": + if x.Reports == nil { + x.Reports = []*Report{} + } + value := &_QueryRequestResponse_2_list{list: &x.Reports} + return protoreflect.ValueOfList(value) + case "oracle.v1.QueryRequestResponse.result": + if x.Result == nil { + x.Result = new(Result) + } + return protoreflect.ValueOfMessage(x.Result.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestResponse 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_QueryRequestResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestResponse.request": + m := new(Request) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "oracle.v1.QueryRequestResponse.reports": + list := []*Report{} + return protoreflect.ValueOfList(&_QueryRequestResponse_2_list{list: &list}) + case "oracle.v1.QueryRequestResponse.result": + m := new(Result) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestResponse 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_QueryRequestResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryRequestResponse", 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_QueryRequestResponse) 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_QueryRequestResponse) 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_QueryRequestResponse) 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_QueryRequestResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRequestResponse) + 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.Request != nil { + l = options.Size(x.Request) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Reports) > 0 { + for _, e := range x.Reports { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Result != nil { + l = options.Size(x.Result) + 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().(*QueryRequestResponse) + 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.Result != nil { + encoded, err := options.Marshal(x.Result) + 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] = 0x1a + } + if len(x.Reports) > 0 { + for iNdEx := len(x.Reports) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Reports[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] = 0x12 + } + } + if x.Request != nil { + encoded, err := options.Marshal(x.Request) + 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().(*QueryRequestResponse) + 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: QueryRequestResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRequestResponse: 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 Request", 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.Request == nil { + x.Request = &Request{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Request); 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 Reports", 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.Reports = append(x.Reports, &Report{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Reports[len(x.Reports)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Result", 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.Result == nil { + x.Result = &Result{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Result); 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_QueryPendingRequestsRequest protoreflect.MessageDescriptor + fd_QueryPendingRequestsRequest_validator_address protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryPendingRequestsRequest = File_oracle_v1_query_proto.Messages().ByName("QueryPendingRequestsRequest") + fd_QueryPendingRequestsRequest_validator_address = md_QueryPendingRequestsRequest.Fields().ByName("validator_address") +} + +var _ protoreflect.Message = (*fastReflection_QueryPendingRequestsRequest)(nil) + +type fastReflection_QueryPendingRequestsRequest QueryPendingRequestsRequest + +func (x *QueryPendingRequestsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryPendingRequestsRequest)(x) +} + +func (x *QueryPendingRequestsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_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_QueryPendingRequestsRequest_messageType fastReflection_QueryPendingRequestsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryPendingRequestsRequest_messageType{} + +type fastReflection_QueryPendingRequestsRequest_messageType struct{} + +func (x fastReflection_QueryPendingRequestsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryPendingRequestsRequest)(nil) +} +func (x fastReflection_QueryPendingRequestsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryPendingRequestsRequest) +} +func (x fastReflection_QueryPendingRequestsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryPendingRequestsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryPendingRequestsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryPendingRequestsRequest +} + +// 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_QueryPendingRequestsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryPendingRequestsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryPendingRequestsRequest) New() protoreflect.Message { + return new(fastReflection_QueryPendingRequestsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryPendingRequestsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryPendingRequestsRequest)(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_QueryPendingRequestsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ValidatorAddress != "" { + value := protoreflect.ValueOfString(x.ValidatorAddress) + if !f(fd_QueryPendingRequestsRequest_validator_address, 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_QueryPendingRequestsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryPendingRequestsRequest.validator_address": + return x.ValidatorAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryPendingRequestsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryPendingRequestsRequest 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_QueryPendingRequestsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryPendingRequestsRequest.validator_address": + x.ValidatorAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryPendingRequestsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryPendingRequestsRequest 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_QueryPendingRequestsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryPendingRequestsRequest.validator_address": + value := x.ValidatorAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryPendingRequestsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryPendingRequestsRequest 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_QueryPendingRequestsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryPendingRequestsRequest.validator_address": + x.ValidatorAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryPendingRequestsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryPendingRequestsRequest 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_QueryPendingRequestsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryPendingRequestsRequest.validator_address": + panic(fmt.Errorf("field validator_address of message oracle.v1.QueryPendingRequestsRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryPendingRequestsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryPendingRequestsRequest 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_QueryPendingRequestsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryPendingRequestsRequest.validator_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryPendingRequestsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryPendingRequestsRequest 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_QueryPendingRequestsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryPendingRequestsRequest", 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_QueryPendingRequestsRequest) 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_QueryPendingRequestsRequest) 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_QueryPendingRequestsRequest) 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_QueryPendingRequestsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryPendingRequestsRequest) + 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.ValidatorAddress) + 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().(*QueryPendingRequestsRequest) + 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.ValidatorAddress) > 0 { + i -= len(x.ValidatorAddress) + copy(dAtA[i:], x.ValidatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorAddress))) + 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().(*QueryPendingRequestsRequest) + 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: QueryPendingRequestsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryPendingRequestsRequest: 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 ValidatorAddress", 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.ValidatorAddress = 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 = (*_QueryPendingRequestsResponse_1_list)(nil) + +type _QueryPendingRequestsResponse_1_list struct { + list *[]uint64 +} + +func (x *_QueryPendingRequestsResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryPendingRequestsResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfUint64((*x.list)[i]) +} + +func (x *_QueryPendingRequestsResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Uint() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_QueryPendingRequestsResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Uint() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryPendingRequestsResponse_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message QueryPendingRequestsResponse at list field RequestIds as it is not of Message kind")) +} + +func (x *_QueryPendingRequestsResponse_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_QueryPendingRequestsResponse_1_list) NewElement() protoreflect.Value { + v := uint64(0) + return protoreflect.ValueOfUint64(v) +} + +func (x *_QueryPendingRequestsResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryPendingRequestsResponse protoreflect.MessageDescriptor + fd_QueryPendingRequestsResponse_request_ids protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryPendingRequestsResponse = File_oracle_v1_query_proto.Messages().ByName("QueryPendingRequestsResponse") + fd_QueryPendingRequestsResponse_request_ids = md_QueryPendingRequestsResponse.Fields().ByName("request_ids") +} + +var _ protoreflect.Message = (*fastReflection_QueryPendingRequestsResponse)(nil) + +type fastReflection_QueryPendingRequestsResponse QueryPendingRequestsResponse + +func (x *QueryPendingRequestsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryPendingRequestsResponse)(x) +} + +func (x *QueryPendingRequestsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[11] + 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_QueryPendingRequestsResponse_messageType fastReflection_QueryPendingRequestsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryPendingRequestsResponse_messageType{} + +type fastReflection_QueryPendingRequestsResponse_messageType struct{} + +func (x fastReflection_QueryPendingRequestsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryPendingRequestsResponse)(nil) +} +func (x fastReflection_QueryPendingRequestsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryPendingRequestsResponse) +} +func (x fastReflection_QueryPendingRequestsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryPendingRequestsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryPendingRequestsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryPendingRequestsResponse +} + +// 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_QueryPendingRequestsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryPendingRequestsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryPendingRequestsResponse) New() protoreflect.Message { + return new(fastReflection_QueryPendingRequestsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryPendingRequestsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryPendingRequestsResponse)(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_QueryPendingRequestsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.RequestIds) != 0 { + value := protoreflect.ValueOfList(&_QueryPendingRequestsResponse_1_list{list: &x.RequestIds}) + if !f(fd_QueryPendingRequestsResponse_request_ids, 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_QueryPendingRequestsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryPendingRequestsResponse.request_ids": + return len(x.RequestIds) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryPendingRequestsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryPendingRequestsResponse 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_QueryPendingRequestsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryPendingRequestsResponse.request_ids": + x.RequestIds = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryPendingRequestsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryPendingRequestsResponse 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_QueryPendingRequestsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryPendingRequestsResponse.request_ids": + if len(x.RequestIds) == 0 { + return protoreflect.ValueOfList(&_QueryPendingRequestsResponse_1_list{}) + } + listValue := &_QueryPendingRequestsResponse_1_list{list: &x.RequestIds} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryPendingRequestsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryPendingRequestsResponse 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_QueryPendingRequestsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryPendingRequestsResponse.request_ids": + lv := value.List() + clv := lv.(*_QueryPendingRequestsResponse_1_list) + x.RequestIds = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryPendingRequestsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryPendingRequestsResponse 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_QueryPendingRequestsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryPendingRequestsResponse.request_ids": + if x.RequestIds == nil { + x.RequestIds = []uint64{} + } + value := &_QueryPendingRequestsResponse_1_list{list: &x.RequestIds} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryPendingRequestsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryPendingRequestsResponse 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_QueryPendingRequestsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryPendingRequestsResponse.request_ids": + list := []uint64{} + return protoreflect.ValueOfList(&_QueryPendingRequestsResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryPendingRequestsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryPendingRequestsResponse 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_QueryPendingRequestsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryPendingRequestsResponse", 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_QueryPendingRequestsResponse) 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_QueryPendingRequestsResponse) 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_QueryPendingRequestsResponse) 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_QueryPendingRequestsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryPendingRequestsResponse) + 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.RequestIds) > 0 { + l = 0 + for _, e := range x.RequestIds { + l += runtime.Sov(uint64(e)) + } + n += 1 + runtime.Sov(uint64(l)) + 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().(*QueryPendingRequestsResponse) + 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.RequestIds) > 0 { + var pksize2 int + for _, num := range x.RequestIds { + pksize2 += runtime.Sov(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num := range x.RequestIds { + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ + } + i = runtime.EncodeVarint(dAtA, i, uint64(pksize2)) + 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().(*QueryPendingRequestsResponse) + 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: QueryPendingRequestsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryPendingRequestsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v 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++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.RequestIds = append(x.RequestIds, v) + } else if wireType == 2 { + var packedLen 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++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + packedLen + 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 + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(x.RequestIds) == 0 { + x.RequestIds = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v 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++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.RequestIds = append(x.RequestIds, v) + } + } else { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestIds", wireType) + } + 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_QueryParamsRequest protoreflect.MessageDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryParamsRequest = File_oracle_v1_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[12] + 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_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// 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_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(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_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryParamsRequest 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_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryParamsRequest 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_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryParamsRequest 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_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryParamsRequest 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_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryParamsRequest 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_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryParamsRequest 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_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryParamsRequest", 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + 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.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().(*QueryParamsRequest) + 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 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().(*QueryParamsRequest) + 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryParamsResponse = File_oracle_v1_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[13] + 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_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// 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_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(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_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, 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_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryParamsResponse 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_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryParamsResponse 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_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryParamsResponse 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_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryParamsResponse 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_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryParamsResponse 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_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryParamsResponse 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_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryParamsResponse", 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_QueryParamsResponse) 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_QueryParamsResponse) 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_QueryParamsResponse) 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_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + 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.Params != nil { + l = options.Size(x.Params) + 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().(*QueryParamsResponse) + 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.Params != nil { + encoded, err := options.Marshal(x.Params) + 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().(*QueryParamsResponse) + 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: 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 Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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_QueryValidatorRequest protoreflect.MessageDescriptor + fd_QueryValidatorRequest_validator_address protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryValidatorRequest = File_oracle_v1_query_proto.Messages().ByName("QueryValidatorRequest") + fd_QueryValidatorRequest_validator_address = md_QueryValidatorRequest.Fields().ByName("validator_address") +} + +var _ protoreflect.Message = (*fastReflection_QueryValidatorRequest)(nil) + +type fastReflection_QueryValidatorRequest QueryValidatorRequest + +func (x *QueryValidatorRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryValidatorRequest)(x) +} + +func (x *QueryValidatorRequest) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[14] + 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_QueryValidatorRequest_messageType fastReflection_QueryValidatorRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryValidatorRequest_messageType{} + +type fastReflection_QueryValidatorRequest_messageType struct{} + +func (x fastReflection_QueryValidatorRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryValidatorRequest)(nil) +} +func (x fastReflection_QueryValidatorRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryValidatorRequest) +} +func (x fastReflection_QueryValidatorRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryValidatorRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryValidatorRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryValidatorRequest +} + +// 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_QueryValidatorRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryValidatorRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryValidatorRequest) New() protoreflect.Message { + return new(fastReflection_QueryValidatorRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryValidatorRequest) Interface() protoreflect.ProtoMessage { + return (*QueryValidatorRequest)(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_QueryValidatorRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ValidatorAddress != "" { + value := protoreflect.ValueOfString(x.ValidatorAddress) + if !f(fd_QueryValidatorRequest_validator_address, 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_QueryValidatorRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryValidatorRequest.validator_address": + return x.ValidatorAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryValidatorRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryValidatorRequest 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_QueryValidatorRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryValidatorRequest.validator_address": + x.ValidatorAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryValidatorRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryValidatorRequest 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_QueryValidatorRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryValidatorRequest.validator_address": + value := x.ValidatorAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryValidatorRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryValidatorRequest 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_QueryValidatorRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryValidatorRequest.validator_address": + x.ValidatorAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryValidatorRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryValidatorRequest 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_QueryValidatorRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryValidatorRequest.validator_address": + panic(fmt.Errorf("field validator_address of message oracle.v1.QueryValidatorRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryValidatorRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryValidatorRequest 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_QueryValidatorRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryValidatorRequest.validator_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryValidatorRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryValidatorRequest 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_QueryValidatorRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryValidatorRequest", 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_QueryValidatorRequest) 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_QueryValidatorRequest) 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_QueryValidatorRequest) 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_QueryValidatorRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryValidatorRequest) + 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.ValidatorAddress) + 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().(*QueryValidatorRequest) + 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.ValidatorAddress) > 0 { + i -= len(x.ValidatorAddress) + copy(dAtA[i:], x.ValidatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorAddress))) + 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().(*QueryValidatorRequest) + 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: QueryValidatorRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryValidatorRequest: 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 ValidatorAddress", 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.ValidatorAddress = 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_QueryValidatorResponse protoreflect.MessageDescriptor + fd_QueryValidatorResponse_status protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryValidatorResponse = File_oracle_v1_query_proto.Messages().ByName("QueryValidatorResponse") + fd_QueryValidatorResponse_status = md_QueryValidatorResponse.Fields().ByName("status") +} + +var _ protoreflect.Message = (*fastReflection_QueryValidatorResponse)(nil) + +type fastReflection_QueryValidatorResponse QueryValidatorResponse + +func (x *QueryValidatorResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryValidatorResponse)(x) +} + +func (x *QueryValidatorResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[15] + 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_QueryValidatorResponse_messageType fastReflection_QueryValidatorResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryValidatorResponse_messageType{} + +type fastReflection_QueryValidatorResponse_messageType struct{} + +func (x fastReflection_QueryValidatorResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryValidatorResponse)(nil) +} +func (x fastReflection_QueryValidatorResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryValidatorResponse) +} +func (x fastReflection_QueryValidatorResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryValidatorResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryValidatorResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryValidatorResponse +} + +// 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_QueryValidatorResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryValidatorResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryValidatorResponse) New() protoreflect.Message { + return new(fastReflection_QueryValidatorResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryValidatorResponse) Interface() protoreflect.ProtoMessage { + return (*QueryValidatorResponse)(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_QueryValidatorResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Status != nil { + value := protoreflect.ValueOfMessage(x.Status.ProtoReflect()) + if !f(fd_QueryValidatorResponse_status, 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_QueryValidatorResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryValidatorResponse.status": + return x.Status != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryValidatorResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryValidatorResponse 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_QueryValidatorResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryValidatorResponse.status": + x.Status = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryValidatorResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryValidatorResponse 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_QueryValidatorResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryValidatorResponse.status": + value := x.Status + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryValidatorResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryValidatorResponse 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_QueryValidatorResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryValidatorResponse.status": + x.Status = value.Message().Interface().(*ValidatorStatus) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryValidatorResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryValidatorResponse 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_QueryValidatorResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryValidatorResponse.status": + if x.Status == nil { + x.Status = new(ValidatorStatus) + } + return protoreflect.ValueOfMessage(x.Status.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryValidatorResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryValidatorResponse 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_QueryValidatorResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryValidatorResponse.status": + m := new(ValidatorStatus) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryValidatorResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryValidatorResponse 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_QueryValidatorResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryValidatorResponse", 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_QueryValidatorResponse) 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_QueryValidatorResponse) 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_QueryValidatorResponse) 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_QueryValidatorResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryValidatorResponse) + 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.Status != nil { + l = options.Size(x.Status) + 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().(*QueryValidatorResponse) + 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.Status != nil { + encoded, err := options.Marshal(x.Status) + 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().(*QueryValidatorResponse) + 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: QueryValidatorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryValidatorResponse: 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 Status", 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.Status == nil { + x.Status = &ValidatorStatus{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Status); 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_QueryIsReporterRequest protoreflect.MessageDescriptor + fd_QueryIsReporterRequest_validator_address protoreflect.FieldDescriptor + fd_QueryIsReporterRequest_reporter_address protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryIsReporterRequest = File_oracle_v1_query_proto.Messages().ByName("QueryIsReporterRequest") + fd_QueryIsReporterRequest_validator_address = md_QueryIsReporterRequest.Fields().ByName("validator_address") + fd_QueryIsReporterRequest_reporter_address = md_QueryIsReporterRequest.Fields().ByName("reporter_address") +} + +var _ protoreflect.Message = (*fastReflection_QueryIsReporterRequest)(nil) + +type fastReflection_QueryIsReporterRequest QueryIsReporterRequest + +func (x *QueryIsReporterRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryIsReporterRequest)(x) +} + +func (x *QueryIsReporterRequest) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[16] + 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_QueryIsReporterRequest_messageType fastReflection_QueryIsReporterRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryIsReporterRequest_messageType{} + +type fastReflection_QueryIsReporterRequest_messageType struct{} + +func (x fastReflection_QueryIsReporterRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryIsReporterRequest)(nil) +} +func (x fastReflection_QueryIsReporterRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryIsReporterRequest) +} +func (x fastReflection_QueryIsReporterRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryIsReporterRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryIsReporterRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryIsReporterRequest +} + +// 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_QueryIsReporterRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryIsReporterRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryIsReporterRequest) New() protoreflect.Message { + return new(fastReflection_QueryIsReporterRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryIsReporterRequest) Interface() protoreflect.ProtoMessage { + return (*QueryIsReporterRequest)(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_QueryIsReporterRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ValidatorAddress != "" { + value := protoreflect.ValueOfString(x.ValidatorAddress) + if !f(fd_QueryIsReporterRequest_validator_address, value) { + return + } + } + if x.ReporterAddress != "" { + value := protoreflect.ValueOfString(x.ReporterAddress) + if !f(fd_QueryIsReporterRequest_reporter_address, 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_QueryIsReporterRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryIsReporterRequest.validator_address": + return x.ValidatorAddress != "" + case "oracle.v1.QueryIsReporterRequest.reporter_address": + return x.ReporterAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryIsReporterRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryIsReporterRequest 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_QueryIsReporterRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryIsReporterRequest.validator_address": + x.ValidatorAddress = "" + case "oracle.v1.QueryIsReporterRequest.reporter_address": + x.ReporterAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryIsReporterRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryIsReporterRequest 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_QueryIsReporterRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryIsReporterRequest.validator_address": + value := x.ValidatorAddress + return protoreflect.ValueOfString(value) + case "oracle.v1.QueryIsReporterRequest.reporter_address": + value := x.ReporterAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryIsReporterRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryIsReporterRequest 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_QueryIsReporterRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryIsReporterRequest.validator_address": + x.ValidatorAddress = value.Interface().(string) + case "oracle.v1.QueryIsReporterRequest.reporter_address": + x.ReporterAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryIsReporterRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryIsReporterRequest 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_QueryIsReporterRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryIsReporterRequest.validator_address": + panic(fmt.Errorf("field validator_address of message oracle.v1.QueryIsReporterRequest is not mutable")) + case "oracle.v1.QueryIsReporterRequest.reporter_address": + panic(fmt.Errorf("field reporter_address of message oracle.v1.QueryIsReporterRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryIsReporterRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryIsReporterRequest 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_QueryIsReporterRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryIsReporterRequest.validator_address": + return protoreflect.ValueOfString("") + case "oracle.v1.QueryIsReporterRequest.reporter_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryIsReporterRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryIsReporterRequest 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_QueryIsReporterRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryIsReporterRequest", 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_QueryIsReporterRequest) 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_QueryIsReporterRequest) 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_QueryIsReporterRequest) 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_QueryIsReporterRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryIsReporterRequest) + 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.ValidatorAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ReporterAddress) + 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().(*QueryIsReporterRequest) + 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.ReporterAddress) > 0 { + i -= len(x.ReporterAddress) + copy(dAtA[i:], x.ReporterAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ReporterAddress))) + i-- + dAtA[i] = 0x12 + } + if len(x.ValidatorAddress) > 0 { + i -= len(x.ValidatorAddress) + copy(dAtA[i:], x.ValidatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorAddress))) + 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().(*QueryIsReporterRequest) + 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: QueryIsReporterRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryIsReporterRequest: 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 ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ReporterAddress", 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.ReporterAddress = 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_QueryIsReporterResponse protoreflect.MessageDescriptor + fd_QueryIsReporterResponse_is_reporter protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryIsReporterResponse = File_oracle_v1_query_proto.Messages().ByName("QueryIsReporterResponse") + fd_QueryIsReporterResponse_is_reporter = md_QueryIsReporterResponse.Fields().ByName("is_reporter") +} + +var _ protoreflect.Message = (*fastReflection_QueryIsReporterResponse)(nil) + +type fastReflection_QueryIsReporterResponse QueryIsReporterResponse + +func (x *QueryIsReporterResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryIsReporterResponse)(x) +} + +func (x *QueryIsReporterResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_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_QueryIsReporterResponse_messageType fastReflection_QueryIsReporterResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryIsReporterResponse_messageType{} + +type fastReflection_QueryIsReporterResponse_messageType struct{} + +func (x fastReflection_QueryIsReporterResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryIsReporterResponse)(nil) +} +func (x fastReflection_QueryIsReporterResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryIsReporterResponse) +} +func (x fastReflection_QueryIsReporterResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryIsReporterResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryIsReporterResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryIsReporterResponse +} + +// 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_QueryIsReporterResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryIsReporterResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryIsReporterResponse) New() protoreflect.Message { + return new(fastReflection_QueryIsReporterResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryIsReporterResponse) Interface() protoreflect.ProtoMessage { + return (*QueryIsReporterResponse)(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_QueryIsReporterResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.IsReporter != false { + value := protoreflect.ValueOfBool(x.IsReporter) + if !f(fd_QueryIsReporterResponse_is_reporter, 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_QueryIsReporterResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryIsReporterResponse.is_reporter": + return x.IsReporter != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryIsReporterResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryIsReporterResponse 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_QueryIsReporterResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryIsReporterResponse.is_reporter": + x.IsReporter = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryIsReporterResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryIsReporterResponse 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_QueryIsReporterResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryIsReporterResponse.is_reporter": + value := x.IsReporter + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryIsReporterResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryIsReporterResponse 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_QueryIsReporterResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryIsReporterResponse.is_reporter": + x.IsReporter = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryIsReporterResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryIsReporterResponse 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_QueryIsReporterResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryIsReporterResponse.is_reporter": + panic(fmt.Errorf("field is_reporter of message oracle.v1.QueryIsReporterResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryIsReporterResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryIsReporterResponse 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_QueryIsReporterResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryIsReporterResponse.is_reporter": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryIsReporterResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryIsReporterResponse 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_QueryIsReporterResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryIsReporterResponse", 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_QueryIsReporterResponse) 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_QueryIsReporterResponse) 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_QueryIsReporterResponse) 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_QueryIsReporterResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryIsReporterResponse) + 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.IsReporter { + n += 2 + } + 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().(*QueryIsReporterResponse) + 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.IsReporter { + i-- + if x.IsReporter { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + 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().(*QueryIsReporterResponse) + 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: QueryIsReporterResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryIsReporterResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IsReporter", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.IsReporter = bool(v != 0) + 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_QueryReportersRequest protoreflect.MessageDescriptor + fd_QueryReportersRequest_validator_address protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryReportersRequest = File_oracle_v1_query_proto.Messages().ByName("QueryReportersRequest") + fd_QueryReportersRequest_validator_address = md_QueryReportersRequest.Fields().ByName("validator_address") +} + +var _ protoreflect.Message = (*fastReflection_QueryReportersRequest)(nil) + +type fastReflection_QueryReportersRequest QueryReportersRequest + +func (x *QueryReportersRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryReportersRequest)(x) +} + +func (x *QueryReportersRequest) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_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_QueryReportersRequest_messageType fastReflection_QueryReportersRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryReportersRequest_messageType{} + +type fastReflection_QueryReportersRequest_messageType struct{} + +func (x fastReflection_QueryReportersRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryReportersRequest)(nil) +} +func (x fastReflection_QueryReportersRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryReportersRequest) +} +func (x fastReflection_QueryReportersRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryReportersRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryReportersRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryReportersRequest +} + +// 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_QueryReportersRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryReportersRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryReportersRequest) New() protoreflect.Message { + return new(fastReflection_QueryReportersRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryReportersRequest) Interface() protoreflect.ProtoMessage { + return (*QueryReportersRequest)(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_QueryReportersRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ValidatorAddress != "" { + value := protoreflect.ValueOfString(x.ValidatorAddress) + if !f(fd_QueryReportersRequest_validator_address, 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_QueryReportersRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryReportersRequest.validator_address": + return x.ValidatorAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryReportersRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryReportersRequest 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_QueryReportersRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryReportersRequest.validator_address": + x.ValidatorAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryReportersRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryReportersRequest 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_QueryReportersRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryReportersRequest.validator_address": + value := x.ValidatorAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryReportersRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryReportersRequest 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_QueryReportersRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryReportersRequest.validator_address": + x.ValidatorAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryReportersRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryReportersRequest 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_QueryReportersRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryReportersRequest.validator_address": + panic(fmt.Errorf("field validator_address of message oracle.v1.QueryReportersRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryReportersRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryReportersRequest 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_QueryReportersRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryReportersRequest.validator_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryReportersRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryReportersRequest 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_QueryReportersRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryReportersRequest", 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_QueryReportersRequest) 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_QueryReportersRequest) 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_QueryReportersRequest) 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_QueryReportersRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryReportersRequest) + 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.ValidatorAddress) + 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().(*QueryReportersRequest) + 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.ValidatorAddress) > 0 { + i -= len(x.ValidatorAddress) + copy(dAtA[i:], x.ValidatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorAddress))) + 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().(*QueryReportersRequest) + 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: QueryReportersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryReportersRequest: 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 ValidatorAddress", 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.ValidatorAddress = 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 = (*_QueryReportersResponse_1_list)(nil) + +type _QueryReportersResponse_1_list struct { + list *[]string +} + +func (x *_QueryReportersResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryReportersResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_QueryReportersResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_QueryReportersResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryReportersResponse_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message QueryReportersResponse at list field Reporter as it is not of Message kind")) +} + +func (x *_QueryReportersResponse_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_QueryReportersResponse_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_QueryReportersResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryReportersResponse protoreflect.MessageDescriptor + fd_QueryReportersResponse_reporter protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryReportersResponse = File_oracle_v1_query_proto.Messages().ByName("QueryReportersResponse") + fd_QueryReportersResponse_reporter = md_QueryReportersResponse.Fields().ByName("reporter") +} + +var _ protoreflect.Message = (*fastReflection_QueryReportersResponse)(nil) + +type fastReflection_QueryReportersResponse QueryReportersResponse + +func (x *QueryReportersResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryReportersResponse)(x) +} + +func (x *QueryReportersResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_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_QueryReportersResponse_messageType fastReflection_QueryReportersResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryReportersResponse_messageType{} + +type fastReflection_QueryReportersResponse_messageType struct{} + +func (x fastReflection_QueryReportersResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryReportersResponse)(nil) +} +func (x fastReflection_QueryReportersResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryReportersResponse) +} +func (x fastReflection_QueryReportersResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryReportersResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryReportersResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryReportersResponse +} + +// 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_QueryReportersResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryReportersResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryReportersResponse) New() protoreflect.Message { + return new(fastReflection_QueryReportersResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryReportersResponse) Interface() protoreflect.ProtoMessage { + return (*QueryReportersResponse)(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_QueryReportersResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Reporter) != 0 { + value := protoreflect.ValueOfList(&_QueryReportersResponse_1_list{list: &x.Reporter}) + if !f(fd_QueryReportersResponse_reporter, 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_QueryReportersResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryReportersResponse.reporter": + return len(x.Reporter) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryReportersResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryReportersResponse 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_QueryReportersResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryReportersResponse.reporter": + x.Reporter = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryReportersResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryReportersResponse 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_QueryReportersResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryReportersResponse.reporter": + if len(x.Reporter) == 0 { + return protoreflect.ValueOfList(&_QueryReportersResponse_1_list{}) + } + listValue := &_QueryReportersResponse_1_list{list: &x.Reporter} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryReportersResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryReportersResponse 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_QueryReportersResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryReportersResponse.reporter": + lv := value.List() + clv := lv.(*_QueryReportersResponse_1_list) + x.Reporter = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryReportersResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryReportersResponse 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_QueryReportersResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryReportersResponse.reporter": + if x.Reporter == nil { + x.Reporter = []string{} + } + value := &_QueryReportersResponse_1_list{list: &x.Reporter} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryReportersResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryReportersResponse 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_QueryReportersResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryReportersResponse.reporter": + list := []string{} + return protoreflect.ValueOfList(&_QueryReportersResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryReportersResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryReportersResponse 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_QueryReportersResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryReportersResponse", 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_QueryReportersResponse) 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_QueryReportersResponse) 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_QueryReportersResponse) 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_QueryReportersResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryReportersResponse) + 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.Reporter) > 0 { + for _, s := range x.Reporter { + 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().(*QueryReportersResponse) + 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.Reporter) > 0 { + for iNdEx := len(x.Reporter) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Reporter[iNdEx]) + copy(dAtA[i:], x.Reporter[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Reporter[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().(*QueryReportersResponse) + 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: QueryReportersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryReportersResponse: 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 Reporter", 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.Reporter = append(x.Reporter, 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_QueryActiveValidatorsRequest protoreflect.MessageDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryActiveValidatorsRequest = File_oracle_v1_query_proto.Messages().ByName("QueryActiveValidatorsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryActiveValidatorsRequest)(nil) + +type fastReflection_QueryActiveValidatorsRequest QueryActiveValidatorsRequest + +func (x *QueryActiveValidatorsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryActiveValidatorsRequest)(x) +} + +func (x *QueryActiveValidatorsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[20] + 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_QueryActiveValidatorsRequest_messageType fastReflection_QueryActiveValidatorsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryActiveValidatorsRequest_messageType{} + +type fastReflection_QueryActiveValidatorsRequest_messageType struct{} + +func (x fastReflection_QueryActiveValidatorsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryActiveValidatorsRequest)(nil) +} +func (x fastReflection_QueryActiveValidatorsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryActiveValidatorsRequest) +} +func (x fastReflection_QueryActiveValidatorsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryActiveValidatorsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryActiveValidatorsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryActiveValidatorsRequest +} + +// 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_QueryActiveValidatorsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryActiveValidatorsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryActiveValidatorsRequest) New() protoreflect.Message { + return new(fastReflection_QueryActiveValidatorsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryActiveValidatorsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryActiveValidatorsRequest)(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_QueryActiveValidatorsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_QueryActiveValidatorsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryActiveValidatorsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryActiveValidatorsRequest 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_QueryActiveValidatorsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryActiveValidatorsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryActiveValidatorsRequest 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_QueryActiveValidatorsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryActiveValidatorsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryActiveValidatorsRequest 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_QueryActiveValidatorsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryActiveValidatorsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryActiveValidatorsRequest 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_QueryActiveValidatorsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryActiveValidatorsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryActiveValidatorsRequest 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_QueryActiveValidatorsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryActiveValidatorsRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryActiveValidatorsRequest 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_QueryActiveValidatorsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryActiveValidatorsRequest", 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_QueryActiveValidatorsRequest) 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_QueryActiveValidatorsRequest) 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_QueryActiveValidatorsRequest) 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_QueryActiveValidatorsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryActiveValidatorsRequest) + 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.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().(*QueryActiveValidatorsRequest) + 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 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().(*QueryActiveValidatorsRequest) + 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: QueryActiveValidatorsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryActiveValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 = (*_QueryActiveValidatorsResponse_1_list)(nil) + +type _QueryActiveValidatorsResponse_1_list struct { + list *[]*ActiveValidator +} + +func (x *_QueryActiveValidatorsResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryActiveValidatorsResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryActiveValidatorsResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ActiveValidator) + (*x.list)[i] = concreteValue +} + +func (x *_QueryActiveValidatorsResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ActiveValidator) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryActiveValidatorsResponse_1_list) AppendMutable() protoreflect.Value { + v := new(ActiveValidator) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryActiveValidatorsResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryActiveValidatorsResponse_1_list) NewElement() protoreflect.Value { + v := new(ActiveValidator) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryActiveValidatorsResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryActiveValidatorsResponse protoreflect.MessageDescriptor + fd_QueryActiveValidatorsResponse_validators protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryActiveValidatorsResponse = File_oracle_v1_query_proto.Messages().ByName("QueryActiveValidatorsResponse") + fd_QueryActiveValidatorsResponse_validators = md_QueryActiveValidatorsResponse.Fields().ByName("validators") +} + +var _ protoreflect.Message = (*fastReflection_QueryActiveValidatorsResponse)(nil) + +type fastReflection_QueryActiveValidatorsResponse QueryActiveValidatorsResponse + +func (x *QueryActiveValidatorsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryActiveValidatorsResponse)(x) +} + +func (x *QueryActiveValidatorsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[21] + 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_QueryActiveValidatorsResponse_messageType fastReflection_QueryActiveValidatorsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryActiveValidatorsResponse_messageType{} + +type fastReflection_QueryActiveValidatorsResponse_messageType struct{} + +func (x fastReflection_QueryActiveValidatorsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryActiveValidatorsResponse)(nil) +} +func (x fastReflection_QueryActiveValidatorsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryActiveValidatorsResponse) +} +func (x fastReflection_QueryActiveValidatorsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryActiveValidatorsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryActiveValidatorsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryActiveValidatorsResponse +} + +// 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_QueryActiveValidatorsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryActiveValidatorsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryActiveValidatorsResponse) New() protoreflect.Message { + return new(fastReflection_QueryActiveValidatorsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryActiveValidatorsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryActiveValidatorsResponse)(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_QueryActiveValidatorsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Validators) != 0 { + value := protoreflect.ValueOfList(&_QueryActiveValidatorsResponse_1_list{list: &x.Validators}) + if !f(fd_QueryActiveValidatorsResponse_validators, 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_QueryActiveValidatorsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryActiveValidatorsResponse.validators": + return len(x.Validators) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryActiveValidatorsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryActiveValidatorsResponse 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_QueryActiveValidatorsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryActiveValidatorsResponse.validators": + x.Validators = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryActiveValidatorsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryActiveValidatorsResponse 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_QueryActiveValidatorsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryActiveValidatorsResponse.validators": + if len(x.Validators) == 0 { + return protoreflect.ValueOfList(&_QueryActiveValidatorsResponse_1_list{}) + } + listValue := &_QueryActiveValidatorsResponse_1_list{list: &x.Validators} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryActiveValidatorsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryActiveValidatorsResponse 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_QueryActiveValidatorsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryActiveValidatorsResponse.validators": + lv := value.List() + clv := lv.(*_QueryActiveValidatorsResponse_1_list) + x.Validators = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryActiveValidatorsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryActiveValidatorsResponse 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_QueryActiveValidatorsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryActiveValidatorsResponse.validators": + if x.Validators == nil { + x.Validators = []*ActiveValidator{} + } + value := &_QueryActiveValidatorsResponse_1_list{list: &x.Validators} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryActiveValidatorsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryActiveValidatorsResponse 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_QueryActiveValidatorsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryActiveValidatorsResponse.validators": + list := []*ActiveValidator{} + return protoreflect.ValueOfList(&_QueryActiveValidatorsResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryActiveValidatorsResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryActiveValidatorsResponse 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_QueryActiveValidatorsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryActiveValidatorsResponse", 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_QueryActiveValidatorsResponse) 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_QueryActiveValidatorsResponse) 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_QueryActiveValidatorsResponse) 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_QueryActiveValidatorsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryActiveValidatorsResponse) + 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.Validators) > 0 { + for _, e := range x.Validators { + 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().(*QueryActiveValidatorsResponse) + 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.Validators) > 0 { + for iNdEx := len(x.Validators) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Validators[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().(*QueryActiveValidatorsResponse) + 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: QueryActiveValidatorsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryActiveValidatorsResponse: 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 Validators", 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.Validators = append(x.Validators, &ActiveValidator{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Validators[len(x.Validators)-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 ( + md_QueryRequestSearchRequest protoreflect.MessageDescriptor + fd_QueryRequestSearchRequest_oracle_script_id protoreflect.FieldDescriptor + fd_QueryRequestSearchRequest_calldata protoreflect.FieldDescriptor + fd_QueryRequestSearchRequest_ask_count protoreflect.FieldDescriptor + fd_QueryRequestSearchRequest_min_count protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryRequestSearchRequest = File_oracle_v1_query_proto.Messages().ByName("QueryRequestSearchRequest") + fd_QueryRequestSearchRequest_oracle_script_id = md_QueryRequestSearchRequest.Fields().ByName("oracle_script_id") + fd_QueryRequestSearchRequest_calldata = md_QueryRequestSearchRequest.Fields().ByName("calldata") + fd_QueryRequestSearchRequest_ask_count = md_QueryRequestSearchRequest.Fields().ByName("ask_count") + fd_QueryRequestSearchRequest_min_count = md_QueryRequestSearchRequest.Fields().ByName("min_count") +} + +var _ protoreflect.Message = (*fastReflection_QueryRequestSearchRequest)(nil) + +type fastReflection_QueryRequestSearchRequest QueryRequestSearchRequest + +func (x *QueryRequestSearchRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRequestSearchRequest)(x) +} + +func (x *QueryRequestSearchRequest) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[22] + 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_QueryRequestSearchRequest_messageType fastReflection_QueryRequestSearchRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryRequestSearchRequest_messageType{} + +type fastReflection_QueryRequestSearchRequest_messageType struct{} + +func (x fastReflection_QueryRequestSearchRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRequestSearchRequest)(nil) +} +func (x fastReflection_QueryRequestSearchRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRequestSearchRequest) +} +func (x fastReflection_QueryRequestSearchRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestSearchRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryRequestSearchRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestSearchRequest +} + +// 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_QueryRequestSearchRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryRequestSearchRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRequestSearchRequest) New() protoreflect.Message { + return new(fastReflection_QueryRequestSearchRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRequestSearchRequest) Interface() protoreflect.ProtoMessage { + return (*QueryRequestSearchRequest)(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_QueryRequestSearchRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.OracleScriptId != uint64(0) { + value := protoreflect.ValueOfUint64(x.OracleScriptId) + if !f(fd_QueryRequestSearchRequest_oracle_script_id, value) { + return + } + } + if x.Calldata != "" { + value := protoreflect.ValueOfString(x.Calldata) + if !f(fd_QueryRequestSearchRequest_calldata, value) { + return + } + } + if x.AskCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.AskCount) + if !f(fd_QueryRequestSearchRequest_ask_count, value) { + return + } + } + if x.MinCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.MinCount) + if !f(fd_QueryRequestSearchRequest_min_count, 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_QueryRequestSearchRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryRequestSearchRequest.oracle_script_id": + return x.OracleScriptId != uint64(0) + case "oracle.v1.QueryRequestSearchRequest.calldata": + return x.Calldata != "" + case "oracle.v1.QueryRequestSearchRequest.ask_count": + return x.AskCount != uint64(0) + case "oracle.v1.QueryRequestSearchRequest.min_count": + return x.MinCount != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestSearchRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestSearchRequest 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_QueryRequestSearchRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryRequestSearchRequest.oracle_script_id": + x.OracleScriptId = uint64(0) + case "oracle.v1.QueryRequestSearchRequest.calldata": + x.Calldata = "" + case "oracle.v1.QueryRequestSearchRequest.ask_count": + x.AskCount = uint64(0) + case "oracle.v1.QueryRequestSearchRequest.min_count": + x.MinCount = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestSearchRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestSearchRequest 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_QueryRequestSearchRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryRequestSearchRequest.oracle_script_id": + value := x.OracleScriptId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.QueryRequestSearchRequest.calldata": + value := x.Calldata + return protoreflect.ValueOfString(value) + case "oracle.v1.QueryRequestSearchRequest.ask_count": + value := x.AskCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.QueryRequestSearchRequest.min_count": + value := x.MinCount + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestSearchRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestSearchRequest 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_QueryRequestSearchRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryRequestSearchRequest.oracle_script_id": + x.OracleScriptId = value.Uint() + case "oracle.v1.QueryRequestSearchRequest.calldata": + x.Calldata = value.Interface().(string) + case "oracle.v1.QueryRequestSearchRequest.ask_count": + x.AskCount = value.Uint() + case "oracle.v1.QueryRequestSearchRequest.min_count": + x.MinCount = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestSearchRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestSearchRequest 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_QueryRequestSearchRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestSearchRequest.oracle_script_id": + panic(fmt.Errorf("field oracle_script_id of message oracle.v1.QueryRequestSearchRequest is not mutable")) + case "oracle.v1.QueryRequestSearchRequest.calldata": + panic(fmt.Errorf("field calldata of message oracle.v1.QueryRequestSearchRequest is not mutable")) + case "oracle.v1.QueryRequestSearchRequest.ask_count": + panic(fmt.Errorf("field ask_count of message oracle.v1.QueryRequestSearchRequest is not mutable")) + case "oracle.v1.QueryRequestSearchRequest.min_count": + panic(fmt.Errorf("field min_count of message oracle.v1.QueryRequestSearchRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestSearchRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestSearchRequest 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_QueryRequestSearchRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestSearchRequest.oracle_script_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.QueryRequestSearchRequest.calldata": + return protoreflect.ValueOfString("") + case "oracle.v1.QueryRequestSearchRequest.ask_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.QueryRequestSearchRequest.min_count": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestSearchRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestSearchRequest 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_QueryRequestSearchRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryRequestSearchRequest", 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_QueryRequestSearchRequest) 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_QueryRequestSearchRequest) 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_QueryRequestSearchRequest) 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_QueryRequestSearchRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRequestSearchRequest) + 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.OracleScriptId != 0 { + n += 1 + runtime.Sov(uint64(x.OracleScriptId)) + } + l = len(x.Calldata) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.AskCount != 0 { + n += 1 + runtime.Sov(uint64(x.AskCount)) + } + if x.MinCount != 0 { + n += 1 + runtime.Sov(uint64(x.MinCount)) + } + 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().(*QueryRequestSearchRequest) + 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.MinCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MinCount)) + i-- + dAtA[i] = 0x20 + } + if x.AskCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AskCount)) + i-- + dAtA[i] = 0x18 + } + if len(x.Calldata) > 0 { + i -= len(x.Calldata) + copy(dAtA[i:], x.Calldata) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Calldata))) + i-- + dAtA[i] = 0x12 + } + if x.OracleScriptId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.OracleScriptId)) + i-- + dAtA[i] = 0x8 + } + 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().(*QueryRequestSearchRequest) + 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: QueryRequestSearchRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRequestSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OracleScriptId", wireType) + } + x.OracleScriptId = 0 + 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++ + x.OracleScriptId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Calldata", 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.Calldata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AskCount", wireType) + } + x.AskCount = 0 + 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++ + x.AskCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinCount", wireType) + } + x.MinCount = 0 + 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++ + x.MinCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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_QueryRequestSearchResponse protoreflect.MessageDescriptor + fd_QueryRequestSearchResponse_request protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryRequestSearchResponse = File_oracle_v1_query_proto.Messages().ByName("QueryRequestSearchResponse") + fd_QueryRequestSearchResponse_request = md_QueryRequestSearchResponse.Fields().ByName("request") +} + +var _ protoreflect.Message = (*fastReflection_QueryRequestSearchResponse)(nil) + +type fastReflection_QueryRequestSearchResponse QueryRequestSearchResponse + +func (x *QueryRequestSearchResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRequestSearchResponse)(x) +} + +func (x *QueryRequestSearchResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[23] + 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_QueryRequestSearchResponse_messageType fastReflection_QueryRequestSearchResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryRequestSearchResponse_messageType{} + +type fastReflection_QueryRequestSearchResponse_messageType struct{} + +func (x fastReflection_QueryRequestSearchResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRequestSearchResponse)(nil) +} +func (x fastReflection_QueryRequestSearchResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRequestSearchResponse) +} +func (x fastReflection_QueryRequestSearchResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestSearchResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryRequestSearchResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestSearchResponse +} + +// 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_QueryRequestSearchResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryRequestSearchResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRequestSearchResponse) New() protoreflect.Message { + return new(fastReflection_QueryRequestSearchResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRequestSearchResponse) Interface() protoreflect.ProtoMessage { + return (*QueryRequestSearchResponse)(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_QueryRequestSearchResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Request != nil { + value := protoreflect.ValueOfMessage(x.Request.ProtoReflect()) + if !f(fd_QueryRequestSearchResponse_request, 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_QueryRequestSearchResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryRequestSearchResponse.request": + return x.Request != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestSearchResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestSearchResponse 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_QueryRequestSearchResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryRequestSearchResponse.request": + x.Request = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestSearchResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestSearchResponse 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_QueryRequestSearchResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryRequestSearchResponse.request": + value := x.Request + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestSearchResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestSearchResponse 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_QueryRequestSearchResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryRequestSearchResponse.request": + x.Request = value.Message().Interface().(*QueryRequestResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestSearchResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestSearchResponse 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_QueryRequestSearchResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestSearchResponse.request": + if x.Request == nil { + x.Request = new(QueryRequestResponse) + } + return protoreflect.ValueOfMessage(x.Request.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestSearchResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestSearchResponse 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_QueryRequestSearchResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestSearchResponse.request": + m := new(QueryRequestResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestSearchResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestSearchResponse 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_QueryRequestSearchResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryRequestSearchResponse", 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_QueryRequestSearchResponse) 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_QueryRequestSearchResponse) 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_QueryRequestSearchResponse) 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_QueryRequestSearchResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRequestSearchResponse) + 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.Request != nil { + l = options.Size(x.Request) + 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().(*QueryRequestSearchResponse) + 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.Request != nil { + encoded, err := options.Marshal(x.Request) + 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().(*QueryRequestSearchResponse) + 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: QueryRequestSearchResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRequestSearchResponse: 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 Request", 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.Request == nil { + x.Request = &QueryRequestResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Request); 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 = (*_QueryRequestPriceRequest_1_list)(nil) + +type _QueryRequestPriceRequest_1_list struct { + list *[]string +} + +func (x *_QueryRequestPriceRequest_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryRequestPriceRequest_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_QueryRequestPriceRequest_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_QueryRequestPriceRequest_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryRequestPriceRequest_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message QueryRequestPriceRequest at list field Symbols as it is not of Message kind")) +} + +func (x *_QueryRequestPriceRequest_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_QueryRequestPriceRequest_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_QueryRequestPriceRequest_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryRequestPriceRequest protoreflect.MessageDescriptor + fd_QueryRequestPriceRequest_symbols protoreflect.FieldDescriptor + fd_QueryRequestPriceRequest_ask_count protoreflect.FieldDescriptor + fd_QueryRequestPriceRequest_min_count protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryRequestPriceRequest = File_oracle_v1_query_proto.Messages().ByName("QueryRequestPriceRequest") + fd_QueryRequestPriceRequest_symbols = md_QueryRequestPriceRequest.Fields().ByName("symbols") + fd_QueryRequestPriceRequest_ask_count = md_QueryRequestPriceRequest.Fields().ByName("ask_count") + fd_QueryRequestPriceRequest_min_count = md_QueryRequestPriceRequest.Fields().ByName("min_count") +} + +var _ protoreflect.Message = (*fastReflection_QueryRequestPriceRequest)(nil) + +type fastReflection_QueryRequestPriceRequest QueryRequestPriceRequest + +func (x *QueryRequestPriceRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRequestPriceRequest)(x) +} + +func (x *QueryRequestPriceRequest) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[24] + 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_QueryRequestPriceRequest_messageType fastReflection_QueryRequestPriceRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryRequestPriceRequest_messageType{} + +type fastReflection_QueryRequestPriceRequest_messageType struct{} + +func (x fastReflection_QueryRequestPriceRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRequestPriceRequest)(nil) +} +func (x fastReflection_QueryRequestPriceRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRequestPriceRequest) +} +func (x fastReflection_QueryRequestPriceRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestPriceRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryRequestPriceRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestPriceRequest +} + +// 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_QueryRequestPriceRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryRequestPriceRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRequestPriceRequest) New() protoreflect.Message { + return new(fastReflection_QueryRequestPriceRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRequestPriceRequest) Interface() protoreflect.ProtoMessage { + return (*QueryRequestPriceRequest)(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_QueryRequestPriceRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Symbols) != 0 { + value := protoreflect.ValueOfList(&_QueryRequestPriceRequest_1_list{list: &x.Symbols}) + if !f(fd_QueryRequestPriceRequest_symbols, value) { + return + } + } + if x.AskCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.AskCount) + if !f(fd_QueryRequestPriceRequest_ask_count, value) { + return + } + } + if x.MinCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.MinCount) + if !f(fd_QueryRequestPriceRequest_min_count, 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_QueryRequestPriceRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryRequestPriceRequest.symbols": + return len(x.Symbols) != 0 + case "oracle.v1.QueryRequestPriceRequest.ask_count": + return x.AskCount != uint64(0) + case "oracle.v1.QueryRequestPriceRequest.min_count": + return x.MinCount != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestPriceRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestPriceRequest 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_QueryRequestPriceRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryRequestPriceRequest.symbols": + x.Symbols = nil + case "oracle.v1.QueryRequestPriceRequest.ask_count": + x.AskCount = uint64(0) + case "oracle.v1.QueryRequestPriceRequest.min_count": + x.MinCount = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestPriceRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestPriceRequest 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_QueryRequestPriceRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryRequestPriceRequest.symbols": + if len(x.Symbols) == 0 { + return protoreflect.ValueOfList(&_QueryRequestPriceRequest_1_list{}) + } + listValue := &_QueryRequestPriceRequest_1_list{list: &x.Symbols} + return protoreflect.ValueOfList(listValue) + case "oracle.v1.QueryRequestPriceRequest.ask_count": + value := x.AskCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.QueryRequestPriceRequest.min_count": + value := x.MinCount + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestPriceRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestPriceRequest 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_QueryRequestPriceRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryRequestPriceRequest.symbols": + lv := value.List() + clv := lv.(*_QueryRequestPriceRequest_1_list) + x.Symbols = *clv.list + case "oracle.v1.QueryRequestPriceRequest.ask_count": + x.AskCount = value.Uint() + case "oracle.v1.QueryRequestPriceRequest.min_count": + x.MinCount = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestPriceRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestPriceRequest 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_QueryRequestPriceRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestPriceRequest.symbols": + if x.Symbols == nil { + x.Symbols = []string{} + } + value := &_QueryRequestPriceRequest_1_list{list: &x.Symbols} + return protoreflect.ValueOfList(value) + case "oracle.v1.QueryRequestPriceRequest.ask_count": + panic(fmt.Errorf("field ask_count of message oracle.v1.QueryRequestPriceRequest is not mutable")) + case "oracle.v1.QueryRequestPriceRequest.min_count": + panic(fmt.Errorf("field min_count of message oracle.v1.QueryRequestPriceRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestPriceRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestPriceRequest 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_QueryRequestPriceRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestPriceRequest.symbols": + list := []string{} + return protoreflect.ValueOfList(&_QueryRequestPriceRequest_1_list{list: &list}) + case "oracle.v1.QueryRequestPriceRequest.ask_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.QueryRequestPriceRequest.min_count": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestPriceRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestPriceRequest 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_QueryRequestPriceRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryRequestPriceRequest", 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_QueryRequestPriceRequest) 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_QueryRequestPriceRequest) 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_QueryRequestPriceRequest) 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_QueryRequestPriceRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRequestPriceRequest) + 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.Symbols) > 0 { + for _, s := range x.Symbols { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.AskCount != 0 { + n += 1 + runtime.Sov(uint64(x.AskCount)) + } + if x.MinCount != 0 { + n += 1 + runtime.Sov(uint64(x.MinCount)) + } + 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().(*QueryRequestPriceRequest) + 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.MinCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MinCount)) + i-- + dAtA[i] = 0x18 + } + if x.AskCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AskCount)) + i-- + dAtA[i] = 0x10 + } + if len(x.Symbols) > 0 { + for iNdEx := len(x.Symbols) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Symbols[iNdEx]) + copy(dAtA[i:], x.Symbols[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Symbols[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().(*QueryRequestPriceRequest) + 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: QueryRequestPriceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRequestPriceRequest: 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 Symbols", 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.Symbols = append(x.Symbols, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AskCount", wireType) + } + x.AskCount = 0 + 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++ + x.AskCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinCount", wireType) + } + x.MinCount = 0 + 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++ + x.MinCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 = (*_QueryRequestPriceResponse_1_list)(nil) + +type _QueryRequestPriceResponse_1_list struct { + list *[]*PriceResult +} + +func (x *_QueryRequestPriceResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryRequestPriceResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryRequestPriceResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*PriceResult) + (*x.list)[i] = concreteValue +} + +func (x *_QueryRequestPriceResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*PriceResult) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryRequestPriceResponse_1_list) AppendMutable() protoreflect.Value { + v := new(PriceResult) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryRequestPriceResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryRequestPriceResponse_1_list) NewElement() protoreflect.Value { + v := new(PriceResult) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryRequestPriceResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryRequestPriceResponse protoreflect.MessageDescriptor + fd_QueryRequestPriceResponse_price_results protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryRequestPriceResponse = File_oracle_v1_query_proto.Messages().ByName("QueryRequestPriceResponse") + fd_QueryRequestPriceResponse_price_results = md_QueryRequestPriceResponse.Fields().ByName("price_results") +} + +var _ protoreflect.Message = (*fastReflection_QueryRequestPriceResponse)(nil) + +type fastReflection_QueryRequestPriceResponse QueryRequestPriceResponse + +func (x *QueryRequestPriceResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRequestPriceResponse)(x) +} + +func (x *QueryRequestPriceResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[25] + 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_QueryRequestPriceResponse_messageType fastReflection_QueryRequestPriceResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryRequestPriceResponse_messageType{} + +type fastReflection_QueryRequestPriceResponse_messageType struct{} + +func (x fastReflection_QueryRequestPriceResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRequestPriceResponse)(nil) +} +func (x fastReflection_QueryRequestPriceResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRequestPriceResponse) +} +func (x fastReflection_QueryRequestPriceResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestPriceResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryRequestPriceResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestPriceResponse +} + +// 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_QueryRequestPriceResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryRequestPriceResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRequestPriceResponse) New() protoreflect.Message { + return new(fastReflection_QueryRequestPriceResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRequestPriceResponse) Interface() protoreflect.ProtoMessage { + return (*QueryRequestPriceResponse)(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_QueryRequestPriceResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.PriceResults) != 0 { + value := protoreflect.ValueOfList(&_QueryRequestPriceResponse_1_list{list: &x.PriceResults}) + if !f(fd_QueryRequestPriceResponse_price_results, 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_QueryRequestPriceResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryRequestPriceResponse.price_results": + return len(x.PriceResults) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestPriceResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestPriceResponse 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_QueryRequestPriceResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryRequestPriceResponse.price_results": + x.PriceResults = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestPriceResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestPriceResponse 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_QueryRequestPriceResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryRequestPriceResponse.price_results": + if len(x.PriceResults) == 0 { + return protoreflect.ValueOfList(&_QueryRequestPriceResponse_1_list{}) + } + listValue := &_QueryRequestPriceResponse_1_list{list: &x.PriceResults} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestPriceResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestPriceResponse 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_QueryRequestPriceResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryRequestPriceResponse.price_results": + lv := value.List() + clv := lv.(*_QueryRequestPriceResponse_1_list) + x.PriceResults = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestPriceResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestPriceResponse 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_QueryRequestPriceResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestPriceResponse.price_results": + if x.PriceResults == nil { + x.PriceResults = []*PriceResult{} + } + value := &_QueryRequestPriceResponse_1_list{list: &x.PriceResults} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestPriceResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestPriceResponse 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_QueryRequestPriceResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestPriceResponse.price_results": + list := []*PriceResult{} + return protoreflect.ValueOfList(&_QueryRequestPriceResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestPriceResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestPriceResponse 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_QueryRequestPriceResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryRequestPriceResponse", 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_QueryRequestPriceResponse) 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_QueryRequestPriceResponse) 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_QueryRequestPriceResponse) 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_QueryRequestPriceResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRequestPriceResponse) + 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.PriceResults) > 0 { + for _, e := range x.PriceResults { + 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().(*QueryRequestPriceResponse) + 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.PriceResults) > 0 { + for iNdEx := len(x.PriceResults) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.PriceResults[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().(*QueryRequestPriceResponse) + 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: QueryRequestPriceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRequestPriceResponse: 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 PriceResults", 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.PriceResults = append(x.PriceResults, &PriceResult{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PriceResults[len(x.PriceResults)-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 ( + md_QueryRequestVerificationRequest protoreflect.MessageDescriptor + fd_QueryRequestVerificationRequest_chain_id protoreflect.FieldDescriptor + fd_QueryRequestVerificationRequest_validator protoreflect.FieldDescriptor + fd_QueryRequestVerificationRequest_request_id protoreflect.FieldDescriptor + fd_QueryRequestVerificationRequest_external_id protoreflect.FieldDescriptor + fd_QueryRequestVerificationRequest_data_source_id protoreflect.FieldDescriptor + fd_QueryRequestVerificationRequest_reporter protoreflect.FieldDescriptor + fd_QueryRequestVerificationRequest_signature protoreflect.FieldDescriptor + fd_QueryRequestVerificationRequest_max_delay protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryRequestVerificationRequest = File_oracle_v1_query_proto.Messages().ByName("QueryRequestVerificationRequest") + fd_QueryRequestVerificationRequest_chain_id = md_QueryRequestVerificationRequest.Fields().ByName("chain_id") + fd_QueryRequestVerificationRequest_validator = md_QueryRequestVerificationRequest.Fields().ByName("validator") + fd_QueryRequestVerificationRequest_request_id = md_QueryRequestVerificationRequest.Fields().ByName("request_id") + fd_QueryRequestVerificationRequest_external_id = md_QueryRequestVerificationRequest.Fields().ByName("external_id") + fd_QueryRequestVerificationRequest_data_source_id = md_QueryRequestVerificationRequest.Fields().ByName("data_source_id") + fd_QueryRequestVerificationRequest_reporter = md_QueryRequestVerificationRequest.Fields().ByName("reporter") + fd_QueryRequestVerificationRequest_signature = md_QueryRequestVerificationRequest.Fields().ByName("signature") + fd_QueryRequestVerificationRequest_max_delay = md_QueryRequestVerificationRequest.Fields().ByName("max_delay") +} + +var _ protoreflect.Message = (*fastReflection_QueryRequestVerificationRequest)(nil) + +type fastReflection_QueryRequestVerificationRequest QueryRequestVerificationRequest + +func (x *QueryRequestVerificationRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRequestVerificationRequest)(x) +} + +func (x *QueryRequestVerificationRequest) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[26] + 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_QueryRequestVerificationRequest_messageType fastReflection_QueryRequestVerificationRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryRequestVerificationRequest_messageType{} + +type fastReflection_QueryRequestVerificationRequest_messageType struct{} + +func (x fastReflection_QueryRequestVerificationRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRequestVerificationRequest)(nil) +} +func (x fastReflection_QueryRequestVerificationRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRequestVerificationRequest) +} +func (x fastReflection_QueryRequestVerificationRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestVerificationRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryRequestVerificationRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestVerificationRequest +} + +// 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_QueryRequestVerificationRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryRequestVerificationRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRequestVerificationRequest) New() protoreflect.Message { + return new(fastReflection_QueryRequestVerificationRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRequestVerificationRequest) Interface() protoreflect.ProtoMessage { + return (*QueryRequestVerificationRequest)(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_QueryRequestVerificationRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ChainId != "" { + value := protoreflect.ValueOfString(x.ChainId) + if !f(fd_QueryRequestVerificationRequest_chain_id, value) { + return + } + } + if x.Validator != "" { + value := protoreflect.ValueOfString(x.Validator) + if !f(fd_QueryRequestVerificationRequest_validator, value) { + return + } + } + if x.RequestId != uint64(0) { + value := protoreflect.ValueOfUint64(x.RequestId) + if !f(fd_QueryRequestVerificationRequest_request_id, value) { + return + } + } + if x.ExternalId != uint64(0) { + value := protoreflect.ValueOfUint64(x.ExternalId) + if !f(fd_QueryRequestVerificationRequest_external_id, value) { + return + } + } + if x.DataSourceId != uint64(0) { + value := protoreflect.ValueOfUint64(x.DataSourceId) + if !f(fd_QueryRequestVerificationRequest_data_source_id, value) { + return + } + } + if x.Reporter != "" { + value := protoreflect.ValueOfString(x.Reporter) + if !f(fd_QueryRequestVerificationRequest_reporter, value) { + return + } + } + if len(x.Signature) != 0 { + value := protoreflect.ValueOfBytes(x.Signature) + if !f(fd_QueryRequestVerificationRequest_signature, value) { + return + } + } + if x.MaxDelay != uint64(0) { + value := protoreflect.ValueOfUint64(x.MaxDelay) + if !f(fd_QueryRequestVerificationRequest_max_delay, 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_QueryRequestVerificationRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryRequestVerificationRequest.chain_id": + return x.ChainId != "" + case "oracle.v1.QueryRequestVerificationRequest.validator": + return x.Validator != "" + case "oracle.v1.QueryRequestVerificationRequest.request_id": + return x.RequestId != uint64(0) + case "oracle.v1.QueryRequestVerificationRequest.external_id": + return x.ExternalId != uint64(0) + case "oracle.v1.QueryRequestVerificationRequest.data_source_id": + return x.DataSourceId != uint64(0) + case "oracle.v1.QueryRequestVerificationRequest.reporter": + return x.Reporter != "" + case "oracle.v1.QueryRequestVerificationRequest.signature": + return len(x.Signature) != 0 + case "oracle.v1.QueryRequestVerificationRequest.max_delay": + return x.MaxDelay != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestVerificationRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestVerificationRequest 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_QueryRequestVerificationRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryRequestVerificationRequest.chain_id": + x.ChainId = "" + case "oracle.v1.QueryRequestVerificationRequest.validator": + x.Validator = "" + case "oracle.v1.QueryRequestVerificationRequest.request_id": + x.RequestId = uint64(0) + case "oracle.v1.QueryRequestVerificationRequest.external_id": + x.ExternalId = uint64(0) + case "oracle.v1.QueryRequestVerificationRequest.data_source_id": + x.DataSourceId = uint64(0) + case "oracle.v1.QueryRequestVerificationRequest.reporter": + x.Reporter = "" + case "oracle.v1.QueryRequestVerificationRequest.signature": + x.Signature = nil + case "oracle.v1.QueryRequestVerificationRequest.max_delay": + x.MaxDelay = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestVerificationRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestVerificationRequest 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_QueryRequestVerificationRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryRequestVerificationRequest.chain_id": + value := x.ChainId + return protoreflect.ValueOfString(value) + case "oracle.v1.QueryRequestVerificationRequest.validator": + value := x.Validator + return protoreflect.ValueOfString(value) + case "oracle.v1.QueryRequestVerificationRequest.request_id": + value := x.RequestId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.QueryRequestVerificationRequest.external_id": + value := x.ExternalId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.QueryRequestVerificationRequest.data_source_id": + value := x.DataSourceId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.QueryRequestVerificationRequest.reporter": + value := x.Reporter + return protoreflect.ValueOfString(value) + case "oracle.v1.QueryRequestVerificationRequest.signature": + value := x.Signature + return protoreflect.ValueOfBytes(value) + case "oracle.v1.QueryRequestVerificationRequest.max_delay": + value := x.MaxDelay + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestVerificationRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestVerificationRequest 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_QueryRequestVerificationRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryRequestVerificationRequest.chain_id": + x.ChainId = value.Interface().(string) + case "oracle.v1.QueryRequestVerificationRequest.validator": + x.Validator = value.Interface().(string) + case "oracle.v1.QueryRequestVerificationRequest.request_id": + x.RequestId = value.Uint() + case "oracle.v1.QueryRequestVerificationRequest.external_id": + x.ExternalId = value.Uint() + case "oracle.v1.QueryRequestVerificationRequest.data_source_id": + x.DataSourceId = value.Uint() + case "oracle.v1.QueryRequestVerificationRequest.reporter": + x.Reporter = value.Interface().(string) + case "oracle.v1.QueryRequestVerificationRequest.signature": + x.Signature = value.Bytes() + case "oracle.v1.QueryRequestVerificationRequest.max_delay": + x.MaxDelay = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestVerificationRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestVerificationRequest 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_QueryRequestVerificationRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestVerificationRequest.chain_id": + panic(fmt.Errorf("field chain_id of message oracle.v1.QueryRequestVerificationRequest is not mutable")) + case "oracle.v1.QueryRequestVerificationRequest.validator": + panic(fmt.Errorf("field validator of message oracle.v1.QueryRequestVerificationRequest is not mutable")) + case "oracle.v1.QueryRequestVerificationRequest.request_id": + panic(fmt.Errorf("field request_id of message oracle.v1.QueryRequestVerificationRequest is not mutable")) + case "oracle.v1.QueryRequestVerificationRequest.external_id": + panic(fmt.Errorf("field external_id of message oracle.v1.QueryRequestVerificationRequest is not mutable")) + case "oracle.v1.QueryRequestVerificationRequest.data_source_id": + panic(fmt.Errorf("field data_source_id of message oracle.v1.QueryRequestVerificationRequest is not mutable")) + case "oracle.v1.QueryRequestVerificationRequest.reporter": + panic(fmt.Errorf("field reporter of message oracle.v1.QueryRequestVerificationRequest is not mutable")) + case "oracle.v1.QueryRequestVerificationRequest.signature": + panic(fmt.Errorf("field signature of message oracle.v1.QueryRequestVerificationRequest is not mutable")) + case "oracle.v1.QueryRequestVerificationRequest.max_delay": + panic(fmt.Errorf("field max_delay of message oracle.v1.QueryRequestVerificationRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestVerificationRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestVerificationRequest 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_QueryRequestVerificationRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestVerificationRequest.chain_id": + return protoreflect.ValueOfString("") + case "oracle.v1.QueryRequestVerificationRequest.validator": + return protoreflect.ValueOfString("") + case "oracle.v1.QueryRequestVerificationRequest.request_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.QueryRequestVerificationRequest.external_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.QueryRequestVerificationRequest.data_source_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.QueryRequestVerificationRequest.reporter": + return protoreflect.ValueOfString("") + case "oracle.v1.QueryRequestVerificationRequest.signature": + return protoreflect.ValueOfBytes(nil) + case "oracle.v1.QueryRequestVerificationRequest.max_delay": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestVerificationRequest")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestVerificationRequest 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_QueryRequestVerificationRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryRequestVerificationRequest", 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_QueryRequestVerificationRequest) 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_QueryRequestVerificationRequest) 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_QueryRequestVerificationRequest) 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_QueryRequestVerificationRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRequestVerificationRequest) + 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.ChainId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Validator) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.RequestId != 0 { + n += 1 + runtime.Sov(uint64(x.RequestId)) + } + if x.ExternalId != 0 { + n += 1 + runtime.Sov(uint64(x.ExternalId)) + } + if x.DataSourceId != 0 { + n += 1 + runtime.Sov(uint64(x.DataSourceId)) + } + l = len(x.Reporter) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Signature) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.MaxDelay != 0 { + n += 1 + runtime.Sov(uint64(x.MaxDelay)) + } + 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().(*QueryRequestVerificationRequest) + 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.MaxDelay != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxDelay)) + i-- + dAtA[i] = 0x40 + } + if len(x.Signature) > 0 { + i -= len(x.Signature) + copy(dAtA[i:], x.Signature) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signature))) + i-- + dAtA[i] = 0x3a + } + if len(x.Reporter) > 0 { + i -= len(x.Reporter) + copy(dAtA[i:], x.Reporter) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Reporter))) + i-- + dAtA[i] = 0x32 + } + if x.DataSourceId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.DataSourceId)) + i-- + dAtA[i] = 0x28 + } + if x.ExternalId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExternalId)) + i-- + dAtA[i] = 0x20 + } + if x.RequestId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RequestId)) + i-- + dAtA[i] = 0x18 + } + if len(x.Validator) > 0 { + i -= len(x.Validator) + copy(dAtA[i:], x.Validator) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Validator))) + i-- + dAtA[i] = 0x12 + } + if len(x.ChainId) > 0 { + i -= len(x.ChainId) + copy(dAtA[i:], x.ChainId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) + 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().(*QueryRequestVerificationRequest) + 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: QueryRequestVerificationRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRequestVerificationRequest: 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 ChainId", 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.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Validator", 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.Validator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) + } + x.RequestId = 0 + 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++ + x.RequestId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType) + } + x.ExternalId = 0 + 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++ + x.ExternalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DataSourceId", wireType) + } + x.DataSourceId = 0 + 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++ + x.DataSourceId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Reporter", 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.Reporter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signature", 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.Signature = append(x.Signature[:0], dAtA[iNdEx:postIndex]...) + if x.Signature == nil { + x.Signature = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxDelay", wireType) + } + x.MaxDelay = 0 + 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++ + x.MaxDelay |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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_QueryRequestVerificationResponse protoreflect.MessageDescriptor + fd_QueryRequestVerificationResponse_chain_id protoreflect.FieldDescriptor + fd_QueryRequestVerificationResponse_validator protoreflect.FieldDescriptor + fd_QueryRequestVerificationResponse_request_id protoreflect.FieldDescriptor + fd_QueryRequestVerificationResponse_external_id protoreflect.FieldDescriptor + fd_QueryRequestVerificationResponse_data_source_id protoreflect.FieldDescriptor + fd_QueryRequestVerificationResponse_is_delay protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_query_proto_init() + md_QueryRequestVerificationResponse = File_oracle_v1_query_proto.Messages().ByName("QueryRequestVerificationResponse") + fd_QueryRequestVerificationResponse_chain_id = md_QueryRequestVerificationResponse.Fields().ByName("chain_id") + fd_QueryRequestVerificationResponse_validator = md_QueryRequestVerificationResponse.Fields().ByName("validator") + fd_QueryRequestVerificationResponse_request_id = md_QueryRequestVerificationResponse.Fields().ByName("request_id") + fd_QueryRequestVerificationResponse_external_id = md_QueryRequestVerificationResponse.Fields().ByName("external_id") + fd_QueryRequestVerificationResponse_data_source_id = md_QueryRequestVerificationResponse.Fields().ByName("data_source_id") + fd_QueryRequestVerificationResponse_is_delay = md_QueryRequestVerificationResponse.Fields().ByName("is_delay") +} + +var _ protoreflect.Message = (*fastReflection_QueryRequestVerificationResponse)(nil) + +type fastReflection_QueryRequestVerificationResponse QueryRequestVerificationResponse + +func (x *QueryRequestVerificationResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRequestVerificationResponse)(x) +} + +func (x *QueryRequestVerificationResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_query_proto_msgTypes[27] + 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_QueryRequestVerificationResponse_messageType fastReflection_QueryRequestVerificationResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryRequestVerificationResponse_messageType{} + +type fastReflection_QueryRequestVerificationResponse_messageType struct{} + +func (x fastReflection_QueryRequestVerificationResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRequestVerificationResponse)(nil) +} +func (x fastReflection_QueryRequestVerificationResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRequestVerificationResponse) +} +func (x fastReflection_QueryRequestVerificationResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestVerificationResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryRequestVerificationResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequestVerificationResponse +} + +// 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_QueryRequestVerificationResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryRequestVerificationResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRequestVerificationResponse) New() protoreflect.Message { + return new(fastReflection_QueryRequestVerificationResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRequestVerificationResponse) Interface() protoreflect.ProtoMessage { + return (*QueryRequestVerificationResponse)(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_QueryRequestVerificationResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ChainId != "" { + value := protoreflect.ValueOfString(x.ChainId) + if !f(fd_QueryRequestVerificationResponse_chain_id, value) { + return + } + } + if x.Validator != "" { + value := protoreflect.ValueOfString(x.Validator) + if !f(fd_QueryRequestVerificationResponse_validator, value) { + return + } + } + if x.RequestId != uint64(0) { + value := protoreflect.ValueOfUint64(x.RequestId) + if !f(fd_QueryRequestVerificationResponse_request_id, value) { + return + } + } + if x.ExternalId != uint64(0) { + value := protoreflect.ValueOfUint64(x.ExternalId) + if !f(fd_QueryRequestVerificationResponse_external_id, value) { + return + } + } + if x.DataSourceId != uint64(0) { + value := protoreflect.ValueOfUint64(x.DataSourceId) + if !f(fd_QueryRequestVerificationResponse_data_source_id, value) { + return + } + } + if x.IsDelay != false { + value := protoreflect.ValueOfBool(x.IsDelay) + if !f(fd_QueryRequestVerificationResponse_is_delay, 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_QueryRequestVerificationResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.QueryRequestVerificationResponse.chain_id": + return x.ChainId != "" + case "oracle.v1.QueryRequestVerificationResponse.validator": + return x.Validator != "" + case "oracle.v1.QueryRequestVerificationResponse.request_id": + return x.RequestId != uint64(0) + case "oracle.v1.QueryRequestVerificationResponse.external_id": + return x.ExternalId != uint64(0) + case "oracle.v1.QueryRequestVerificationResponse.data_source_id": + return x.DataSourceId != uint64(0) + case "oracle.v1.QueryRequestVerificationResponse.is_delay": + return x.IsDelay != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestVerificationResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestVerificationResponse 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_QueryRequestVerificationResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.QueryRequestVerificationResponse.chain_id": + x.ChainId = "" + case "oracle.v1.QueryRequestVerificationResponse.validator": + x.Validator = "" + case "oracle.v1.QueryRequestVerificationResponse.request_id": + x.RequestId = uint64(0) + case "oracle.v1.QueryRequestVerificationResponse.external_id": + x.ExternalId = uint64(0) + case "oracle.v1.QueryRequestVerificationResponse.data_source_id": + x.DataSourceId = uint64(0) + case "oracle.v1.QueryRequestVerificationResponse.is_delay": + x.IsDelay = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestVerificationResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestVerificationResponse 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_QueryRequestVerificationResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.QueryRequestVerificationResponse.chain_id": + value := x.ChainId + return protoreflect.ValueOfString(value) + case "oracle.v1.QueryRequestVerificationResponse.validator": + value := x.Validator + return protoreflect.ValueOfString(value) + case "oracle.v1.QueryRequestVerificationResponse.request_id": + value := x.RequestId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.QueryRequestVerificationResponse.external_id": + value := x.ExternalId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.QueryRequestVerificationResponse.data_source_id": + value := x.DataSourceId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.QueryRequestVerificationResponse.is_delay": + value := x.IsDelay + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestVerificationResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestVerificationResponse 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_QueryRequestVerificationResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.QueryRequestVerificationResponse.chain_id": + x.ChainId = value.Interface().(string) + case "oracle.v1.QueryRequestVerificationResponse.validator": + x.Validator = value.Interface().(string) + case "oracle.v1.QueryRequestVerificationResponse.request_id": + x.RequestId = value.Uint() + case "oracle.v1.QueryRequestVerificationResponse.external_id": + x.ExternalId = value.Uint() + case "oracle.v1.QueryRequestVerificationResponse.data_source_id": + x.DataSourceId = value.Uint() + case "oracle.v1.QueryRequestVerificationResponse.is_delay": + x.IsDelay = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestVerificationResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestVerificationResponse 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_QueryRequestVerificationResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestVerificationResponse.chain_id": + panic(fmt.Errorf("field chain_id of message oracle.v1.QueryRequestVerificationResponse is not mutable")) + case "oracle.v1.QueryRequestVerificationResponse.validator": + panic(fmt.Errorf("field validator of message oracle.v1.QueryRequestVerificationResponse is not mutable")) + case "oracle.v1.QueryRequestVerificationResponse.request_id": + panic(fmt.Errorf("field request_id of message oracle.v1.QueryRequestVerificationResponse is not mutable")) + case "oracle.v1.QueryRequestVerificationResponse.external_id": + panic(fmt.Errorf("field external_id of message oracle.v1.QueryRequestVerificationResponse is not mutable")) + case "oracle.v1.QueryRequestVerificationResponse.data_source_id": + panic(fmt.Errorf("field data_source_id of message oracle.v1.QueryRequestVerificationResponse is not mutable")) + case "oracle.v1.QueryRequestVerificationResponse.is_delay": + panic(fmt.Errorf("field is_delay of message oracle.v1.QueryRequestVerificationResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestVerificationResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestVerificationResponse 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_QueryRequestVerificationResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.QueryRequestVerificationResponse.chain_id": + return protoreflect.ValueOfString("") + case "oracle.v1.QueryRequestVerificationResponse.validator": + return protoreflect.ValueOfString("") + case "oracle.v1.QueryRequestVerificationResponse.request_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.QueryRequestVerificationResponse.external_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.QueryRequestVerificationResponse.data_source_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.QueryRequestVerificationResponse.is_delay": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryRequestVerificationResponse")) + } + panic(fmt.Errorf("message oracle.v1.QueryRequestVerificationResponse 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_QueryRequestVerificationResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryRequestVerificationResponse", 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_QueryRequestVerificationResponse) 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_QueryRequestVerificationResponse) 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_QueryRequestVerificationResponse) 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_QueryRequestVerificationResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRequestVerificationResponse) + 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.ChainId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Validator) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.RequestId != 0 { + n += 1 + runtime.Sov(uint64(x.RequestId)) + } + if x.ExternalId != 0 { + n += 1 + runtime.Sov(uint64(x.ExternalId)) + } + if x.DataSourceId != 0 { + n += 1 + runtime.Sov(uint64(x.DataSourceId)) + } + if x.IsDelay { + n += 2 + } + 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().(*QueryRequestVerificationResponse) + 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.IsDelay { + i-- + if x.IsDelay { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if x.DataSourceId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.DataSourceId)) + i-- + dAtA[i] = 0x28 + } + if x.ExternalId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExternalId)) + i-- + dAtA[i] = 0x20 + } + if x.RequestId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RequestId)) + i-- + dAtA[i] = 0x18 + } + if len(x.Validator) > 0 { + i -= len(x.Validator) + copy(dAtA[i:], x.Validator) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Validator))) + i-- + dAtA[i] = 0x12 + } + if len(x.ChainId) > 0 { + i -= len(x.ChainId) + copy(dAtA[i:], x.ChainId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) + 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().(*QueryRequestVerificationResponse) + 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: QueryRequestVerificationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRequestVerificationResponse: 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 ChainId", 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.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Validator", 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.Validator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) + } + x.RequestId = 0 + 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++ + x.RequestId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType) + } + x.ExternalId = 0 + 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++ + x.ExternalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DataSourceId", wireType) + } + x.DataSourceId = 0 + 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++ + x.DataSourceId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IsDelay", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.IsDelay = bool(v != 0) + 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: oracle/v1/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// QueryCountsRequest is request type for the Query/Count RPC method. +type QueryCountsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryCountsRequest) Reset() { + *x = QueryCountsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCountsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCountsRequest) ProtoMessage() {} + +// Deprecated: Use QueryCountsRequest.ProtoReflect.Descriptor instead. +func (*QueryCountsRequest) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryCountsResponse is response type for the Query/Count RPC method. +type QueryCountsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // DataSourceCount is total number of data sources available on the chain + DataSourceCount uint64 `protobuf:"varint,1,opt,name=data_source_count,json=dataSourceCount,proto3" json:"data_source_count,omitempty"` + // OracleScriptCount is total number of oracle scripts available on the chain + OracleScriptCount uint64 `protobuf:"varint,2,opt,name=oracle_script_count,json=oracleScriptCount,proto3" json:"oracle_script_count,omitempty"` + // RequestCount is total number of requests submitted to the chain + RequestCount uint64 `protobuf:"varint,3,opt,name=request_count,json=requestCount,proto3" json:"request_count,omitempty"` +} + +func (x *QueryCountsResponse) Reset() { + *x = QueryCountsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCountsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCountsResponse) ProtoMessage() {} + +// Deprecated: Use QueryCountsResponse.ProtoReflect.Descriptor instead. +func (*QueryCountsResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryCountsResponse) GetDataSourceCount() uint64 { + if x != nil { + return x.DataSourceCount + } + return 0 +} + +func (x *QueryCountsResponse) GetOracleScriptCount() uint64 { + if x != nil { + return x.OracleScriptCount + } + return 0 +} + +func (x *QueryCountsResponse) GetRequestCount() uint64 { + if x != nil { + return x.RequestCount + } + return 0 +} + +// QueryDataRequest is request type for the Query/Data RPC method. +type QueryDataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // DataHash is SHA256 hash of the file's content, which can be data source or + // oracle script + DataHash string `protobuf:"bytes,1,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` +} + +func (x *QueryDataRequest) Reset() { + *x = QueryDataRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDataRequest) ProtoMessage() {} + +// Deprecated: Use QueryDataRequest.ProtoReflect.Descriptor instead. +func (*QueryDataRequest) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryDataRequest) GetDataHash() string { + if x != nil { + return x.DataHash + } + return "" +} + +// QueryDataResponse is response type for the Query/Data RPC method. +type QueryDataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Data is file's content, which can be data source or oracle script + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *QueryDataResponse) Reset() { + *x = QueryDataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDataResponse) ProtoMessage() {} + +// Deprecated: Use QueryDataResponse.ProtoReflect.Descriptor instead. +func (*QueryDataResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryDataResponse) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +// QueryDataSourceRequest is request type for the Query/DataSource RPC method. +type QueryDataSourceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // DataSourceID is ID of a data source script + DataSourceId uint64 `protobuf:"varint,1,opt,name=data_source_id,json=dataSourceId,proto3" json:"data_source_id,omitempty"` +} + +func (x *QueryDataSourceRequest) Reset() { + *x = QueryDataSourceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDataSourceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDataSourceRequest) ProtoMessage() {} + +// Deprecated: Use QueryDataSourceRequest.ProtoReflect.Descriptor instead. +func (*QueryDataSourceRequest) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryDataSourceRequest) GetDataSourceId() uint64 { + if x != nil { + return x.DataSourceId + } + return 0 +} + +// QueryDataSourceResponse is response type for the Query/DataSource RPC method. +type QueryDataSourceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // DataSource is summary information of a data source + DataSource *DataSource `protobuf:"bytes,1,opt,name=data_source,json=dataSource,proto3" json:"data_source,omitempty"` +} + +func (x *QueryDataSourceResponse) Reset() { + *x = QueryDataSourceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDataSourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDataSourceResponse) ProtoMessage() {} + +// Deprecated: Use QueryDataSourceResponse.ProtoReflect.Descriptor instead. +func (*QueryDataSourceResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryDataSourceResponse) GetDataSource() *DataSource { + if x != nil { + return x.DataSource + } + return nil +} + +// QueryOracleScriptRequest is request type for the Query/OracleScript RPC +// method. +type QueryOracleScriptRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // OracleScriptID is ID of an oracle script + OracleScriptId uint64 `protobuf:"varint,1,opt,name=oracle_script_id,json=oracleScriptId,proto3" json:"oracle_script_id,omitempty"` +} + +func (x *QueryOracleScriptRequest) Reset() { + *x = QueryOracleScriptRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryOracleScriptRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryOracleScriptRequest) ProtoMessage() {} + +// Deprecated: Use QueryOracleScriptRequest.ProtoReflect.Descriptor instead. +func (*QueryOracleScriptRequest) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{6} +} + +func (x *QueryOracleScriptRequest) GetOracleScriptId() uint64 { + if x != nil { + return x.OracleScriptId + } + return 0 +} + +// QueryOracleScriptResponse is response type for the Query/OracleScript RPC +// method. +type QueryOracleScriptResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // OracleScript is summary information of an oracle script + OracleScript *OracleScript `protobuf:"bytes,1,opt,name=oracle_script,json=oracleScript,proto3" json:"oracle_script,omitempty"` +} + +func (x *QueryOracleScriptResponse) Reset() { + *x = QueryOracleScriptResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryOracleScriptResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryOracleScriptResponse) ProtoMessage() {} + +// Deprecated: Use QueryOracleScriptResponse.ProtoReflect.Descriptor instead. +func (*QueryOracleScriptResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryOracleScriptResponse) GetOracleScript() *OracleScript { + if x != nil { + return x.OracleScript + } + return nil +} + +// QueryRequestRequest is request type for the Query/Request RPC method. +type QueryRequestRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // RequestID is ID of an oracle request + RequestId uint64 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` +} + +func (x *QueryRequestRequest) Reset() { + *x = QueryRequestRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRequestRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRequestRequest) ProtoMessage() {} + +// Deprecated: Use QueryRequestRequest.ProtoReflect.Descriptor instead. +func (*QueryRequestRequest) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{8} +} + +func (x *QueryRequestRequest) GetRequestId() uint64 { + if x != nil { + return x.RequestId + } + return 0 +} + +// QueryRequestResponse is response type for the Query/Request RPC method. +type QueryRequestResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Request is an oracle request + Request *Request `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` + // Reports is list of result data as raw reports that are fulfilled by + // assigned validators + Reports []*Report `protobuf:"bytes,2,rep,name=reports,proto3" json:"reports,omitempty"` + // Result is a final form of result data + Result *Result `protobuf:"bytes,3,opt,name=result,proto3" json:"result,omitempty"` +} + +func (x *QueryRequestResponse) Reset() { + *x = QueryRequestResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRequestResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRequestResponse) ProtoMessage() {} + +// Deprecated: Use QueryRequestResponse.ProtoReflect.Descriptor instead. +func (*QueryRequestResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{9} +} + +func (x *QueryRequestResponse) GetRequest() *Request { + if x != nil { + return x.Request + } + return nil +} + +func (x *QueryRequestResponse) GetReports() []*Report { + if x != nil { + return x.Reports + } + return nil +} + +func (x *QueryRequestResponse) GetResult() *Result { + if x != nil { + return x.Result + } + return nil +} + +// QueryPendingRequestRequest is request type for the Query/PendingRequests RPC +// method. +type QueryPendingRequestsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ValidatorAddress is address of a validator + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` +} + +func (x *QueryPendingRequestsRequest) Reset() { + *x = QueryPendingRequestsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryPendingRequestsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryPendingRequestsRequest) ProtoMessage() {} + +// Deprecated: Use QueryPendingRequestsRequest.ProtoReflect.Descriptor instead. +func (*QueryPendingRequestsRequest) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{10} +} + +func (x *QueryPendingRequestsRequest) GetValidatorAddress() string { + if x != nil { + return x.ValidatorAddress + } + return "" +} + +// QueryPendingRequestResponse is response type for the Query/PendingRequests +// RPC method. +type QueryPendingRequestsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // RequestIDs is a list of pending request IDs assigned to the given validator + RequestIds []uint64 `protobuf:"varint,1,rep,packed,name=request_ids,json=requestIds,proto3" json:"request_ids,omitempty"` +} + +func (x *QueryPendingRequestsResponse) Reset() { + *x = QueryPendingRequestsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryPendingRequestsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryPendingRequestsResponse) ProtoMessage() {} + +// Deprecated: Use QueryPendingRequestsResponse.ProtoReflect.Descriptor instead. +func (*QueryPendingRequestsResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{11} +} + +func (x *QueryPendingRequestsResponse) GetRequestIds() []uint64 { + if x != nil { + return x.RequestIds + } + return nil +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{12} +} + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // pagination defines an optional pagination for the request. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{13} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// QueryValidatorRequest is request type for the Query/Validator RPC method. +type QueryValidatorRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ValidatorAddress is address of a validator + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` +} + +func (x *QueryValidatorRequest) Reset() { + *x = QueryValidatorRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryValidatorRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryValidatorRequest) ProtoMessage() {} + +// Deprecated: Use QueryValidatorRequest.ProtoReflect.Descriptor instead. +func (*QueryValidatorRequest) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{14} +} + +func (x *QueryValidatorRequest) GetValidatorAddress() string { + if x != nil { + return x.ValidatorAddress + } + return "" +} + +// QueryValidatorResponse is response type for the Query/Validator RPC method. +type QueryValidatorResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Status is status of a validator e.g. active/inactive + Status *ValidatorStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *QueryValidatorResponse) Reset() { + *x = QueryValidatorResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryValidatorResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryValidatorResponse) ProtoMessage() {} + +// Deprecated: Use QueryValidatorResponse.ProtoReflect.Descriptor instead. +func (*QueryValidatorResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{15} +} + +func (x *QueryValidatorResponse) GetStatus() *ValidatorStatus { + if x != nil { + return x.Status + } + return nil +} + +// QueryIsReporterRequest is request type for the Query/Reporter RPC method. +type QueryIsReporterRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ValidatorAddress is a validator address + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + // ReporterAddress is a candidate account + ReporterAddress string `protobuf:"bytes,2,opt,name=reporter_address,json=reporterAddress,proto3" json:"reporter_address,omitempty"` +} + +func (x *QueryIsReporterRequest) Reset() { + *x = QueryIsReporterRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryIsReporterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryIsReporterRequest) ProtoMessage() {} + +// Deprecated: Use QueryIsReporterRequest.ProtoReflect.Descriptor instead. +func (*QueryIsReporterRequest) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{16} +} + +func (x *QueryIsReporterRequest) GetValidatorAddress() string { + if x != nil { + return x.ValidatorAddress + } + return "" +} + +func (x *QueryIsReporterRequest) GetReporterAddress() string { + if x != nil { + return x.ReporterAddress + } + return "" +} + +// QueryIsReporterResponse is response type for the Query/Reporter RPC method. +type QueryIsReporterResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // IsReporter is true if this account has been granted by validator + IsReporter bool `protobuf:"varint,1,opt,name=is_reporter,json=isReporter,proto3" json:"is_reporter,omitempty"` +} + +func (x *QueryIsReporterResponse) Reset() { + *x = QueryIsReporterResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryIsReporterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryIsReporterResponse) ProtoMessage() {} + +// Deprecated: Use QueryIsReporterResponse.ProtoReflect.Descriptor instead. +func (*QueryIsReporterResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{17} +} + +func (x *QueryIsReporterResponse) GetIsReporter() bool { + if x != nil { + return x.IsReporter + } + return false +} + +// QueryReportersRequest is request type for the Query/Reporters RPC method. +type QueryReportersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ValidatorAddress is a validator address + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` +} + +func (x *QueryReportersRequest) Reset() { + *x = QueryReportersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryReportersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryReportersRequest) ProtoMessage() {} + +// Deprecated: Use QueryReportersRequest.ProtoReflect.Descriptor instead. +func (*QueryReportersRequest) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{18} +} + +func (x *QueryReportersRequest) GetValidatorAddress() string { + if x != nil { + return x.ValidatorAddress + } + return "" +} + +// QueryReportersResponse is response type for the Query/Reporters RPC method. +type QueryReportersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Reporter is a list of account addresses of reporters + Reporter []string `protobuf:"bytes,1,rep,name=reporter,proto3" json:"reporter,omitempty"` +} + +func (x *QueryReportersResponse) Reset() { + *x = QueryReportersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryReportersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryReportersResponse) ProtoMessage() {} + +// Deprecated: Use QueryReportersResponse.ProtoReflect.Descriptor instead. +func (*QueryReportersResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{19} +} + +func (x *QueryReportersResponse) GetReporter() []string { + if x != nil { + return x.Reporter + } + return nil +} + +// QueryActiveValidatorsRequest is request type for the Query/ActiveValidators +// RPC method. +type QueryActiveValidatorsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryActiveValidatorsRequest) Reset() { + *x = QueryActiveValidatorsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryActiveValidatorsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryActiveValidatorsRequest) ProtoMessage() {} + +// Deprecated: Use QueryActiveValidatorsRequest.ProtoReflect.Descriptor instead. +func (*QueryActiveValidatorsRequest) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{20} +} + +// QueryActiveValidatorsResponse is response type for the Query/ActiveValidators +// RPC method. +type QueryActiveValidatorsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Validators is a list of active validators + Validators []*ActiveValidator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators,omitempty"` +} + +func (x *QueryActiveValidatorsResponse) Reset() { + *x = QueryActiveValidatorsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryActiveValidatorsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryActiveValidatorsResponse) ProtoMessage() {} + +// Deprecated: Use QueryActiveValidatorsResponse.ProtoReflect.Descriptor instead. +func (*QueryActiveValidatorsResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{21} +} + +func (x *QueryActiveValidatorsResponse) GetValidators() []*ActiveValidator { + if x != nil { + return x.Validators + } + return nil +} + +// QueryRequestSearchRequest is request type for the Query/RequestSearch RPC +// method. +type QueryRequestSearchRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // OracleScriptID is ID of an oracle script + OracleScriptId uint64 `protobuf:"varint,1,opt,name=oracle_script_id,json=oracleScriptId,proto3" json:"oracle_script_id,omitempty"` + // Calldata is OBI-encoded data in hex format as argument params for the + // oracle script + Calldata string `protobuf:"bytes,2,opt,name=calldata,proto3" json:"calldata,omitempty"` + // AskCount is number of validators allowed for fulfilling the request + AskCount uint64 `protobuf:"varint,3,opt,name=ask_count,json=askCount,proto3" json:"ask_count,omitempty"` + // MinCount is number of validators required for fulfilling the request + MinCount uint64 `protobuf:"varint,4,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty"` +} + +func (x *QueryRequestSearchRequest) Reset() { + *x = QueryRequestSearchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRequestSearchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRequestSearchRequest) ProtoMessage() {} + +// Deprecated: Use QueryRequestSearchRequest.ProtoReflect.Descriptor instead. +func (*QueryRequestSearchRequest) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{22} +} + +func (x *QueryRequestSearchRequest) GetOracleScriptId() uint64 { + if x != nil { + return x.OracleScriptId + } + return 0 +} + +func (x *QueryRequestSearchRequest) GetCalldata() string { + if x != nil { + return x.Calldata + } + return "" +} + +func (x *QueryRequestSearchRequest) GetAskCount() uint64 { + if x != nil { + return x.AskCount + } + return 0 +} + +func (x *QueryRequestSearchRequest) GetMinCount() uint64 { + if x != nil { + return x.MinCount + } + return 0 +} + +// QueryRequestSearchResponse is response type for the Query/RequestSearch RPC +// method. +type QueryRequestSearchResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Request is details of an oracle request + Request *QueryRequestResponse `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` +} + +func (x *QueryRequestSearchResponse) Reset() { + *x = QueryRequestSearchResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRequestSearchResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRequestSearchResponse) ProtoMessage() {} + +// Deprecated: Use QueryRequestSearchResponse.ProtoReflect.Descriptor instead. +func (*QueryRequestSearchResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{23} +} + +func (x *QueryRequestSearchResponse) GetRequest() *QueryRequestResponse { + if x != nil { + return x.Request + } + return nil +} + +// QueryRequestPriceRequest is request type for the Query/RequestPrice RPC +// method. +type QueryRequestPriceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Symbol is unit of data indicating what the data is + Symbols []string `protobuf:"bytes,1,rep,name=symbols,proto3" json:"symbols,omitempty"` + // AskCount is number of validators allowed for fulfilling the request + AskCount uint64 `protobuf:"varint,2,opt,name=ask_count,json=askCount,proto3" json:"ask_count,omitempty"` + // MinCount is number of validators required for fulfilling the request + MinCount uint64 `protobuf:"varint,3,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty"` +} + +func (x *QueryRequestPriceRequest) Reset() { + *x = QueryRequestPriceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRequestPriceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRequestPriceRequest) ProtoMessage() {} + +// Deprecated: Use QueryRequestPriceRequest.ProtoReflect.Descriptor instead. +func (*QueryRequestPriceRequest) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{24} +} + +func (x *QueryRequestPriceRequest) GetSymbols() []string { + if x != nil { + return x.Symbols + } + return nil +} + +func (x *QueryRequestPriceRequest) GetAskCount() uint64 { + if x != nil { + return x.AskCount + } + return 0 +} + +func (x *QueryRequestPriceRequest) GetMinCount() uint64 { + if x != nil { + return x.MinCount + } + return 0 +} + +// QueryRequestPriceResponse is response type for the Query/RequestPrice RPC +// method. +type QueryRequestPriceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // PriceResult is a list of price results for given symbols + PriceResults []*PriceResult `protobuf:"bytes,1,rep,name=price_results,json=priceResults,proto3" json:"price_results,omitempty"` +} + +func (x *QueryRequestPriceResponse) Reset() { + *x = QueryRequestPriceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRequestPriceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRequestPriceResponse) ProtoMessage() {} + +// Deprecated: Use QueryRequestPriceResponse.ProtoReflect.Descriptor instead. +func (*QueryRequestPriceResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{25} +} + +func (x *QueryRequestPriceResponse) GetPriceResults() []*PriceResult { + if x != nil { + return x.PriceResults + } + return nil +} + +// QueryRequestVerificationRequest is request type for the +// Query/RequestVerification RPC +type QueryRequestVerificationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ChainID is the chain ID to identify which chain ID is used for the + // verification + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // Validator is a validator address + Validator string `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator,omitempty"` + // RequestID is oracle request ID + RequestId uint64 `protobuf:"varint,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + // ExternalID is an oracle's external ID + ExternalId uint64 `protobuf:"varint,4,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` + // DataSourceID is the ID of data source + DataSourceId uint64 `protobuf:"varint,5,opt,name=data_source_id,json=dataSourceId,proto3" json:"data_source_id,omitempty"` + // Reporter is an bech32-encoded public key of the reporter authorized by the + // validator + Reporter string `protobuf:"bytes,6,opt,name=reporter,proto3" json:"reporter,omitempty"` + // Signature is a signature signed by the reporter using reporter's private + // key + Signature []byte `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"` + // MaxDelay is a max number of RequestID delay acceptable in case of node + // delay + MaxDelay uint64 `protobuf:"varint,8,opt,name=max_delay,json=maxDelay,proto3" json:"max_delay,omitempty"` +} + +func (x *QueryRequestVerificationRequest) Reset() { + *x = QueryRequestVerificationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRequestVerificationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRequestVerificationRequest) ProtoMessage() {} + +// Deprecated: Use QueryRequestVerificationRequest.ProtoReflect.Descriptor instead. +func (*QueryRequestVerificationRequest) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{26} +} + +func (x *QueryRequestVerificationRequest) GetChainId() string { + if x != nil { + return x.ChainId + } + return "" +} + +func (x *QueryRequestVerificationRequest) GetValidator() string { + if x != nil { + return x.Validator + } + return "" +} + +func (x *QueryRequestVerificationRequest) GetRequestId() uint64 { + if x != nil { + return x.RequestId + } + return 0 +} + +func (x *QueryRequestVerificationRequest) GetExternalId() uint64 { + if x != nil { + return x.ExternalId + } + return 0 +} + +func (x *QueryRequestVerificationRequest) GetDataSourceId() uint64 { + if x != nil { + return x.DataSourceId + } + return 0 +} + +func (x *QueryRequestVerificationRequest) GetReporter() string { + if x != nil { + return x.Reporter + } + return "" +} + +func (x *QueryRequestVerificationRequest) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +func (x *QueryRequestVerificationRequest) GetMaxDelay() uint64 { + if x != nil { + return x.MaxDelay + } + return 0 +} + +// QueryRequestVerificationResponse is response type for the +// Query/RequestVerification RPC +type QueryRequestVerificationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ChainID is the targeted chain ID + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // Validator is the targeted validator address + Validator string `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator,omitempty"` + // RequestID is the ID of targeted request + RequestId uint64 `protobuf:"varint,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + // ExternalID is the ID of targeted oracle's external data source + ExternalId uint64 `protobuf:"varint,4,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` + // DataSourceID is the ID of a data source that relates to the targeted + // external ID + DataSourceId uint64 `protobuf:"varint,5,opt,name=data_source_id,json=dataSourceId,proto3" json:"data_source_id,omitempty"` + // IsDelay is a flag to tell that this request is not exist yet but in + // MaxDelay range + IsDelay bool `protobuf:"varint,6,opt,name=is_delay,json=isDelay,proto3" json:"is_delay,omitempty"` +} + +func (x *QueryRequestVerificationResponse) Reset() { + *x = QueryRequestVerificationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_query_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRequestVerificationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRequestVerificationResponse) ProtoMessage() {} + +// Deprecated: Use QueryRequestVerificationResponse.ProtoReflect.Descriptor instead. +func (*QueryRequestVerificationResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_query_proto_rawDescGZIP(), []int{27} +} + +func (x *QueryRequestVerificationResponse) GetChainId() string { + if x != nil { + return x.ChainId + } + return "" +} + +func (x *QueryRequestVerificationResponse) GetValidator() string { + if x != nil { + return x.Validator + } + return "" +} + +func (x *QueryRequestVerificationResponse) GetRequestId() uint64 { + if x != nil { + return x.RequestId + } + return 0 +} + +func (x *QueryRequestVerificationResponse) GetExternalId() uint64 { + if x != nil { + return x.ExternalId + } + return 0 +} + +func (x *QueryRequestVerificationResponse) GetDataSourceId() uint64 { + if x != nil { + return x.DataSourceId + } + return 0 +} + +func (x *QueryRequestVerificationResponse) GetIsDelay() bool { + if x != nil { + return x.IsDelay + } + return false +} + +var File_oracle_v1_query_proto protoreflect.FileDescriptor + +var file_oracle_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, + 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, + 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 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, 0x16, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x96, 0x01, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x64, 0x61, 0x74, 0x61, 0x5f, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x13, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x11, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x2f, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, + 0x64, 0x61, 0x74, 0x61, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x64, 0x61, 0x74, 0x61, 0x48, 0x61, 0x73, 0x68, 0x22, 0x27, 0x0a, 0x11, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x22, 0x3e, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0e, + 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x49, 0x64, 0x22, 0x51, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, + 0x0b, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x44, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x28, 0x0a, 0x10, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x49, 0x64, 0x22, 0x59, 0x0a, 0x19, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x6f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x0c, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, + 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x34, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, + 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0xa2, 0x01, 0x0a, + 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x72, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x29, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x22, 0x6d, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x10, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x22, 0x4f, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2f, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x04, 0x42, 0x0e, 0xe2, 0xde, 0x1f, 0x0a, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x49, 0x44, 0x73, 0x52, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, + 0x73, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x46, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, + 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, + 0x67, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x4c, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xad, 0x01, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, + 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x43, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, + 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x3a, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, + 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x72, 0x22, 0x67, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x11, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 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, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x4e, 0x0a, 0x16, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x22, 0x1e, 0x0a, 0x1c, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5b, 0x0a, 0x1d, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0a, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0a, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x9b, 0x01, 0x0a, 0x19, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, + 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x49, 0x64, + 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, + 0x61, 0x73, 0x6b, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x08, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x69, + 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x57, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x6e, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, + 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, + 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x79, + 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x73, 0x6b, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, + 0x58, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, + 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0d, + 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0c, 0x70, 0x72, 0x69, + 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xba, 0x02, 0x0a, 0x1f, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, + 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 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, 0x09, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, + 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x64, 0x61, 0x74, + 0x61, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, + 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, + 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x61, + 0x78, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x22, 0xff, 0x01, 0x0a, 0x20, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x18, 0x02, 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, 0x09, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x78, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x5f, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0c, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, + 0x08, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x32, 0xab, 0x0e, 0x0a, 0x05, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x12, 0x62, 0x0a, 0x06, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x66, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1b, + 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1d, 0x12, 0x1b, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x61, + 0x74, 0x61, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x7d, 0x12, 0x85, + 0x01, 0x0a, 0x0a, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x21, 0x2e, + 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, + 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x22, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x8f, 0x01, 0x0a, 0x0c, 0x4f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x23, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x73, 0x2f, 0x7b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x74, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x73, 0x2f, 0x7b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x9b, + 0x01, 0x0a, 0x0f, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x73, 0x12, 0x26, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x6f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2f, 0x7b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x83, 0x01, 0x0a, + 0x09, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x20, 0x2e, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, + 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x7d, 0x12, 0x97, 0x01, 0x0a, 0x0a, 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, + 0x72, 0x12, 0x21, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3c, + 0x12, 0x3a, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2f, 0x7b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x7b, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x82, 0x01, 0x0a, + 0x09, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x12, 0x20, 0x2e, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, + 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x7d, 0x12, 0x8b, 0x01, 0x0a, 0x10, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x27, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x28, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1e, 0x12, 0x1c, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, + 0x62, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x2e, 0x6f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, + 0x12, 0x11, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x7f, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x12, 0x24, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x6f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x12, 0x7c, 0x0a, 0x0c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, + 0x72, 0x69, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x72, 0x69, + 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, + 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x73, 0x12, 0x91, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x6f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x99, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, + 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_oracle_v1_query_proto_rawDescOnce sync.Once + file_oracle_v1_query_proto_rawDescData = file_oracle_v1_query_proto_rawDesc +) + +func file_oracle_v1_query_proto_rawDescGZIP() []byte { + file_oracle_v1_query_proto_rawDescOnce.Do(func() { + file_oracle_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_oracle_v1_query_proto_rawDescData) + }) + return file_oracle_v1_query_proto_rawDescData +} + +var file_oracle_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 28) +var file_oracle_v1_query_proto_goTypes = []interface{}{ + (*QueryCountsRequest)(nil), // 0: oracle.v1.QueryCountsRequest + (*QueryCountsResponse)(nil), // 1: oracle.v1.QueryCountsResponse + (*QueryDataRequest)(nil), // 2: oracle.v1.QueryDataRequest + (*QueryDataResponse)(nil), // 3: oracle.v1.QueryDataResponse + (*QueryDataSourceRequest)(nil), // 4: oracle.v1.QueryDataSourceRequest + (*QueryDataSourceResponse)(nil), // 5: oracle.v1.QueryDataSourceResponse + (*QueryOracleScriptRequest)(nil), // 6: oracle.v1.QueryOracleScriptRequest + (*QueryOracleScriptResponse)(nil), // 7: oracle.v1.QueryOracleScriptResponse + (*QueryRequestRequest)(nil), // 8: oracle.v1.QueryRequestRequest + (*QueryRequestResponse)(nil), // 9: oracle.v1.QueryRequestResponse + (*QueryPendingRequestsRequest)(nil), // 10: oracle.v1.QueryPendingRequestsRequest + (*QueryPendingRequestsResponse)(nil), // 11: oracle.v1.QueryPendingRequestsResponse + (*QueryParamsRequest)(nil), // 12: oracle.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 13: oracle.v1.QueryParamsResponse + (*QueryValidatorRequest)(nil), // 14: oracle.v1.QueryValidatorRequest + (*QueryValidatorResponse)(nil), // 15: oracle.v1.QueryValidatorResponse + (*QueryIsReporterRequest)(nil), // 16: oracle.v1.QueryIsReporterRequest + (*QueryIsReporterResponse)(nil), // 17: oracle.v1.QueryIsReporterResponse + (*QueryReportersRequest)(nil), // 18: oracle.v1.QueryReportersRequest + (*QueryReportersResponse)(nil), // 19: oracle.v1.QueryReportersResponse + (*QueryActiveValidatorsRequest)(nil), // 20: oracle.v1.QueryActiveValidatorsRequest + (*QueryActiveValidatorsResponse)(nil), // 21: oracle.v1.QueryActiveValidatorsResponse + (*QueryRequestSearchRequest)(nil), // 22: oracle.v1.QueryRequestSearchRequest + (*QueryRequestSearchResponse)(nil), // 23: oracle.v1.QueryRequestSearchResponse + (*QueryRequestPriceRequest)(nil), // 24: oracle.v1.QueryRequestPriceRequest + (*QueryRequestPriceResponse)(nil), // 25: oracle.v1.QueryRequestPriceResponse + (*QueryRequestVerificationRequest)(nil), // 26: oracle.v1.QueryRequestVerificationRequest + (*QueryRequestVerificationResponse)(nil), // 27: oracle.v1.QueryRequestVerificationResponse + (*DataSource)(nil), // 28: oracle.v1.DataSource + (*OracleScript)(nil), // 29: oracle.v1.OracleScript + (*Request)(nil), // 30: oracle.v1.Request + (*Report)(nil), // 31: oracle.v1.Report + (*Result)(nil), // 32: oracle.v1.Result + (*Params)(nil), // 33: oracle.v1.Params + (*ValidatorStatus)(nil), // 34: oracle.v1.ValidatorStatus + (*ActiveValidator)(nil), // 35: oracle.v1.ActiveValidator + (*PriceResult)(nil), // 36: oracle.v1.PriceResult +} +var file_oracle_v1_query_proto_depIdxs = []int32{ + 28, // 0: oracle.v1.QueryDataSourceResponse.data_source:type_name -> oracle.v1.DataSource + 29, // 1: oracle.v1.QueryOracleScriptResponse.oracle_script:type_name -> oracle.v1.OracleScript + 30, // 2: oracle.v1.QueryRequestResponse.request:type_name -> oracle.v1.Request + 31, // 3: oracle.v1.QueryRequestResponse.reports:type_name -> oracle.v1.Report + 32, // 4: oracle.v1.QueryRequestResponse.result:type_name -> oracle.v1.Result + 33, // 5: oracle.v1.QueryParamsResponse.params:type_name -> oracle.v1.Params + 34, // 6: oracle.v1.QueryValidatorResponse.status:type_name -> oracle.v1.ValidatorStatus + 35, // 7: oracle.v1.QueryActiveValidatorsResponse.validators:type_name -> oracle.v1.ActiveValidator + 9, // 8: oracle.v1.QueryRequestSearchResponse.request:type_name -> oracle.v1.QueryRequestResponse + 36, // 9: oracle.v1.QueryRequestPriceResponse.price_results:type_name -> oracle.v1.PriceResult + 0, // 10: oracle.v1.Query.Counts:input_type -> oracle.v1.QueryCountsRequest + 2, // 11: oracle.v1.Query.Data:input_type -> oracle.v1.QueryDataRequest + 4, // 12: oracle.v1.Query.DataSource:input_type -> oracle.v1.QueryDataSourceRequest + 6, // 13: oracle.v1.Query.OracleScript:input_type -> oracle.v1.QueryOracleScriptRequest + 8, // 14: oracle.v1.Query.Request:input_type -> oracle.v1.QueryRequestRequest + 10, // 15: oracle.v1.Query.PendingRequests:input_type -> oracle.v1.QueryPendingRequestsRequest + 14, // 16: oracle.v1.Query.Validator:input_type -> oracle.v1.QueryValidatorRequest + 16, // 17: oracle.v1.Query.IsReporter:input_type -> oracle.v1.QueryIsReporterRequest + 18, // 18: oracle.v1.Query.Reporters:input_type -> oracle.v1.QueryReportersRequest + 20, // 19: oracle.v1.Query.ActiveValidators:input_type -> oracle.v1.QueryActiveValidatorsRequest + 12, // 20: oracle.v1.Query.Params:input_type -> oracle.v1.QueryParamsRequest + 22, // 21: oracle.v1.Query.RequestSearch:input_type -> oracle.v1.QueryRequestSearchRequest + 24, // 22: oracle.v1.Query.RequestPrice:input_type -> oracle.v1.QueryRequestPriceRequest + 26, // 23: oracle.v1.Query.RequestVerification:input_type -> oracle.v1.QueryRequestVerificationRequest + 1, // 24: oracle.v1.Query.Counts:output_type -> oracle.v1.QueryCountsResponse + 3, // 25: oracle.v1.Query.Data:output_type -> oracle.v1.QueryDataResponse + 5, // 26: oracle.v1.Query.DataSource:output_type -> oracle.v1.QueryDataSourceResponse + 7, // 27: oracle.v1.Query.OracleScript:output_type -> oracle.v1.QueryOracleScriptResponse + 9, // 28: oracle.v1.Query.Request:output_type -> oracle.v1.QueryRequestResponse + 11, // 29: oracle.v1.Query.PendingRequests:output_type -> oracle.v1.QueryPendingRequestsResponse + 15, // 30: oracle.v1.Query.Validator:output_type -> oracle.v1.QueryValidatorResponse + 17, // 31: oracle.v1.Query.IsReporter:output_type -> oracle.v1.QueryIsReporterResponse + 19, // 32: oracle.v1.Query.Reporters:output_type -> oracle.v1.QueryReportersResponse + 21, // 33: oracle.v1.Query.ActiveValidators:output_type -> oracle.v1.QueryActiveValidatorsResponse + 13, // 34: oracle.v1.Query.Params:output_type -> oracle.v1.QueryParamsResponse + 23, // 35: oracle.v1.Query.RequestSearch:output_type -> oracle.v1.QueryRequestSearchResponse + 25, // 36: oracle.v1.Query.RequestPrice:output_type -> oracle.v1.QueryRequestPriceResponse + 27, // 37: oracle.v1.Query.RequestVerification:output_type -> oracle.v1.QueryRequestVerificationResponse + 24, // [24:38] is the sub-list for method output_type + 10, // [10:24] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_oracle_v1_query_proto_init() } +func file_oracle_v1_query_proto_init() { + if File_oracle_v1_query_proto != nil { + return + } + file_oracle_v1_oracle_proto_init() + if !protoimpl.UnsafeEnabled { + file_oracle_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCountsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCountsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryDataRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryDataResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryDataSourceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryDataSourceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryOracleScriptRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryOracleScriptResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequestRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequestResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryPendingRequestsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryPendingRequestsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryValidatorRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryValidatorResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryIsReporterRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryIsReporterResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryReportersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryReportersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryActiveValidatorsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryActiveValidatorsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequestSearchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequestSearchResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequestPriceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequestPriceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequestVerificationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_query_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequestVerificationResponse); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_oracle_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 28, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_oracle_v1_query_proto_goTypes, + DependencyIndexes: file_oracle_v1_query_proto_depIdxs, + MessageInfos: file_oracle_v1_query_proto_msgTypes, + }.Build() + File_oracle_v1_query_proto = out.File + file_oracle_v1_query_proto_rawDesc = nil + file_oracle_v1_query_proto_goTypes = nil + file_oracle_v1_query_proto_depIdxs = nil +} diff --git a/api/oracle/v1/query_grpc.pb.go b/api/oracle/v1/query_grpc.pb.go new file mode 100644 index 000000000..d52fdf1a9 --- /dev/null +++ b/api/oracle/v1/query_grpc.pb.go @@ -0,0 +1,628 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: oracle/v1/query.proto + +package oraclev1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Query_Counts_FullMethodName = "/oracle.v1.Query/Counts" + Query_Data_FullMethodName = "/oracle.v1.Query/Data" + Query_DataSource_FullMethodName = "/oracle.v1.Query/DataSource" + Query_OracleScript_FullMethodName = "/oracle.v1.Query/OracleScript" + Query_Request_FullMethodName = "/oracle.v1.Query/Request" + Query_PendingRequests_FullMethodName = "/oracle.v1.Query/PendingRequests" + Query_Validator_FullMethodName = "/oracle.v1.Query/Validator" + Query_IsReporter_FullMethodName = "/oracle.v1.Query/IsReporter" + Query_Reporters_FullMethodName = "/oracle.v1.Query/Reporters" + Query_ActiveValidators_FullMethodName = "/oracle.v1.Query/ActiveValidators" + Query_Params_FullMethodName = "/oracle.v1.Query/Params" + Query_RequestSearch_FullMethodName = "/oracle.v1.Query/RequestSearch" + Query_RequestPrice_FullMethodName = "/oracle.v1.Query/RequestPrice" + Query_RequestVerification_FullMethodName = "/oracle.v1.Query/RequestVerification" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryClient interface { + // Counts queries the number of existing data sources, oracle scripts, and + // requests. + Counts(ctx context.Context, in *QueryCountsRequest, opts ...grpc.CallOption) (*QueryCountsResponse, error) + // Data queries content of the data source or oracle script for given SHA256 + // file hash. + Data(ctx context.Context, in *QueryDataRequest, opts ...grpc.CallOption) (*QueryDataResponse, error) + // DataSource queries data source summary info for given data source id. + DataSource(ctx context.Context, in *QueryDataSourceRequest, opts ...grpc.CallOption) (*QueryDataSourceResponse, error) + // OracleScript queries oracle script summary info for given oracle script id. + OracleScript(ctx context.Context, in *QueryOracleScriptRequest, opts ...grpc.CallOption) (*QueryOracleScriptResponse, error) + // Request queries request info for given request id. + Request(ctx context.Context, in *QueryRequestRequest, opts ...grpc.CallOption) (*QueryRequestResponse, error) + // PendingRequests queries list of pending request IDs assigned to given + // validator. + PendingRequests(ctx context.Context, in *QueryPendingRequestsRequest, opts ...grpc.CallOption) (*QueryPendingRequestsResponse, error) + // Validator queries properties of given validator address. + Validator(ctx context.Context, in *QueryValidatorRequest, opts ...grpc.CallOption) (*QueryValidatorResponse, error) + // IsReporter queries grant of account on this validator. + IsReporter(ctx context.Context, in *QueryIsReporterRequest, opts ...grpc.CallOption) (*QueryIsReporterResponse, error) + // Reporters queries all reporters associated with given validator address. + Reporters(ctx context.Context, in *QueryReportersRequest, opts ...grpc.CallOption) (*QueryReportersResponse, error) + // ActiveValidators queries all active oracle validators. + ActiveValidators(ctx context.Context, in *QueryActiveValidatorsRequest, opts ...grpc.CallOption) (*QueryActiveValidatorsResponse, error) + // Params queries parameters used for runnning bandchain network. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // RequestSearch queries the latest request that match search criteria. + RequestSearch(ctx context.Context, in *QueryRequestSearchRequest, opts ...grpc.CallOption) (*QueryRequestSearchResponse, error) + // RequestPrice queries the latest price on standard price reference oracle + // script. + RequestPrice(ctx context.Context, in *QueryRequestPriceRequest, opts ...grpc.CallOption) (*QueryRequestPriceResponse, error) + // RequestVerification verifies a request to make sure that + // all information that will be used to report the data is valid + RequestVerification(ctx context.Context, in *QueryRequestVerificationRequest, opts ...grpc.CallOption) (*QueryRequestVerificationResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Counts(ctx context.Context, in *QueryCountsRequest, opts ...grpc.CallOption) (*QueryCountsResponse, error) { + out := new(QueryCountsResponse) + err := c.cc.Invoke(ctx, Query_Counts_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Data(ctx context.Context, in *QueryDataRequest, opts ...grpc.CallOption) (*QueryDataResponse, error) { + out := new(QueryDataResponse) + err := c.cc.Invoke(ctx, Query_Data_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) DataSource(ctx context.Context, in *QueryDataSourceRequest, opts ...grpc.CallOption) (*QueryDataSourceResponse, error) { + out := new(QueryDataSourceResponse) + err := c.cc.Invoke(ctx, Query_DataSource_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) OracleScript(ctx context.Context, in *QueryOracleScriptRequest, opts ...grpc.CallOption) (*QueryOracleScriptResponse, error) { + out := new(QueryOracleScriptResponse) + err := c.cc.Invoke(ctx, Query_OracleScript_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Request(ctx context.Context, in *QueryRequestRequest, opts ...grpc.CallOption) (*QueryRequestResponse, error) { + out := new(QueryRequestResponse) + err := c.cc.Invoke(ctx, Query_Request_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) PendingRequests(ctx context.Context, in *QueryPendingRequestsRequest, opts ...grpc.CallOption) (*QueryPendingRequestsResponse, error) { + out := new(QueryPendingRequestsResponse) + err := c.cc.Invoke(ctx, Query_PendingRequests_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Validator(ctx context.Context, in *QueryValidatorRequest, opts ...grpc.CallOption) (*QueryValidatorResponse, error) { + out := new(QueryValidatorResponse) + err := c.cc.Invoke(ctx, Query_Validator_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) IsReporter(ctx context.Context, in *QueryIsReporterRequest, opts ...grpc.CallOption) (*QueryIsReporterResponse, error) { + out := new(QueryIsReporterResponse) + err := c.cc.Invoke(ctx, Query_IsReporter_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Reporters(ctx context.Context, in *QueryReportersRequest, opts ...grpc.CallOption) (*QueryReportersResponse, error) { + out := new(QueryReportersResponse) + err := c.cc.Invoke(ctx, Query_Reporters_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ActiveValidators(ctx context.Context, in *QueryActiveValidatorsRequest, opts ...grpc.CallOption) (*QueryActiveValidatorsResponse, error) { + out := new(QueryActiveValidatorsResponse) + err := c.cc.Invoke(ctx, Query_ActiveValidators_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RequestSearch(ctx context.Context, in *QueryRequestSearchRequest, opts ...grpc.CallOption) (*QueryRequestSearchResponse, error) { + out := new(QueryRequestSearchResponse) + err := c.cc.Invoke(ctx, Query_RequestSearch_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RequestPrice(ctx context.Context, in *QueryRequestPriceRequest, opts ...grpc.CallOption) (*QueryRequestPriceResponse, error) { + out := new(QueryRequestPriceResponse) + err := c.cc.Invoke(ctx, Query_RequestPrice_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RequestVerification(ctx context.Context, in *QueryRequestVerificationRequest, opts ...grpc.CallOption) (*QueryRequestVerificationResponse, error) { + out := new(QueryRequestVerificationResponse) + err := c.cc.Invoke(ctx, Query_RequestVerification_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +type QueryServer interface { + // Counts queries the number of existing data sources, oracle scripts, and + // requests. + Counts(context.Context, *QueryCountsRequest) (*QueryCountsResponse, error) + // Data queries content of the data source or oracle script for given SHA256 + // file hash. + Data(context.Context, *QueryDataRequest) (*QueryDataResponse, error) + // DataSource queries data source summary info for given data source id. + DataSource(context.Context, *QueryDataSourceRequest) (*QueryDataSourceResponse, error) + // OracleScript queries oracle script summary info for given oracle script id. + OracleScript(context.Context, *QueryOracleScriptRequest) (*QueryOracleScriptResponse, error) + // Request queries request info for given request id. + Request(context.Context, *QueryRequestRequest) (*QueryRequestResponse, error) + // PendingRequests queries list of pending request IDs assigned to given + // validator. + PendingRequests(context.Context, *QueryPendingRequestsRequest) (*QueryPendingRequestsResponse, error) + // Validator queries properties of given validator address. + Validator(context.Context, *QueryValidatorRequest) (*QueryValidatorResponse, error) + // IsReporter queries grant of account on this validator. + IsReporter(context.Context, *QueryIsReporterRequest) (*QueryIsReporterResponse, error) + // Reporters queries all reporters associated with given validator address. + Reporters(context.Context, *QueryReportersRequest) (*QueryReportersResponse, error) + // ActiveValidators queries all active oracle validators. + ActiveValidators(context.Context, *QueryActiveValidatorsRequest) (*QueryActiveValidatorsResponse, error) + // Params queries parameters used for runnning bandchain network. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // RequestSearch queries the latest request that match search criteria. + RequestSearch(context.Context, *QueryRequestSearchRequest) (*QueryRequestSearchResponse, error) + // RequestPrice queries the latest price on standard price reference oracle + // script. + RequestPrice(context.Context, *QueryRequestPriceRequest) (*QueryRequestPriceResponse, error) + // RequestVerification verifies a request to make sure that + // all information that will be used to report the data is valid + RequestVerification(context.Context, *QueryRequestVerificationRequest) (*QueryRequestVerificationResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Counts(context.Context, *QueryCountsRequest) (*QueryCountsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Counts not implemented") +} +func (UnimplementedQueryServer) Data(context.Context, *QueryDataRequest) (*QueryDataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Data not implemented") +} +func (UnimplementedQueryServer) DataSource(context.Context, *QueryDataSourceRequest) (*QueryDataSourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DataSource not implemented") +} +func (UnimplementedQueryServer) OracleScript(context.Context, *QueryOracleScriptRequest) (*QueryOracleScriptResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OracleScript not implemented") +} +func (UnimplementedQueryServer) Request(context.Context, *QueryRequestRequest) (*QueryRequestResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Request not implemented") +} +func (UnimplementedQueryServer) PendingRequests(context.Context, *QueryPendingRequestsRequest) (*QueryPendingRequestsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PendingRequests not implemented") +} +func (UnimplementedQueryServer) Validator(context.Context, *QueryValidatorRequest) (*QueryValidatorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Validator not implemented") +} +func (UnimplementedQueryServer) IsReporter(context.Context, *QueryIsReporterRequest) (*QueryIsReporterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IsReporter not implemented") +} +func (UnimplementedQueryServer) Reporters(context.Context, *QueryReportersRequest) (*QueryReportersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Reporters not implemented") +} +func (UnimplementedQueryServer) ActiveValidators(context.Context, *QueryActiveValidatorsRequest) (*QueryActiveValidatorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ActiveValidators not implemented") +} +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) RequestSearch(context.Context, *QueryRequestSearchRequest) (*QueryRequestSearchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RequestSearch not implemented") +} +func (UnimplementedQueryServer) RequestPrice(context.Context, *QueryRequestPriceRequest) (*QueryRequestPriceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RequestPrice not implemented") +} +func (UnimplementedQueryServer) RequestVerification(context.Context, *QueryRequestVerificationRequest) (*QueryRequestVerificationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RequestVerification not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_Counts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCountsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Counts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Counts_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Counts(ctx, req.(*QueryCountsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Data_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Data(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Data_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Data(ctx, req.(*QueryDataRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_DataSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDataSourceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DataSource(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_DataSource_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DataSource(ctx, req.(*QueryDataSourceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_OracleScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOracleScriptRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).OracleScript(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_OracleScript_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).OracleScript(ctx, req.(*QueryOracleScriptRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Request_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequestRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Request(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Request_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Request(ctx, req.(*QueryRequestRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_PendingRequests_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPendingRequestsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).PendingRequests(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_PendingRequests_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PendingRequests(ctx, req.(*QueryPendingRequestsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Validator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Validator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Validator_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Validator(ctx, req.(*QueryValidatorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_IsReporter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryIsReporterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).IsReporter(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_IsReporter_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).IsReporter(ctx, req.(*QueryIsReporterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Reporters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryReportersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Reporters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Reporters_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Reporters(ctx, req.(*QueryReportersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ActiveValidators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryActiveValidatorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ActiveValidators(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ActiveValidators_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ActiveValidators(ctx, req.(*QueryActiveValidatorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RequestSearch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequestSearchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RequestSearch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_RequestSearch_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RequestSearch(ctx, req.(*QueryRequestSearchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RequestPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequestPriceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RequestPrice(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_RequestPrice_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RequestPrice(ctx, req.(*QueryRequestPriceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RequestVerification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequestVerificationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RequestVerification(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_RequestVerification_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RequestVerification(ctx, req.(*QueryRequestVerificationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "oracle.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Counts", + Handler: _Query_Counts_Handler, + }, + { + MethodName: "Data", + Handler: _Query_Data_Handler, + }, + { + MethodName: "DataSource", + Handler: _Query_DataSource_Handler, + }, + { + MethodName: "OracleScript", + Handler: _Query_OracleScript_Handler, + }, + { + MethodName: "Request", + Handler: _Query_Request_Handler, + }, + { + MethodName: "PendingRequests", + Handler: _Query_PendingRequests_Handler, + }, + { + MethodName: "Validator", + Handler: _Query_Validator_Handler, + }, + { + MethodName: "IsReporter", + Handler: _Query_IsReporter_Handler, + }, + { + MethodName: "Reporters", + Handler: _Query_Reporters_Handler, + }, + { + MethodName: "ActiveValidators", + Handler: _Query_ActiveValidators_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "RequestSearch", + Handler: _Query_RequestSearch_Handler, + }, + { + MethodName: "RequestPrice", + Handler: _Query_RequestPrice_Handler, + }, + { + MethodName: "RequestVerification", + Handler: _Query_RequestVerification_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "oracle/v1/query.proto", +} diff --git a/api/oracle/v1/tx.pulsar.go b/api/oracle/v1/tx.pulsar.go new file mode 100644 index 000000000..796f5a8fa --- /dev/null +++ b/api/oracle/v1/tx.pulsar.go @@ -0,0 +1,10203 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package oraclev1 + +import ( + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_MsgRequestData_6_list)(nil) + +type _MsgRequestData_6_list struct { + list *[]*v1beta1.Coin +} + +func (x *_MsgRequestData_6_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgRequestData_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgRequestData_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_MsgRequestData_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgRequestData_6_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgRequestData_6_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgRequestData_6_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgRequestData_6_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgRequestData protoreflect.MessageDescriptor + fd_MsgRequestData_oracle_script_id protoreflect.FieldDescriptor + fd_MsgRequestData_calldata protoreflect.FieldDescriptor + fd_MsgRequestData_ask_count protoreflect.FieldDescriptor + fd_MsgRequestData_min_count protoreflect.FieldDescriptor + fd_MsgRequestData_client_id protoreflect.FieldDescriptor + fd_MsgRequestData_fee_limit protoreflect.FieldDescriptor + fd_MsgRequestData_prepare_gas protoreflect.FieldDescriptor + fd_MsgRequestData_execute_gas protoreflect.FieldDescriptor + fd_MsgRequestData_sender protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgRequestData = File_oracle_v1_tx_proto.Messages().ByName("MsgRequestData") + fd_MsgRequestData_oracle_script_id = md_MsgRequestData.Fields().ByName("oracle_script_id") + fd_MsgRequestData_calldata = md_MsgRequestData.Fields().ByName("calldata") + fd_MsgRequestData_ask_count = md_MsgRequestData.Fields().ByName("ask_count") + fd_MsgRequestData_min_count = md_MsgRequestData.Fields().ByName("min_count") + fd_MsgRequestData_client_id = md_MsgRequestData.Fields().ByName("client_id") + fd_MsgRequestData_fee_limit = md_MsgRequestData.Fields().ByName("fee_limit") + fd_MsgRequestData_prepare_gas = md_MsgRequestData.Fields().ByName("prepare_gas") + fd_MsgRequestData_execute_gas = md_MsgRequestData.Fields().ByName("execute_gas") + fd_MsgRequestData_sender = md_MsgRequestData.Fields().ByName("sender") +} + +var _ protoreflect.Message = (*fastReflection_MsgRequestData)(nil) + +type fastReflection_MsgRequestData MsgRequestData + +func (x *MsgRequestData) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRequestData)(x) +} + +func (x *MsgRequestData) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_proto_msgTypes[0] + 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_MsgRequestData_messageType fastReflection_MsgRequestData_messageType +var _ protoreflect.MessageType = fastReflection_MsgRequestData_messageType{} + +type fastReflection_MsgRequestData_messageType struct{} + +func (x fastReflection_MsgRequestData_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRequestData)(nil) +} +func (x fastReflection_MsgRequestData_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRequestData) +} +func (x fastReflection_MsgRequestData_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRequestData +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgRequestData) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRequestData +} + +// 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_MsgRequestData) Type() protoreflect.MessageType { + return _fastReflection_MsgRequestData_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgRequestData) New() protoreflect.Message { + return new(fastReflection_MsgRequestData) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgRequestData) Interface() protoreflect.ProtoMessage { + return (*MsgRequestData)(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_MsgRequestData) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.OracleScriptId != uint64(0) { + value := protoreflect.ValueOfUint64(x.OracleScriptId) + if !f(fd_MsgRequestData_oracle_script_id, value) { + return + } + } + if len(x.Calldata) != 0 { + value := protoreflect.ValueOfBytes(x.Calldata) + if !f(fd_MsgRequestData_calldata, value) { + return + } + } + if x.AskCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.AskCount) + if !f(fd_MsgRequestData_ask_count, value) { + return + } + } + if x.MinCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.MinCount) + if !f(fd_MsgRequestData_min_count, value) { + return + } + } + if x.ClientId != "" { + value := protoreflect.ValueOfString(x.ClientId) + if !f(fd_MsgRequestData_client_id, value) { + return + } + } + if len(x.FeeLimit) != 0 { + value := protoreflect.ValueOfList(&_MsgRequestData_6_list{list: &x.FeeLimit}) + if !f(fd_MsgRequestData_fee_limit, value) { + return + } + } + if x.PrepareGas != uint64(0) { + value := protoreflect.ValueOfUint64(x.PrepareGas) + if !f(fd_MsgRequestData_prepare_gas, value) { + return + } + } + if x.ExecuteGas != uint64(0) { + value := protoreflect.ValueOfUint64(x.ExecuteGas) + if !f(fd_MsgRequestData_execute_gas, value) { + return + } + } + if x.Sender != "" { + value := protoreflect.ValueOfString(x.Sender) + if !f(fd_MsgRequestData_sender, 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_MsgRequestData) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.MsgRequestData.oracle_script_id": + return x.OracleScriptId != uint64(0) + case "oracle.v1.MsgRequestData.calldata": + return len(x.Calldata) != 0 + case "oracle.v1.MsgRequestData.ask_count": + return x.AskCount != uint64(0) + case "oracle.v1.MsgRequestData.min_count": + return x.MinCount != uint64(0) + case "oracle.v1.MsgRequestData.client_id": + return x.ClientId != "" + case "oracle.v1.MsgRequestData.fee_limit": + return len(x.FeeLimit) != 0 + case "oracle.v1.MsgRequestData.prepare_gas": + return x.PrepareGas != uint64(0) + case "oracle.v1.MsgRequestData.execute_gas": + return x.ExecuteGas != uint64(0) + case "oracle.v1.MsgRequestData.sender": + return x.Sender != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgRequestData")) + } + panic(fmt.Errorf("message oracle.v1.MsgRequestData 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_MsgRequestData) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.MsgRequestData.oracle_script_id": + x.OracleScriptId = uint64(0) + case "oracle.v1.MsgRequestData.calldata": + x.Calldata = nil + case "oracle.v1.MsgRequestData.ask_count": + x.AskCount = uint64(0) + case "oracle.v1.MsgRequestData.min_count": + x.MinCount = uint64(0) + case "oracle.v1.MsgRequestData.client_id": + x.ClientId = "" + case "oracle.v1.MsgRequestData.fee_limit": + x.FeeLimit = nil + case "oracle.v1.MsgRequestData.prepare_gas": + x.PrepareGas = uint64(0) + case "oracle.v1.MsgRequestData.execute_gas": + x.ExecuteGas = uint64(0) + case "oracle.v1.MsgRequestData.sender": + x.Sender = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgRequestData")) + } + panic(fmt.Errorf("message oracle.v1.MsgRequestData 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_MsgRequestData) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.MsgRequestData.oracle_script_id": + value := x.OracleScriptId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.MsgRequestData.calldata": + value := x.Calldata + return protoreflect.ValueOfBytes(value) + case "oracle.v1.MsgRequestData.ask_count": + value := x.AskCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.MsgRequestData.min_count": + value := x.MinCount + return protoreflect.ValueOfUint64(value) + case "oracle.v1.MsgRequestData.client_id": + value := x.ClientId + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgRequestData.fee_limit": + if len(x.FeeLimit) == 0 { + return protoreflect.ValueOfList(&_MsgRequestData_6_list{}) + } + listValue := &_MsgRequestData_6_list{list: &x.FeeLimit} + return protoreflect.ValueOfList(listValue) + case "oracle.v1.MsgRequestData.prepare_gas": + value := x.PrepareGas + return protoreflect.ValueOfUint64(value) + case "oracle.v1.MsgRequestData.execute_gas": + value := x.ExecuteGas + return protoreflect.ValueOfUint64(value) + case "oracle.v1.MsgRequestData.sender": + value := x.Sender + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgRequestData")) + } + panic(fmt.Errorf("message oracle.v1.MsgRequestData 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_MsgRequestData) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.MsgRequestData.oracle_script_id": + x.OracleScriptId = value.Uint() + case "oracle.v1.MsgRequestData.calldata": + x.Calldata = value.Bytes() + case "oracle.v1.MsgRequestData.ask_count": + x.AskCount = value.Uint() + case "oracle.v1.MsgRequestData.min_count": + x.MinCount = value.Uint() + case "oracle.v1.MsgRequestData.client_id": + x.ClientId = value.Interface().(string) + case "oracle.v1.MsgRequestData.fee_limit": + lv := value.List() + clv := lv.(*_MsgRequestData_6_list) + x.FeeLimit = *clv.list + case "oracle.v1.MsgRequestData.prepare_gas": + x.PrepareGas = value.Uint() + case "oracle.v1.MsgRequestData.execute_gas": + x.ExecuteGas = value.Uint() + case "oracle.v1.MsgRequestData.sender": + x.Sender = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgRequestData")) + } + panic(fmt.Errorf("message oracle.v1.MsgRequestData 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_MsgRequestData) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgRequestData.fee_limit": + if x.FeeLimit == nil { + x.FeeLimit = []*v1beta1.Coin{} + } + value := &_MsgRequestData_6_list{list: &x.FeeLimit} + return protoreflect.ValueOfList(value) + case "oracle.v1.MsgRequestData.oracle_script_id": + panic(fmt.Errorf("field oracle_script_id of message oracle.v1.MsgRequestData is not mutable")) + case "oracle.v1.MsgRequestData.calldata": + panic(fmt.Errorf("field calldata of message oracle.v1.MsgRequestData is not mutable")) + case "oracle.v1.MsgRequestData.ask_count": + panic(fmt.Errorf("field ask_count of message oracle.v1.MsgRequestData is not mutable")) + case "oracle.v1.MsgRequestData.min_count": + panic(fmt.Errorf("field min_count of message oracle.v1.MsgRequestData is not mutable")) + case "oracle.v1.MsgRequestData.client_id": + panic(fmt.Errorf("field client_id of message oracle.v1.MsgRequestData is not mutable")) + case "oracle.v1.MsgRequestData.prepare_gas": + panic(fmt.Errorf("field prepare_gas of message oracle.v1.MsgRequestData is not mutable")) + case "oracle.v1.MsgRequestData.execute_gas": + panic(fmt.Errorf("field execute_gas of message oracle.v1.MsgRequestData is not mutable")) + case "oracle.v1.MsgRequestData.sender": + panic(fmt.Errorf("field sender of message oracle.v1.MsgRequestData is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgRequestData")) + } + panic(fmt.Errorf("message oracle.v1.MsgRequestData 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_MsgRequestData) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgRequestData.oracle_script_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.MsgRequestData.calldata": + return protoreflect.ValueOfBytes(nil) + case "oracle.v1.MsgRequestData.ask_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.MsgRequestData.min_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.MsgRequestData.client_id": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgRequestData.fee_limit": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_MsgRequestData_6_list{list: &list}) + case "oracle.v1.MsgRequestData.prepare_gas": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.MsgRequestData.execute_gas": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.MsgRequestData.sender": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgRequestData")) + } + panic(fmt.Errorf("message oracle.v1.MsgRequestData 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_MsgRequestData) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgRequestData", 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_MsgRequestData) 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_MsgRequestData) 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_MsgRequestData) 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_MsgRequestData) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgRequestData) + 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.OracleScriptId != 0 { + n += 1 + runtime.Sov(uint64(x.OracleScriptId)) + } + l = len(x.Calldata) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.AskCount != 0 { + n += 1 + runtime.Sov(uint64(x.AskCount)) + } + if x.MinCount != 0 { + n += 1 + runtime.Sov(uint64(x.MinCount)) + } + l = len(x.ClientId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.FeeLimit) > 0 { + for _, e := range x.FeeLimit { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.PrepareGas != 0 { + n += 1 + runtime.Sov(uint64(x.PrepareGas)) + } + if x.ExecuteGas != 0 { + n += 1 + runtime.Sov(uint64(x.ExecuteGas)) + } + l = len(x.Sender) + 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().(*MsgRequestData) + 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.Sender) > 0 { + i -= len(x.Sender) + copy(dAtA[i:], x.Sender) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) + i-- + dAtA[i] = 0x4a + } + if x.ExecuteGas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExecuteGas)) + i-- + dAtA[i] = 0x40 + } + if x.PrepareGas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.PrepareGas)) + i-- + dAtA[i] = 0x38 + } + if len(x.FeeLimit) > 0 { + for iNdEx := len(x.FeeLimit) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.FeeLimit[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] = 0x32 + } + } + if len(x.ClientId) > 0 { + i -= len(x.ClientId) + copy(dAtA[i:], x.ClientId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ClientId))) + i-- + dAtA[i] = 0x2a + } + if x.MinCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MinCount)) + i-- + dAtA[i] = 0x20 + } + if x.AskCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AskCount)) + i-- + dAtA[i] = 0x18 + } + if len(x.Calldata) > 0 { + i -= len(x.Calldata) + copy(dAtA[i:], x.Calldata) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Calldata))) + i-- + dAtA[i] = 0x12 + } + if x.OracleScriptId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.OracleScriptId)) + i-- + dAtA[i] = 0x8 + } + 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().(*MsgRequestData) + 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: MsgRequestData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRequestData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OracleScriptId", wireType) + } + x.OracleScriptId = 0 + 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++ + x.OracleScriptId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Calldata", 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.Calldata = append(x.Calldata[:0], dAtA[iNdEx:postIndex]...) + if x.Calldata == nil { + x.Calldata = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AskCount", wireType) + } + x.AskCount = 0 + 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++ + x.AskCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinCount", wireType) + } + x.MinCount = 0 + 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++ + x.MinCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClientId", 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.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FeeLimit", 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.FeeLimit = append(x.FeeLimit, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.FeeLimit[len(x.FeeLimit)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PrepareGas", wireType) + } + x.PrepareGas = 0 + 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++ + x.PrepareGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExecuteGas", wireType) + } + x.ExecuteGas = 0 + 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++ + x.ExecuteGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = 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_MsgRequestDataResponse protoreflect.MessageDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgRequestDataResponse = File_oracle_v1_tx_proto.Messages().ByName("MsgRequestDataResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgRequestDataResponse)(nil) + +type fastReflection_MsgRequestDataResponse MsgRequestDataResponse + +func (x *MsgRequestDataResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRequestDataResponse)(x) +} + +func (x *MsgRequestDataResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_proto_msgTypes[1] + 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_MsgRequestDataResponse_messageType fastReflection_MsgRequestDataResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgRequestDataResponse_messageType{} + +type fastReflection_MsgRequestDataResponse_messageType struct{} + +func (x fastReflection_MsgRequestDataResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRequestDataResponse)(nil) +} +func (x fastReflection_MsgRequestDataResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRequestDataResponse) +} +func (x fastReflection_MsgRequestDataResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRequestDataResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgRequestDataResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRequestDataResponse +} + +// 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_MsgRequestDataResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgRequestDataResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgRequestDataResponse) New() protoreflect.Message { + return new(fastReflection_MsgRequestDataResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgRequestDataResponse) Interface() protoreflect.ProtoMessage { + return (*MsgRequestDataResponse)(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_MsgRequestDataResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgRequestDataResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgRequestDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgRequestDataResponse 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_MsgRequestDataResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgRequestDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgRequestDataResponse 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_MsgRequestDataResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgRequestDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgRequestDataResponse 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_MsgRequestDataResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgRequestDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgRequestDataResponse 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_MsgRequestDataResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgRequestDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgRequestDataResponse 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_MsgRequestDataResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgRequestDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgRequestDataResponse 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_MsgRequestDataResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgRequestDataResponse", 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_MsgRequestDataResponse) 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_MsgRequestDataResponse) 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_MsgRequestDataResponse) 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_MsgRequestDataResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgRequestDataResponse) + 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.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().(*MsgRequestDataResponse) + 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 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().(*MsgRequestDataResponse) + 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: MsgRequestDataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRequestDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 = (*_MsgReportData_2_list)(nil) + +type _MsgReportData_2_list struct { + list *[]*RawReport +} + +func (x *_MsgReportData_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgReportData_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgReportData_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*RawReport) + (*x.list)[i] = concreteValue +} + +func (x *_MsgReportData_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*RawReport) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgReportData_2_list) AppendMutable() protoreflect.Value { + v := new(RawReport) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgReportData_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgReportData_2_list) NewElement() protoreflect.Value { + v := new(RawReport) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgReportData_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgReportData protoreflect.MessageDescriptor + fd_MsgReportData_request_id protoreflect.FieldDescriptor + fd_MsgReportData_raw_reports protoreflect.FieldDescriptor + fd_MsgReportData_validator protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgReportData = File_oracle_v1_tx_proto.Messages().ByName("MsgReportData") + fd_MsgReportData_request_id = md_MsgReportData.Fields().ByName("request_id") + fd_MsgReportData_raw_reports = md_MsgReportData.Fields().ByName("raw_reports") + fd_MsgReportData_validator = md_MsgReportData.Fields().ByName("validator") +} + +var _ protoreflect.Message = (*fastReflection_MsgReportData)(nil) + +type fastReflection_MsgReportData MsgReportData + +func (x *MsgReportData) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgReportData)(x) +} + +func (x *MsgReportData) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_proto_msgTypes[2] + 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_MsgReportData_messageType fastReflection_MsgReportData_messageType +var _ protoreflect.MessageType = fastReflection_MsgReportData_messageType{} + +type fastReflection_MsgReportData_messageType struct{} + +func (x fastReflection_MsgReportData_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgReportData)(nil) +} +func (x fastReflection_MsgReportData_messageType) New() protoreflect.Message { + return new(fastReflection_MsgReportData) +} +func (x fastReflection_MsgReportData_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReportData +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgReportData) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReportData +} + +// 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_MsgReportData) Type() protoreflect.MessageType { + return _fastReflection_MsgReportData_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgReportData) New() protoreflect.Message { + return new(fastReflection_MsgReportData) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgReportData) Interface() protoreflect.ProtoMessage { + return (*MsgReportData)(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_MsgReportData) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.RequestId != uint64(0) { + value := protoreflect.ValueOfUint64(x.RequestId) + if !f(fd_MsgReportData_request_id, value) { + return + } + } + if len(x.RawReports) != 0 { + value := protoreflect.ValueOfList(&_MsgReportData_2_list{list: &x.RawReports}) + if !f(fd_MsgReportData_raw_reports, value) { + return + } + } + if x.Validator != "" { + value := protoreflect.ValueOfString(x.Validator) + if !f(fd_MsgReportData_validator, 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_MsgReportData) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.MsgReportData.request_id": + return x.RequestId != uint64(0) + case "oracle.v1.MsgReportData.raw_reports": + return len(x.RawReports) != 0 + case "oracle.v1.MsgReportData.validator": + return x.Validator != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgReportData")) + } + panic(fmt.Errorf("message oracle.v1.MsgReportData 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_MsgReportData) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.MsgReportData.request_id": + x.RequestId = uint64(0) + case "oracle.v1.MsgReportData.raw_reports": + x.RawReports = nil + case "oracle.v1.MsgReportData.validator": + x.Validator = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgReportData")) + } + panic(fmt.Errorf("message oracle.v1.MsgReportData 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_MsgReportData) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.MsgReportData.request_id": + value := x.RequestId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.MsgReportData.raw_reports": + if len(x.RawReports) == 0 { + return protoreflect.ValueOfList(&_MsgReportData_2_list{}) + } + listValue := &_MsgReportData_2_list{list: &x.RawReports} + return protoreflect.ValueOfList(listValue) + case "oracle.v1.MsgReportData.validator": + value := x.Validator + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgReportData")) + } + panic(fmt.Errorf("message oracle.v1.MsgReportData 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_MsgReportData) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.MsgReportData.request_id": + x.RequestId = value.Uint() + case "oracle.v1.MsgReportData.raw_reports": + lv := value.List() + clv := lv.(*_MsgReportData_2_list) + x.RawReports = *clv.list + case "oracle.v1.MsgReportData.validator": + x.Validator = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgReportData")) + } + panic(fmt.Errorf("message oracle.v1.MsgReportData 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_MsgReportData) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgReportData.raw_reports": + if x.RawReports == nil { + x.RawReports = []*RawReport{} + } + value := &_MsgReportData_2_list{list: &x.RawReports} + return protoreflect.ValueOfList(value) + case "oracle.v1.MsgReportData.request_id": + panic(fmt.Errorf("field request_id of message oracle.v1.MsgReportData is not mutable")) + case "oracle.v1.MsgReportData.validator": + panic(fmt.Errorf("field validator of message oracle.v1.MsgReportData is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgReportData")) + } + panic(fmt.Errorf("message oracle.v1.MsgReportData 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_MsgReportData) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgReportData.request_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.MsgReportData.raw_reports": + list := []*RawReport{} + return protoreflect.ValueOfList(&_MsgReportData_2_list{list: &list}) + case "oracle.v1.MsgReportData.validator": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgReportData")) + } + panic(fmt.Errorf("message oracle.v1.MsgReportData 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_MsgReportData) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgReportData", 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_MsgReportData) 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_MsgReportData) 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_MsgReportData) 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_MsgReportData) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgReportData) + 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.RequestId != 0 { + n += 1 + runtime.Sov(uint64(x.RequestId)) + } + if len(x.RawReports) > 0 { + for _, e := range x.RawReports { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.Validator) + 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().(*MsgReportData) + 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.Validator) > 0 { + i -= len(x.Validator) + copy(dAtA[i:], x.Validator) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Validator))) + i-- + dAtA[i] = 0x1a + } + if len(x.RawReports) > 0 { + for iNdEx := len(x.RawReports) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.RawReports[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] = 0x12 + } + } + if x.RequestId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.RequestId)) + i-- + dAtA[i] = 0x8 + } + 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().(*MsgReportData) + 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: MsgReportData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgReportData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) + } + x.RequestId = 0 + 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++ + x.RequestId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RawReports", 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.RawReports = append(x.RawReports, &RawReport{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RawReports[len(x.RawReports)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Validator", 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.Validator = 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_MsgReportDataResponse protoreflect.MessageDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgReportDataResponse = File_oracle_v1_tx_proto.Messages().ByName("MsgReportDataResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgReportDataResponse)(nil) + +type fastReflection_MsgReportDataResponse MsgReportDataResponse + +func (x *MsgReportDataResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgReportDataResponse)(x) +} + +func (x *MsgReportDataResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_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_MsgReportDataResponse_messageType fastReflection_MsgReportDataResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgReportDataResponse_messageType{} + +type fastReflection_MsgReportDataResponse_messageType struct{} + +func (x fastReflection_MsgReportDataResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgReportDataResponse)(nil) +} +func (x fastReflection_MsgReportDataResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgReportDataResponse) +} +func (x fastReflection_MsgReportDataResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReportDataResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgReportDataResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReportDataResponse +} + +// 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_MsgReportDataResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgReportDataResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgReportDataResponse) New() protoreflect.Message { + return new(fastReflection_MsgReportDataResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgReportDataResponse) Interface() protoreflect.ProtoMessage { + return (*MsgReportDataResponse)(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_MsgReportDataResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgReportDataResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgReportDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgReportDataResponse 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_MsgReportDataResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgReportDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgReportDataResponse 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_MsgReportDataResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgReportDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgReportDataResponse 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_MsgReportDataResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgReportDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgReportDataResponse 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_MsgReportDataResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgReportDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgReportDataResponse 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_MsgReportDataResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgReportDataResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgReportDataResponse 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_MsgReportDataResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgReportDataResponse", 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_MsgReportDataResponse) 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_MsgReportDataResponse) 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_MsgReportDataResponse) 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_MsgReportDataResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgReportDataResponse) + 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.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().(*MsgReportDataResponse) + 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 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().(*MsgReportDataResponse) + 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: MsgReportDataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgReportDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 = (*_MsgCreateDataSource_4_list)(nil) + +type _MsgCreateDataSource_4_list struct { + list *[]*v1beta1.Coin +} + +func (x *_MsgCreateDataSource_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateDataSource_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgCreateDataSource_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateDataSource_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateDataSource_4_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateDataSource_4_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateDataSource_4_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateDataSource_4_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgCreateDataSource protoreflect.MessageDescriptor + fd_MsgCreateDataSource_name protoreflect.FieldDescriptor + fd_MsgCreateDataSource_description protoreflect.FieldDescriptor + fd_MsgCreateDataSource_executable protoreflect.FieldDescriptor + fd_MsgCreateDataSource_fee protoreflect.FieldDescriptor + fd_MsgCreateDataSource_treasury protoreflect.FieldDescriptor + fd_MsgCreateDataSource_owner protoreflect.FieldDescriptor + fd_MsgCreateDataSource_sender protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgCreateDataSource = File_oracle_v1_tx_proto.Messages().ByName("MsgCreateDataSource") + fd_MsgCreateDataSource_name = md_MsgCreateDataSource.Fields().ByName("name") + fd_MsgCreateDataSource_description = md_MsgCreateDataSource.Fields().ByName("description") + fd_MsgCreateDataSource_executable = md_MsgCreateDataSource.Fields().ByName("executable") + fd_MsgCreateDataSource_fee = md_MsgCreateDataSource.Fields().ByName("fee") + fd_MsgCreateDataSource_treasury = md_MsgCreateDataSource.Fields().ByName("treasury") + fd_MsgCreateDataSource_owner = md_MsgCreateDataSource.Fields().ByName("owner") + fd_MsgCreateDataSource_sender = md_MsgCreateDataSource.Fields().ByName("sender") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateDataSource)(nil) + +type fastReflection_MsgCreateDataSource MsgCreateDataSource + +func (x *MsgCreateDataSource) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateDataSource)(x) +} + +func (x *MsgCreateDataSource) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_proto_msgTypes[4] + 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_MsgCreateDataSource_messageType fastReflection_MsgCreateDataSource_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateDataSource_messageType{} + +type fastReflection_MsgCreateDataSource_messageType struct{} + +func (x fastReflection_MsgCreateDataSource_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateDataSource)(nil) +} +func (x fastReflection_MsgCreateDataSource_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateDataSource) +} +func (x fastReflection_MsgCreateDataSource_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateDataSource +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateDataSource) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateDataSource +} + +// 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_MsgCreateDataSource) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateDataSource_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateDataSource) New() protoreflect.Message { + return new(fastReflection_MsgCreateDataSource) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateDataSource) Interface() protoreflect.ProtoMessage { + return (*MsgCreateDataSource)(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_MsgCreateDataSource) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Name != "" { + value := protoreflect.ValueOfString(x.Name) + if !f(fd_MsgCreateDataSource_name, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_MsgCreateDataSource_description, value) { + return + } + } + if len(x.Executable) != 0 { + value := protoreflect.ValueOfBytes(x.Executable) + if !f(fd_MsgCreateDataSource_executable, value) { + return + } + } + if len(x.Fee) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateDataSource_4_list{list: &x.Fee}) + if !f(fd_MsgCreateDataSource_fee, value) { + return + } + } + if x.Treasury != "" { + value := protoreflect.ValueOfString(x.Treasury) + if !f(fd_MsgCreateDataSource_treasury, value) { + return + } + } + if x.Owner != "" { + value := protoreflect.ValueOfString(x.Owner) + if !f(fd_MsgCreateDataSource_owner, value) { + return + } + } + if x.Sender != "" { + value := protoreflect.ValueOfString(x.Sender) + if !f(fd_MsgCreateDataSource_sender, 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_MsgCreateDataSource) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.MsgCreateDataSource.name": + return x.Name != "" + case "oracle.v1.MsgCreateDataSource.description": + return x.Description != "" + case "oracle.v1.MsgCreateDataSource.executable": + return len(x.Executable) != 0 + case "oracle.v1.MsgCreateDataSource.fee": + return len(x.Fee) != 0 + case "oracle.v1.MsgCreateDataSource.treasury": + return x.Treasury != "" + case "oracle.v1.MsgCreateDataSource.owner": + return x.Owner != "" + case "oracle.v1.MsgCreateDataSource.sender": + return x.Sender != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateDataSource")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateDataSource 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_MsgCreateDataSource) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.MsgCreateDataSource.name": + x.Name = "" + case "oracle.v1.MsgCreateDataSource.description": + x.Description = "" + case "oracle.v1.MsgCreateDataSource.executable": + x.Executable = nil + case "oracle.v1.MsgCreateDataSource.fee": + x.Fee = nil + case "oracle.v1.MsgCreateDataSource.treasury": + x.Treasury = "" + case "oracle.v1.MsgCreateDataSource.owner": + x.Owner = "" + case "oracle.v1.MsgCreateDataSource.sender": + x.Sender = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateDataSource")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateDataSource 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_MsgCreateDataSource) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.MsgCreateDataSource.name": + value := x.Name + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgCreateDataSource.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgCreateDataSource.executable": + value := x.Executable + return protoreflect.ValueOfBytes(value) + case "oracle.v1.MsgCreateDataSource.fee": + if len(x.Fee) == 0 { + return protoreflect.ValueOfList(&_MsgCreateDataSource_4_list{}) + } + listValue := &_MsgCreateDataSource_4_list{list: &x.Fee} + return protoreflect.ValueOfList(listValue) + case "oracle.v1.MsgCreateDataSource.treasury": + value := x.Treasury + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgCreateDataSource.owner": + value := x.Owner + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgCreateDataSource.sender": + value := x.Sender + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateDataSource")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateDataSource 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_MsgCreateDataSource) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.MsgCreateDataSource.name": + x.Name = value.Interface().(string) + case "oracle.v1.MsgCreateDataSource.description": + x.Description = value.Interface().(string) + case "oracle.v1.MsgCreateDataSource.executable": + x.Executable = value.Bytes() + case "oracle.v1.MsgCreateDataSource.fee": + lv := value.List() + clv := lv.(*_MsgCreateDataSource_4_list) + x.Fee = *clv.list + case "oracle.v1.MsgCreateDataSource.treasury": + x.Treasury = value.Interface().(string) + case "oracle.v1.MsgCreateDataSource.owner": + x.Owner = value.Interface().(string) + case "oracle.v1.MsgCreateDataSource.sender": + x.Sender = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateDataSource")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateDataSource 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_MsgCreateDataSource) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgCreateDataSource.fee": + if x.Fee == nil { + x.Fee = []*v1beta1.Coin{} + } + value := &_MsgCreateDataSource_4_list{list: &x.Fee} + return protoreflect.ValueOfList(value) + case "oracle.v1.MsgCreateDataSource.name": + panic(fmt.Errorf("field name of message oracle.v1.MsgCreateDataSource is not mutable")) + case "oracle.v1.MsgCreateDataSource.description": + panic(fmt.Errorf("field description of message oracle.v1.MsgCreateDataSource is not mutable")) + case "oracle.v1.MsgCreateDataSource.executable": + panic(fmt.Errorf("field executable of message oracle.v1.MsgCreateDataSource is not mutable")) + case "oracle.v1.MsgCreateDataSource.treasury": + panic(fmt.Errorf("field treasury of message oracle.v1.MsgCreateDataSource is not mutable")) + case "oracle.v1.MsgCreateDataSource.owner": + panic(fmt.Errorf("field owner of message oracle.v1.MsgCreateDataSource is not mutable")) + case "oracle.v1.MsgCreateDataSource.sender": + panic(fmt.Errorf("field sender of message oracle.v1.MsgCreateDataSource is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateDataSource")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateDataSource 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_MsgCreateDataSource) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgCreateDataSource.name": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgCreateDataSource.description": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgCreateDataSource.executable": + return protoreflect.ValueOfBytes(nil) + case "oracle.v1.MsgCreateDataSource.fee": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_MsgCreateDataSource_4_list{list: &list}) + case "oracle.v1.MsgCreateDataSource.treasury": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgCreateDataSource.owner": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgCreateDataSource.sender": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateDataSource")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateDataSource 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_MsgCreateDataSource) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgCreateDataSource", 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_MsgCreateDataSource) 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_MsgCreateDataSource) 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_MsgCreateDataSource) 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_MsgCreateDataSource) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateDataSource) + 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.Name) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Executable) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Fee) > 0 { + for _, e := range x.Fee { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.Treasury) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Owner) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Sender) + 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().(*MsgCreateDataSource) + 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.Sender) > 0 { + i -= len(x.Sender) + copy(dAtA[i:], x.Sender) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) + i-- + dAtA[i] = 0x3a + } + if len(x.Owner) > 0 { + i -= len(x.Owner) + copy(dAtA[i:], x.Owner) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Owner))) + i-- + dAtA[i] = 0x32 + } + if len(x.Treasury) > 0 { + i -= len(x.Treasury) + copy(dAtA[i:], x.Treasury) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Treasury))) + i-- + dAtA[i] = 0x2a + } + if len(x.Fee) > 0 { + for iNdEx := len(x.Fee) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Fee[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] = 0x22 + } + } + if len(x.Executable) > 0 { + i -= len(x.Executable) + copy(dAtA[i:], x.Executable) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Executable))) + i-- + dAtA[i] = 0x1a + } + if len(x.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x12 + } + if len(x.Name) > 0 { + i -= len(x.Name) + copy(dAtA[i:], x.Name) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) + 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().(*MsgCreateDataSource) + 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: MsgCreateDataSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateDataSource: 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 Name", 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.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Executable", 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.Executable = append(x.Executable[:0], dAtA[iNdEx:postIndex]...) + if x.Executable == nil { + x.Executable = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Fee", 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.Fee = append(x.Fee, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Fee[len(x.Fee)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Treasury", 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.Treasury = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = 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_MsgCreateDataSourceResponse protoreflect.MessageDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgCreateDataSourceResponse = File_oracle_v1_tx_proto.Messages().ByName("MsgCreateDataSourceResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateDataSourceResponse)(nil) + +type fastReflection_MsgCreateDataSourceResponse MsgCreateDataSourceResponse + +func (x *MsgCreateDataSourceResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateDataSourceResponse)(x) +} + +func (x *MsgCreateDataSourceResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_proto_msgTypes[5] + 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_MsgCreateDataSourceResponse_messageType fastReflection_MsgCreateDataSourceResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateDataSourceResponse_messageType{} + +type fastReflection_MsgCreateDataSourceResponse_messageType struct{} + +func (x fastReflection_MsgCreateDataSourceResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateDataSourceResponse)(nil) +} +func (x fastReflection_MsgCreateDataSourceResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateDataSourceResponse) +} +func (x fastReflection_MsgCreateDataSourceResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateDataSourceResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateDataSourceResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateDataSourceResponse +} + +// 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_MsgCreateDataSourceResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateDataSourceResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateDataSourceResponse) New() protoreflect.Message { + return new(fastReflection_MsgCreateDataSourceResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateDataSourceResponse) Interface() protoreflect.ProtoMessage { + return (*MsgCreateDataSourceResponse)(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_MsgCreateDataSourceResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgCreateDataSourceResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateDataSourceResponse 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_MsgCreateDataSourceResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateDataSourceResponse 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_MsgCreateDataSourceResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateDataSourceResponse 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_MsgCreateDataSourceResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateDataSourceResponse 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_MsgCreateDataSourceResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateDataSourceResponse 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_MsgCreateDataSourceResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateDataSourceResponse 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_MsgCreateDataSourceResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgCreateDataSourceResponse", 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_MsgCreateDataSourceResponse) 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_MsgCreateDataSourceResponse) 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_MsgCreateDataSourceResponse) 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_MsgCreateDataSourceResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateDataSourceResponse) + 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.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().(*MsgCreateDataSourceResponse) + 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 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().(*MsgCreateDataSourceResponse) + 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: MsgCreateDataSourceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateDataSourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 = (*_MsgEditDataSource_5_list)(nil) + +type _MsgEditDataSource_5_list struct { + list *[]*v1beta1.Coin +} + +func (x *_MsgEditDataSource_5_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgEditDataSource_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgEditDataSource_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_MsgEditDataSource_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgEditDataSource_5_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgEditDataSource_5_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgEditDataSource_5_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgEditDataSource_5_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgEditDataSource protoreflect.MessageDescriptor + fd_MsgEditDataSource_data_source_id protoreflect.FieldDescriptor + fd_MsgEditDataSource_name protoreflect.FieldDescriptor + fd_MsgEditDataSource_description protoreflect.FieldDescriptor + fd_MsgEditDataSource_executable protoreflect.FieldDescriptor + fd_MsgEditDataSource_fee protoreflect.FieldDescriptor + fd_MsgEditDataSource_treasury protoreflect.FieldDescriptor + fd_MsgEditDataSource_owner protoreflect.FieldDescriptor + fd_MsgEditDataSource_sender protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgEditDataSource = File_oracle_v1_tx_proto.Messages().ByName("MsgEditDataSource") + fd_MsgEditDataSource_data_source_id = md_MsgEditDataSource.Fields().ByName("data_source_id") + fd_MsgEditDataSource_name = md_MsgEditDataSource.Fields().ByName("name") + fd_MsgEditDataSource_description = md_MsgEditDataSource.Fields().ByName("description") + fd_MsgEditDataSource_executable = md_MsgEditDataSource.Fields().ByName("executable") + fd_MsgEditDataSource_fee = md_MsgEditDataSource.Fields().ByName("fee") + fd_MsgEditDataSource_treasury = md_MsgEditDataSource.Fields().ByName("treasury") + fd_MsgEditDataSource_owner = md_MsgEditDataSource.Fields().ByName("owner") + fd_MsgEditDataSource_sender = md_MsgEditDataSource.Fields().ByName("sender") +} + +var _ protoreflect.Message = (*fastReflection_MsgEditDataSource)(nil) + +type fastReflection_MsgEditDataSource MsgEditDataSource + +func (x *MsgEditDataSource) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgEditDataSource)(x) +} + +func (x *MsgEditDataSource) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_proto_msgTypes[6] + 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_MsgEditDataSource_messageType fastReflection_MsgEditDataSource_messageType +var _ protoreflect.MessageType = fastReflection_MsgEditDataSource_messageType{} + +type fastReflection_MsgEditDataSource_messageType struct{} + +func (x fastReflection_MsgEditDataSource_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgEditDataSource)(nil) +} +func (x fastReflection_MsgEditDataSource_messageType) New() protoreflect.Message { + return new(fastReflection_MsgEditDataSource) +} +func (x fastReflection_MsgEditDataSource_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEditDataSource +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgEditDataSource) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEditDataSource +} + +// 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_MsgEditDataSource) Type() protoreflect.MessageType { + return _fastReflection_MsgEditDataSource_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgEditDataSource) New() protoreflect.Message { + return new(fastReflection_MsgEditDataSource) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgEditDataSource) Interface() protoreflect.ProtoMessage { + return (*MsgEditDataSource)(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_MsgEditDataSource) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.DataSourceId != uint64(0) { + value := protoreflect.ValueOfUint64(x.DataSourceId) + if !f(fd_MsgEditDataSource_data_source_id, value) { + return + } + } + if x.Name != "" { + value := protoreflect.ValueOfString(x.Name) + if !f(fd_MsgEditDataSource_name, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_MsgEditDataSource_description, value) { + return + } + } + if len(x.Executable) != 0 { + value := protoreflect.ValueOfBytes(x.Executable) + if !f(fd_MsgEditDataSource_executable, value) { + return + } + } + if len(x.Fee) != 0 { + value := protoreflect.ValueOfList(&_MsgEditDataSource_5_list{list: &x.Fee}) + if !f(fd_MsgEditDataSource_fee, value) { + return + } + } + if x.Treasury != "" { + value := protoreflect.ValueOfString(x.Treasury) + if !f(fd_MsgEditDataSource_treasury, value) { + return + } + } + if x.Owner != "" { + value := protoreflect.ValueOfString(x.Owner) + if !f(fd_MsgEditDataSource_owner, value) { + return + } + } + if x.Sender != "" { + value := protoreflect.ValueOfString(x.Sender) + if !f(fd_MsgEditDataSource_sender, 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_MsgEditDataSource) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.MsgEditDataSource.data_source_id": + return x.DataSourceId != uint64(0) + case "oracle.v1.MsgEditDataSource.name": + return x.Name != "" + case "oracle.v1.MsgEditDataSource.description": + return x.Description != "" + case "oracle.v1.MsgEditDataSource.executable": + return len(x.Executable) != 0 + case "oracle.v1.MsgEditDataSource.fee": + return len(x.Fee) != 0 + case "oracle.v1.MsgEditDataSource.treasury": + return x.Treasury != "" + case "oracle.v1.MsgEditDataSource.owner": + return x.Owner != "" + case "oracle.v1.MsgEditDataSource.sender": + return x.Sender != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditDataSource")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditDataSource 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_MsgEditDataSource) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.MsgEditDataSource.data_source_id": + x.DataSourceId = uint64(0) + case "oracle.v1.MsgEditDataSource.name": + x.Name = "" + case "oracle.v1.MsgEditDataSource.description": + x.Description = "" + case "oracle.v1.MsgEditDataSource.executable": + x.Executable = nil + case "oracle.v1.MsgEditDataSource.fee": + x.Fee = nil + case "oracle.v1.MsgEditDataSource.treasury": + x.Treasury = "" + case "oracle.v1.MsgEditDataSource.owner": + x.Owner = "" + case "oracle.v1.MsgEditDataSource.sender": + x.Sender = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditDataSource")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditDataSource 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_MsgEditDataSource) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.MsgEditDataSource.data_source_id": + value := x.DataSourceId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.MsgEditDataSource.name": + value := x.Name + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgEditDataSource.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgEditDataSource.executable": + value := x.Executable + return protoreflect.ValueOfBytes(value) + case "oracle.v1.MsgEditDataSource.fee": + if len(x.Fee) == 0 { + return protoreflect.ValueOfList(&_MsgEditDataSource_5_list{}) + } + listValue := &_MsgEditDataSource_5_list{list: &x.Fee} + return protoreflect.ValueOfList(listValue) + case "oracle.v1.MsgEditDataSource.treasury": + value := x.Treasury + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgEditDataSource.owner": + value := x.Owner + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgEditDataSource.sender": + value := x.Sender + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditDataSource")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditDataSource 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_MsgEditDataSource) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.MsgEditDataSource.data_source_id": + x.DataSourceId = value.Uint() + case "oracle.v1.MsgEditDataSource.name": + x.Name = value.Interface().(string) + case "oracle.v1.MsgEditDataSource.description": + x.Description = value.Interface().(string) + case "oracle.v1.MsgEditDataSource.executable": + x.Executable = value.Bytes() + case "oracle.v1.MsgEditDataSource.fee": + lv := value.List() + clv := lv.(*_MsgEditDataSource_5_list) + x.Fee = *clv.list + case "oracle.v1.MsgEditDataSource.treasury": + x.Treasury = value.Interface().(string) + case "oracle.v1.MsgEditDataSource.owner": + x.Owner = value.Interface().(string) + case "oracle.v1.MsgEditDataSource.sender": + x.Sender = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditDataSource")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditDataSource 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_MsgEditDataSource) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgEditDataSource.fee": + if x.Fee == nil { + x.Fee = []*v1beta1.Coin{} + } + value := &_MsgEditDataSource_5_list{list: &x.Fee} + return protoreflect.ValueOfList(value) + case "oracle.v1.MsgEditDataSource.data_source_id": + panic(fmt.Errorf("field data_source_id of message oracle.v1.MsgEditDataSource is not mutable")) + case "oracle.v1.MsgEditDataSource.name": + panic(fmt.Errorf("field name of message oracle.v1.MsgEditDataSource is not mutable")) + case "oracle.v1.MsgEditDataSource.description": + panic(fmt.Errorf("field description of message oracle.v1.MsgEditDataSource is not mutable")) + case "oracle.v1.MsgEditDataSource.executable": + panic(fmt.Errorf("field executable of message oracle.v1.MsgEditDataSource is not mutable")) + case "oracle.v1.MsgEditDataSource.treasury": + panic(fmt.Errorf("field treasury of message oracle.v1.MsgEditDataSource is not mutable")) + case "oracle.v1.MsgEditDataSource.owner": + panic(fmt.Errorf("field owner of message oracle.v1.MsgEditDataSource is not mutable")) + case "oracle.v1.MsgEditDataSource.sender": + panic(fmt.Errorf("field sender of message oracle.v1.MsgEditDataSource is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditDataSource")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditDataSource 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_MsgEditDataSource) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgEditDataSource.data_source_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.MsgEditDataSource.name": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgEditDataSource.description": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgEditDataSource.executable": + return protoreflect.ValueOfBytes(nil) + case "oracle.v1.MsgEditDataSource.fee": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_MsgEditDataSource_5_list{list: &list}) + case "oracle.v1.MsgEditDataSource.treasury": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgEditDataSource.owner": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgEditDataSource.sender": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditDataSource")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditDataSource 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_MsgEditDataSource) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgEditDataSource", 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_MsgEditDataSource) 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_MsgEditDataSource) 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_MsgEditDataSource) 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_MsgEditDataSource) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgEditDataSource) + 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.DataSourceId != 0 { + n += 1 + runtime.Sov(uint64(x.DataSourceId)) + } + l = len(x.Name) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Executable) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Fee) > 0 { + for _, e := range x.Fee { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.Treasury) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Owner) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Sender) + 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().(*MsgEditDataSource) + 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.Sender) > 0 { + i -= len(x.Sender) + copy(dAtA[i:], x.Sender) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) + i-- + dAtA[i] = 0x42 + } + if len(x.Owner) > 0 { + i -= len(x.Owner) + copy(dAtA[i:], x.Owner) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Owner))) + i-- + dAtA[i] = 0x3a + } + if len(x.Treasury) > 0 { + i -= len(x.Treasury) + copy(dAtA[i:], x.Treasury) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Treasury))) + i-- + dAtA[i] = 0x32 + } + if len(x.Fee) > 0 { + for iNdEx := len(x.Fee) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Fee[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] = 0x2a + } + } + if len(x.Executable) > 0 { + i -= len(x.Executable) + copy(dAtA[i:], x.Executable) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Executable))) + i-- + dAtA[i] = 0x22 + } + if len(x.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x1a + } + if len(x.Name) > 0 { + i -= len(x.Name) + copy(dAtA[i:], x.Name) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) + i-- + dAtA[i] = 0x12 + } + if x.DataSourceId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.DataSourceId)) + i-- + dAtA[i] = 0x8 + } + 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().(*MsgEditDataSource) + 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: MsgEditDataSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEditDataSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DataSourceId", wireType) + } + x.DataSourceId = 0 + 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++ + x.DataSourceId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Name", 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.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Executable", 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.Executable = append(x.Executable[:0], dAtA[iNdEx:postIndex]...) + if x.Executable == nil { + x.Executable = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Fee", 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.Fee = append(x.Fee, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Fee[len(x.Fee)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Treasury", 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.Treasury = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = 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_MsgEditDataSourceResponse protoreflect.MessageDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgEditDataSourceResponse = File_oracle_v1_tx_proto.Messages().ByName("MsgEditDataSourceResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgEditDataSourceResponse)(nil) + +type fastReflection_MsgEditDataSourceResponse MsgEditDataSourceResponse + +func (x *MsgEditDataSourceResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgEditDataSourceResponse)(x) +} + +func (x *MsgEditDataSourceResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_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_MsgEditDataSourceResponse_messageType fastReflection_MsgEditDataSourceResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgEditDataSourceResponse_messageType{} + +type fastReflection_MsgEditDataSourceResponse_messageType struct{} + +func (x fastReflection_MsgEditDataSourceResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgEditDataSourceResponse)(nil) +} +func (x fastReflection_MsgEditDataSourceResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgEditDataSourceResponse) +} +func (x fastReflection_MsgEditDataSourceResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEditDataSourceResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgEditDataSourceResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEditDataSourceResponse +} + +// 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_MsgEditDataSourceResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgEditDataSourceResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgEditDataSourceResponse) New() protoreflect.Message { + return new(fastReflection_MsgEditDataSourceResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgEditDataSourceResponse) Interface() protoreflect.ProtoMessage { + return (*MsgEditDataSourceResponse)(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_MsgEditDataSourceResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgEditDataSourceResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditDataSourceResponse 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_MsgEditDataSourceResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditDataSourceResponse 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_MsgEditDataSourceResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditDataSourceResponse 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_MsgEditDataSourceResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditDataSourceResponse 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_MsgEditDataSourceResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditDataSourceResponse 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_MsgEditDataSourceResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditDataSourceResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditDataSourceResponse 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_MsgEditDataSourceResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgEditDataSourceResponse", 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_MsgEditDataSourceResponse) 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_MsgEditDataSourceResponse) 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_MsgEditDataSourceResponse) 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_MsgEditDataSourceResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgEditDataSourceResponse) + 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.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().(*MsgEditDataSourceResponse) + 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 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().(*MsgEditDataSourceResponse) + 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: MsgEditDataSourceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEditDataSourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_MsgCreateOracleScript protoreflect.MessageDescriptor + fd_MsgCreateOracleScript_name protoreflect.FieldDescriptor + fd_MsgCreateOracleScript_description protoreflect.FieldDescriptor + fd_MsgCreateOracleScript_schema protoreflect.FieldDescriptor + fd_MsgCreateOracleScript_source_code_url protoreflect.FieldDescriptor + fd_MsgCreateOracleScript_code protoreflect.FieldDescriptor + fd_MsgCreateOracleScript_owner protoreflect.FieldDescriptor + fd_MsgCreateOracleScript_sender protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgCreateOracleScript = File_oracle_v1_tx_proto.Messages().ByName("MsgCreateOracleScript") + fd_MsgCreateOracleScript_name = md_MsgCreateOracleScript.Fields().ByName("name") + fd_MsgCreateOracleScript_description = md_MsgCreateOracleScript.Fields().ByName("description") + fd_MsgCreateOracleScript_schema = md_MsgCreateOracleScript.Fields().ByName("schema") + fd_MsgCreateOracleScript_source_code_url = md_MsgCreateOracleScript.Fields().ByName("source_code_url") + fd_MsgCreateOracleScript_code = md_MsgCreateOracleScript.Fields().ByName("code") + fd_MsgCreateOracleScript_owner = md_MsgCreateOracleScript.Fields().ByName("owner") + fd_MsgCreateOracleScript_sender = md_MsgCreateOracleScript.Fields().ByName("sender") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateOracleScript)(nil) + +type fastReflection_MsgCreateOracleScript MsgCreateOracleScript + +func (x *MsgCreateOracleScript) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateOracleScript)(x) +} + +func (x *MsgCreateOracleScript) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_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_MsgCreateOracleScript_messageType fastReflection_MsgCreateOracleScript_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateOracleScript_messageType{} + +type fastReflection_MsgCreateOracleScript_messageType struct{} + +func (x fastReflection_MsgCreateOracleScript_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateOracleScript)(nil) +} +func (x fastReflection_MsgCreateOracleScript_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateOracleScript) +} +func (x fastReflection_MsgCreateOracleScript_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateOracleScript +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateOracleScript) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateOracleScript +} + +// 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_MsgCreateOracleScript) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateOracleScript_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateOracleScript) New() protoreflect.Message { + return new(fastReflection_MsgCreateOracleScript) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateOracleScript) Interface() protoreflect.ProtoMessage { + return (*MsgCreateOracleScript)(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_MsgCreateOracleScript) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Name != "" { + value := protoreflect.ValueOfString(x.Name) + if !f(fd_MsgCreateOracleScript_name, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_MsgCreateOracleScript_description, value) { + return + } + } + if x.Schema != "" { + value := protoreflect.ValueOfString(x.Schema) + if !f(fd_MsgCreateOracleScript_schema, value) { + return + } + } + if x.SourceCodeUrl != "" { + value := protoreflect.ValueOfString(x.SourceCodeUrl) + if !f(fd_MsgCreateOracleScript_source_code_url, value) { + return + } + } + if len(x.Code) != 0 { + value := protoreflect.ValueOfBytes(x.Code) + if !f(fd_MsgCreateOracleScript_code, value) { + return + } + } + if x.Owner != "" { + value := protoreflect.ValueOfString(x.Owner) + if !f(fd_MsgCreateOracleScript_owner, value) { + return + } + } + if x.Sender != "" { + value := protoreflect.ValueOfString(x.Sender) + if !f(fd_MsgCreateOracleScript_sender, 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_MsgCreateOracleScript) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.MsgCreateOracleScript.name": + return x.Name != "" + case "oracle.v1.MsgCreateOracleScript.description": + return x.Description != "" + case "oracle.v1.MsgCreateOracleScript.schema": + return x.Schema != "" + case "oracle.v1.MsgCreateOracleScript.source_code_url": + return x.SourceCodeUrl != "" + case "oracle.v1.MsgCreateOracleScript.code": + return len(x.Code) != 0 + case "oracle.v1.MsgCreateOracleScript.owner": + return x.Owner != "" + case "oracle.v1.MsgCreateOracleScript.sender": + return x.Sender != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateOracleScript")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateOracleScript 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_MsgCreateOracleScript) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.MsgCreateOracleScript.name": + x.Name = "" + case "oracle.v1.MsgCreateOracleScript.description": + x.Description = "" + case "oracle.v1.MsgCreateOracleScript.schema": + x.Schema = "" + case "oracle.v1.MsgCreateOracleScript.source_code_url": + x.SourceCodeUrl = "" + case "oracle.v1.MsgCreateOracleScript.code": + x.Code = nil + case "oracle.v1.MsgCreateOracleScript.owner": + x.Owner = "" + case "oracle.v1.MsgCreateOracleScript.sender": + x.Sender = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateOracleScript")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateOracleScript 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_MsgCreateOracleScript) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.MsgCreateOracleScript.name": + value := x.Name + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgCreateOracleScript.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgCreateOracleScript.schema": + value := x.Schema + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgCreateOracleScript.source_code_url": + value := x.SourceCodeUrl + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgCreateOracleScript.code": + value := x.Code + return protoreflect.ValueOfBytes(value) + case "oracle.v1.MsgCreateOracleScript.owner": + value := x.Owner + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgCreateOracleScript.sender": + value := x.Sender + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateOracleScript")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateOracleScript 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_MsgCreateOracleScript) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.MsgCreateOracleScript.name": + x.Name = value.Interface().(string) + case "oracle.v1.MsgCreateOracleScript.description": + x.Description = value.Interface().(string) + case "oracle.v1.MsgCreateOracleScript.schema": + x.Schema = value.Interface().(string) + case "oracle.v1.MsgCreateOracleScript.source_code_url": + x.SourceCodeUrl = value.Interface().(string) + case "oracle.v1.MsgCreateOracleScript.code": + x.Code = value.Bytes() + case "oracle.v1.MsgCreateOracleScript.owner": + x.Owner = value.Interface().(string) + case "oracle.v1.MsgCreateOracleScript.sender": + x.Sender = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateOracleScript")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateOracleScript 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_MsgCreateOracleScript) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgCreateOracleScript.name": + panic(fmt.Errorf("field name of message oracle.v1.MsgCreateOracleScript is not mutable")) + case "oracle.v1.MsgCreateOracleScript.description": + panic(fmt.Errorf("field description of message oracle.v1.MsgCreateOracleScript is not mutable")) + case "oracle.v1.MsgCreateOracleScript.schema": + panic(fmt.Errorf("field schema of message oracle.v1.MsgCreateOracleScript is not mutable")) + case "oracle.v1.MsgCreateOracleScript.source_code_url": + panic(fmt.Errorf("field source_code_url of message oracle.v1.MsgCreateOracleScript is not mutable")) + case "oracle.v1.MsgCreateOracleScript.code": + panic(fmt.Errorf("field code of message oracle.v1.MsgCreateOracleScript is not mutable")) + case "oracle.v1.MsgCreateOracleScript.owner": + panic(fmt.Errorf("field owner of message oracle.v1.MsgCreateOracleScript is not mutable")) + case "oracle.v1.MsgCreateOracleScript.sender": + panic(fmt.Errorf("field sender of message oracle.v1.MsgCreateOracleScript is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateOracleScript")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateOracleScript 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_MsgCreateOracleScript) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgCreateOracleScript.name": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgCreateOracleScript.description": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgCreateOracleScript.schema": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgCreateOracleScript.source_code_url": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgCreateOracleScript.code": + return protoreflect.ValueOfBytes(nil) + case "oracle.v1.MsgCreateOracleScript.owner": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgCreateOracleScript.sender": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateOracleScript")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateOracleScript 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_MsgCreateOracleScript) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgCreateOracleScript", 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_MsgCreateOracleScript) 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_MsgCreateOracleScript) 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_MsgCreateOracleScript) 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_MsgCreateOracleScript) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateOracleScript) + 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.Name) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Schema) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.SourceCodeUrl) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Code) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Owner) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Sender) + 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().(*MsgCreateOracleScript) + 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.Sender) > 0 { + i -= len(x.Sender) + copy(dAtA[i:], x.Sender) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) + i-- + dAtA[i] = 0x3a + } + if len(x.Owner) > 0 { + i -= len(x.Owner) + copy(dAtA[i:], x.Owner) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Owner))) + i-- + dAtA[i] = 0x32 + } + if len(x.Code) > 0 { + i -= len(x.Code) + copy(dAtA[i:], x.Code) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Code))) + i-- + dAtA[i] = 0x2a + } + if len(x.SourceCodeUrl) > 0 { + i -= len(x.SourceCodeUrl) + copy(dAtA[i:], x.SourceCodeUrl) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SourceCodeUrl))) + i-- + dAtA[i] = 0x22 + } + if len(x.Schema) > 0 { + i -= len(x.Schema) + copy(dAtA[i:], x.Schema) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Schema))) + i-- + dAtA[i] = 0x1a + } + if len(x.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x12 + } + if len(x.Name) > 0 { + i -= len(x.Name) + copy(dAtA[i:], x.Name) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) + 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().(*MsgCreateOracleScript) + 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: MsgCreateOracleScript: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateOracleScript: 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 Name", 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.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Schema", 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.Schema = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SourceCodeUrl", 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.SourceCodeUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Code", 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.Code = append(x.Code[:0], dAtA[iNdEx:postIndex]...) + if x.Code == nil { + x.Code = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = 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_MsgCreateOracleScriptResponse protoreflect.MessageDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgCreateOracleScriptResponse = File_oracle_v1_tx_proto.Messages().ByName("MsgCreateOracleScriptResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateOracleScriptResponse)(nil) + +type fastReflection_MsgCreateOracleScriptResponse MsgCreateOracleScriptResponse + +func (x *MsgCreateOracleScriptResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateOracleScriptResponse)(x) +} + +func (x *MsgCreateOracleScriptResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_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_MsgCreateOracleScriptResponse_messageType fastReflection_MsgCreateOracleScriptResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateOracleScriptResponse_messageType{} + +type fastReflection_MsgCreateOracleScriptResponse_messageType struct{} + +func (x fastReflection_MsgCreateOracleScriptResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateOracleScriptResponse)(nil) +} +func (x fastReflection_MsgCreateOracleScriptResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateOracleScriptResponse) +} +func (x fastReflection_MsgCreateOracleScriptResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateOracleScriptResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateOracleScriptResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateOracleScriptResponse +} + +// 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_MsgCreateOracleScriptResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateOracleScriptResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateOracleScriptResponse) New() protoreflect.Message { + return new(fastReflection_MsgCreateOracleScriptResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateOracleScriptResponse) Interface() protoreflect.ProtoMessage { + return (*MsgCreateOracleScriptResponse)(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_MsgCreateOracleScriptResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgCreateOracleScriptResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateOracleScriptResponse 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_MsgCreateOracleScriptResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateOracleScriptResponse 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_MsgCreateOracleScriptResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateOracleScriptResponse 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_MsgCreateOracleScriptResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateOracleScriptResponse 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_MsgCreateOracleScriptResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateOracleScriptResponse 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_MsgCreateOracleScriptResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgCreateOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgCreateOracleScriptResponse 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_MsgCreateOracleScriptResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgCreateOracleScriptResponse", 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_MsgCreateOracleScriptResponse) 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_MsgCreateOracleScriptResponse) 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_MsgCreateOracleScriptResponse) 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_MsgCreateOracleScriptResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateOracleScriptResponse) + 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.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().(*MsgCreateOracleScriptResponse) + 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 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().(*MsgCreateOracleScriptResponse) + 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: MsgCreateOracleScriptResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateOracleScriptResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_MsgEditOracleScript protoreflect.MessageDescriptor + fd_MsgEditOracleScript_oracle_script_id protoreflect.FieldDescriptor + fd_MsgEditOracleScript_name protoreflect.FieldDescriptor + fd_MsgEditOracleScript_description protoreflect.FieldDescriptor + fd_MsgEditOracleScript_schema protoreflect.FieldDescriptor + fd_MsgEditOracleScript_source_code_url protoreflect.FieldDescriptor + fd_MsgEditOracleScript_code protoreflect.FieldDescriptor + fd_MsgEditOracleScript_owner protoreflect.FieldDescriptor + fd_MsgEditOracleScript_sender protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgEditOracleScript = File_oracle_v1_tx_proto.Messages().ByName("MsgEditOracleScript") + fd_MsgEditOracleScript_oracle_script_id = md_MsgEditOracleScript.Fields().ByName("oracle_script_id") + fd_MsgEditOracleScript_name = md_MsgEditOracleScript.Fields().ByName("name") + fd_MsgEditOracleScript_description = md_MsgEditOracleScript.Fields().ByName("description") + fd_MsgEditOracleScript_schema = md_MsgEditOracleScript.Fields().ByName("schema") + fd_MsgEditOracleScript_source_code_url = md_MsgEditOracleScript.Fields().ByName("source_code_url") + fd_MsgEditOracleScript_code = md_MsgEditOracleScript.Fields().ByName("code") + fd_MsgEditOracleScript_owner = md_MsgEditOracleScript.Fields().ByName("owner") + fd_MsgEditOracleScript_sender = md_MsgEditOracleScript.Fields().ByName("sender") +} + +var _ protoreflect.Message = (*fastReflection_MsgEditOracleScript)(nil) + +type fastReflection_MsgEditOracleScript MsgEditOracleScript + +func (x *MsgEditOracleScript) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgEditOracleScript)(x) +} + +func (x *MsgEditOracleScript) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_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_MsgEditOracleScript_messageType fastReflection_MsgEditOracleScript_messageType +var _ protoreflect.MessageType = fastReflection_MsgEditOracleScript_messageType{} + +type fastReflection_MsgEditOracleScript_messageType struct{} + +func (x fastReflection_MsgEditOracleScript_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgEditOracleScript)(nil) +} +func (x fastReflection_MsgEditOracleScript_messageType) New() protoreflect.Message { + return new(fastReflection_MsgEditOracleScript) +} +func (x fastReflection_MsgEditOracleScript_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEditOracleScript +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgEditOracleScript) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEditOracleScript +} + +// 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_MsgEditOracleScript) Type() protoreflect.MessageType { + return _fastReflection_MsgEditOracleScript_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgEditOracleScript) New() protoreflect.Message { + return new(fastReflection_MsgEditOracleScript) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgEditOracleScript) Interface() protoreflect.ProtoMessage { + return (*MsgEditOracleScript)(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_MsgEditOracleScript) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.OracleScriptId != uint64(0) { + value := protoreflect.ValueOfUint64(x.OracleScriptId) + if !f(fd_MsgEditOracleScript_oracle_script_id, value) { + return + } + } + if x.Name != "" { + value := protoreflect.ValueOfString(x.Name) + if !f(fd_MsgEditOracleScript_name, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_MsgEditOracleScript_description, value) { + return + } + } + if x.Schema != "" { + value := protoreflect.ValueOfString(x.Schema) + if !f(fd_MsgEditOracleScript_schema, value) { + return + } + } + if x.SourceCodeUrl != "" { + value := protoreflect.ValueOfString(x.SourceCodeUrl) + if !f(fd_MsgEditOracleScript_source_code_url, value) { + return + } + } + if len(x.Code) != 0 { + value := protoreflect.ValueOfBytes(x.Code) + if !f(fd_MsgEditOracleScript_code, value) { + return + } + } + if x.Owner != "" { + value := protoreflect.ValueOfString(x.Owner) + if !f(fd_MsgEditOracleScript_owner, value) { + return + } + } + if x.Sender != "" { + value := protoreflect.ValueOfString(x.Sender) + if !f(fd_MsgEditOracleScript_sender, 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_MsgEditOracleScript) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.MsgEditOracleScript.oracle_script_id": + return x.OracleScriptId != uint64(0) + case "oracle.v1.MsgEditOracleScript.name": + return x.Name != "" + case "oracle.v1.MsgEditOracleScript.description": + return x.Description != "" + case "oracle.v1.MsgEditOracleScript.schema": + return x.Schema != "" + case "oracle.v1.MsgEditOracleScript.source_code_url": + return x.SourceCodeUrl != "" + case "oracle.v1.MsgEditOracleScript.code": + return len(x.Code) != 0 + case "oracle.v1.MsgEditOracleScript.owner": + return x.Owner != "" + case "oracle.v1.MsgEditOracleScript.sender": + return x.Sender != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditOracleScript")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditOracleScript 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_MsgEditOracleScript) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.MsgEditOracleScript.oracle_script_id": + x.OracleScriptId = uint64(0) + case "oracle.v1.MsgEditOracleScript.name": + x.Name = "" + case "oracle.v1.MsgEditOracleScript.description": + x.Description = "" + case "oracle.v1.MsgEditOracleScript.schema": + x.Schema = "" + case "oracle.v1.MsgEditOracleScript.source_code_url": + x.SourceCodeUrl = "" + case "oracle.v1.MsgEditOracleScript.code": + x.Code = nil + case "oracle.v1.MsgEditOracleScript.owner": + x.Owner = "" + case "oracle.v1.MsgEditOracleScript.sender": + x.Sender = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditOracleScript")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditOracleScript 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_MsgEditOracleScript) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.MsgEditOracleScript.oracle_script_id": + value := x.OracleScriptId + return protoreflect.ValueOfUint64(value) + case "oracle.v1.MsgEditOracleScript.name": + value := x.Name + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgEditOracleScript.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgEditOracleScript.schema": + value := x.Schema + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgEditOracleScript.source_code_url": + value := x.SourceCodeUrl + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgEditOracleScript.code": + value := x.Code + return protoreflect.ValueOfBytes(value) + case "oracle.v1.MsgEditOracleScript.owner": + value := x.Owner + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgEditOracleScript.sender": + value := x.Sender + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditOracleScript")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditOracleScript 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_MsgEditOracleScript) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.MsgEditOracleScript.oracle_script_id": + x.OracleScriptId = value.Uint() + case "oracle.v1.MsgEditOracleScript.name": + x.Name = value.Interface().(string) + case "oracle.v1.MsgEditOracleScript.description": + x.Description = value.Interface().(string) + case "oracle.v1.MsgEditOracleScript.schema": + x.Schema = value.Interface().(string) + case "oracle.v1.MsgEditOracleScript.source_code_url": + x.SourceCodeUrl = value.Interface().(string) + case "oracle.v1.MsgEditOracleScript.code": + x.Code = value.Bytes() + case "oracle.v1.MsgEditOracleScript.owner": + x.Owner = value.Interface().(string) + case "oracle.v1.MsgEditOracleScript.sender": + x.Sender = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditOracleScript")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditOracleScript 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_MsgEditOracleScript) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgEditOracleScript.oracle_script_id": + panic(fmt.Errorf("field oracle_script_id of message oracle.v1.MsgEditOracleScript is not mutable")) + case "oracle.v1.MsgEditOracleScript.name": + panic(fmt.Errorf("field name of message oracle.v1.MsgEditOracleScript is not mutable")) + case "oracle.v1.MsgEditOracleScript.description": + panic(fmt.Errorf("field description of message oracle.v1.MsgEditOracleScript is not mutable")) + case "oracle.v1.MsgEditOracleScript.schema": + panic(fmt.Errorf("field schema of message oracle.v1.MsgEditOracleScript is not mutable")) + case "oracle.v1.MsgEditOracleScript.source_code_url": + panic(fmt.Errorf("field source_code_url of message oracle.v1.MsgEditOracleScript is not mutable")) + case "oracle.v1.MsgEditOracleScript.code": + panic(fmt.Errorf("field code of message oracle.v1.MsgEditOracleScript is not mutable")) + case "oracle.v1.MsgEditOracleScript.owner": + panic(fmt.Errorf("field owner of message oracle.v1.MsgEditOracleScript is not mutable")) + case "oracle.v1.MsgEditOracleScript.sender": + panic(fmt.Errorf("field sender of message oracle.v1.MsgEditOracleScript is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditOracleScript")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditOracleScript 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_MsgEditOracleScript) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgEditOracleScript.oracle_script_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "oracle.v1.MsgEditOracleScript.name": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgEditOracleScript.description": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgEditOracleScript.schema": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgEditOracleScript.source_code_url": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgEditOracleScript.code": + return protoreflect.ValueOfBytes(nil) + case "oracle.v1.MsgEditOracleScript.owner": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgEditOracleScript.sender": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditOracleScript")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditOracleScript 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_MsgEditOracleScript) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgEditOracleScript", 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_MsgEditOracleScript) 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_MsgEditOracleScript) 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_MsgEditOracleScript) 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_MsgEditOracleScript) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgEditOracleScript) + 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.OracleScriptId != 0 { + n += 1 + runtime.Sov(uint64(x.OracleScriptId)) + } + l = len(x.Name) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Schema) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.SourceCodeUrl) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Code) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Owner) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Sender) + 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().(*MsgEditOracleScript) + 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.Sender) > 0 { + i -= len(x.Sender) + copy(dAtA[i:], x.Sender) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) + i-- + dAtA[i] = 0x42 + } + if len(x.Owner) > 0 { + i -= len(x.Owner) + copy(dAtA[i:], x.Owner) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Owner))) + i-- + dAtA[i] = 0x3a + } + if len(x.Code) > 0 { + i -= len(x.Code) + copy(dAtA[i:], x.Code) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Code))) + i-- + dAtA[i] = 0x32 + } + if len(x.SourceCodeUrl) > 0 { + i -= len(x.SourceCodeUrl) + copy(dAtA[i:], x.SourceCodeUrl) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SourceCodeUrl))) + i-- + dAtA[i] = 0x2a + } + if len(x.Schema) > 0 { + i -= len(x.Schema) + copy(dAtA[i:], x.Schema) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Schema))) + i-- + dAtA[i] = 0x22 + } + if len(x.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x1a + } + if len(x.Name) > 0 { + i -= len(x.Name) + copy(dAtA[i:], x.Name) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) + i-- + dAtA[i] = 0x12 + } + if x.OracleScriptId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.OracleScriptId)) + i-- + dAtA[i] = 0x8 + } + 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().(*MsgEditOracleScript) + 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: MsgEditOracleScript: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEditOracleScript: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OracleScriptId", wireType) + } + x.OracleScriptId = 0 + 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++ + x.OracleScriptId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Name", 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.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Schema", 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.Schema = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SourceCodeUrl", 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.SourceCodeUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Code", 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.Code = append(x.Code[:0], dAtA[iNdEx:postIndex]...) + if x.Code == nil { + x.Code = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = 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_MsgEditOracleScriptResponse protoreflect.MessageDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgEditOracleScriptResponse = File_oracle_v1_tx_proto.Messages().ByName("MsgEditOracleScriptResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgEditOracleScriptResponse)(nil) + +type fastReflection_MsgEditOracleScriptResponse MsgEditOracleScriptResponse + +func (x *MsgEditOracleScriptResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgEditOracleScriptResponse)(x) +} + +func (x *MsgEditOracleScriptResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_proto_msgTypes[11] + 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_MsgEditOracleScriptResponse_messageType fastReflection_MsgEditOracleScriptResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgEditOracleScriptResponse_messageType{} + +type fastReflection_MsgEditOracleScriptResponse_messageType struct{} + +func (x fastReflection_MsgEditOracleScriptResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgEditOracleScriptResponse)(nil) +} +func (x fastReflection_MsgEditOracleScriptResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgEditOracleScriptResponse) +} +func (x fastReflection_MsgEditOracleScriptResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEditOracleScriptResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgEditOracleScriptResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEditOracleScriptResponse +} + +// 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_MsgEditOracleScriptResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgEditOracleScriptResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgEditOracleScriptResponse) New() protoreflect.Message { + return new(fastReflection_MsgEditOracleScriptResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgEditOracleScriptResponse) Interface() protoreflect.ProtoMessage { + return (*MsgEditOracleScriptResponse)(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_MsgEditOracleScriptResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgEditOracleScriptResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditOracleScriptResponse 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_MsgEditOracleScriptResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditOracleScriptResponse 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_MsgEditOracleScriptResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditOracleScriptResponse 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_MsgEditOracleScriptResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditOracleScriptResponse 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_MsgEditOracleScriptResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditOracleScriptResponse 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_MsgEditOracleScriptResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgEditOracleScriptResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgEditOracleScriptResponse 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_MsgEditOracleScriptResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgEditOracleScriptResponse", 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_MsgEditOracleScriptResponse) 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_MsgEditOracleScriptResponse) 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_MsgEditOracleScriptResponse) 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_MsgEditOracleScriptResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgEditOracleScriptResponse) + 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.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().(*MsgEditOracleScriptResponse) + 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 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().(*MsgEditOracleScriptResponse) + 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: MsgEditOracleScriptResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEditOracleScriptResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_MsgActivate protoreflect.MessageDescriptor + fd_MsgActivate_validator protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgActivate = File_oracle_v1_tx_proto.Messages().ByName("MsgActivate") + fd_MsgActivate_validator = md_MsgActivate.Fields().ByName("validator") +} + +var _ protoreflect.Message = (*fastReflection_MsgActivate)(nil) + +type fastReflection_MsgActivate MsgActivate + +func (x *MsgActivate) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgActivate)(x) +} + +func (x *MsgActivate) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_proto_msgTypes[12] + 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_MsgActivate_messageType fastReflection_MsgActivate_messageType +var _ protoreflect.MessageType = fastReflection_MsgActivate_messageType{} + +type fastReflection_MsgActivate_messageType struct{} + +func (x fastReflection_MsgActivate_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgActivate)(nil) +} +func (x fastReflection_MsgActivate_messageType) New() protoreflect.Message { + return new(fastReflection_MsgActivate) +} +func (x fastReflection_MsgActivate_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgActivate +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgActivate) Descriptor() protoreflect.MessageDescriptor { + return md_MsgActivate +} + +// 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_MsgActivate) Type() protoreflect.MessageType { + return _fastReflection_MsgActivate_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgActivate) New() protoreflect.Message { + return new(fastReflection_MsgActivate) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgActivate) Interface() protoreflect.ProtoMessage { + return (*MsgActivate)(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_MsgActivate) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Validator != "" { + value := protoreflect.ValueOfString(x.Validator) + if !f(fd_MsgActivate_validator, 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_MsgActivate) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.MsgActivate.validator": + return x.Validator != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgActivate")) + } + panic(fmt.Errorf("message oracle.v1.MsgActivate 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_MsgActivate) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.MsgActivate.validator": + x.Validator = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgActivate")) + } + panic(fmt.Errorf("message oracle.v1.MsgActivate 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_MsgActivate) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.MsgActivate.validator": + value := x.Validator + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgActivate")) + } + panic(fmt.Errorf("message oracle.v1.MsgActivate 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_MsgActivate) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.MsgActivate.validator": + x.Validator = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgActivate")) + } + panic(fmt.Errorf("message oracle.v1.MsgActivate 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_MsgActivate) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgActivate.validator": + panic(fmt.Errorf("field validator of message oracle.v1.MsgActivate is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgActivate")) + } + panic(fmt.Errorf("message oracle.v1.MsgActivate 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_MsgActivate) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgActivate.validator": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgActivate")) + } + panic(fmt.Errorf("message oracle.v1.MsgActivate 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_MsgActivate) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgActivate", 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_MsgActivate) 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_MsgActivate) 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_MsgActivate) 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_MsgActivate) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgActivate) + 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.Validator) + 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().(*MsgActivate) + 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.Validator) > 0 { + i -= len(x.Validator) + copy(dAtA[i:], x.Validator) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Validator))) + 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().(*MsgActivate) + 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: MsgActivate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgActivate: 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 Validator", 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.Validator = 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_MsgActivateResponse protoreflect.MessageDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgActivateResponse = File_oracle_v1_tx_proto.Messages().ByName("MsgActivateResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgActivateResponse)(nil) + +type fastReflection_MsgActivateResponse MsgActivateResponse + +func (x *MsgActivateResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgActivateResponse)(x) +} + +func (x *MsgActivateResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_proto_msgTypes[13] + 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_MsgActivateResponse_messageType fastReflection_MsgActivateResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgActivateResponse_messageType{} + +type fastReflection_MsgActivateResponse_messageType struct{} + +func (x fastReflection_MsgActivateResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgActivateResponse)(nil) +} +func (x fastReflection_MsgActivateResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgActivateResponse) +} +func (x fastReflection_MsgActivateResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgActivateResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgActivateResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgActivateResponse +} + +// 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_MsgActivateResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgActivateResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgActivateResponse) New() protoreflect.Message { + return new(fastReflection_MsgActivateResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgActivateResponse) Interface() protoreflect.ProtoMessage { + return (*MsgActivateResponse)(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_MsgActivateResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgActivateResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgActivateResponse 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_MsgActivateResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgActivateResponse 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_MsgActivateResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgActivateResponse 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_MsgActivateResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgActivateResponse 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_MsgActivateResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgActivateResponse 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_MsgActivateResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgActivateResponse 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_MsgActivateResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgActivateResponse", 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_MsgActivateResponse) 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_MsgActivateResponse) 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_MsgActivateResponse) 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_MsgActivateResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgActivateResponse) + 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.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().(*MsgActivateResponse) + 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 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().(*MsgActivateResponse) + 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: MsgActivateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgActivateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgUpdateParams = File_oracle_v1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_proto_msgTypes[14] + 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_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// 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_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(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_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, 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_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "oracle.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "oracle.v1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message oracle.v1.MsgUpdateParams 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_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "oracle.v1.MsgUpdateParams.authority": + x.Authority = "" + case "oracle.v1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message oracle.v1.MsgUpdateParams 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_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "oracle.v1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "oracle.v1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message oracle.v1.MsgUpdateParams 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_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "oracle.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "oracle.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message oracle.v1.MsgUpdateParams 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_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "oracle.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message oracle.v1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message oracle.v1.MsgUpdateParams 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_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "oracle.v1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "oracle.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message oracle.v1.MsgUpdateParams 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_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgUpdateParams", 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + 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.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + 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().(*MsgUpdateParams) + 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.Params != nil { + encoded, err := options.Marshal(x.Params) + 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 len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + 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().(*MsgUpdateParams) + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: 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 Authority", 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.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_oracle_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_oracle_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_oracle_v1_tx_proto_msgTypes[15] + 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_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// 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_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(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_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message oracle.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgUpdateParamsResponse", 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + 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.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().(*MsgUpdateParamsResponse) + 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 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().(*MsgUpdateParamsResponse) + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: oracle/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgRequestData is a message for sending a data oracle request. +type MsgRequestData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // OracleScriptID is the identifier of the oracle script to be called. + OracleScriptId uint64 `protobuf:"varint,1,opt,name=oracle_script_id,json=oracleScriptId,proto3" json:"oracle_script_id,omitempty"` + // Calldata is the OBI-encoded call parameters for the oracle script. + Calldata []byte `protobuf:"bytes,2,opt,name=calldata,proto3" json:"calldata,omitempty"` + // AskCount is the number of validators to perform the oracle task. + AskCount uint64 `protobuf:"varint,3,opt,name=ask_count,json=askCount,proto3" json:"ask_count,omitempty"` + // MinCount is the minimum number of validators sufficient to resolve the + // oracle tasks. + MinCount uint64 `protobuf:"varint,4,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty"` + // ClientID is the client-provided unique identifier to track the request. + ClientId string `protobuf:"bytes,5,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + // FeeLimit is the maximum tokens that will be paid to all data source + // providers. + FeeLimit []*v1beta1.Coin `protobuf:"bytes,6,rep,name=fee_limit,json=feeLimit,proto3" json:"fee_limit,omitempty"` + // PrepareGas is amount of gas to pay to prepare raw requests + PrepareGas uint64 `protobuf:"varint,7,opt,name=prepare_gas,json=prepareGas,proto3" json:"prepare_gas,omitempty"` + // ExecuteGas is amount of gas to reserve for executing + ExecuteGas uint64 `protobuf:"varint,8,opt,name=execute_gas,json=executeGas,proto3" json:"execute_gas,omitempty"` + // Sender is an account address of message sender. + Sender string `protobuf:"bytes,9,opt,name=sender,proto3" json:"sender,omitempty"` +} + +func (x *MsgRequestData) Reset() { + *x = MsgRequestData{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRequestData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRequestData) ProtoMessage() {} + +// Deprecated: Use MsgRequestData.ProtoReflect.Descriptor instead. +func (*MsgRequestData) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgRequestData) GetOracleScriptId() uint64 { + if x != nil { + return x.OracleScriptId + } + return 0 +} + +func (x *MsgRequestData) GetCalldata() []byte { + if x != nil { + return x.Calldata + } + return nil +} + +func (x *MsgRequestData) GetAskCount() uint64 { + if x != nil { + return x.AskCount + } + return 0 +} + +func (x *MsgRequestData) GetMinCount() uint64 { + if x != nil { + return x.MinCount + } + return 0 +} + +func (x *MsgRequestData) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *MsgRequestData) GetFeeLimit() []*v1beta1.Coin { + if x != nil { + return x.FeeLimit + } + return nil +} + +func (x *MsgRequestData) GetPrepareGas() uint64 { + if x != nil { + return x.PrepareGas + } + return 0 +} + +func (x *MsgRequestData) GetExecuteGas() uint64 { + if x != nil { + return x.ExecuteGas + } + return 0 +} + +func (x *MsgRequestData) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +// MsgRequestDataResponse is response data for MsgRequestData message +type MsgRequestDataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgRequestDataResponse) Reset() { + *x = MsgRequestDataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRequestDataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRequestDataResponse) ProtoMessage() {} + +// Deprecated: Use MsgRequestDataResponse.ProtoReflect.Descriptor instead. +func (*MsgRequestDataResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{1} +} + +// MsgReportData is a message for reporting to a data request by a validator. +type MsgReportData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // RequestID is the identifier of the request to be reported to. + RequestId uint64 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + // RawReports is the list of report information provided by data sources + // identified by external ID + RawReports []*RawReport `protobuf:"bytes,2,rep,name=raw_reports,json=rawReports,proto3" json:"raw_reports,omitempty"` + // Validator is the address of the validator that owns this report. + Validator string `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator,omitempty"` +} + +func (x *MsgReportData) Reset() { + *x = MsgReportData{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgReportData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgReportData) ProtoMessage() {} + +// Deprecated: Use MsgReportData.ProtoReflect.Descriptor instead. +func (*MsgReportData) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgReportData) GetRequestId() uint64 { + if x != nil { + return x.RequestId + } + return 0 +} + +func (x *MsgReportData) GetRawReports() []*RawReport { + if x != nil { + return x.RawReports + } + return nil +} + +func (x *MsgReportData) GetValidator() string { + if x != nil { + return x.Validator + } + return "" +} + +// MsgReportDataResponse is response data for MsgReportData message +type MsgReportDataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgReportDataResponse) Reset() { + *x = MsgReportDataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgReportDataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgReportDataResponse) ProtoMessage() {} + +// Deprecated: Use MsgReportDataResponse.ProtoReflect.Descriptor instead. +func (*MsgReportDataResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{3} +} + +// MsgCreateDataSource is a message for creating a new data source. +type MsgCreateDataSource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name is the name of this data source used for display (optional). + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Description is the description of this data source used for display + // (optional). + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // Executable is the content of executable script or binary file to be run by + // validators upon execution. + Executable []byte `protobuf:"bytes,3,opt,name=executable,proto3" json:"executable,omitempty"` + // Fee is the data source fee per ask_count that data provider will receive + // from requester. + Fee []*v1beta1.Coin `protobuf:"bytes,4,rep,name=fee,proto3" json:"fee,omitempty"` + // Treasury is the account address who receive data source fee from requester. + Treasury string `protobuf:"bytes,5,opt,name=treasury,proto3" json:"treasury,omitempty"` + // Owner is the account address who is allowed to make further changes to the + // data source. + Owner string `protobuf:"bytes,6,opt,name=owner,proto3" json:"owner,omitempty"` + // Sender is the signer of this message. + Sender string `protobuf:"bytes,7,opt,name=sender,proto3" json:"sender,omitempty"` +} + +func (x *MsgCreateDataSource) Reset() { + *x = MsgCreateDataSource{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateDataSource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateDataSource) ProtoMessage() {} + +// Deprecated: Use MsgCreateDataSource.ProtoReflect.Descriptor instead. +func (*MsgCreateDataSource) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgCreateDataSource) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *MsgCreateDataSource) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *MsgCreateDataSource) GetExecutable() []byte { + if x != nil { + return x.Executable + } + return nil +} + +func (x *MsgCreateDataSource) GetFee() []*v1beta1.Coin { + if x != nil { + return x.Fee + } + return nil +} + +func (x *MsgCreateDataSource) GetTreasury() string { + if x != nil { + return x.Treasury + } + return "" +} + +func (x *MsgCreateDataSource) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *MsgCreateDataSource) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +// MsgCreateDataSourceResponse is response data for MsgCreateDataSource message +type MsgCreateDataSourceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgCreateDataSourceResponse) Reset() { + *x = MsgCreateDataSourceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateDataSourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateDataSourceResponse) ProtoMessage() {} + +// Deprecated: Use MsgCreateDataSourceResponse.ProtoReflect.Descriptor instead. +func (*MsgCreateDataSourceResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{5} +} + +// MsgEditDataSource is a message for editing an existing data source. +type MsgEditDataSource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // DataSourceID is the unique identifier of the data source to be edited. + DataSourceId uint64 `protobuf:"varint,1,opt,name=data_source_id,json=dataSourceId,proto3" json:"data_source_id,omitempty"` + // Name is the name of this data source used for display (optional). + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Description is the description of this data source used for display + // (optional). + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // Executable is the executable script or binary to be run by validators upon + // execution. + Executable []byte `protobuf:"bytes,4,opt,name=executable,proto3" json:"executable,omitempty"` + // Fee is the data source fee per ask_count that data provider will receive + // from requester. + Fee []*v1beta1.Coin `protobuf:"bytes,5,rep,name=fee,proto3" json:"fee,omitempty"` + // Treasury is the address who receive data source fee from requester. + Treasury string `protobuf:"bytes,6,opt,name=treasury,proto3" json:"treasury,omitempty"` + // Owner is the address who is allowed to make further changes to the data + // source. + Owner string `protobuf:"bytes,7,opt,name=owner,proto3" json:"owner,omitempty"` + // Sender is the signer of this message. Must be the current data source's + // owner. + Sender string `protobuf:"bytes,8,opt,name=sender,proto3" json:"sender,omitempty"` +} + +func (x *MsgEditDataSource) Reset() { + *x = MsgEditDataSource{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgEditDataSource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgEditDataSource) ProtoMessage() {} + +// Deprecated: Use MsgEditDataSource.ProtoReflect.Descriptor instead. +func (*MsgEditDataSource) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgEditDataSource) GetDataSourceId() uint64 { + if x != nil { + return x.DataSourceId + } + return 0 +} + +func (x *MsgEditDataSource) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *MsgEditDataSource) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *MsgEditDataSource) GetExecutable() []byte { + if x != nil { + return x.Executable + } + return nil +} + +func (x *MsgEditDataSource) GetFee() []*v1beta1.Coin { + if x != nil { + return x.Fee + } + return nil +} + +func (x *MsgEditDataSource) GetTreasury() string { + if x != nil { + return x.Treasury + } + return "" +} + +func (x *MsgEditDataSource) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *MsgEditDataSource) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +// MsgEditDataSourceResponse is response data for MsgEditDataSource message +type MsgEditDataSourceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgEditDataSourceResponse) Reset() { + *x = MsgEditDataSourceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgEditDataSourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgEditDataSourceResponse) ProtoMessage() {} + +// Deprecated: Use MsgEditDataSourceResponse.ProtoReflect.Descriptor instead. +func (*MsgEditDataSourceResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{7} +} + +// MsgCreateOracleScript is a message for creating an oracle script. +type MsgCreateOracleScript struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name is the name of this oracle script used for display (optional). + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Description is the description of this oracle script used for display + // (optional). + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // Schema is the OBI schema of this oracle script (optional). + Schema string `protobuf:"bytes,3,opt,name=schema,proto3" json:"schema,omitempty"` + // SourceCodeURL is the absolute URI to the script's source code (optional). + SourceCodeUrl string `protobuf:"bytes,4,opt,name=source_code_url,json=sourceCodeUrl,proto3" json:"source_code_url,omitempty"` + // Code is the oracle WebAssembly binary code. Can be raw of gzip compressed. + Code []byte `protobuf:"bytes,5,opt,name=code,proto3" json:"code,omitempty"` + // Owner is the address who is allowed to make further changes to the oracle + // script. + Owner string `protobuf:"bytes,6,opt,name=owner,proto3" json:"owner,omitempty"` + // Sender is the signer of this message. + Sender string `protobuf:"bytes,7,opt,name=sender,proto3" json:"sender,omitempty"` +} + +func (x *MsgCreateOracleScript) Reset() { + *x = MsgCreateOracleScript{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateOracleScript) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateOracleScript) ProtoMessage() {} + +// Deprecated: Use MsgCreateOracleScript.ProtoReflect.Descriptor instead. +func (*MsgCreateOracleScript) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{8} +} + +func (x *MsgCreateOracleScript) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *MsgCreateOracleScript) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *MsgCreateOracleScript) GetSchema() string { + if x != nil { + return x.Schema + } + return "" +} + +func (x *MsgCreateOracleScript) GetSourceCodeUrl() string { + if x != nil { + return x.SourceCodeUrl + } + return "" +} + +func (x *MsgCreateOracleScript) GetCode() []byte { + if x != nil { + return x.Code + } + return nil +} + +func (x *MsgCreateOracleScript) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *MsgCreateOracleScript) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +// MsgCreateOracleScriptResponse is response data for MsgCreateOracleScript +// message +type MsgCreateOracleScriptResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgCreateOracleScriptResponse) Reset() { + *x = MsgCreateOracleScriptResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateOracleScriptResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateOracleScriptResponse) ProtoMessage() {} + +// Deprecated: Use MsgCreateOracleScriptResponse.ProtoReflect.Descriptor instead. +func (*MsgCreateOracleScriptResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{9} +} + +// MsgEditOracleScript is a message for editing an existing oracle script. +type MsgEditOracleScript struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // OracleScriptID is the unique identifier of the oracle script to be edited. + OracleScriptId uint64 `protobuf:"varint,1,opt,name=oracle_script_id,json=oracleScriptId,proto3" json:"oracle_script_id,omitempty"` + // Name is the name of this oracle script used for display (optional). + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Description is the description of this oracle script used for display + // (optional). + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // Schema is the OBI schema of this oracle script (optional). + Schema string `protobuf:"bytes,4,opt,name=schema,proto3" json:"schema,omitempty"` + // SourceCodeURL is the absolute URI to the script's source code (optional). + SourceCodeUrl string `protobuf:"bytes,5,opt,name=source_code_url,json=sourceCodeUrl,proto3" json:"source_code_url,omitempty"` + // Code is the oracle WebAssembly binary code. Can be raw of gzip compressed. + Code []byte `protobuf:"bytes,6,opt,name=code,proto3" json:"code,omitempty"` + // Owner is an account address who is allowed to make further changes to the + // oracle script. + Owner string `protobuf:"bytes,7,opt,name=owner,proto3" json:"owner,omitempty"` + // Sender is an account address who sign this message. Must be the current + // oracle script's owner. + Sender string `protobuf:"bytes,8,opt,name=sender,proto3" json:"sender,omitempty"` +} + +func (x *MsgEditOracleScript) Reset() { + *x = MsgEditOracleScript{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgEditOracleScript) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgEditOracleScript) ProtoMessage() {} + +// Deprecated: Use MsgEditOracleScript.ProtoReflect.Descriptor instead. +func (*MsgEditOracleScript) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{10} +} + +func (x *MsgEditOracleScript) GetOracleScriptId() uint64 { + if x != nil { + return x.OracleScriptId + } + return 0 +} + +func (x *MsgEditOracleScript) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *MsgEditOracleScript) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *MsgEditOracleScript) GetSchema() string { + if x != nil { + return x.Schema + } + return "" +} + +func (x *MsgEditOracleScript) GetSourceCodeUrl() string { + if x != nil { + return x.SourceCodeUrl + } + return "" +} + +func (x *MsgEditOracleScript) GetCode() []byte { + if x != nil { + return x.Code + } + return nil +} + +func (x *MsgEditOracleScript) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *MsgEditOracleScript) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +// MsgEditOracleScriptResponse is response data for MsgEditOracleScript message +type MsgEditOracleScriptResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgEditOracleScriptResponse) Reset() { + *x = MsgEditOracleScriptResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgEditOracleScriptResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgEditOracleScriptResponse) ProtoMessage() {} + +// Deprecated: Use MsgEditOracleScriptResponse.ProtoReflect.Descriptor instead. +func (*MsgEditOracleScriptResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{11} +} + +// MsgEditOracleScript is a message for activating a validator to become an +// oracle provider. However, the activation can be revoked once the validator +// is unable to provide data to fulfill requests +type MsgActivate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Validator is the validator address who sign this message and request to be + // activated. + Validator string `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator,omitempty"` +} + +func (x *MsgActivate) Reset() { + *x = MsgActivate{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgActivate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgActivate) ProtoMessage() {} + +// Deprecated: Use MsgActivate.ProtoReflect.Descriptor instead. +func (*MsgActivate) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{12} +} + +func (x *MsgActivate) GetValidator() string { + if x != nil { + return x.Validator + } + return "" +} + +// MsgActivateResponse is response data for MsgActivate message +type MsgActivateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgActivateResponse) Reset() { + *x = MsgActivateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgActivateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgActivateResponse) ProtoMessage() {} + +// Deprecated: Use MsgActivateResponse.ProtoReflect.Descriptor instead. +func (*MsgActivateResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{13} +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/oracle parameters to update. + // + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{14} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_oracle_v1_tx_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_oracle_v1_tx_proto_rawDescGZIP(), []int{15} +} + +var File_oracle_v1_tx_proto protoreflect.FileDescriptor + +var file_oracle_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x12, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, + 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, + 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 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, 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, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 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, 0x22, 0xe3, 0x03, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x4e, 0x0a, 0x10, 0x6f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x24, 0xe2, 0xde, 0x1f, 0x0e, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x49, 0x44, 0xfa, 0xde, 0x1f, 0x0e, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x49, 0x44, 0x52, 0x0e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x73, 0x6b, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x29, 0x0a, + 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0c, 0xe2, 0xde, 0x1f, 0x08, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x52, 0x08, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x68, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x5f, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x08, 0x66, 0x65, 0x65, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x5f, 0x67, 0x61, + 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, + 0x47, 0x61, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x5f, 0x67, + 0x61, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x65, 0x47, 0x61, 0x73, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, + 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3a, 0x22, 0xe8, 0xa0, 0x1f, 0x01, 0x82, 0xe7, 0xb0, 0x2a, + 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x0e, 0x6f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x2f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x18, 0x0a, 0x16, 0x4d, 0x73, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xee, 0x01, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1a, 0xe2, 0xde, 0x1f, 0x09, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0xfa, 0xde, 0x1f, 0x09, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, + 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x72, 0x61, 0x77, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x61, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x0a, 0x72, 0x61, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x3f, + 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 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, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x3a, + 0x24, 0xe8, 0xa0, 0x1f, 0x01, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x0d, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x52, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x17, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8f, + 0x03, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0a, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x5d, 0x0a, 0x03, + 0x66, 0x65, 0x65, 0x18, 0x04, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, 0x34, 0x0a, 0x08, 0x74, + 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, + 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, + 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, + 0x72, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x3a, 0x2b, 0xe8, 0xa0, 0x1f, 0x01, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x17, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x22, 0x1d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, + 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0xd3, 0x03, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, 0x44, 0x61, 0x74, 0x61, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x46, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x20, 0xe2, + 0xde, 0x1f, 0x0c, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0xfa, + 0xde, 0x1f, 0x0c, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0x52, + 0x0c, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x12, 0x5d, 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x05, 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, 0x30, 0xc8, 0xde, 0x1f, + 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x03, 0x66, + 0x65, 0x65, 0x12, 0x34, 0x0a, 0x08, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x79, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x08, + 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, + 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3a, 0x29, 0xe8, 0xa0, 0x1f, 0x01, + 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x15, + 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x45, 0x64, 0x69, 0x74, 0x44, 0x61, 0x74, 0x61, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, + 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0xc5, 0x02, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x39, 0x0a, 0x0f, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x11, 0xe2, 0xde, 0x1f, 0x0d, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, + 0x6f, 0x64, 0x65, 0x55, 0x52, 0x4c, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, + 0x64, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x6f, 0x77, 0x6e, + 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3a, 0x2d, 0xe8, 0xa0, 0x1f, + 0x01, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, + 0x19, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x1f, 0x0a, 0x1d, 0x4d, 0x73, + 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x91, 0x03, 0x0a, 0x13, + 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x12, 0x4e, 0x0a, 0x10, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x24, 0xe2, + 0xde, 0x1f, 0x0e, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x49, + 0x44, 0xfa, 0xde, 0x1f, 0x0e, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x49, 0x44, 0x52, 0x0e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x12, 0x39, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x11, 0xe2, 0xde, 0x1f, 0x0d, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x55, 0x52, 0x4c, 0x52, 0x0d, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x12, 0x2e, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x12, 0x30, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x3a, 0x2b, 0xe8, 0xa0, 0x1f, 0x01, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x17, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x45, + 0x64, 0x69, 0x74, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, + 0x1d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, + 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x76, + 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x3f, 0x0a, + 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 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, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x3a, 0x26, + 0xe8, 0xa0, 0x1f, 0x01, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa2, 0x01, + 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2f, 0x0a, 0x06, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x26, 0x82, 0xe7, 0xb0, 0x2a, + 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x13, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xa7, 0x05, + 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x4b, 0x0a, 0x0b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x1a, + 0x21, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x18, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x20, 0x2e, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x10, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x1e, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x1a, 0x26, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x0e, 0x45, 0x64, 0x69, 0x74, + 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, 0x44, 0x61, + 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0x24, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, 0x44, 0x61, 0x74, 0x61, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, + 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x12, 0x20, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, + 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x1a, 0x28, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x5a, 0x0a, 0x10, 0x45, 0x64, 0x69, 0x74, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x12, 0x1e, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x1a, 0x26, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x53, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x08, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x1a, 0x1e, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x1a, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x22, 0x2e, 0x6f, + 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x96, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, + 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_oracle_v1_tx_proto_rawDescOnce sync.Once + file_oracle_v1_tx_proto_rawDescData = file_oracle_v1_tx_proto_rawDesc +) + +func file_oracle_v1_tx_proto_rawDescGZIP() []byte { + file_oracle_v1_tx_proto_rawDescOnce.Do(func() { + file_oracle_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_oracle_v1_tx_proto_rawDescData) + }) + return file_oracle_v1_tx_proto_rawDescData +} + +var file_oracle_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_oracle_v1_tx_proto_goTypes = []interface{}{ + (*MsgRequestData)(nil), // 0: oracle.v1.MsgRequestData + (*MsgRequestDataResponse)(nil), // 1: oracle.v1.MsgRequestDataResponse + (*MsgReportData)(nil), // 2: oracle.v1.MsgReportData + (*MsgReportDataResponse)(nil), // 3: oracle.v1.MsgReportDataResponse + (*MsgCreateDataSource)(nil), // 4: oracle.v1.MsgCreateDataSource + (*MsgCreateDataSourceResponse)(nil), // 5: oracle.v1.MsgCreateDataSourceResponse + (*MsgEditDataSource)(nil), // 6: oracle.v1.MsgEditDataSource + (*MsgEditDataSourceResponse)(nil), // 7: oracle.v1.MsgEditDataSourceResponse + (*MsgCreateOracleScript)(nil), // 8: oracle.v1.MsgCreateOracleScript + (*MsgCreateOracleScriptResponse)(nil), // 9: oracle.v1.MsgCreateOracleScriptResponse + (*MsgEditOracleScript)(nil), // 10: oracle.v1.MsgEditOracleScript + (*MsgEditOracleScriptResponse)(nil), // 11: oracle.v1.MsgEditOracleScriptResponse + (*MsgActivate)(nil), // 12: oracle.v1.MsgActivate + (*MsgActivateResponse)(nil), // 13: oracle.v1.MsgActivateResponse + (*MsgUpdateParams)(nil), // 14: oracle.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 15: oracle.v1.MsgUpdateParamsResponse + (*v1beta1.Coin)(nil), // 16: cosmos.base.v1beta1.Coin + (*RawReport)(nil), // 17: oracle.v1.RawReport + (*Params)(nil), // 18: oracle.v1.Params +} +var file_oracle_v1_tx_proto_depIdxs = []int32{ + 16, // 0: oracle.v1.MsgRequestData.fee_limit:type_name -> cosmos.base.v1beta1.Coin + 17, // 1: oracle.v1.MsgReportData.raw_reports:type_name -> oracle.v1.RawReport + 16, // 2: oracle.v1.MsgCreateDataSource.fee:type_name -> cosmos.base.v1beta1.Coin + 16, // 3: oracle.v1.MsgEditDataSource.fee:type_name -> cosmos.base.v1beta1.Coin + 18, // 4: oracle.v1.MsgUpdateParams.params:type_name -> oracle.v1.Params + 0, // 5: oracle.v1.Msg.RequestData:input_type -> oracle.v1.MsgRequestData + 2, // 6: oracle.v1.Msg.ReportData:input_type -> oracle.v1.MsgReportData + 4, // 7: oracle.v1.Msg.CreateDataSource:input_type -> oracle.v1.MsgCreateDataSource + 6, // 8: oracle.v1.Msg.EditDataSource:input_type -> oracle.v1.MsgEditDataSource + 8, // 9: oracle.v1.Msg.CreateOracleScript:input_type -> oracle.v1.MsgCreateOracleScript + 10, // 10: oracle.v1.Msg.EditOracleScript:input_type -> oracle.v1.MsgEditOracleScript + 12, // 11: oracle.v1.Msg.Activate:input_type -> oracle.v1.MsgActivate + 14, // 12: oracle.v1.Msg.UpdateParams:input_type -> oracle.v1.MsgUpdateParams + 1, // 13: oracle.v1.Msg.RequestData:output_type -> oracle.v1.MsgRequestDataResponse + 3, // 14: oracle.v1.Msg.ReportData:output_type -> oracle.v1.MsgReportDataResponse + 5, // 15: oracle.v1.Msg.CreateDataSource:output_type -> oracle.v1.MsgCreateDataSourceResponse + 7, // 16: oracle.v1.Msg.EditDataSource:output_type -> oracle.v1.MsgEditDataSourceResponse + 9, // 17: oracle.v1.Msg.CreateOracleScript:output_type -> oracle.v1.MsgCreateOracleScriptResponse + 11, // 18: oracle.v1.Msg.EditOracleScript:output_type -> oracle.v1.MsgEditOracleScriptResponse + 13, // 19: oracle.v1.Msg.Activate:output_type -> oracle.v1.MsgActivateResponse + 15, // 20: oracle.v1.Msg.UpdateParams:output_type -> oracle.v1.MsgUpdateParamsResponse + 13, // [13:21] is the sub-list for method output_type + 5, // [5:13] 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_oracle_v1_tx_proto_init() } +func file_oracle_v1_tx_proto_init() { + if File_oracle_v1_tx_proto != nil { + return + } + file_oracle_v1_oracle_proto_init() + if !protoimpl.UnsafeEnabled { + file_oracle_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgRequestData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgRequestDataResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgReportData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgReportDataResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCreateDataSource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCreateDataSourceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgEditDataSource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgEditDataSourceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCreateOracleScript); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCreateOracleScriptResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_tx_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgEditOracleScript); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_tx_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgEditOracleScriptResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_tx_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgActivate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_tx_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgActivateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_tx_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oracle_v1_tx_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_oracle_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 16, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_oracle_v1_tx_proto_goTypes, + DependencyIndexes: file_oracle_v1_tx_proto_depIdxs, + MessageInfos: file_oracle_v1_tx_proto_msgTypes, + }.Build() + File_oracle_v1_tx_proto = out.File + file_oracle_v1_tx_proto_rawDesc = nil + file_oracle_v1_tx_proto_goTypes = nil + file_oracle_v1_tx_proto_depIdxs = nil +} diff --git a/api/oracle/v1/tx_grpc.pb.go b/api/oracle/v1/tx_grpc.pb.go new file mode 100644 index 000000000..1adaa04ef --- /dev/null +++ b/api/oracle/v1/tx_grpc.pb.go @@ -0,0 +1,390 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: oracle/v1/tx.proto + +package oraclev1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Msg_RequestData_FullMethodName = "/oracle.v1.Msg/RequestData" + Msg_ReportData_FullMethodName = "/oracle.v1.Msg/ReportData" + Msg_CreateDataSource_FullMethodName = "/oracle.v1.Msg/CreateDataSource" + Msg_EditDataSource_FullMethodName = "/oracle.v1.Msg/EditDataSource" + Msg_CreateOracleScript_FullMethodName = "/oracle.v1.Msg/CreateOracleScript" + Msg_EditOracleScript_FullMethodName = "/oracle.v1.Msg/EditOracleScript" + Msg_Activate_FullMethodName = "/oracle.v1.Msg/Activate" + Msg_UpdateParams_FullMethodName = "/oracle.v1.Msg/UpdateParams" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MsgClient interface { + // RequestData defines a method for submitting a new request. + RequestData(ctx context.Context, in *MsgRequestData, opts ...grpc.CallOption) (*MsgRequestDataResponse, error) + // ReportData defines a method for reporting a data to resolve the request. + ReportData(ctx context.Context, in *MsgReportData, opts ...grpc.CallOption) (*MsgReportDataResponse, error) + // CreateDataSource defines a method for creating a new data source. + CreateDataSource(ctx context.Context, in *MsgCreateDataSource, opts ...grpc.CallOption) (*MsgCreateDataSourceResponse, error) + // EditDataSource defines a method for editing an existing data source. + EditDataSource(ctx context.Context, in *MsgEditDataSource, opts ...grpc.CallOption) (*MsgEditDataSourceResponse, error) + // CreateOracleScript defines a method for creating a new oracle script. + CreateOracleScript(ctx context.Context, in *MsgCreateOracleScript, opts ...grpc.CallOption) (*MsgCreateOracleScriptResponse, error) + // EditOracleScript defines a method for editing an existing oracle script. + EditOracleScript(ctx context.Context, in *MsgEditOracleScript, opts ...grpc.CallOption) (*MsgEditOracleScriptResponse, error) + // Activate defines a method for applying to be an oracle validator. + Activate(ctx context.Context, in *MsgActivate, opts ...grpc.CallOption) (*MsgActivateResponse, error) + // UpdateParams defines a governance operation for updating the x/oracle module + // parameters. + // + // Since: cosmos-sdk 0.47 + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) RequestData(ctx context.Context, in *MsgRequestData, opts ...grpc.CallOption) (*MsgRequestDataResponse, error) { + out := new(MsgRequestDataResponse) + err := c.cc.Invoke(ctx, Msg_RequestData_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ReportData(ctx context.Context, in *MsgReportData, opts ...grpc.CallOption) (*MsgReportDataResponse, error) { + out := new(MsgReportDataResponse) + err := c.cc.Invoke(ctx, Msg_ReportData_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CreateDataSource(ctx context.Context, in *MsgCreateDataSource, opts ...grpc.CallOption) (*MsgCreateDataSourceResponse, error) { + out := new(MsgCreateDataSourceResponse) + err := c.cc.Invoke(ctx, Msg_CreateDataSource_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) EditDataSource(ctx context.Context, in *MsgEditDataSource, opts ...grpc.CallOption) (*MsgEditDataSourceResponse, error) { + out := new(MsgEditDataSourceResponse) + err := c.cc.Invoke(ctx, Msg_EditDataSource_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CreateOracleScript(ctx context.Context, in *MsgCreateOracleScript, opts ...grpc.CallOption) (*MsgCreateOracleScriptResponse, error) { + out := new(MsgCreateOracleScriptResponse) + err := c.cc.Invoke(ctx, Msg_CreateOracleScript_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) EditOracleScript(ctx context.Context, in *MsgEditOracleScript, opts ...grpc.CallOption) (*MsgEditOracleScriptResponse, error) { + out := new(MsgEditOracleScriptResponse) + err := c.cc.Invoke(ctx, Msg_EditOracleScript_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Activate(ctx context.Context, in *MsgActivate, opts ...grpc.CallOption) (*MsgActivateResponse, error) { + out := new(MsgActivateResponse) + err := c.cc.Invoke(ctx, Msg_Activate_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +type MsgServer interface { + // RequestData defines a method for submitting a new request. + RequestData(context.Context, *MsgRequestData) (*MsgRequestDataResponse, error) + // ReportData defines a method for reporting a data to resolve the request. + ReportData(context.Context, *MsgReportData) (*MsgReportDataResponse, error) + // CreateDataSource defines a method for creating a new data source. + CreateDataSource(context.Context, *MsgCreateDataSource) (*MsgCreateDataSourceResponse, error) + // EditDataSource defines a method for editing an existing data source. + EditDataSource(context.Context, *MsgEditDataSource) (*MsgEditDataSourceResponse, error) + // CreateOracleScript defines a method for creating a new oracle script. + CreateOracleScript(context.Context, *MsgCreateOracleScript) (*MsgCreateOracleScriptResponse, error) + // EditOracleScript defines a method for editing an existing oracle script. + EditOracleScript(context.Context, *MsgEditOracleScript) (*MsgEditOracleScriptResponse, error) + // Activate defines a method for applying to be an oracle validator. + Activate(context.Context, *MsgActivate) (*MsgActivateResponse, error) + // UpdateParams defines a governance operation for updating the x/oracle module + // parameters. + // + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) RequestData(context.Context, *MsgRequestData) (*MsgRequestDataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RequestData not implemented") +} +func (UnimplementedMsgServer) ReportData(context.Context, *MsgReportData) (*MsgReportDataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReportData not implemented") +} +func (UnimplementedMsgServer) CreateDataSource(context.Context, *MsgCreateDataSource) (*MsgCreateDataSourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDataSource not implemented") +} +func (UnimplementedMsgServer) EditDataSource(context.Context, *MsgEditDataSource) (*MsgEditDataSourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EditDataSource not implemented") +} +func (UnimplementedMsgServer) CreateOracleScript(context.Context, *MsgCreateOracleScript) (*MsgCreateOracleScriptResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateOracleScript not implemented") +} +func (UnimplementedMsgServer) EditOracleScript(context.Context, *MsgEditOracleScript) (*MsgEditOracleScriptResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EditOracleScript not implemented") +} +func (UnimplementedMsgServer) Activate(context.Context, *MsgActivate) (*MsgActivateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Activate not implemented") +} +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_RequestData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRequestData) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RequestData(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_RequestData_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RequestData(ctx, req.(*MsgRequestData)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ReportData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgReportData) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ReportData(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_ReportData_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ReportData(ctx, req.(*MsgReportData)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CreateDataSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateDataSource) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateDataSource(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_CreateDataSource_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateDataSource(ctx, req.(*MsgCreateDataSource)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_EditDataSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgEditDataSource) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).EditDataSource(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_EditDataSource_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).EditDataSource(ctx, req.(*MsgEditDataSource)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CreateOracleScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateOracleScript) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateOracleScript(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_CreateOracleScript_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateOracleScript(ctx, req.(*MsgCreateOracleScript)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_EditOracleScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgEditOracleScript) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).EditOracleScript(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_EditOracleScript_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).EditOracleScript(ctx, req.(*MsgEditOracleScript)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Activate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgActivate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Activate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_Activate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Activate(ctx, req.(*MsgActivate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "oracle.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RequestData", + Handler: _Msg_RequestData_Handler, + }, + { + MethodName: "ReportData", + Handler: _Msg_ReportData_Handler, + }, + { + MethodName: "CreateDataSource", + Handler: _Msg_CreateDataSource_Handler, + }, + { + MethodName: "EditDataSource", + Handler: _Msg_EditDataSource_Handler, + }, + { + MethodName: "CreateOracleScript", + Handler: _Msg_CreateOracleScript_Handler, + }, + { + MethodName: "EditOracleScript", + Handler: _Msg_EditOracleScript_Handler, + }, + { + MethodName: "Activate", + Handler: _Msg_Activate_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "oracle/v1/tx.proto", +} diff --git a/app/ante.go b/app/ante.go index d7ab499f2..cb7f8a4ad 100644 --- a/app/ante.go +++ b/app/ante.go @@ -1,16 +1,17 @@ package band import ( + ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - "github.com/bandprotocol/chain/v2/x/globalfee/feechecker" - globalfeekeeper "github.com/bandprotocol/chain/v2/x/globalfee/keeper" - oraclekeeper "github.com/bandprotocol/chain/v2/x/oracle/keeper" + "github.com/bandprotocol/chain/v3/x/globalfee/feechecker" + globalfeekeeper "github.com/bandprotocol/chain/v3/x/globalfee/keeper" + oraclekeeper "github.com/bandprotocol/chain/v3/x/oracle/keeper" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC diff --git a/app/app.go b/app/app.go index a9dc4d991..de81f3d6c 100644 --- a/app/app.go +++ b/app/app.go @@ -3,26 +3,33 @@ package band import ( "fmt" "io" - "net/http" "os" "path/filepath" - "strconv" - "strings" + + "github.com/spf13/cast" + + abci "github.com/cometbft/cometbft/abci/types" + cmtjson "github.com/cometbft/cometbft/libs/json" + cmtos "github.com/cometbft/cometbft/libs/os" + + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/gogoproto/proto" + ibctesting "github.com/cosmos/ibc-go/v8/testing" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" - owasm "github.com/bandprotocol/go-owasm/api" - dbm "github.com/cometbft/cometbft-db" - abci "github.com/cometbft/cometbft/abci/types" - tmjson "github.com/cometbft/cometbft/libs/json" - "github.com/cometbft/cometbft/libs/log" - tmos "github.com/cometbft/cometbft/libs/os" + "cosmossdk.io/client/v2/autocli" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/log" + "cosmossdk.io/x/tx/signing" + upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" cosmosnodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" @@ -30,175 +37,41 @@ import ( "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/std" + "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/types/msgservice" + sigtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/auth/ante" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" + txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - "github.com/cosmos/cosmos-sdk/x/authz" - authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" - authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" - "github.com/cosmos/cosmos-sdk/x/bank" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - "github.com/cosmos/cosmos-sdk/x/consensus" - consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" - consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/crisis" - crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" - crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" - distr "github.com/cosmos/cosmos-sdk/x/distribution" - distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/evidence" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" - feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/cosmos/cosmos-sdk/x/gov" - govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/cosmos/cosmos-sdk/x/group" - groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper" - groupmodule "github.com/cosmos/cosmos-sdk/x/group/module" - "github.com/cosmos/cosmos-sdk/x/mint" - mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/cosmos/cosmos-sdk/x/params" - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - "github.com/cosmos/cosmos-sdk/x/slashing" - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/staking" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" - icahost "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host" - icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - "github.com/gorilla/mux" - "github.com/rakyll/statik/fs" - "github.com/spf13/cast" - - "github.com/bandprotocol/chain/v2/app/keepers" - "github.com/bandprotocol/chain/v2/app/upgrades" - "github.com/bandprotocol/chain/v2/app/upgrades/v2_6" - nodeservice "github.com/bandprotocol/chain/v2/client/grpc/node" - proofservice "github.com/bandprotocol/chain/v2/client/grpc/oracle/proof" - "github.com/bandprotocol/chain/v2/hooks/common" - "github.com/bandprotocol/chain/v2/hooks/emitter" - "github.com/bandprotocol/chain/v2/hooks/price" - "github.com/bandprotocol/chain/v2/hooks/request" - bandbank "github.com/bandprotocol/chain/v2/x/bank" - bandbankkeeper "github.com/bandprotocol/chain/v2/x/bank/keeper" - "github.com/bandprotocol/chain/v2/x/globalfee" - globalfeekeeper "github.com/bandprotocol/chain/v2/x/globalfee/keeper" - globalfeetypes "github.com/bandprotocol/chain/v2/x/globalfee/types" - "github.com/bandprotocol/chain/v2/x/oracle" - oraclekeeper "github.com/bandprotocol/chain/v2/x/oracle/keeper" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" -) -const ( - appName = "BandApp" - Bech32MainPrefix = "band" - Bip44CoinType = 494 + "github.com/bandprotocol/chain/v3/app/keepers" + "github.com/bandprotocol/chain/v3/app/upgrades" + v3 "github.com/bandprotocol/chain/v3/app/upgrades/v3" + nodeservice "github.com/bandprotocol/chain/v3/client/grpc/node" + proofservice "github.com/bandprotocol/chain/v3/client/grpc/oracle/proof" + "github.com/bandprotocol/chain/v3/hooks/common" + oraclekeeper "github.com/bandprotocol/chain/v3/x/oracle/keeper" ) var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string - // ModuleBasics defines the module BasicManager is in charge of setting up basic, - // non-dependant module elements, such as codec registration - // and genesis verification. - ModuleBasics = module.NewBasicManager( - auth.AppModuleBasic{}, - genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), - bank.AppModuleBasic{}, - capability.AppModuleBasic{}, - staking.AppModuleBasic{}, - mint.AppModuleBasic{}, - distr.AppModuleBasic{}, - gov.NewAppModuleBasic( - []govclient.ProposalHandler{ - paramsclient.ProposalHandler, - upgradeclient.LegacyProposalHandler, - upgradeclient.LegacyCancelProposalHandler, - ibcclientclient.UpdateClientProposalHandler, - ibcclientclient.UpgradeProposalHandler, - }, - ), - params.AppModuleBasic{}, - crisis.AppModuleBasic{}, - slashing.AppModuleBasic{}, - feegrantmodule.AppModuleBasic{}, - authzmodule.AppModuleBasic{}, - ibc.AppModuleBasic{}, - ibctm.AppModuleBasic{}, - upgrade.AppModuleBasic{}, - evidence.AppModuleBasic{}, - transfer.AppModuleBasic{}, - groupmodule.AppModuleBasic{}, - vesting.AppModuleBasic{}, - consensus.AppModuleBasic{}, - ica.AppModuleBasic{}, - oracle.AppModuleBasic{}, - globalfee.AppModule{}, - ) - // module account permissions - maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - distrtypes.ModuleName: nil, - icatypes.ModuleName: nil, - minttypes.ModuleName: {authtypes.Minter}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - govtypes.ModuleName: {authtypes.Burner}, - ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - } - - Upgrades = []upgrades.Upgrade{v2_6.Upgrade} + Upgrades = []upgrades.Upgrade{v3.Upgrade} ) var ( _ runtime.AppI = (*BandApp)(nil) _ servertypes.Application = (*BandApp)(nil) + _ ibctesting.TestingApp = (*BandApp)(nil) ) // BandApp is the application of BandChain, extended base ABCI application. @@ -208,27 +81,20 @@ type BandApp struct { legacyAmino *codec.LegacyAmino appCodec codec.Codec + txConfig client.TxConfig interfaceRegistry types.InterfaceRegistry - // keys to access the substores. - keys map[string]*storetypes.KVStoreKey - tkeys map[string]*storetypes.TransientStoreKey - memKeys map[string]*storetypes.MemoryStoreKey + invCheckPeriod uint // Module manager. - mm *module.Manager - - // Deliver context, set during InitGenesis/BeginBlock and cleared during Commit. It allows - // anyone with access to BandApp to read/mutate consensus state anytime. USE WITH CARE! - DeliverContext sdk.Context + mm *module.Manager + ModuleBasics module.BasicManager // List of hooks hooks common.Hooks // simulation manager - sm *module.SimulationManager - - // the configurator + sm *module.SimulationManager configurator module.Configurator } @@ -241,19 +107,6 @@ func init() { DefaultNodeHome = filepath.Join(userHomeDir, ".band") } -// SetBech32AddressPrefixesAndBip44CoinTypeAndSeal sets the global Bech32 prefixes and HD wallet coin type and seal config. -func SetBech32AddressPrefixesAndBip44CoinTypeAndSeal(config *sdk.Config) { - accountPrefix := Bech32MainPrefix - validatorPrefix := Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixOperator - consensusPrefix := Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixConsensus - config.SetCoinType(Bip44CoinType) - config.SetBech32PrefixForAccount(accountPrefix, accountPrefix+sdk.PrefixPublic) - config.SetBech32PrefixForValidator(validatorPrefix, validatorPrefix+sdk.PrefixPublic) - config.SetBech32PrefixForConsensusNode(consensusPrefix, consensusPrefix+sdk.PrefixPublic) - - config.Seal() -} - // NewBandApp returns a reference to an initialized BandApp. func NewBandApp( logger log.Logger, @@ -261,496 +114,110 @@ func NewBandApp( traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, + homePath string, appOpts servertypes.AppOptions, owasmCacheSize uint32, - emitterFlag, - requestSearchFlag, - pricerFlag string, baseAppOptions ...func(*baseapp.BaseApp), ) *BandApp { - encodingConfig := MakeEncodingConfig() + legacyAmino := codec.NewLegacyAmino() + interfaceRegistry, err := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{ + ProtoFiles: proto.HybridResolver, + SigningOptions: signing.Options{ + AddressCodec: address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(), + }, + ValidatorAddressCodec: address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(), + }, + }, + }) + if err != nil { + panic(err) + } + appCodec := codec.NewProtoCodec(interfaceRegistry) + txConfig := authtx.NewTxConfig(appCodec, authtx.DefaultSignModes) - appCodec := encodingConfig.Marshaler - legacyAmino := encodingConfig.Amino - interfaceRegistry := encodingConfig.InterfaceRegistry + std.RegisterLegacyAminoCodec(legacyAmino) + std.RegisterInterfaces(interfaceRegistry) + + // App Opts + skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) + invCheckPeriod := cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)) + + bApp := baseapp.NewBaseApp( + appName, + logger, + db, + txConfig.TxDecoder(), + baseAppOptions..., + ) - bApp := baseapp.NewBaseApp(appName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetVersion(version.Version) bApp.SetInterfaceRegistry(interfaceRegistry) - bApp.SetTxEncoder(encodingConfig.TxConfig.TxEncoder()) - - keys := sdk.NewKVStoreKeys( - authtypes.StoreKey, - banktypes.StoreKey, - stakingtypes.StoreKey, - crisistypes.StoreKey, - minttypes.StoreKey, - distrtypes.StoreKey, - slashingtypes.StoreKey, - govtypes.StoreKey, - paramstypes.StoreKey, - consensusparamtypes.StoreKey, - ibcexported.StoreKey, - upgradetypes.StoreKey, - evidencetypes.StoreKey, - ibctransfertypes.StoreKey, - capabilitytypes.StoreKey, - feegrant.StoreKey, - authzkeeper.StoreKey, - icahosttypes.StoreKey, - group.StoreKey, - oracletypes.StoreKey, - globalfeetypes.StoreKey, - ) - tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + bApp.SetTxEncoder(txConfig.TxEncoder()) app := &BandApp{ BaseApp: bApp, legacyAmino: legacyAmino, + txConfig: txConfig, appCodec: appCodec, interfaceRegistry: interfaceRegistry, - keys: keys, - tkeys: tkeys, - memKeys: memKeys, + invCheckPeriod: invCheckPeriod, } - owasmVM, err := owasm.NewVm(owasmCacheSize) - if err != nil { - panic(err) - } - - // Initialize params keeper and module subspaces. - app.ParamsKeeper = initParamsKeeper( - appCodec, - legacyAmino, - keys[paramstypes.StoreKey], - tkeys[paramstypes.TStoreKey], - ) - // set the BaseApp's parameter store - app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper( - appCodec, - keys[consensusparamtypes.StoreKey], - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - bApp.SetParamStore(&app.ConsensusParamsKeeper) - - // add capability keeper and ScopeToModule for ibc module - app.CapabilityKeeper = capabilitykeeper.NewKeeper( - appCodec, - keys[capabilitytypes.StoreKey], - memKeys[capabilitytypes.MemStoreKey], - ) - scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName) - scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) - scopedOracleKeeper := app.CapabilityKeeper.ScopeToModule(oracletypes.ModuleName) - scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) - app.CapabilityKeeper.Seal() - - // Add keepers. - app.AccountKeeper = authkeeper.NewAccountKeeper( - appCodec, - keys[authtypes.StoreKey], - authtypes.ProtoBaseAccount, - maccPerms, - Bech32MainPrefix, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - // wrappedBankerKeeper overrides burn token behavior to instead transfer to community pool. - app.BankKeeper = bandbankkeeper.NewWrappedBankKeeperBurnToCommunityPool( - bankkeeper.NewBaseKeeper( - appCodec, - keys[banktypes.StoreKey], - app.AccountKeeper, - BlockedAddresses(), - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ), - app.AccountKeeper, - ) - - app.StakingKeeper = stakingkeeper.NewKeeper( - appCodec, - keys[stakingtypes.StoreKey], - app.AccountKeeper, - app.BankKeeper, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - app.MintKeeper = mintkeeper.NewKeeper( - appCodec, - keys[minttypes.StoreKey], - app.StakingKeeper, - app.AccountKeeper, - app.BankKeeper, - authtypes.FeeCollectorName, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - app.DistrKeeper = distrkeeper.NewKeeper( - appCodec, - keys[distrtypes.StoreKey], - app.AccountKeeper, - app.BankKeeper, - app.StakingKeeper, - authtypes.FeeCollectorName, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - // DistrKeeper must be set afterward due to the circular reference between banker-staking-distr. - app.BankKeeper.SetDistrKeeper(&app.DistrKeeper) + moduleAccountAddresses := app.ModuleAccountAddrs() - app.SlashingKeeper = slashingkeeper.NewKeeper( + app.AppKeepers = keepers.NewAppKeeper( appCodec, + bApp, legacyAmino, - keys[slashingtypes.StoreKey], - app.StakingKeeper, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - invCheckPeriod := cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)) - app.CrisisKeeper = crisiskeeper.NewKeeper( - appCodec, - keys[crisistypes.StoreKey], - invCheckPeriod, - app.BankKeeper, - authtypes.FeeCollectorName, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - app.FeegrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper) - - homePath := cast.ToString(appOpts.Get(flags.FlagHome)) - app.UpgradeKeeper = upgradekeeper.NewKeeper( + maccPerms, + moduleAccountAddresses, + app.BlockedModuleAccountAddrs(moduleAccountAddresses), skipUpgradeHeights, - keys[upgradetypes.StoreKey], - appCodec, homePath, - app.BaseApp, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - app.StakingKeeper.SetHooks( - stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()), - ) - - // create IBC Keeper - app.IBCKeeper = ibckeeper.NewKeeper( - appCodec, - keys[ibcexported.StoreKey], - app.GetSubspace(ibcexported.ModuleName), - app.StakingKeeper, - app.UpgradeKeeper, - scopedIBCKeeper, - ) - - app.AuthzKeeper = authzkeeper.NewKeeper( - keys[authzkeeper.StoreKey], - appCodec, - app.MsgServiceRouter(), - app.AccountKeeper, - ) - - groupConfig := group.DefaultConfig() - /* - Example of setting group params: - groupConfig.MaxMetadataLen = 1000 - */ - app.GroupKeeper = groupkeeper.NewKeeper( - keys[group.StoreKey], - appCodec, - app.MsgServiceRouter(), - app.AccountKeeper, - groupConfig, - ) - - // register the proposal types. - govRouter := govv1beta1.NewRouter() - govRouter. - AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) - govConfig := govtypes.DefaultConfig() - govKeeper := govkeeper.NewKeeper( - appCodec, - keys[govtypes.StoreKey], - app.AccountKeeper, - app.BankKeeper, - app.StakingKeeper, - app.MsgServiceRouter(), - govConfig, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - // Set legacy router for backwards compatibility with gov v1beta1 - govKeeper.SetLegacyRouter(govRouter) - - app.GovKeeper = *govKeeper.SetHooks( - govtypes.NewMultiGovHooks( - // register the governance hooks - ), - ) - - app.TransferKeeper = ibctransferkeeper.NewKeeper( - appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), - app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, - app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, - ) - transferModule := transfer.NewAppModule(app.TransferKeeper) - transferIBCModule := transfer.NewIBCModule(app.TransferKeeper) - - app.ICAHostKeeper = icahostkeeper.NewKeeper( - appCodec, keys[icahosttypes.StoreKey], - app.GetSubspace(icahosttypes.SubModuleName), - app.IBCKeeper.ChannelKeeper, - app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, - app.AccountKeeper, - scopedICAHostKeeper, - app.MsgServiceRouter(), + invCheckPeriod, + logger, + appOpts, + owasmCacheSize, ) - app.ICAHostKeeper.WithQueryRouter(app.GRPCQueryRouter()) - icaModule := ica.NewAppModule(nil, &app.ICAHostKeeper) - icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper) + app.hooks = NewAppHooks(appCodec, txConfig, &app.AppKeepers, homePath, appOpts) - app.OracleKeeper = oraclekeeper.NewKeeper( - appCodec, - keys[oracletypes.StoreKey], - filepath.Join(homePath, "files"), - authtypes.FeeCollectorName, - app.AccountKeeper, - app.BankKeeper, - app.StakingKeeper, - app.DistrKeeper, - app.AuthzKeeper, - app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, - scopedOracleKeeper, - owasmVM, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) + // NOTE: Any module instantiated in the module manager that is later modified + // must be passed by reference here. + app.mm = module.NewManager(appModules(app, appCodec, txConfig, skipGenesisInvariants)...) + app.ModuleBasics = newBasicManagerFromManager(app) - if emitterFlag != "" { - app.hooks = append(app.hooks, emitter.NewHook( - appCodec, - app.LegacyAmino(), - encodingConfig, - app.AccountKeeper, - app.BankKeeper, - app.StakingKeeper, - app.MintKeeper, - app.DistrKeeper, - app.GovKeeper, - app.GroupKeeper, - app.OracleKeeper, - app.ICAHostKeeper, - app.IBCKeeper.ClientKeeper, - app.IBCKeeper.ConnectionKeeper, - app.IBCKeeper.ChannelKeeper, - keys[group.StoreKey], - emitterFlag, - false, - )) - } + enabledSignModes := append([]sigtypes.SignMode(nil), authtx.DefaultSignModes...) + enabledSignModes = append(enabledSignModes, sigtypes.SignMode_SIGN_MODE_TEXTUAL) - if requestSearchFlag != "" { - app.hooks = append( - app.hooks, - request.NewHook(appCodec, app.OracleKeeper, requestSearchFlag, 10), - ) + txConfigOpts := authtx.ConfigOptions{ + EnabledSignModes: enabledSignModes, + TextualCoinMetadataQueryFn: txmodule.NewBankKeeperCoinMetadataQueryFn(app.BankKeeper), } - - if pricerFlag != "" { - pricerStrArgs := strings.Split(pricerFlag, "/") - var defaultAskCount, defaultMinCount uint64 - if len(pricerStrArgs) == 3 { - defaultAskCount, err = strconv.ParseUint(pricerStrArgs[1], 10, 64) - if err != nil { - panic(err) - } - defaultMinCount, err = strconv.ParseUint(pricerStrArgs[2], 10, 64) - if err != nil { - panic(err) - } - } else if len(pricerStrArgs) == 2 || len(pricerStrArgs) > 3 { - panic(fmt.Errorf("accepts 1 or 3 arg(s), received %d", len(pricerStrArgs))) - } - rawOracleIDs := strings.Split(pricerStrArgs[0], ",") - var oracleIDs []oracletypes.OracleScriptID - for _, rawOracleID := range rawOracleIDs { - oracleID, err := strconv.ParseInt(rawOracleID, 10, 64) - if err != nil { - panic(err) - } - oracleIDs = append(oracleIDs, oracletypes.OracleScriptID(oracleID)) - } - app.hooks = append(app.hooks, - price.NewHook(appCodec, app.OracleKeeper, oracleIDs, - filepath.Join(homePath, "prices"), - defaultAskCount, defaultMinCount)) - } - - // Add hook to app module for create Querier - oracleModule := oracle.NewAppModule( + txConfig, err = authtx.NewTxConfigWithOptions( appCodec, - app.OracleKeeper, - app.AccountKeeper, - app.BankKeeper, - app.StakingKeeper, - app.GetSubspace(oracletypes.ModuleName), - app.hooks, + txConfigOpts, ) - oracleIBCModule := oracle.NewIBCModule(app.OracleKeeper) - - // Create static IBC router, add transfer route, then set and seal it - ibcRouter := porttypes.NewRouter() - ibcRouter. - AddRoute(icahosttypes.SubModuleName, icaHostIBCModule). - AddRoute(ibctransfertypes.ModuleName, transferIBCModule). - AddRoute(oracletypes.ModuleName, oracleIBCModule) - - app.IBCKeeper.SetRouter(ibcRouter) - - // create evidence keeper with router - evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, keys[evidencetypes.StoreKey], app.StakingKeeper, app.SlashingKeeper, - ) - // If evidence needs to be handled for the app, set routes in router here and seal - app.EvidenceKeeper = *evidenceKeeper - - app.GlobalfeeKeeper = globalfeekeeper.NewKeeper( - appCodec, - keys[globalfeetypes.StoreKey], - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - /**** Module Options ****/ - // NOTE: we may consider parsing `appOpts` inside module constructors. For the moment - // we prefer to be more strict in what arguments the modules expect. - skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) + if err != nil { + panic(err) + } + app.txConfig = txConfig - // NOTE: Any module instantiated in the module manager that is later modified - // must be passed by reference here. - app.mm = module.NewManager( - genutil.NewAppModule(app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, encodingConfig.TxConfig), - auth.NewAppModule( - appCodec, - app.AccountKeeper, - authsims.RandomGenesisAccounts, - app.GetSubspace(authtypes.ModuleName), - ), - vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), - bandbank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), - capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), - crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), - feegrantmodule.NewAppModule( - appCodec, - app.AccountKeeper, - app.BankKeeper, - app.FeegrantKeeper, - app.interfaceRegistry, - ), - gov.NewAppModule( - appCodec, - &app.GovKeeper, - app.AccountKeeper, - app.BankKeeper, - app.GetSubspace(govtypes.ModuleName), - ), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), - slashing.NewAppModule( - appCodec, - app.SlashingKeeper, - app.AccountKeeper, - app.BankKeeper, - app.StakingKeeper, - app.GetSubspace(slashingtypes.ModuleName), - ), - distr.NewAppModule( - appCodec, - app.DistrKeeper, - app.AccountKeeper, - app.BankKeeper, - app.StakingKeeper, - app.GetSubspace(distrtypes.ModuleName), - ), - staking.NewAppModule( - appCodec, - app.StakingKeeper, - app.AccountKeeper, - app.BankKeeper, - app.GetSubspace(stakingtypes.ModuleName), - ), - upgrade.NewAppModule(app.UpgradeKeeper), - evidence.NewAppModule(app.EvidenceKeeper), - ibc.NewAppModule(app.IBCKeeper), - params.NewAppModule(app.ParamsKeeper), - authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), - transferModule, - icaModule, - oracleModule, - globalfee.NewAppModule(app.GlobalfeeKeeper), + // NOTE: upgrade module is required to be prioritized + app.mm.SetOrderPreBlockers( + upgradetypes.ModuleName, ) // NOTE: Oracle module must occur before distr as it takes some fee to distribute to active oracle validators. // NOTE: During begin block slashing happens after distr.BeginBlocker so that there is nothing left // over in the validator fee pool, so as to keep the CanWithdrawInvariant invariant. // NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC) - app.mm.SetOrderBeginBlockers( - upgradetypes.ModuleName, - capabilitytypes.ModuleName, - minttypes.ModuleName, - oracletypes.ModuleName, - distrtypes.ModuleName, - slashingtypes.ModuleName, - evidencetypes.ModuleName, - stakingtypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - govtypes.ModuleName, - crisistypes.ModuleName, - ibctransfertypes.ModuleName, - ibcexported.ModuleName, - icatypes.ModuleName, - genutiltypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - group.ModuleName, - paramstypes.ModuleName, - vestingtypes.ModuleName, - consensusparamtypes.ModuleName, - globalfeetypes.ModuleName, - ) + app.mm.SetOrderBeginBlockers(orderBeginBlockers()...) - app.mm.SetOrderEndBlockers( - crisistypes.ModuleName, - govtypes.ModuleName, - stakingtypes.ModuleName, - oracletypes.ModuleName, - ibctransfertypes.ModuleName, - ibcexported.ModuleName, - icatypes.ModuleName, - capabilitytypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - slashingtypes.ModuleName, - minttypes.ModuleName, - genutiltypes.ModuleName, - evidencetypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - group.ModuleName, - paramstypes.ModuleName, - upgradetypes.ModuleName, - vestingtypes.ModuleName, - consensusparamtypes.ModuleName, - globalfeetypes.ModuleName, - ) + app.mm.SetOrderEndBlockers(orderEndBlockers()...) // NOTE: The genutils module must occur after staking so that pools are // properly initialized with tokens from genesis accounts. @@ -758,35 +225,17 @@ func NewBandApp( // NOTE: Capability module must occur first so that it can initialize any capabilities // so that other modules that want to create or claim capabilities afterwards in InitChain // can do so safely. - app.mm.SetOrderInitGenesis( - capabilitytypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - stakingtypes.ModuleName, - slashingtypes.ModuleName, - govtypes.ModuleName, - minttypes.ModuleName, - crisistypes.ModuleName, - genutiltypes.ModuleName, - ibctransfertypes.ModuleName, - ibcexported.ModuleName, - icatypes.ModuleName, - evidencetypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - group.ModuleName, - paramstypes.ModuleName, - upgradetypes.ModuleName, - vestingtypes.ModuleName, - consensusparamtypes.ModuleName, - oracletypes.ModuleName, - globalfeetypes.ModuleName, - ) + app.mm.SetOrderInitGenesis(orderInitBlockers()...) + + // Uncomment if you want to set a custom migration order here. + // app.mm.SetOrderMigrations(custom order) app.mm.RegisterInvariants(app.CrisisKeeper) app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) - app.mm.RegisterServices(app.configurator) + err = app.mm.RegisterServices(app.configurator) + if err != nil { + panic(err) + } autocliv1.RegisterQueryServer( app.GRPCQueryRouter(), @@ -799,49 +248,60 @@ func NewBandApp( } reflectionv1.RegisterReflectionServiceServer(app.GRPCQueryRouter(), reflectionSvc) + // add test gRPC service for testing gRPC queries in isolation + testdata.RegisterQueryServer(app.GRPCQueryRouter(), testdata.QueryImpl{}) + // create the simulation manager and define the order of the modules for deterministic simulations - overrideModules := map[string]module.AppModuleSimulation{} - app.sm = module.NewSimulationManagerFromAppModules(app.mm.Modules, overrideModules) + // + // NOTE: this is not required apps that don't use the simulator for fuzz testing + // transactions + app.sm = module.NewSimulationManager(simulationModules(app, appCodec, skipGenesisInvariants)...) app.sm.RegisterStoreDecoders() // Initialize stores. - app.MountKVStores(keys) - app.MountTransientStores(tkeys) - app.MountMemoryStores(memKeys) - - // initialize BaseApp. - app.SetInitChainer(app.InitChainer) - app.SetBeginBlocker(app.BeginBlocker) + app.MountKVStores(app.GetKVStoreKey()) + app.MountTransientStores(app.GetTransientStoreKey()) + app.MountMemoryStores(app.GetMemoryStoreKey()) anteHandler, err := NewAnteHandler( HandlerOptions{ HandlerOptions: ante.HandlerOptions{ AccountKeeper: app.AccountKeeper, BankKeeper: app.BankKeeper, - SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), - FeegrantKeeper: app.FeegrantKeeper, + SignModeHandler: txConfig.SignModeHandler(), + FeegrantKeeper: app.FeeGrantKeeper, SigGasConsumer: ante.DefaultSigVerificationGasConsumer, }, OracleKeeper: &app.OracleKeeper, IBCKeeper: app.IBCKeeper, StakingKeeper: app.StakingKeeper, - GlobalfeeKeeper: &app.GlobalfeeKeeper, + GlobalfeeKeeper: &app.GlobalFeeKeeper, }, ) if err != nil { panic(fmt.Errorf("failed to create ante handler: %s", err)) } + postHandler, err := NewPostHandler( + PostHandlerOptions{}, + ) + if err != nil { + panic(fmt.Errorf("failed to create post handler: %s", err)) + } + + // set ante and post handlers app.SetAnteHandler(anteHandler) - app.SetEndBlocker(app.EndBlocker) + app.SetPostHandler(postHandler) - app.setupUpgradeHandlers() - app.setupUpgradeStoreLoaders() + app.SetInitChainer(app.InitChainer) + app.SetPreBlocker(app.PreBlocker) + app.SetBeginBlocker(app.BeginBlocker) + app.SetEndBlocker(app.EndBlocker) // if there is no snapshot manager, it's ok to skip extension registration. chain can still run normally. - if snapshotManager := app.SnapshotManager(); snapshotManager != nil { - err := snapshotManager.RegisterExtensions( + if manager := app.SnapshotManager(); manager != nil { + err = manager.RegisterExtensions( oraclekeeper.NewOracleSnapshotter(app.CommitMultiStore(), &app.OracleKeeper), ) if err != nil { @@ -849,76 +309,67 @@ func NewBandApp( } } + app.setupUpgradeHandlers() + app.setupUpgradeStoreLoaders() + + // At startup, after all modules have been registered, check that all proto + // annotations are correct. + protoFiles, err := proto.MergedRegistry() + if err != nil { + panic(err) + } + err = msgservice.ValidateProtoAnnotations(protoFiles) + if err != nil { + // Once we switch to using protoreflect-based antehandlers, we might + // want to panic here instead of logging a warning. + fmt.Fprintln(os.Stderr, err.Error()) + } + if loadLatest { - err := app.LoadLatestVersion() - if err != nil { - tmos.Exit(fmt.Sprintf("failed to load latest version: %s", err)) + if err := app.LoadLatestVersion(); err != nil { + cmtos.Exit(fmt.Sprintf("failed to load latest version: %s", err)) } } - app.ScopedIBCKeeper = scopedIBCKeeper - app.ScopedTransferKeeper = scopedTransferKeeper - app.ScopedOracleKeeper = scopedOracleKeeper - app.ScopedICAHostKeeper = scopedICAHostKeeper - return app } -// MakeCodecs constructs the *std.Codec and *codec.LegacyAmino instances used by -// Gaia. It is useful for tests and clients who do not want to construct the -// full gaia application -func MakeCodecs() (codec.Codec, *codec.LegacyAmino) { - config := MakeEncodingConfig() - return config.Marshaler, config.Amino -} - // Name returns the name of the App. func (app *BandApp) Name() string { return app.BaseApp.Name() } -// BeginBlocker application updates every begin block. -func (app *BandApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - app.DeliverContext = ctx - res := app.mm.BeginBlock(ctx, req) - app.hooks.AfterBeginBlock(ctx, req, res) - - return res +// PreBlocker application updates every pre block +func (app *BandApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { + return app.mm.PreBlock(ctx) } -// EndBlocker application updates every end block. -func (app *BandApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { - res := app.mm.EndBlock(ctx, req) - app.hooks.AfterEndBlock(ctx, req, res) - - return res +// BeginBlocker application updates every begin block +func (app *BandApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) { + return app.mm.BeginBlock(ctx) } -// Commit overrides the default BaseApp's ABCI commit by adding DeliverContext clearing. -func (app *BandApp) Commit() (res abci.ResponseCommit) { - app.hooks.BeforeCommit() - app.DeliverContext = sdk.Context{} - - return app.BaseApp.Commit() +// EndBlocker application updates every end block +func (app *BandApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) { + return app.mm.EndBlock(ctx) } // InitChainer application update at chain initialization -func (app *BandApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { +func (app *BandApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { var genesisState GenesisState - if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { + if err := cmtjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { + panic(err) + } + if err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()); err != nil { panic(err) } - app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) - res := app.mm.InitGenesis(ctx, app.appCodec, genesisState) - app.hooks.AfterInitChain(ctx, req, res) - return res -} + response, err := app.mm.InitGenesis(ctx, app.appCodec, genesisState) + if err != nil { + panic(err) + } -// DeliverTx overwrite DeliverTx to apply afterDeliverTx hook -func (app *BandApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { - res := app.BaseApp.DeliverTx(req) - app.hooks.AfterDeliverTx(app.DeliverContext, req, res) + app.hooks.AfterInitChain(ctx, req, response) - return res + return response, nil } // LoadHeight loads a particular height @@ -935,6 +386,15 @@ func (app *BandApp) ModuleAccountAddrs() map[string]bool { return modAccAddrs } +// BlockedModuleAccountAddrs returns all the app's blocked module account +// addresses. +func (app *BandApp) BlockedModuleAccountAddrs(modAccAddrs map[string]bool) map[string]bool { + // remove module accounts that are ALLOWED to received funds + delete(modAccAddrs, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + + return modAccAddrs +} + // LegacyAmino returns BandApp's amino codec. // // NOTE: This is solely to be used for testing purposes as it may be desirable @@ -956,33 +416,6 @@ func (app *BandApp) InterfaceRegistry() types.InterfaceRegistry { return app.interfaceRegistry } -// GetKey returns the KVStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *BandApp) GetKey(storeKey string) *storetypes.KVStoreKey { - return app.keys[storeKey] -} - -// GetTKey returns the TransientStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *BandApp) GetTKey(storeKey string) *storetypes.TransientStoreKey { - return app.tkeys[storeKey] -} - -// GetMemKey returns the MemStoreKey for the provided mem key. -// -// NOTE: This is solely used for testing purposes. -func (app *BandApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { - return app.memKeys[storeKey] -} - -// GetSubspace returns a param subspace for a given module name. -func (app *BandApp) GetSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) - return subspace -} - // SimulationManager implements the SimulationApp interface func (app *BandApp) SimulationManager() *module.SimulationManager { return app.sm @@ -996,10 +429,10 @@ func (app *BandApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APICo // Register new tx routes from grpc-gateway. authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + cmtservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - // Register grpc-gateway routes for all modules. - ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + // Register legacy and grpc-gateway routes for all modules. + app.ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register grpc-gateway routes for additional services nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) @@ -1007,11 +440,18 @@ func (app *BandApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APICo cosmosnodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // register swagger API from root so that other applications can override easily - if apiConfig.Swagger { - RegisterSwaggerAPI(apiSvr.Router) + if err := server.RegisterSwaggerAPI(apiSvr.ClientCtx, apiSvr.Router, apiConfig.Swagger); err != nil { + panic(err) } } +// RegisterNodeService allows query minimum-gas-prices in app.toml +func (app *BandApp) RegisterNodeService(clientCtx client.Context, cfg config.Config) { + nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter(), cfg) + proofservice.RegisterProofService(clientCtx, app.GRPCQueryRouter(), cfg) + cosmosnodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter(), cfg) +} + // RegisterTxService implements the Application.RegisterTxService method. func (app *BandApp) RegisterTxService(clientCtx client.Context) { authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) @@ -1019,73 +459,28 @@ func (app *BandApp) RegisterTxService(clientCtx client.Context) { // RegisterTendermintService implements the Application.RegisterTendermintService method. func (app *BandApp) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService(clientCtx, app.BaseApp.GRPCQueryRouter(), app.interfaceRegistry, app.Query) -} - -// RegisterNodeService registers all additional services. -func (app *BandApp) RegisterNodeService(clientCtx client.Context) { - nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) - proofservice.RegisterProofService(clientCtx, app.GRPCQueryRouter()) - cosmosnodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) + cmtservice.RegisterTendermintService(clientCtx, app.BaseApp.GRPCQueryRouter(), app.interfaceRegistry, app.Query) } -// RegisterSwaggerAPI registers swagger route with API Server -func RegisterSwaggerAPI(rtr *mux.Router) { - statikFS, err := fs.New() +// configure store loader that checks if version == upgradeHeight and applies store upgrades +func (app *BandApp) setupUpgradeStoreLoaders() { + upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() if err != nil { - panic(err) + panic(fmt.Sprintf("failed to read upgrade info from disk %s", err)) } - staticServer := http.FileServer(statikFS) - rtr.PathPrefix("/swagger/").Handler(http.StripPrefix("/swagger/", staticServer)) -} - -// GetMaccPerms returns a mapping of the application's module account permissions. -func GetMaccPerms() map[string][]string { - modAccPerms := make(map[string][]string) - for k, v := range maccPerms { - modAccPerms[k] = v + if app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + return } - return modAccPerms -} -// BlockedAddresses returns all the app's blocked account addresses. -func BlockedAddresses() map[string]bool { - modAccAddrs := make(map[string]bool) - for acc := range GetMaccPerms() { - modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true + for idx, upgrade := range Upgrades { + if upgradeInfo.Name == upgrade.UpgradeName { + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &Upgrades[idx].StoreUpgrades)) + } } - - // allow the following addresses to receive funds - delete(modAccAddrs, authtypes.NewModuleAddress(govtypes.ModuleName).String()) - - return modAccAddrs -} - -// initParamsKeeper init params keeper and its subspaces -func initParamsKeeper( - appCodec codec.BinaryCodec, - legacyAmino *codec.LegacyAmino, - key, tkey storetypes.StoreKey, -) paramskeeper.Keeper { - paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) - - paramsKeeper.Subspace(authtypes.ModuleName) - paramsKeeper.Subspace(banktypes.ModuleName) - paramsKeeper.Subspace(stakingtypes.ModuleName) - paramsKeeper.Subspace(minttypes.ModuleName) - paramsKeeper.Subspace(distrtypes.ModuleName) - paramsKeeper.Subspace(slashingtypes.ModuleName) - paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) //nolint:staticcheck - paramsKeeper.Subspace(crisistypes.ModuleName) - paramsKeeper.Subspace(ibcexported.ModuleName) - paramsKeeper.Subspace(ibctransfertypes.ModuleName) - paramsKeeper.Subspace(icahosttypes.SubModuleName) - paramsKeeper.Subspace(oracletypes.ModuleName) - - return paramsKeeper } +// set all upgrade handlers func (app *BandApp) setupUpgradeHandlers() { for _, upgrade := range Upgrades { app.UpgradeKeeper.SetUpgradeHandler( @@ -1093,27 +488,28 @@ func (app *BandApp) setupUpgradeHandlers() { upgrade.CreateUpgradeHandler( app.mm, app.configurator, - app, &app.AppKeepers, ), ) } } -// configure store loader that checks if version == upgradeHeight and applies store upgrades -func (app *BandApp) setupUpgradeStoreLoaders() { - upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() - if err != nil { - panic(fmt.Sprintf("failed to read upgrade info from disk %s", err)) - } - - if app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { - return +// AutoCliOpts returns the autocli options for the app. +func (app *BandApp) AutoCliOpts() autocli.AppOptions { + modules := make(map[string]appmodule.AppModule, 0) + for _, m := range app.mm.Modules { + if moduleWithName, ok := m.(module.HasName); ok { + moduleName := moduleWithName.Name() + if appModule, ok := moduleWithName.(appmodule.AppModule); ok { + modules[moduleName] = appModule + } + } } - for idx, upgrade := range Upgrades { - if upgradeInfo.Name == upgrade.UpgradeName { - app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &Upgrades[idx].StoreUpgrades)) - } + return autocli.AppOptions{ + Modules: modules, + AddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), + ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), + ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), } } diff --git a/app/app_helpers.go b/app/app_helpers.go new file mode 100644 index 000000000..87581e133 --- /dev/null +++ b/app/app_helpers.go @@ -0,0 +1,43 @@ +package band + +import ( + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + ibctestingtypes "github.com/cosmos/ibc-go/v8/testing/types" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" +) + +// TestingApp functions + +// GetBaseApp implements the TestingApp interface. +func (app *BandApp) GetBaseApp() *baseapp.BaseApp { + return app.BaseApp +} + +// GetTxConfig implements the TestingApp interface. +func (app *BandApp) GetTxConfig() client.TxConfig { + return app.txConfig +} + +// GetTestGovKeeper implements the TestingApp interface. +func (app *BandApp) GetTestGovKeeper() *govkeeper.Keeper { + return app.AppKeepers.GovKeeper +} + +// GetStakingKeeper implements the TestingApp interface. +func (app *BandApp) GetStakingKeeper() ibctestingtypes.StakingKeeper { + return app.StakingKeeper +} + +// GetIBCKeeper implements the TestingApp interface. +func (app *BandApp) GetIBCKeeper() *ibckeeper.Keeper { + return app.IBCKeeper +} + +// GetScopedIBCKeeper implements the TestingApp interface. +func (app *BandApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { + return app.ScopedIBCKeeper +} diff --git a/app/config.go b/app/config.go new file mode 100644 index 000000000..56d707cf6 --- /dev/null +++ b/app/config.go @@ -0,0 +1,18 @@ +package band + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetBech32AddressPrefixesAndBip44CoinTypeAndSeal sets the global Bech32 prefixes and HD wallet coin type and seal config. +func SetBech32AddressPrefixesAndBip44CoinTypeAndSeal(config *sdk.Config) { + accountPrefix := Bech32MainPrefix + validatorPrefix := Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixOperator + consensusPrefix := Bech32MainPrefix + sdk.PrefixValidator + sdk.PrefixConsensus + config.SetCoinType(Bip44CoinType) + config.SetBech32PrefixForAccount(accountPrefix, accountPrefix+sdk.PrefixPublic) + config.SetBech32PrefixForValidator(validatorPrefix, validatorPrefix+sdk.PrefixPublic) + config.SetBech32PrefixForConsensusNode(consensusPrefix, consensusPrefix+sdk.PrefixPublic) + + config.Seal() +} diff --git a/app/const.go b/app/const.go new file mode 100644 index 000000000..113eb2ddc --- /dev/null +++ b/app/const.go @@ -0,0 +1,7 @@ +package band + +const ( + appName = "BandApp" + Bech32MainPrefix = "band" + Bip44CoinType = 494 +) diff --git a/app/encoding.go b/app/encoding.go deleted file mode 100644 index 6f891d28e..000000000 --- a/app/encoding.go +++ /dev/null @@ -1,17 +0,0 @@ -package band - -import ( - "github.com/cosmos/cosmos-sdk/std" - - "github.com/bandprotocol/chain/v2/app/params" -) - -// MakeEncodingConfig creates an EncodingConfig for testing -func MakeEncodingConfig() params.EncodingConfig { - encodingConfig := params.MakeEncodingConfig() - std.RegisterLegacyAminoCodec(encodingConfig.Amino) - std.RegisterInterfaces(encodingConfig.InterfaceRegistry) - ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) - ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) - return encodingConfig -} diff --git a/app/export.go b/app/export.go index 77ed8652f..799d80bf0 100644 --- a/app/export.go +++ b/app/export.go @@ -2,10 +2,12 @@ package band import ( "encoding/json" - "fmt" "log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + + storetypes "cosmossdk.io/store/types" + servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -18,7 +20,7 @@ func (app *BandApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string, ) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctx := app.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()}) // We export at last height + 1, because that's the height at which // Tendermint will start InitChain. @@ -28,7 +30,11 @@ func (app *BandApp) ExportAppStateAndValidators( app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) } - genState := app.mm.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) + genState, err := app.mm.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) + if err != nil { + return servertypes.ExportedApp{}, err + } + appState, err := json.MarshalIndent(genState, "", " ") if err != nil { return servertypes.ExportedApp{}, err @@ -71,13 +77,26 @@ func (app *BandApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [ /* Handle fee distribution state. */ // withdraw all validator commission - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) + err := app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + valAddr, err := app.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + app.Logger().Error(err.Error(), "ValOperatorAddress", val.GetOperator()) + } + _, err = app.DistrKeeper.WithdrawValidatorCommission(ctx, valAddr) + if err != nil { + app.Logger().Error(err.Error(), "ValOperatorAddress", val.GetOperator()) + } return false }) + if err != nil { + panic(err) + } // withdraw all delegator rewards - dels := app.StakingKeeper.GetAllDelegations(ctx) + dels, err := app.StakingKeeper.GetAllDelegations(ctx) + if err != nil { + panic(err) + } for _, delegation := range dels { valAddr, err := sdk.ValAddressFromBech32(delegation.ValidatorAddress) if err != nil { @@ -104,19 +123,49 @@ func (app *BandApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [ height := ctx.BlockHeight() ctx = ctx.WithBlockHeight(0) + // reinitialize all validators (v0.46 version) + // app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + // // donate any unwithdrawn outstanding reward fraction tokens to the community pool + // scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) + // feePool := app.DistrKeeper.GetFeePool(ctx) + // feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) + // app.DistrKeeper.SetFeePool(ctx, feePool) + + // err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) + // if err != nil { + // panic(err) + // } + // return false + // }) + // reinitialize all validators - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + err = app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { // donate any unwithdrawn outstanding reward fraction tokens to the community pool - scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) - feePool := app.DistrKeeper.GetFeePool(ctx) + valAddr, err := app.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + panic(err) + } + scraps, err := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, valAddr) + if err != nil { + panic(err) + } + feePool, err := app.DistrKeeper.FeePool.Get(ctx) + if err != nil { + panic(err) + } feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) - app.DistrKeeper.SetFeePool(ctx, feePool) - - if err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()); err != nil { + err = app.DistrKeeper.FeePool.Set(ctx, feePool) + if err != nil { + panic(err) + } + if err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, valAddr); err != nil { panic(err) } return false }) + if err != nil { + panic(err) + } // reinitialize all delegations for _, del := range dels { @@ -124,16 +173,15 @@ func (app *BandApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [ if err != nil { panic(err) } - delAddr := sdk.MustAccAddressFromBech32(del.DelegatorAddress) - + delAddr, err := sdk.AccAddressFromBech32(del.DelegatorAddress) + if err != nil { + panic(err) + } if err := app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr); err != nil { - // never called as BeforeDelegationCreated always returns nil - panic(fmt.Errorf("error while incrementing period: %w", err)) + panic(err) } - if err := app.DistrKeeper.Hooks().AfterDelegationModified(ctx, delAddr, valAddr); err != nil { - // never called as AfterDelegationModified always returns nil - panic(fmt.Errorf("error while creating a new delegation period record: %w", err)) + panic(err) } } @@ -143,67 +191,85 @@ func (app *BandApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [ /* Handle staking state. */ // iterate through redelegations, reset creation height - app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { + err = app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { for i := range red.Entries { red.Entries[i].CreationHeight = 0 } - app.StakingKeeper.SetRedelegation(ctx, red) + if err := app.StakingKeeper.SetRedelegation(ctx, red); err != nil { + panic(err) + } return false }) + if err != nil { + panic(err) + } // iterate through unbonding delegations, reset creation height - app.StakingKeeper.IterateUnbondingDelegations( + err = app.StakingKeeper.IterateUnbondingDelegations( ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { for i := range ubd.Entries { ubd.Entries[i].CreationHeight = 0 } - app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) + if err := app.StakingKeeper.SetUnbondingDelegation(ctx, ubd); err != nil { + panic(err) + } return false }, ) + if err != nil { + panic(err) + } // Iterate through validators by power descending, reset bond heights, and // update bond intra-tx counters. - store := ctx.KVStore(app.keys[stakingtypes.StoreKey]) - iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) + store := ctx.KVStore(app.GetKey(stakingtypes.StoreKey)) + iter := storetypes.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) + counter := int16(0) - for ; iter.Valid(); iter.Next() { - addr := sdk.ValAddress(stakingtypes.AddressFromValidatorsKey(iter.Key())) - validator, found := app.StakingKeeper.GetValidator(ctx, addr) - if !found { - panic("expected validator, not found") - } + // Closure to ensure iterator doesn't leak. + func() { + defer iter.Close() + for ; iter.Valid(); iter.Next() { + addr := sdk.ValAddress(stakingtypes.AddressFromValidatorsKey(iter.Key())) + validator, err := app.StakingKeeper.GetValidator(ctx, addr) + if err != nil { + panic("expected validator, not found") + } - validator.UnbondingHeight = 0 - if applyAllowedAddrs && !allowedAddrsMap[addr.String()] { - validator.Jailed = true - } + validator.UnbondingHeight = 0 + if applyAllowedAddrs && !allowedAddrsMap[addr.String()] { + validator.Jailed = true + } - app.StakingKeeper.SetValidator(ctx, validator) - counter++ - } + if err = app.StakingKeeper.SetValidator(ctx, validator); err != nil { + panic(err) + } - if err := iter.Close(); err != nil { - app.Logger().Error("error while closing the key-value store reverse prefix iterator: ", err) - return - } + counter++ + } + }() - _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + _, err = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) if err != nil { - log.Fatal(err) + panic(err) } /* Handle slashing state. */ // reset start height on signing infos - app.SlashingKeeper.IterateValidatorSigningInfos( + err = app.SlashingKeeper.IterateValidatorSigningInfos( ctx, func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { info.StartHeight = 0 - app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info) + if err = app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info); err != nil { + panic(err) + } return false }, ) + if err != nil { + panic(err) + } } diff --git a/app/genesis.go b/app/genesis.go index 64f6c02b7..16dbd1eaf 100644 --- a/app/genesis.go +++ b/app/genesis.go @@ -4,20 +4,35 @@ import ( "encoding/json" "time" + "github.com/cosmos/ibc-go/modules/capability" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + icagenesistypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/genesis/types" + icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" + ibcfee "github.com/cosmos/ibc-go/v8/modules/apps/29-fee" + ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" + ibctransfer "github.com/cosmos/ibc-go/v8/modules/apps/transfer" + ibctransafertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v8/modules/core" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + + "cosmossdk.io/math" + "cosmossdk.io/x/evidence" + evidencetypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" + feegrantmodule "cosmossdk.io/x/feegrant/module" + "cosmossdk.io/x/upgrade" + upgradetypes "cosmossdk.io/x/upgrade/types" + + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/authz" authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" "github.com/cosmos/cosmos-sdk/x/bank" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/evidence" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -27,29 +42,18 @@ import ( minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - icagenesistypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/genesis/types" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - ibctransfer "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransafertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - "github.com/bandprotocol/chain/v2/app/upgrades/v2_6" - globalfeetypes "github.com/bandprotocol/chain/v2/x/globalfee/types" - "github.com/bandprotocol/chain/v2/x/oracle" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + v3 "github.com/bandprotocol/chain/v3/app/upgrades/v3" + globalfeetypes "github.com/bandprotocol/chain/v3/x/globalfee/types" + "github.com/bandprotocol/chain/v3/x/oracle" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) // GenesisState defines a type alias for the Band genesis application state. type GenesisState map[string]json.RawMessage // NewDefaultGenesisState generates the default state for the application. -func NewDefaultGenesisState() GenesisState { - cdc := MakeEncodingConfig().Marshaler - ModuleBasics.DefaultGenesis(cdc) +func NewDefaultGenesisState(cdc codec.Codec) GenesisState { denom := "uband" // Get default genesis states of the modules we are to override. authGenesis := authtypes.DefaultGenesisState() @@ -65,25 +69,31 @@ func NewDefaultGenesisState() GenesisState { authGenesis.Params.TxSizeCostPerByte = 5 stakingGenesis.Params.BondDenom = denom stakingGenesis.Params.HistoricalEntries = 1000 - mintGenesis.Params.BlocksPerYear = 10519200 // target 3-second block time + mintGenesis.Params.BlocksPerYear = 31557600 // target 1-second block time mintGenesis.Params.MintDenom = denom govGenesis.Params.MinDeposit = sdk.NewCoins( sdk.NewCoin(denom, sdk.TokensFromConsensusPower(1000, sdk.DefaultPowerReduction)), ) + govGenesis.Params.ExpeditedMinDeposit = sdk.NewCoins( + sdk.NewCoin( + denom, + sdk.TokensFromConsensusPower(2000, sdk.DefaultPowerReduction)), + ) + crisisGenesis.ConstantFee = sdk.NewCoin(denom, sdk.TokensFromConsensusPower(10000, sdk.DefaultPowerReduction)) - slashingGenesis.Params.SignedBlocksWindow = 30000 // approximately 1 day - slashingGenesis.Params.MinSignedPerWindow = sdk.NewDecWithPrec(5, 2) // 5% - slashingGenesis.Params.DowntimeJailDuration = 60 * 10 * time.Second // 10 minutes - slashingGenesis.Params.SlashFractionDoubleSign = sdk.NewDecWithPrec(5, 2) // 5% - slashingGenesis.Params.SlashFractionDowntime = sdk.NewDecWithPrec(1, 4) // 0.01% + slashingGenesis.Params.SignedBlocksWindow = 86400 // approximately 1 day + slashingGenesis.Params.MinSignedPerWindow = math.LegacyNewDecWithPrec(5, 2) // 5% + slashingGenesis.Params.DowntimeJailDuration = 60 * 10 * time.Second // 10 minutes + slashingGenesis.Params.SlashFractionDoubleSign = math.LegacyNewDecWithPrec(5, 2) // 5% + slashingGenesis.Params.SlashFractionDowntime = math.LegacyNewDecWithPrec(1, 4) // 0.01% icaGenesis.HostGenesisState.Params = icahosttypes.Params{ HostEnabled: true, - AllowMessages: v2_6.ICAAllowMessages, + AllowMessages: v3.ICAAllowMessages, } globalfeeGenesis.Params.MinimumGasPrices = sdk.NewDecCoins( - sdk.NewDecCoinFromDec(denom, sdk.NewDecWithPrec(25, 4)), + sdk.NewDecCoinFromDec(denom, math.LegacyNewDecWithPrec(25, 4)), // 0.0025uband ) return GenesisState{ @@ -105,6 +115,7 @@ func NewDefaultGenesisState() GenesisState { group.ModuleName: groupmodule.AppModuleBasic{}.DefaultGenesis(cdc), ibctransafertypes.ModuleName: ibctransfer.AppModuleBasic{}.DefaultGenesis(cdc), icatypes.ModuleName: cdc.MustMarshalJSON(icaGenesis), + ibcfeetypes.ModuleName: ibcfee.AppModuleBasic{}.DefaultGenesis(cdc), oracletypes.ModuleName: oracle.AppModuleBasic{}.DefaultGenesis(cdc), globalfeetypes.ModuleName: cdc.MustMarshalJSON(globalfeeGenesis), } diff --git a/app/hooks.go b/app/hooks.go new file mode 100644 index 000000000..be46e3a4a --- /dev/null +++ b/app/hooks.go @@ -0,0 +1,148 @@ +package band + +import ( + "fmt" + "path/filepath" + "strconv" + "strings" + + "github.com/spf13/cast" + + abci "github.com/cometbft/cometbft/abci/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + "github.com/cosmos/cosmos-sdk/x/group" + + "github.com/bandprotocol/chain/v3/app/keepers" + "github.com/bandprotocol/chain/v3/hooks/common" + "github.com/bandprotocol/chain/v3/hooks/emitter" + "github.com/bandprotocol/chain/v3/hooks/price" + "github.com/bandprotocol/chain/v3/hooks/request" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" +) + +const ( + FlagWithEmitter = "with-emitter" + FlagWithPricer = "with-pricer" + FlagWithRequestSearch = "with-request-search" + FlagRequestSearchCacheSize = "request-search-cache-size" + FlagWithOwasmCacheSize = "oracle-script-cache-size" +) + +func NewAppHooks(appCodec codec.Codec, + txConfig client.TxConfig, + keepers *keepers.AppKeepers, + homePath string, + appOpts servertypes.AppOptions, +) common.Hooks { + hooks := make(common.Hooks, 0) + + if emitterURI := cast.ToString(appOpts.Get(FlagWithEmitter)); emitterURI != "" { + hooks = append(hooks, emitter.NewHook( + appCodec, + txConfig, + keepers.AccountKeeper, + keepers.BankKeeper, + keepers.StakingKeeper, + keepers.MintKeeper, + keepers.DistrKeeper, + keepers.GovKeeper, + keepers.GroupKeeper, + keepers.OracleKeeper, + keepers.ICAHostKeeper, + keepers.IBCKeeper.ClientKeeper, + keepers.IBCKeeper.ConnectionKeeper, + keepers.IBCKeeper.ChannelKeeper, + keepers.GetKey(group.StoreKey), + emitterURI, + false, + )) + } + + if requestSearchURI := cast.ToString(appOpts.Get(FlagWithRequestSearch)); requestSearchURI != "" { + hooks = append(hooks, + request.NewHook(appCodec, keepers.OracleKeeper, requestSearchURI, 10), + ) + } + + if pricerDetail := cast.ToString(appOpts.Get(FlagWithPricer)); pricerDetail != "" { + pricerStrArgs := strings.Split(pricerDetail, "/") + var defaultAskCount, defaultMinCount uint64 + if len(pricerStrArgs) == 3 { + var err error + defaultAskCount, err = strconv.ParseUint(pricerStrArgs[1], 10, 64) + if err != nil { + panic(err) + } + defaultMinCount, err = strconv.ParseUint(pricerStrArgs[2], 10, 64) + if err != nil { + panic(err) + } + } else if len(pricerStrArgs) == 2 || len(pricerStrArgs) > 3 { + panic(fmt.Errorf("accepts 1 or 3 arg(s), received %d", len(pricerStrArgs))) + } + rawOracleIDs := strings.Split(pricerStrArgs[0], ",") + var oracleIDs []oracletypes.OracleScriptID + for _, rawOracleID := range rawOracleIDs { + oracleID, err := strconv.ParseInt(rawOracleID, 10, 64) + if err != nil { + panic(err) + } + oracleIDs = append(oracleIDs, oracletypes.OracleScriptID(oracleID)) + } + hooks = append(hooks, + price.NewHook(appCodec, keepers.OracleKeeper, oracleIDs, + filepath.Join(homePath, "prices"), + defaultAskCount, defaultMinCount)) + } + + return hooks +} + +// ABCI app to call hook +// FinalizeBlock overrides the default BaseApp's ABCI FinalizeBlock to process transaction in blocks +func (app *BandApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) { + // Finalize on base app first + res, err := app.BaseApp.FinalizeBlock(req) + + beginBlockEvents, endBlockEvents := splitEvents(res.Events) + ctx := app.BaseApp.GetContextForFinalizeBlock(nil) + app.hooks.AfterBeginBlock(ctx, req, beginBlockEvents) + + for i := range len(req.Txs) { + tx, _ := app.txConfig.TxDecoder()(req.Txs[i]) + resTx := res.TxResults[i] + app.hooks.AfterDeliverTx(ctx, tx, resTx) + } + + app.hooks.AfterEndBlock(ctx, endBlockEvents) + + return res, err +} + +// Commit overrides the default BaseApp's ABCI commit to commit some state on hooks +func (app *BandApp) Commit() (res *abci.ResponseCommit, err error) { + app.hooks.BeforeCommit() + + return app.BaseApp.Commit() +} + +func splitEvents(events []abci.Event) (begins []abci.Event, ends []abci.Event) { + for _, event := range events { + n := len(event.Attributes) + attrType := event.Attributes[n-1] + if attrType.Key != "mode" { + panic("The last attribute of begin/end block event should be mode") + } + if attrType.Value == "BeginBlock" { + begins = append(begins, event) + } else if attrType.Value == "EndBlock" { + ends = append(ends, event) + } else { + panic(fmt.Sprintf("Mode of event should be BeginBlock/EndBlock got %s", attrType.Value)) + } + } + return begins, ends +} diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index c4b74b829..ae7cbf9da 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -1,54 +1,115 @@ package keepers import ( + "os" + "path/filepath" + + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" + icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" + ibcfee "github.com/cosmos/ibc-go/v8/modules/apps/29-fee" + ibcfeekeeper "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/keeper" + ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" + "github.com/cosmos/ibc-go/v8/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + evidencekeeper "cosmossdk.io/x/evidence/keeper" + evidencetypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" + feegrantkeeper "cosmossdk.io/x/feegrant/keeper" + upgradekeeper "cosmossdk.io/x/upgrade/keeper" + upgradetypes "cosmossdk.io/x/upgrade/types" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/runtime" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + sdk "github.com/cosmos/cosmos-sdk/types" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" + consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" + crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/group" groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/cosmos/cosmos-sdk/x/params" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - - bandbankkeeper "github.com/bandprotocol/chain/v2/x/bank/keeper" - globalfeekeeper "github.com/bandprotocol/chain/v2/x/globalfee/keeper" - oraclekeeper "github.com/bandprotocol/chain/v2/x/oracle/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + owasm "github.com/bandprotocol/go-owasm/api" + + bandbankkeeper "github.com/bandprotocol/chain/v3/x/bank/keeper" + globalfeekeeper "github.com/bandprotocol/chain/v3/x/globalfee/keeper" + globalfeetypes "github.com/bandprotocol/chain/v3/x/globalfee/types" + "github.com/bandprotocol/chain/v3/x/oracle" + oraclekeeper "github.com/bandprotocol/chain/v3/x/oracle/keeper" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) type AppKeepers struct { + // keys to access the substores + keys map[string]*storetypes.KVStoreKey + tkeys map[string]*storetypes.TransientStoreKey + memKeys map[string]*storetypes.MemoryStoreKey + // keepers - AccountKeeper authkeeper.AccountKeeper - BankKeeper bandbankkeeper.WrappedBankKeeper - CapabilityKeeper *capabilitykeeper.Keeper - StakingKeeper *stakingkeeper.Keeper - SlashingKeeper slashingkeeper.Keeper - MintKeeper mintkeeper.Keeper - DistrKeeper distrkeeper.Keeper - GovKeeper govkeeper.Keeper - CrisisKeeper *crisiskeeper.Keeper - UpgradeKeeper *upgradekeeper.Keeper - ParamsKeeper paramskeeper.Keeper - // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly - IBCKeeper *ibckeeper.Keeper - ICAHostKeeper icahostkeeper.Keeper + AccountKeeper authkeeper.AccountKeeper + BankKeeper bankkeeper.Keeper + CapabilityKeeper *capabilitykeeper.Keeper + StakingKeeper *stakingkeeper.Keeper + SlashingKeeper slashingkeeper.Keeper + MintKeeper mintkeeper.Keeper + DistrKeeper distrkeeper.Keeper + GovKeeper *govkeeper.Keeper + CrisisKeeper *crisiskeeper.Keeper + UpgradeKeeper *upgradekeeper.Keeper + ParamsKeeper paramskeeper.Keeper + FeeGrantKeeper feegrantkeeper.Keeper EvidenceKeeper evidencekeeper.Keeper - TransferKeeper ibctransferkeeper.Keeper - FeegrantKeeper feegrantkeeper.Keeper AuthzKeeper authzkeeper.Keeper GroupKeeper groupkeeper.Keeper OracleKeeper oraclekeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper - GlobalfeeKeeper globalfeekeeper.Keeper + GlobalFeeKeeper globalfeekeeper.Keeper + // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly + IBCKeeper *ibckeeper.Keeper + ICAHostKeeper icahostkeeper.Keeper + IBCFeeKeeper ibcfeekeeper.Keeper + TransferKeeper ibctransferkeeper.Keeper + + // Modules + ICAModule ica.AppModule + TransferModule transfer.AppModule // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper @@ -56,3 +117,375 @@ type AppKeepers struct { ScopedICAHostKeeper capabilitykeeper.ScopedKeeper ScopedOracleKeeper capabilitykeeper.ScopedKeeper } + +func NewAppKeeper( + appCodec codec.Codec, + bApp *baseapp.BaseApp, + legacyAmino *codec.LegacyAmino, + maccPerms map[string][]string, + modAccAddrs map[string]bool, + blockedAddress map[string]bool, + skipUpgradeHeights map[int64]bool, + homePath string, + invCheckPeriod uint, + logger log.Logger, + appOpts servertypes.AppOptions, + owasmCacheSize uint32, +) AppKeepers { + appKeepers := AppKeepers{} + + // Set keys KVStoreKey, TransientStoreKey, MemoryStoreKey + appKeepers.GenerateKeys() + + /* + configure state listening capabilities using AppOptions + we are doing nothing with the returned streamingServices and waitGroup in this case + */ + // load state streaming if enabled + + if err := bApp.RegisterStreamingServices(appOpts, appKeepers.keys); err != nil { + logger.Error("failed to load state streaming", "err", err) + os.Exit(1) + } + + appKeepers.ParamsKeeper = initParamsKeeper( + appCodec, + legacyAmino, + appKeepers.keys[paramstypes.StoreKey], + appKeepers.tkeys[paramstypes.TStoreKey], + ) + + // set the BaseApp's parameter store + appKeepers.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(appKeepers.keys[consensusparamtypes.StoreKey]), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + runtime.EventService{}, + ) + + bApp.SetParamStore(appKeepers.ConsensusParamsKeeper.ParamsStore) + + // add capability keeper and ScopeToModule for ibc module + appKeepers.CapabilityKeeper = capabilitykeeper.NewKeeper( + appCodec, + appKeepers.keys[capabilitytypes.StoreKey], + appKeepers.memKeys[capabilitytypes.MemStoreKey], + ) + + appKeepers.ScopedIBCKeeper = appKeepers.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName) + appKeepers.ScopedICAHostKeeper = appKeepers.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) + appKeepers.ScopedTransferKeeper = appKeepers.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) + appKeepers.ScopedOracleKeeper = appKeepers.CapabilityKeeper.ScopeToModule(oracletypes.ModuleName) + + // Applications that wish to enforce statically created ScopedKeepers should call `Seal` after creating + // their scoped modules in `NewApp` with `ScopeToModule` + appKeepers.CapabilityKeeper.Seal() + + // Add normal keepers + appKeepers.AccountKeeper = authkeeper.NewAccountKeeper( + appCodec, + runtime.NewKVStoreService(appKeepers.keys[authtypes.StoreKey]), + authtypes.ProtoBaseAccount, + maccPerms, + address.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), + sdk.GetConfig().GetBech32AccountAddrPrefix(), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + // wrappedBankerKeeper overrides burn token behavior to instead transfer to community pool. + appKeepers.BankKeeper = bankkeeper.NewBaseKeeper( + appCodec, + runtime.NewKVStoreService(appKeepers.keys[banktypes.StoreKey]), + appKeepers.AccountKeeper, + blockedAddress, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + logger, + ) + + wrapBank := bandbankkeeper.NewWrappedBankKeeperBurnToCommunityPool( + appKeepers.BankKeeper, + appKeepers.AccountKeeper, + logger, + ) + + appKeepers.CrisisKeeper = crisiskeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(appKeepers.keys[crisistypes.StoreKey]), + invCheckPeriod, + appKeepers.BankKeeper, + authtypes.FeeCollectorName, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + appKeepers.AccountKeeper.AddressCodec(), + ) + + appKeepers.AuthzKeeper = authzkeeper.NewKeeper( + runtime.NewKVStoreService(appKeepers.keys[authzkeeper.StoreKey]), + appCodec, + bApp.MsgServiceRouter(), + appKeepers.AccountKeeper, + ) + + appKeepers.FeeGrantKeeper = feegrantkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(appKeepers.keys[feegrant.StoreKey]), + appKeepers.AccountKeeper, + ) + + // Using pointer of WrapBankKeeper in staking module + appKeepers.StakingKeeper = stakingkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(appKeepers.keys[stakingtypes.StoreKey]), + appKeepers.AccountKeeper, + wrapBank, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), + ) + + appKeepers.MintKeeper = mintkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(appKeepers.keys[minttypes.StoreKey]), + appKeepers.StakingKeeper, + appKeepers.AccountKeeper, + appKeepers.BankKeeper, + authtypes.FeeCollectorName, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + appKeepers.DistrKeeper = distrkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(appKeepers.keys[distrtypes.StoreKey]), + appKeepers.AccountKeeper, + appKeepers.BankKeeper, + appKeepers.StakingKeeper, + authtypes.FeeCollectorName, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + wrapBank.SetDistrKeeper(&appKeepers.DistrKeeper) + + appKeepers.SlashingKeeper = slashingkeeper.NewKeeper( + appCodec, + legacyAmino, + runtime.NewKVStoreService(appKeepers.keys[slashingtypes.StoreKey]), + appKeepers.StakingKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + // register the staking hooks + // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks + appKeepers.StakingKeeper.SetHooks( + stakingtypes.NewMultiStakingHooks( + appKeepers.DistrKeeper.Hooks(), + appKeepers.SlashingKeeper.Hooks(), + ), + ) + + // UpgradeKeeper must be created before IBCKeeper + appKeepers.UpgradeKeeper = upgradekeeper.NewKeeper( + skipUpgradeHeights, + runtime.NewKVStoreService(appKeepers.keys[upgradetypes.StoreKey]), + appCodec, + homePath, + bApp, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + // UpgradeKeeper must be created before IBCKeeper + appKeepers.IBCKeeper = ibckeeper.NewKeeper( + appCodec, + appKeepers.keys[ibcexported.StoreKey], + appKeepers.GetSubspace(ibcexported.ModuleName), + appKeepers.StakingKeeper, + appKeepers.UpgradeKeeper, + appKeepers.ScopedIBCKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + groupConfig := group.DefaultConfig() + appKeepers.GroupKeeper = groupkeeper.NewKeeper( + appKeepers.keys[group.StoreKey], + appCodec, + bApp.MsgServiceRouter(), + appKeepers.AccountKeeper, + groupConfig, + ) + + govConfig := govtypes.DefaultConfig() + // set the MaxMetadataLen for proposals to the same value as it was pre-sdk v0.47.x + govConfig.MaxMetadataLen = 10200 + appKeepers.GovKeeper = govkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(appKeepers.keys[govtypes.StoreKey]), + appKeepers.AccountKeeper, + appKeepers.BankKeeper, + appKeepers.StakingKeeper, + appKeepers.DistrKeeper, + bApp.MsgServiceRouter(), + govConfig, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + // Register the proposal types + // Deprecated: Avoid adding new handlers, instead use the new proposal flow + // by granting the governance module the right to execute the message. + // See: https://docs.cosmos.network/main/modules/gov#proposal-messages + govRouter := govv1beta1.NewRouter() + govRouter. + AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). + AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(appKeepers.ParamsKeeper)) + + // Set legacy router for backwards compatibility with gov v1beta1 + appKeepers.GovKeeper.SetLegacyRouter(govRouter) + + appKeepers.GovKeeper = appKeepers.GovKeeper.SetHooks( + govtypes.NewMultiGovHooks( + // register the governance hooks + ), + ) + + evidenceKeeper := evidencekeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(appKeepers.keys[evidencetypes.StoreKey]), + appKeepers.StakingKeeper, + appKeepers.SlashingKeeper, + appKeepers.AccountKeeper.AddressCodec(), + runtime.ProvideCometInfoService(), + ) + + // If evidence needs to be handled for the app, set routes in router here and seal + appKeepers.EvidenceKeeper = *evidenceKeeper + + appKeepers.GlobalFeeKeeper = globalfeekeeper.NewKeeper( + appCodec, + appKeepers.keys[globalfeetypes.StoreKey], + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + appKeepers.IBCFeeKeeper = ibcfeekeeper.NewKeeper( + appCodec, appKeepers.keys[ibcfeetypes.StoreKey], + appKeepers.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware + appKeepers.IBCKeeper.ChannelKeeper, + appKeepers.IBCKeeper.PortKeeper, appKeepers.AccountKeeper, appKeepers.BankKeeper, + ) + + // ICA Host keeper + appKeepers.ICAHostKeeper = icahostkeeper.NewKeeper( + appCodec, + appKeepers.keys[icahosttypes.StoreKey], + appKeepers.GetSubspace(icahosttypes.SubModuleName), + appKeepers.IBCKeeper.ChannelKeeper, // ICS4Wrapper + appKeepers.IBCKeeper.ChannelKeeper, + appKeepers.IBCKeeper.PortKeeper, + appKeepers.AccountKeeper, + appKeepers.ScopedICAHostKeeper, + bApp.MsgServiceRouter(), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + // required since ibc-go v7.5.0 + appKeepers.ICAHostKeeper.WithQueryRouter(bApp.GRPCQueryRouter()) + + appKeepers.TransferKeeper = ibctransferkeeper.NewKeeper( + appCodec, + appKeepers.keys[ibctransfertypes.StoreKey], + appKeepers.GetSubspace(ibctransfertypes.ModuleName), + appKeepers.IBCFeeKeeper, + appKeepers.IBCKeeper.ChannelKeeper, + appKeepers.IBCKeeper.PortKeeper, + appKeepers.AccountKeeper, + appKeepers.BankKeeper, + appKeepers.ScopedTransferKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + owasmVM, err := owasm.NewVm(owasmCacheSize) + if err != nil { + panic(err) + } + + appKeepers.OracleKeeper = oraclekeeper.NewKeeper( + appCodec, + appKeepers.keys[oracletypes.StoreKey], + filepath.Join(homePath, "files"), + authtypes.FeeCollectorName, + appKeepers.AccountKeeper, + appKeepers.BankKeeper, + appKeepers.StakingKeeper, + appKeepers.DistrKeeper, + appKeepers.AuthzKeeper, + appKeepers.IBCFeeKeeper, + appKeepers.IBCKeeper.PortKeeper, + appKeepers.ScopedOracleKeeper, + owasmVM, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + // Middleware Stacks + appKeepers.ICAModule = ica.NewAppModule(nil, &appKeepers.ICAHostKeeper) + appKeepers.TransferModule = transfer.NewAppModule(appKeepers.TransferKeeper) + + // Create Transfer Stack + var transferStack porttypes.IBCModule + transferStack = transfer.NewIBCModule(appKeepers.TransferKeeper) + transferStack = ibcfee.NewIBCMiddleware(transferStack, appKeepers.IBCFeeKeeper) + + // Create ICAHost Stack + var icaHostStack porttypes.IBCModule + icaHostStack = icahost.NewIBCModule(appKeepers.ICAHostKeeper) + icaHostStack = ibcfee.NewIBCMiddleware(icaHostStack, appKeepers.IBCFeeKeeper) + + // Create Oracle Stack + var oracleStack porttypes.IBCModule = oracle.NewIBCModule(appKeepers.OracleKeeper) + + ibcRouter := porttypes.NewRouter().AddRoute(icahosttypes.SubModuleName, icaHostStack). + AddRoute(ibctransfertypes.ModuleName, transferStack). + AddRoute(oracletypes.ModuleName, oracleStack) + + appKeepers.IBCKeeper.SetRouter(ibcRouter) + + return appKeepers +} + +// GetSubspace returns a param subspace for a given module name. +func (appKeepers *AppKeepers) GetSubspace(moduleName string) paramstypes.Subspace { + subspace, ok := appKeepers.ParamsKeeper.GetSubspace(moduleName) + if !ok { + panic("couldn't load subspace for module: " + moduleName) + } + return subspace +} + +// initParamsKeeper init params keeper and its subspaces +func initParamsKeeper( + appCodec codec.BinaryCodec, + legacyAmino *codec.LegacyAmino, + key, tkey storetypes.StoreKey, +) paramskeeper.Keeper { + paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) + + // register the key tables for legacy param subspaces + keyTable := ibcclienttypes.ParamKeyTable() + keyTable.RegisterParamSet(&ibcconnectiontypes.Params{}) + paramsKeeper.Subspace(authtypes.ModuleName).WithKeyTable(authtypes.ParamKeyTable()) //nolint: staticcheck + paramsKeeper.Subspace(stakingtypes.ModuleName). + WithKeyTable(stakingtypes.ParamKeyTable()) //nolint: staticcheck // SA1019 + paramsKeeper.Subspace(banktypes.ModuleName). + WithKeyTable(banktypes.ParamKeyTable()) //nolint: staticcheck // SA1019 + paramsKeeper.Subspace(minttypes.ModuleName). + WithKeyTable(minttypes.ParamKeyTable()) //nolint: staticcheck // SA1019 + paramsKeeper.Subspace(distrtypes.ModuleName). + WithKeyTable(distrtypes.ParamKeyTable()) //nolint: staticcheck // SA1019 + paramsKeeper.Subspace(slashingtypes.ModuleName). + WithKeyTable(slashingtypes.ParamKeyTable()) //nolint: staticcheck // SA1019 + paramsKeeper.Subspace(govtypes.ModuleName). + WithKeyTable(govv1.ParamKeyTable()) //nolint: staticcheck // SA1019 + paramsKeeper.Subspace(crisistypes.ModuleName). + WithKeyTable(crisistypes.ParamKeyTable()) //nolint: staticcheck // SA1019 + paramsKeeper.Subspace(ibcexported.ModuleName) + paramsKeeper.Subspace(ibctransfertypes.ModuleName) + paramsKeeper.Subspace(icahosttypes.SubModuleName) + paramsKeeper.Subspace(oracletypes.ModuleName) + + return paramsKeeper +} diff --git a/app/keepers/keys.go b/app/keepers/keys.go new file mode 100644 index 000000000..905e1377f --- /dev/null +++ b/app/keepers/keys.go @@ -0,0 +1,98 @@ +package keepers + +import ( + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" + ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + + storetypes "cosmossdk.io/store/types" + evidencetypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" + upgradetypes "cosmossdk.io/x/upgrade/types" + + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" + crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/group" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + globalfeetypes "github.com/bandprotocol/chain/v3/x/globalfee/types" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" +) + +func (appKeepers *AppKeepers) GenerateKeys() { + // Define what keys will be used in the cosmos-sdk key/value store. + // Cosmos-SDK modules each have a "key" that allows the application to reference what they've stored on the chain. + appKeepers.keys = storetypes.NewKVStoreKeys( + authtypes.StoreKey, + banktypes.StoreKey, + stakingtypes.StoreKey, + crisistypes.StoreKey, + minttypes.StoreKey, + distrtypes.StoreKey, + slashingtypes.StoreKey, + govtypes.StoreKey, + paramstypes.StoreKey, + consensusparamtypes.StoreKey, + ibcexported.StoreKey, + upgradetypes.StoreKey, + evidencetypes.StoreKey, + ibctransfertypes.StoreKey, + capabilitytypes.StoreKey, + feegrant.StoreKey, + authzkeeper.StoreKey, + icahosttypes.StoreKey, + group.StoreKey, + oracletypes.StoreKey, + globalfeetypes.StoreKey, + ibcfeetypes.StoreKey, + ) + + // Define transient store keys + appKeepers.tkeys = storetypes.NewTransientStoreKeys(paramstypes.TStoreKey) + + // MemKeys are for information that is stored only in RAM. + appKeepers.memKeys = storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) +} + +func (appKeepers *AppKeepers) GetKVStoreKey() map[string]*storetypes.KVStoreKey { + return appKeepers.keys +} + +func (appKeepers *AppKeepers) GetTransientStoreKey() map[string]*storetypes.TransientStoreKey { + return appKeepers.tkeys +} + +func (appKeepers *AppKeepers) GetMemoryStoreKey() map[string]*storetypes.MemoryStoreKey { + return appKeepers.memKeys +} + +// GetKey returns the KVStoreKey for the provided store key. +// +// NOTE: This is solely to be used for testing purposes. +func (appKeepers *AppKeepers) GetKey(storeKey string) *storetypes.KVStoreKey { + return appKeepers.keys[storeKey] +} + +// GetTKey returns the TransientStoreKey for the provided store key. +// +// NOTE: This is solely to be used for testing purposes. +func (appKeepers *AppKeepers) GetTKey(storeKey string) *storetypes.TransientStoreKey { + return appKeepers.tkeys[storeKey] +} + +// GetMemKey returns the MemStoreKey for the provided mem key. +// +// NOTE: This is solely used for testing purposes. +func (appKeepers *AppKeepers) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { + return appKeepers.memKeys[storeKey] +} diff --git a/app/modules.go b/app/modules.go new file mode 100644 index 000000000..aadfb903a --- /dev/null +++ b/app/modules.go @@ -0,0 +1,347 @@ +package band + +import ( + "github.com/cosmos/ibc-go/modules/capability" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" + ibcfee "github.com/cosmos/ibc-go/v8/modules/apps/29-fee" + ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v8/modules/core" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" + + "cosmossdk.io/x/evidence" + evidencetypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" + feegrantmodule "cosmossdk.io/x/feegrant/module" + "cosmossdk.io/x/upgrade" + upgradetypes "cosmossdk.io/x/upgrade/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/x/auth" + authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting" + vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + "github.com/cosmos/cosmos-sdk/x/authz" + authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" + "github.com/cosmos/cosmos-sdk/x/bank" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/consensus" + consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" + "github.com/cosmos/cosmos-sdk/x/crisis" + crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + distr "github.com/cosmos/cosmos-sdk/x/distribution" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + "github.com/cosmos/cosmos-sdk/x/gov" + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/group" + groupmodule "github.com/cosmos/cosmos-sdk/x/group/module" + "github.com/cosmos/cosmos-sdk/x/mint" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + sdkparams "github.com/cosmos/cosmos-sdk/x/params" + paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/cosmos/cosmos-sdk/x/slashing" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + "github.com/cosmos/cosmos-sdk/x/staking" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + "github.com/bandprotocol/chain/v3/x/globalfee" + globalfeetypes "github.com/bandprotocol/chain/v3/x/globalfee/types" + "github.com/bandprotocol/chain/v3/x/oracle" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" +) + +var maccPerms = map[string][]string{ + authtypes.FeeCollectorName: nil, + distrtypes.ModuleName: nil, + icatypes.ModuleName: nil, + minttypes.ModuleName: {authtypes.Minter}, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + govtypes.ModuleName: {authtypes.Burner}, + ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + ibcfeetypes.ModuleName: nil, +} + +func appModules( + app *BandApp, + appCodec codec.Codec, + txConfig client.TxEncodingConfig, + skipGenesisInvariants bool, +) []module.AppModule { + return []module.AppModule{ + genutil.NewAppModule( + app.AccountKeeper, + app.StakingKeeper, + app, + txConfig, + ), + auth.NewAppModule(appCodec, app.AccountKeeper, nil, app.GetSubspace(authtypes.ModuleName)), + vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), + bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), + capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), + crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), + gov.NewAppModule( + appCodec, + app.GovKeeper, + app.AccountKeeper, + app.BankKeeper, + app.GetSubspace(govtypes.ModuleName), + ), + mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), + slashing.NewAppModule( + appCodec, + app.SlashingKeeper, + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + app.GetSubspace(slashingtypes.ModuleName), + app.interfaceRegistry, + ), + distr.NewAppModule( + appCodec, + app.DistrKeeper, + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + app.GetSubspace(distrtypes.ModuleName), + ), + staking.NewAppModule( + appCodec, + app.StakingKeeper, + app.AccountKeeper, + app.BankKeeper, + app.GetSubspace(stakingtypes.ModuleName), + ), + upgrade.NewAppModule(app.UpgradeKeeper, app.AccountKeeper.AddressCodec()), + evidence.NewAppModule(app.EvidenceKeeper), + feegrantmodule.NewAppModule( + appCodec, + app.AccountKeeper, + app.BankKeeper, + app.FeeGrantKeeper, + app.interfaceRegistry, + ), + authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), + ibc.NewAppModule(app.IBCKeeper), + ibctm.NewAppModule(), + sdkparams.NewAppModule(app.ParamsKeeper), + consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), + groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), + oracle.NewAppModule( + appCodec, + app.OracleKeeper, + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + app.GetSubspace(oracletypes.ModuleName), + app.hooks, + ), + app.TransferModule, + app.ICAModule, + globalfee.NewAppModule(app.GlobalFeeKeeper), + ibcfee.NewAppModule(app.IBCFeeKeeper), + } +} + +// ModuleBasics defines the module BasicManager that is in charge of setting up basic, +// non-dependant module elements, such as codec registration +// and genesis verification. +func newBasicManagerFromManager(app *BandApp) module.BasicManager { + basicManager := module.NewBasicManagerFromManager( + app.mm, + map[string]module.AppModuleBasic{ + genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), + govtypes.ModuleName: gov.NewAppModuleBasic( + []govclient.ProposalHandler{ + paramsclient.ProposalHandler, + }, + ), + }) + basicManager.RegisterLegacyAminoCodec(app.legacyAmino) + basicManager.RegisterInterfaces(app.interfaceRegistry) + return basicManager +} + +// simulationModules returns modules for simulation manager +// define the order of the modules for deterministic simulations +func simulationModules( + app *BandApp, + appCodec codec.Codec, + _ bool, +) []module.AppModuleSimulation { + return []module.AppModuleSimulation{ + auth.NewAppModule( + appCodec, + app.AccountKeeper, + authsims.RandomGenesisAccounts, + app.GetSubspace(authtypes.ModuleName), + ), + bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), + capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), + feegrantmodule.NewAppModule( + appCodec, + app.AccountKeeper, + app.BankKeeper, + app.FeeGrantKeeper, + app.interfaceRegistry, + ), + gov.NewAppModule( + appCodec, + app.GovKeeper, + app.AccountKeeper, + app.BankKeeper, + app.GetSubspace(govtypes.ModuleName), + ), + mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), + staking.NewAppModule( + appCodec, + app.StakingKeeper, + app.AccountKeeper, + app.BankKeeper, + app.GetSubspace(stakingtypes.ModuleName), + ), + distr.NewAppModule( + appCodec, + app.DistrKeeper, + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + app.GetSubspace(distrtypes.ModuleName), + ), + slashing.NewAppModule( + appCodec, + app.SlashingKeeper, + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + app.GetSubspace(slashingtypes.ModuleName), + app.interfaceRegistry, + ), + sdkparams.NewAppModule(app.ParamsKeeper), + evidence.NewAppModule(app.EvidenceKeeper), + authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), + groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), + oracle.NewAppModule( + appCodec, + app.OracleKeeper, + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + app.GetSubspace(oracletypes.ModuleName), + app.hooks, + ), + ibc.NewAppModule(app.IBCKeeper), + app.TransferModule, + } +} + +func orderBeginBlockers() []string { + return []string{ + capabilitytypes.ModuleName, + minttypes.ModuleName, + oracletypes.ModuleName, + distrtypes.ModuleName, + slashingtypes.ModuleName, + evidencetypes.ModuleName, + stakingtypes.ModuleName, + authtypes.ModuleName, + banktypes.ModuleName, + govtypes.ModuleName, + crisistypes.ModuleName, + ibcexported.ModuleName, + ibctransfertypes.ModuleName, + icatypes.ModuleName, + ibcfeetypes.ModuleName, + genutiltypes.ModuleName, + authz.ModuleName, + feegrant.ModuleName, + group.ModuleName, + paramstypes.ModuleName, + vestingtypes.ModuleName, + consensusparamtypes.ModuleName, + globalfeetypes.ModuleName, + } +} + +/* +Interchain Security Requirements: +- provider.EndBlock gets validator updates from the staking module; +thus, staking.EndBlock must be executed before provider.EndBlock; +- creating a new consumer chain requires the following order, +CreateChildClient(), staking.EndBlock, provider.EndBlock; +thus, gov.EndBlock must be executed before staking.EndBlock +*/ +func orderEndBlockers() []string { + return []string{ + crisistypes.ModuleName, + govtypes.ModuleName, + stakingtypes.ModuleName, + oracletypes.ModuleName, + ibcexported.ModuleName, + ibctransfertypes.ModuleName, + icatypes.ModuleName, + capabilitytypes.ModuleName, + ibcfeetypes.ModuleName, + authtypes.ModuleName, + banktypes.ModuleName, + distrtypes.ModuleName, + slashingtypes.ModuleName, + minttypes.ModuleName, + genutiltypes.ModuleName, + evidencetypes.ModuleName, + authz.ModuleName, + feegrant.ModuleName, + group.ModuleName, + paramstypes.ModuleName, + upgradetypes.ModuleName, + vestingtypes.ModuleName, + consensusparamtypes.ModuleName, + globalfeetypes.ModuleName, + } +} + +/* +NOTE: The genutils module must occur after staking so that pools are +properly initialized with tokens from genesis accounts. +NOTE: The genutils module must also occur after auth so that it can access the params from auth. +NOTE: Capability module must occur first so that it can initialize any capabilities +so that other modules that want to create or claim capabilities afterwards in InitChain +can do so safely. +*/ +func orderInitBlockers() []string { + return []string{ + capabilitytypes.ModuleName, + authtypes.ModuleName, + banktypes.ModuleName, + distrtypes.ModuleName, + govtypes.ModuleName, + stakingtypes.ModuleName, + slashingtypes.ModuleName, + minttypes.ModuleName, + crisistypes.ModuleName, + genutiltypes.ModuleName, + ibctransfertypes.ModuleName, + ibcexported.ModuleName, + icatypes.ModuleName, + ibcfeetypes.ModuleName, + evidencetypes.ModuleName, + authz.ModuleName, + feegrant.ModuleName, + group.ModuleName, + paramstypes.ModuleName, + upgradetypes.ModuleName, + vestingtypes.ModuleName, + consensusparamtypes.ModuleName, + oracletypes.ModuleName, + globalfeetypes.ModuleName, + } +} diff --git a/app/params/amino.go b/app/params/amino.go new file mode 100644 index 000000000..364e917b3 --- /dev/null +++ b/app/params/amino.go @@ -0,0 +1,23 @@ +//go:build test_amino +// +build test_amino + +package params + +import ( + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" +) + +func MakeTestEncodingConfig() EncodingConfig { + cdc := codec.NewLegacyAmino() + interfaceRegistry := cdctypes.NewInterfaceRegistry() + codec := codec.NewProtoCodec(interfaceRegistry) + + return EncodingConfig{ + InterfaceRegistry: interfaceRegistry, + Marshaler: codec, + TxConfig: legacytx.StdTxConfig{Cdc: cdc}, + Amino: cdc, + } +} diff --git a/app/params/proto.go b/app/params/proto.go index 84ff35a39..2de22cebf 100644 --- a/app/params/proto.go +++ b/app/params/proto.go @@ -1,21 +1,39 @@ package params import ( + "github.com/cosmos/gogoproto/proto" + + "cosmossdk.io/x/tx/signing" + "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/codec/address" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/tx" ) // MakeEncodingConfig creates an EncodingConfig for an amino based test configuration. func MakeEncodingConfig() EncodingConfig { amino := codec.NewLegacyAmino() - interfaceRegistry := types.NewInterfaceRegistry() - marshaler := codec.NewProtoCodec(interfaceRegistry) - txCfg := tx.NewTxConfig(marshaler, tx.DefaultSignModes) - + interfaceRegistry, err := codectypes.NewInterfaceRegistryWithOptions(codectypes.InterfaceRegistryOptions{ + ProtoFiles: proto.HybridResolver, + SigningOptions: signing.Options{ + AddressCodec: address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(), + }, + ValidatorAddressCodec: address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(), + }, + }, + }) + if err != nil { + panic(err) + } + cdc := codec.NewProtoCodec(interfaceRegistry) + txCfg := tx.NewTxConfig(cdc, tx.DefaultSignModes) return EncodingConfig{ InterfaceRegistry: interfaceRegistry, - Marshaler: marshaler, + Marshaler: cdc, TxConfig: txCfg, Amino: amino, } diff --git a/app/post.go b/app/post.go new file mode 100644 index 000000000..009203243 --- /dev/null +++ b/app/post.go @@ -0,0 +1,14 @@ +package band + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// PostHandlerOptions are the options required for constructing PostHandlers. +type PostHandlerOptions struct{} + +// NewPostHandler returns a PostHandler chain with decorators. +func NewPostHandler(options PostHandlerOptions) (sdk.PostHandler, error) { + postDecorators := []sdk.PostDecorator{} + return sdk.ChainPostDecorators(postDecorators...), nil +} diff --git a/app/sim_test.go b/app/sim_test.go index 9b45c24b6..df532972c 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -9,24 +9,28 @@ import ( "strings" "testing" - dbm "github.com/cometbft/cometbft-db" + "github.com/stretchr/testify/require" + abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + + dbm "github.com/cosmos/cosmos-db" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + + "cosmossdk.io/log" + "cosmossdk.io/store" + storetypes "cosmossdk.io/store/types" + evidencetypes "cosmossdk.io/x/evidence/types" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -34,9 +38,8 @@ import ( simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/require" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) // BandAppChainID hardcoded chainID for simulation @@ -96,9 +99,9 @@ func TestFullAppSimulation(t *testing.T) { nil, true, map[int64]bool{}, + DefaultNodeHome, appOptions, 100, - "", "", "", fauxMerkleModeOpt, baseapp.SetChainID(BandAppChainID), ) @@ -109,7 +112,7 @@ func TestFullAppSimulation(t *testing.T) { t, os.Stdout, app.BaseApp, - simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), NewDefaultGenesisState()), + simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), NewDefaultGenesisState(app.AppCodec())), simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 simtestutil.SimulationOperations(app, app.AppCodec(), config), app.ModuleAccountAddrs(), @@ -158,9 +161,9 @@ func TestAppImportExport(t *testing.T) { nil, true, map[int64]bool{}, + DefaultNodeHome, appOptions, 100, - "", "", "", fauxMerkleModeOpt, baseapp.SetChainID(BandAppChainID), ) @@ -171,7 +174,7 @@ func TestAppImportExport(t *testing.T) { t, os.Stdout, app.BaseApp, - simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), NewDefaultGenesisState()), + simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), NewDefaultGenesisState(app.AppCodec())), simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 simtestutil.SimulationOperations(app, app.AppCodec(), config), app.ModuleAccountAddrs(), @@ -215,9 +218,9 @@ func TestAppImportExport(t *testing.T) { nil, true, map[int64]bool{}, + DefaultNodeHome, appOptions, 100, - "", "", "", fauxMerkleModeOpt, baseapp.SetChainID(BandAppChainID), ) @@ -238,10 +241,12 @@ func TestAppImportExport(t *testing.T) { } }() - ctxA := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) - ctxB := newApp.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) - newApp.mm.InitGenesis(ctxB, app.AppCodec(), genesisState) - newApp.StoreConsensusParams(ctxB, exported.ConsensusParams) + ctxA := app.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()}) + ctxB := newApp.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()}) + _, err = newApp.mm.InitGenesis(ctxB, app.AppCodec(), genesisState) + require.NoError(t, err) + err = newApp.StoreConsensusParams(ctxB, exported.ConsensusParams) + require.NoError(t, err) fmt.Printf("comparing stores...\n") @@ -282,7 +287,7 @@ func TestAppImportExport(t *testing.T) { storeA := ctxA.KVStore(skp.A) storeB := ctxB.KVStore(skp.B) - failedKVAs, failedKVBs := sdk.DiffKVStores(storeA, storeB, skp.Prefixes) + failedKVAs, failedKVBs := simtestutil.DiffKVStores(storeA, storeB, skp.Prefixes) require.Equal(t, len(failedKVAs), len(failedKVBs), "unequal sets of key-values to compare") fmt.Printf("compared %d different key/value pairs between %s and %s\n", len(failedKVAs), skp.A, skp.B) @@ -326,9 +331,9 @@ func TestAppSimulationAfterImport(t *testing.T) { nil, true, map[int64]bool{}, + DefaultNodeHome, appOptions, 100, - "", "", "", fauxMerkleModeOpt, baseapp.SetChainID(BandAppChainID), ) @@ -339,7 +344,7 @@ func TestAppSimulationAfterImport(t *testing.T) { t, os.Stdout, app.BaseApp, - simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), NewDefaultGenesisState()), + simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), NewDefaultGenesisState(app.AppCodec())), simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 simtestutil.SimulationOperations(app, app.AppCodec(), config), app.ModuleAccountAddrs(), @@ -388,25 +393,26 @@ func TestAppSimulationAfterImport(t *testing.T) { nil, true, map[int64]bool{}, + DefaultNodeHome, appOptions, 100, - "", "", "", fauxMerkleModeOpt, baseapp.SetChainID(BandAppChainID), ) require.Equal(t, "BandApp", newApp.Name()) - newApp.InitChain(abci.RequestInitChain{ + _, err = newApp.InitChain(&abci.RequestInitChain{ ChainId: BandAppChainID, AppStateBytes: exported.AppState, }) + require.NoError(t, err) _, _, err = simulation.SimulateFromSeed( t, os.Stdout, newApp.BaseApp, - simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), NewDefaultGenesisState()), + simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), NewDefaultGenesisState(app.AppCodec())), simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 simtestutil.SimulationOperations(newApp, newApp.AppCodec(), config), app.ModuleAccountAddrs(), @@ -453,7 +459,7 @@ func TestAppStateDeterminism(t *testing.T) { for j := 0; j < numTimesToRunPerSeed; j++ { var logger log.Logger if simcli.FlagVerboseValue { - logger = log.TestingLogger() + logger = log.NewTestLogger(t) } else { logger = log.NewNopLogger() } @@ -465,9 +471,9 @@ func TestAppStateDeterminism(t *testing.T) { nil, true, map[int64]bool{}, + DefaultNodeHome, appOptions, 100, - "", "", "", interBlockCacheOpt(), baseapp.SetChainID(BandAppChainID), ) @@ -482,7 +488,11 @@ func TestAppStateDeterminism(t *testing.T) { t, os.Stdout, app.BaseApp, - simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), NewDefaultGenesisState()), + simtestutil.AppStateFn( + app.AppCodec(), + app.SimulationManager(), + NewDefaultGenesisState(app.AppCodec()), + ), simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 simtestutil.SimulationOperations(app, app.AppCodec(), config), app.ModuleAccountAddrs(), diff --git a/app/upgrades/types.go b/app/upgrades/types.go index bc2e0b7dc..6aa231738 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -1,14 +1,12 @@ package upgrades import ( - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - store "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" + store "cosmossdk.io/store/types" + upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/types/module" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/bandprotocol/chain/v2/app/keepers" + "github.com/bandprotocol/chain/v3/app/keepers" ) // Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal @@ -16,20 +14,12 @@ import ( // An upgrade must implement this struct, and then set it in the app.go. // The app.go will then define the handler. type Upgrade struct { - // Upgrade version name, for the upgrade handler, e.g. `v7`. + // Upgrade version name, for the upgrade handler, e.g. `v7` UpgradeName string - // CreateUpgradeHandler defines the function that creates an upgrade handler. - CreateUpgradeHandler func(*module.Manager, module.Configurator, AppManager, *keepers.AppKeepers) upgradetypes.UpgradeHandler + // CreateUpgradeHandler defines the function that creates an upgrade handler + CreateUpgradeHandler func(*module.Manager, module.Configurator, *keepers.AppKeepers) upgradetypes.UpgradeHandler // Store upgrades, should be used for any new modules introduced, new modules deleted, or store names renamed. StoreUpgrades store.StoreUpgrades } - -// BaseAppParamManager defines an interface that BaseApp is expected to fulfill -// that allows upgrade handlers to modify BaseApp parameters. -type AppManager interface { - GetConsensusParams(ctx sdk.Context) *tmproto.ConsensusParams - StoreConsensusParams(ctx sdk.Context, cp *tmproto.ConsensusParams) - GetSubspace(moduleName string) paramstypes.Subspace -} diff --git a/app/upgrades/v2_4/constants.go b/app/upgrades/v2_4/constants.go deleted file mode 100644 index e811ccb6a..000000000 --- a/app/upgrades/v2_4/constants.go +++ /dev/null @@ -1,18 +0,0 @@ -package v2_4 - -import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - - "github.com/bandprotocol/chain/v2/app/upgrades" -) - -const UpgradeName = "v2_4" - -var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - CreateUpgradeHandler: CreateUpgradeHandler, - StoreUpgrades: storetypes.StoreUpgrades{ - Added: []string{icahosttypes.StoreKey}, - }, -} diff --git a/app/upgrades/v2_4/upgrades.go b/app/upgrades/v2_4/upgrades.go deleted file mode 100644 index 0f9716b47..000000000 --- a/app/upgrades/v2_4/upgrades.go +++ /dev/null @@ -1,104 +0,0 @@ -package v2_4 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - "github.com/cosmos/cosmos-sdk/x/authz" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" - icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - - "github.com/bandprotocol/chain/v2/app/keepers" - "github.com/bandprotocol/chain/v2/app/upgrades" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - am upgrades.AppManager, - keepers *keepers.AppKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, _ module.VersionMap) (module.VersionMap, error) { - // hardcode version of all modules of v2.3.x - fromVM := map[string]uint64{ - "auth": 2, - "authz": 1, - "bank": 2, - "capability": 1, - "crisis": 1, - "distribution": 2, - "evidence": 1, - "feegrant": 1, - "genutil": 1, - "gov": 2, - "ibc": 2, - "mint": 1, - "oracle": 1, - "params": 1, - "slashing": 2, - "staking": 2, - "transfer": 1, - "upgrade": 1, - "vesting": 1, - } - - // set version of ica so that it won't run initgenesis again - fromVM["interchainaccounts"] = 1 - - // prepare ICS27 controller and host params - controllerParams := icacontrollertypes.Params{} - hostParams := icahosttypes.Params{ - HostEnabled: true, - AllowMessages: []string{ - sdk.MsgTypeURL(&authz.MsgExec{}), - sdk.MsgTypeURL(&authz.MsgGrant{}), - sdk.MsgTypeURL(&authz.MsgRevoke{}), - sdk.MsgTypeURL(&banktypes.MsgSend{}), - sdk.MsgTypeURL(&banktypes.MsgMultiSend{}), - sdk.MsgTypeURL(&distrtypes.MsgSetWithdrawAddress{}), - sdk.MsgTypeURL(&distrtypes.MsgWithdrawValidatorCommission{}), - sdk.MsgTypeURL(&distrtypes.MsgFundCommunityPool{}), - sdk.MsgTypeURL(&distrtypes.MsgWithdrawDelegatorReward{}), - sdk.MsgTypeURL(&feegrant.MsgGrantAllowance{}), - sdk.MsgTypeURL(&feegrant.MsgRevokeAllowance{}), - sdk.MsgTypeURL(&govv1beta1.MsgVoteWeighted{}), - sdk.MsgTypeURL(&govv1beta1.MsgSubmitProposal{}), - sdk.MsgTypeURL(&govv1beta1.MsgDeposit{}), - sdk.MsgTypeURL(&govv1beta1.MsgVote{}), - sdk.MsgTypeURL(&stakingtypes.MsgEditValidator{}), - sdk.MsgTypeURL(&stakingtypes.MsgDelegate{}), - sdk.MsgTypeURL(&stakingtypes.MsgUndelegate{}), - sdk.MsgTypeURL(&stakingtypes.MsgBeginRedelegate{}), - sdk.MsgTypeURL(&stakingtypes.MsgCreateValidator{}), - sdk.MsgTypeURL(&vestingtypes.MsgCreateVestingAccount{}), - sdk.MsgTypeURL(&ibctransfertypes.MsgTransfer{}), - }, - } - - // Oracle DefaultParams only upgrade BaseRequestGas to 50000 - if err := keepers.OracleKeeper.SetParams(ctx, oracletypes.DefaultParams()); err != nil { - return nil, err - } - - consensusParam := am.GetConsensusParams(ctx) - consensusParam.Block.MaxGas = 50_000_000 - am.StoreConsensusParams(ctx, consensusParam) - - // initialize ICS27 module - icaModule, _ := mm.Modules[icatypes.ModuleName].(ica.AppModule) - icaModule.InitModule(ctx, controllerParams, hostParams) - - // run migrations - return mm.RunMigrations(ctx, configurator, fromVM) - } -} diff --git a/app/upgrades/v2_5/constants.go b/app/upgrades/v2_5/constants.go deleted file mode 100644 index 76038188e..000000000 --- a/app/upgrades/v2_5/constants.go +++ /dev/null @@ -1,15 +0,0 @@ -package v2_5 - -import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" - - "github.com/bandprotocol/chain/v2/app/upgrades" -) - -const UpgradeName = "v2_5" - -var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - CreateUpgradeHandler: CreateUpgradeHandler, - StoreUpgrades: storetypes.StoreUpgrades{}, -} diff --git a/app/upgrades/v2_5/upgrades.go b/app/upgrades/v2_5/upgrades.go deleted file mode 100644 index 1aaa025a6..000000000 --- a/app/upgrades/v2_5/upgrades.go +++ /dev/null @@ -1,29 +0,0 @@ -package v2_5 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - "github.com/bandprotocol/chain/v2/app/keepers" - "github.com/bandprotocol/chain/v2/app/upgrades" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - am upgrades.AppManager, - keepers *keepers.AppKeepers, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - ctx.Logger().Info("Starting module migrations...") - - vm, err := mm.RunMigrations(ctx, configurator, vm) - if err != nil { - return vm, err - } - - ctx.Logger().Info("Upgrade complete") - return vm, err - } -} diff --git a/app/upgrades/v2_6/constants.go b/app/upgrades/v3/constants.go similarity index 86% rename from app/upgrades/v2_6/constants.go rename to app/upgrades/v3/constants.go index 1e4de25e9..2fdc8f3e7 100644 --- a/app/upgrades/v2_6/constants.go +++ b/app/upgrades/v3/constants.go @@ -1,7 +1,12 @@ -package v2_6 +package v3 import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" + ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/feegrant" + sdk "github.com/cosmos/cosmos-sdk/types" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" "github.com/cosmos/cosmos-sdk/x/authz" @@ -9,18 +14,16 @@ import ( consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/group" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - "github.com/bandprotocol/chain/v2/app/upgrades" - globalfeetypes "github.com/bandprotocol/chain/v2/x/globalfee/types" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/app/upgrades" + globalfeetypes "github.com/bandprotocol/chain/v3/x/globalfee/types" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) -const UpgradeName = "v2_6" +const UpgradeName = "v3" var Upgrade = upgrades.Upgrade{ UpgradeName: UpgradeName, @@ -31,10 +34,12 @@ var Upgrade = upgrades.Upgrade{ globalfeetypes.StoreKey, consensusparamtypes.StoreKey, crisistypes.StoreKey, + ibcfeetypes.StoreKey, }, }, } +// TODO: Update ICA Allow messages var ICAAllowMessages = []string{ sdk.MsgTypeURL(&authz.MsgExec{}), sdk.MsgTypeURL(&authz.MsgGrant{}), diff --git a/app/upgrades/v2_6/upgrades.go b/app/upgrades/v3/upgrades.go similarity index 75% rename from app/upgrades/v2_6/upgrades.go rename to app/upgrades/v3/upgrades.go index ce52e0bda..e508d7253 100644 --- a/app/upgrades/v2_6/upgrades.go +++ b/app/upgrades/v3/upgrades.go @@ -1,6 +1,14 @@ -package v2_6 +package v3 import ( + "context" + + icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + + "cosmossdk.io/math" + upgradetypes "cosmossdk.io/x/upgrade/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -13,35 +21,31 @@ import ( paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - "github.com/bandprotocol/chain/v2/app/keepers" - "github.com/bandprotocol/chain/v2/app/upgrades" - globalfeetypes "github.com/bandprotocol/chain/v2/x/globalfee/types" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/app/keepers" + globalfeetypes "github.com/bandprotocol/chain/v3/x/globalfee/types" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, - am upgrades.AppManager, keepers *keepers.AppKeepers, ) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return func(c context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { // Set param key table for params module migration + ctx := sdk.UnwrapSDKContext(c) for _, subspace := range keepers.ParamsKeeper.GetSubspaces() { - subspace := subspace + ss := subspace var keyTable paramstypes.KeyTable - switch subspace.Name() { + switch ss.Name() { case authtypes.ModuleName: keyTable = authtypes.ParamKeyTable() //nolint:staticcheck case banktypes.ModuleName: keyTable = banktypes.ParamKeyTable() //nolint:staticcheck case stakingtypes.ModuleName: - keyTable = stakingtypes.ParamKeyTable() + keyTable = stakingtypes.ParamKeyTable() //nolint:staticcheck case minttypes.ModuleName: keyTable = minttypes.ParamKeyTable() //nolint:staticcheck case distrtypes.ModuleName: @@ -63,8 +67,8 @@ func CreateUpgradeHandler( continue } - if !subspace.HasKeyTable() { - subspace.WithKeyTable(keyTable) + if !ss.HasKeyTable() { + ss.WithKeyTable(keyTable) } } @@ -80,8 +84,8 @@ func CreateUpgradeHandler( return nil, err } - err = keepers.GlobalfeeKeeper.SetParams(ctx, globalfeetypes.Params{ - MinimumGasPrices: sdk.DecCoins{sdk.NewDecCoinFromDec("uband", sdk.NewDecWithPrec(25, 4))}, + err = keepers.GlobalFeeKeeper.SetParams(ctx, globalfeetypes.Params{ + MinimumGasPrices: sdk.DecCoins{sdk.NewDecCoinFromDec("uband", math.LegacyNewDecWithPrec(25, 4))}, }) if err != nil { return nil, err diff --git a/benchmark/app_test.go b/benchmark/app_test.go index e293298c1..ca9b0e71e 100644 --- a/benchmark/app_test.go +++ b/benchmark/app_test.go @@ -2,20 +2,30 @@ package benchmark import ( "testing" + "time" + + "github.com/stretchr/testify/require" abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/x/oracle/keeper" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + band "github.com/bandprotocol/chain/v3/app" + bandtesting "github.com/bandprotocol/chain/v3/testing" + "github.com/bandprotocol/chain/v3/x/oracle/keeper" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) +func init() { + band.SetBech32AddressPrefixesAndBip44CoinTypeAndSeal(sdk.GetConfig()) + sdk.DefaultBondDenom = "uband" +} + type BenchmarkApp struct { - *bandtesting.TestingApp + *band.BandApp Sender *Account Validator *Account Oid uint64 @@ -28,9 +38,11 @@ type BenchmarkApp struct { } func InitializeBenchmarkApp(tb testing.TB, maxGasPerBlock int64) *BenchmarkApp { - app, _ := bandtesting.CreateTestApp(&testing.T{}, false) + dir := testutil.GetTempDir(tb) + app := bandtesting.SetupWithCustomHome(false, dir) + ba := &BenchmarkApp{ - TestingApp: app, + BandApp: app, Sender: &Account{ Account: bandtesting.Owner, Num: 0, @@ -38,106 +50,66 @@ func InitializeBenchmarkApp(tb testing.TB, maxGasPerBlock int64) *BenchmarkApp { }, Validator: &Account{ Account: bandtesting.Validators[0], - Num: 5, + Num: 6, Seq: 0, }, - TB: tb, } - ba.Ctx = ba.NewUncachedContext(false, tmproto.Header{ChainID: bandtesting.ChainID}) + ba.TB = tb + ba.Ctx = ba.NewUncachedContext(false, cmtproto.Header{ChainID: bandtesting.ChainID}) ba.Querier = keeper.Querier{ Keeper: ba.OracleKeeper, } ba.TxConfig = ba.GetTxConfig() ba.TxEncoder = ba.TxConfig.TxEncoder() - ba.Commit() - ba.CallBeginBlock() + err := ba.StoreConsensusParams(ba.Ctx, GetConsensusParams(maxGasPerBlock)) + require.NoError(tb, err) - ba.StoreConsensusParams(ba.Ctx, GetConsensusParams(maxGasPerBlock)) + var txs [][]byte // create oracle script oCode, err := GetBenchmarkWasm() require.NoError(tb, err) - _, res, err := ba.DeliverMsg(ba.Sender, GenMsgCreateOracleScript(ba.Sender, oCode)) - require.NoError(tb, err) - oid, err := GetFirstAttributeOfLastEventValue(res.Events) - require.NoError(tb, err) - ba.Oid = uint64(oid) + txs = append( + txs, + GenSequenceOfTxs(ba.TxEncoder, ba.TxConfig, GenMsgCreateOracleScript(ba.Sender, oCode), ba.Sender, 1)[0], + ) // create data source dCode := []byte("hello") - _, res, err = ba.DeliverMsg(ba.Sender, GenMsgCreateDataSource(ba.Sender, dCode)) - require.NoError(tb, err) - did, err := GetFirstAttributeOfLastEventValue(res.Events) - require.NoError(tb, err) - ba.Did = uint64(did) + txs = append( + txs, + GenSequenceOfTxs(ba.TxEncoder, ba.TxConfig, GenMsgCreateDataSource(ba.Sender, dCode), ba.Sender, 1)[0], + ) // activate oracle - _, _, err = ba.DeliverMsg(ba.Validator, GenMsgActivate(ba.Validator)) - require.NoError(tb, err) - - ba.CallEndBlock() - ba.Commit() - - return ba -} - -func (ba *BenchmarkApp) DeliverMsg(account *Account, msgs []sdk.Msg) (sdk.GasInfo, *sdk.Result, error) { - tx := GenSequenceOfTxs(ba.TxConfig, msgs, account, 1)[0] - gas, res, err := ba.CallDeliver(tx) - return gas, res, err -} + txs = append( + txs, + GenSequenceOfTxs(ba.TxEncoder, ba.TxConfig, GenMsgActivate(ba.Validator), ba.Validator, 1)[0], + ) -func (ba *BenchmarkApp) CallBeginBlock() abci.ResponseBeginBlock { - return ba.BeginBlock( - abci.RequestBeginBlock{ - Header: tmproto.Header{ - Height: ba.LastBlockHeight() + 1, - ChainID: bandtesting.ChainID, - }, - Hash: ba.LastCommitID().Hash, - }, + res, err := ba.FinalizeBlock( + &abci.RequestFinalizeBlock{Txs: txs, Height: ba.LastBlockHeight() + 1, Time: time.Now()}, ) -} + require.NoError(tb, err) -func (ba *BenchmarkApp) CallEndBlock() abci.ResponseEndBlock { - return ba.EndBlock(abci.RequestEndBlock{Height: ba.LastBlockHeight() + 1}) -} + _, err = ba.Commit() + require.NoError(tb, err) -func (ba *BenchmarkApp) CallDeliver(tx sdk.Tx) (sdk.GasInfo, *sdk.Result, error) { - return ba.SimDeliver(ba.TxEncoder, tx) -} + oid, err := GetFirstAttributeOfLastEventValue(res.TxResults[0].Events) + require.NoError(tb, err) + ba.Oid = uint64(oid) -func (ba *BenchmarkApp) AddMaxMsgRequests(msg []sdk.Msg) { - // maximum of request blocks is only 20 because after that it will become report only block because of ante - for block := 0; block < 10; block++ { - ba.CallBeginBlock() - - totalGas := uint64(0) - for { - tx := GenSequenceOfTxs( - ba.TxConfig, - msg, - ba.Sender, - 1, - )[0] - - gas, _, _ := ba.CallDeliver(tx) - - totalGas += gas.GasUsed - if totalGas+gas.GasUsed >= uint64(BlockMaxGas) { - break - } - } + did, err := GetFirstAttributeOfLastEventValue(res.TxResults[1].Events) + require.NoError(tb, err) + ba.Did = uint64(did) - ba.CallEndBlock() - ba.Commit() - } + return ba } func (ba *BenchmarkApp) GetAllPendingRequests(account *Account) *oracletypes.QueryPendingRequestsResponse { res, err := ba.Querier.PendingRequests( - sdk.WrapSDKContext(ba.Ctx), + ba.Ctx, &oracletypes.QueryPendingRequestsRequest{ ValidatorAddress: account.ValAddress.String(), }, @@ -147,16 +119,6 @@ func (ba *BenchmarkApp) GetAllPendingRequests(account *Account) *oracletypes.Que return res } -func (ba *BenchmarkApp) SendAllPendingReports(account *Account) { - // query all pending requests - res := ba.GetAllPendingRequests(account) - - for _, rid := range res.RequestIDs { - _, _, err := ba.DeliverMsg(account, ba.GenMsgReportData(account, []uint64{rid})) - require.NoError(ba.TB, err) - } -} - func (ba *BenchmarkApp) GenMsgReportData(account *Account, rids []uint64) []sdk.Msg { msgs := make([]sdk.Msg, 0) diff --git a/benchmark/bench_test.go b/benchmark/bench_test.go index b4586b314..ea4eef664 100644 --- a/benchmark/bench_test.go +++ b/benchmark/bench_test.go @@ -6,11 +6,12 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - oraclekeeper "github.com/bandprotocol/chain/v2/x/oracle/keeper" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + abci "github.com/cometbft/cometbft/abci/types" + + oraclekeeper "github.com/bandprotocol/chain/v3/x/oracle/keeper" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) var PrepareCases = map[string]struct { @@ -257,121 +258,64 @@ func BenchmarkOwasmVMExecute(b *testing.B) { } } -// benchmark test for delivering MsgRequestData -func BenchmarkRequestDataDeliver(b *testing.B) { +// BenchmarkBlockOracleMsgRequestData benchmarks MsgRequestData of oracle module +func BenchmarkBlockOracleMsgRequestData(b *testing.B) { for name, tc := range PrepareCases { for _, pm := range tc.parameters { for _, strlen := range tc.stringLength { - b.Run( - fmt.Sprintf( - "%s (param: %d, strlen: %d)", - name, - pm, - strlen, - ), - func(b *testing.B) { - ba := InitializeBenchmarkApp(b, -1) - - txs := GenSequenceOfTxs( - ba.TxConfig, - GenMsgRequestData( - ba.Sender, - ba.Oid, - ba.Did, - tc.scenario, - pm, - strlen, - PrepareGasLimit, - 1000, - ), - ba.Sender, - b.N, - ) - - ba.CallBeginBlock() - b.ResetTimer() - b.StopTimer() - - // deliver MsgRequestData to the block - for i := 0; i < b.N; i++ { - b.StartTimer() - gasInfo, _, err := ba.CallDeliver(txs[i]) - b.StopTimer() - if i == 0 { - if err != nil { - fmt.Println("\tDeliver Error:", err.Error()) - } else { - fmt.Println("\tCosmos Gas used:", gasInfo.GasUsed) - } - } - } - }, - ) - } - } - } -} - -// benchmark test for processing oracle scripts at endblock -func BenchmarkRequestDataEndBlock(b *testing.B) { - for name, tc := range ExecuteCases { - for _, pm := range tc.parameters { - for _, strlen := range tc.stringLength { - for _, nr := range []int{1, 5, 10, 20} { + for _, reqPerBlock := range []int{1, 5, 10, 20} { b.Run( fmt.Sprintf( "%s (param: %d, strlen: %d) - %d requests/block", name, pm, strlen, - nr, + reqPerBlock, ), func(b *testing.B) { - ba := InitializeBenchmarkApp(b, -1) - - txs := GenSequenceOfTxs( - ba.TxConfig, - GenMsgRequestData( - ba.Sender, - ba.Oid, - ba.Did, - tc.scenario, - pm, - strlen, - 10000, - ExecuteGasLimit, - ), - ba.Sender, - b.N*nr, - ) - b.ResetTimer() b.StopTimer() for i := 0; i < b.N; i++ { - // deliver MsgRequestData to the first block - ba.CallBeginBlock() + ba := InitializeBenchmarkApp(b, -1) - for idx := 0; idx < nr; idx++ { - _, _, err := ba.CallDeliver(txs[i*nr+idx]) - if i == 0 && idx == 0 && err != nil { - fmt.Println("\tDeliver error:", err.Error()) - } - } + txs := GenSequenceOfTxs( + ba.TxEncoder, + ba.TxConfig, + GenMsgRequestData( + ba.Sender, + ba.Oid, + ba.Did, + tc.scenario, + pm, + strlen, + PrepareGasLimit, + 1000, + ), + ba.Sender, + reqPerBlock, + ) - ba.CallEndBlock() - ba.Commit() + b.StartTimer() - // deliver MsgReportData to the second block - ba.CallBeginBlock() - ba.SendAllPendingReports(ba.Validator) + res, err := ba.FinalizeBlock( + &abci.RequestFinalizeBlock{ + Txs: txs, + Height: ba.LastBlockHeight() + 1, + Time: time.Now(), + }, + ) + require.NoError(b, err) - // process endblock - b.StartTimer() - ba.CallEndBlock() b.StopTimer() - ba.Commit() + if i == 0 { + if res.TxResults[len(res.TxResults)-1].Code != 0 { + fmt.Println("\tDeliver Error:", res.TxResults[0].Log) + } else { + fmt.Println("\tCosmos Gas used:", res.TxResults[0].GasUsed) + } + } } }, ) @@ -381,161 +325,93 @@ func BenchmarkRequestDataEndBlock(b *testing.B) { } } -func BenchmarkBlock(b *testing.B) { - benchmarkBlockNormalMsg(b) - benchmarkBlockReportMsg(b) -} - -func benchmarkBlockNormalMsg(b *testing.B) { - tmpApp := InitializeBenchmarkApp(b, BlockMaxGas) - - type caseType struct { - name string - msg []sdk.Msg - } - - // construct normal msg e.g. MsgSend of bank module - cases := make([]caseType, 0) - cases = append(cases, caseType{ - name: "bank_msg_send", - msg: GenMsgSend( - tmpApp.Sender, - tmpApp.Validator, - ), - }) - - // add MsgRequestData of oracle for each parameter into test cases - for name, tc := range PrepareCases { - for _, prepareGas := range GasRanges { - cases = append(cases, caseType{ - name: fmt.Sprintf( - "oracle_msg_request_data - %s - %d prepare gas", - name, - prepareGas), - msg: GenMsgRequestData( - tmpApp.Sender, - tmpApp.Oid, - tmpApp.Did, - tc.scenario, - math.MaxUint64, - 1, - uint64(prepareGas), - 1000, - ), - }) - } - } - - // use each msg to test full blocks - for _, c := range cases { - b.Run(c.name, - func(b *testing.B) { - b.ResetTimer() - b.StopTimer() - - for i := 0; i < b.N; i++ { - ba := InitializeBenchmarkApp(b, BlockMaxGas) - - b.StartTimer() - ba.CallBeginBlock() - b.StopTimer() - - totalGas := uint64(0) - for { - tx := GenSequenceOfTxs( - ba.TxConfig, - c.msg, - ba.Sender, - 1, - )[0] - - b.StartTimer() - gas, _, _ := ba.CallDeliver(tx) - b.StopTimer() - - totalGas += gas.GasUsed - if totalGas+gas.GasUsed >= uint64(BlockMaxGas) { - break - } - } - - b.StartTimer() - ba.CallEndBlock() - ba.Commit() - b.StopTimer() - } - }, - ) - } -} - -func benchmarkBlockReportMsg(b *testing.B) { +// BenchmarkBlockOracleMsgReportData benchmarks MsgReportData of oracle module +func BenchmarkBlockOracleMsgReportData(b *testing.B) { for name, tc := range ExecuteCases { - for _, executeGas := range GasRanges { - // reportSize is the number of MsgReportData in one tx - // 1 means send one report per tx - // Note: 1000 is the maximum number of MsgReportData in one tx that doesn't exceed MaxGas of block (50M) - for _, reportSize := range []int{1, 100, 1000} { - b.Run( - fmt.Sprintf( - "oracle_msg_report_data - %s - %d execute gas - %d report sizes", - name, - executeGas, - reportSize, - ), - func(b *testing.B) { - b.ResetTimer() - b.StopTimer() + for _, pm := range tc.parameters { + for _, strlen := range tc.stringLength { + for _, reqPerBlock := range []int{1, 5, 10, 20} { + b.Run( + fmt.Sprintf( + "%s (param: %d, strlen: %d) - %d requests/block", + name, + pm, + strlen, + reqPerBlock, + ), + func(b *testing.B) { + b.ResetTimer() + b.StopTimer() - for i := 0; i < b.N; i++ { - ba := InitializeBenchmarkApp(b, BlockMaxGas) - ba.AddMaxMsgRequests(GenMsgRequestData( - ba.Sender, - ba.Oid, - ba.Did, - tc.scenario, - math.MaxUint64, - 1, - 1000, - uint64(executeGas), - )) + for i := 0; i < b.N; i++ { + ba := InitializeBenchmarkApp(b, BlockMaxGas) - b.StartTimer() - ba.CallBeginBlock() - b.StopTimer() + // add request + txs := GenSequenceOfTxs( + ba.TxEncoder, + ba.TxConfig, + GenMsgRequestData( + ba.Sender, + ba.Oid, + ba.Did, + tc.scenario, + pm, + strlen, + 10000, + ExecuteGasLimit, + ), + ba.Sender, + reqPerBlock, + ) + + _, err := ba.FinalizeBlock( + &abci.RequestFinalizeBlock{ + Txs: txs, + Height: ba.LastBlockHeight() + 1, + Time: time.Now(), + }, + ) + require.NoError(b, err) + + _, err = ba.Commit() + require.NoError(b, err) - res := ba.GetAllPendingRequests(ba.Validator) - totalGas := uint64(0) + // get pending requests + pendingRequests := ba.GetAllPendingRequests(ba.Validator) - reqChunks := ChunkSlice(res.RequestIDs, reportSize) - for _, reqChunk := range reqChunks { + // create msg report data tx := GenSequenceOfTxs( + ba.TxEncoder, ba.TxConfig, - ba.GenMsgReportData(ba.Validator, reqChunk), + ba.GenMsgReportData(ba.Validator, pendingRequests.RequestIDs), ba.Validator, 1, )[0] b.StartTimer() - gas, _, err := ba.CallDeliver(tx) - b.StopTimer() + res, err := ba.FinalizeBlock( + &abci.RequestFinalizeBlock{ + Txs: [][]byte{tx}, + Height: ba.LastBlockHeight() + 1, + Time: time.Now(), + }, + ) require.NoError(b, err) - totalGas += gas.GasUsed - // add 10% more because it will use more gas next time - if totalGas+(gas.GasUsed*110/100) >= uint64(BlockMaxGas) { - break + b.StopTimer() + + if i == 0 { + if res.TxResults[len(res.TxResults)-1].Code != 0 { + fmt.Println("\tDeliver Error:", res.TxResults[0].Log) + } else { + fmt.Println("\tCosmos Gas used:", res.TxResults[0].GasUsed) + } } } - - b.StartTimer() - ba.CallEndBlock() - ba.Commit() - b.StopTimer() - } - }, - ) + }, + ) + } } } } diff --git a/benchmark/helper_test.go b/benchmark/helper_test.go index 5954f8a1a..b2c5af86c 100644 --- a/benchmark/helper_test.go +++ b/benchmark/helper_test.go @@ -2,24 +2,28 @@ package benchmark import ( "math" + "math/rand" "os" "strconv" "strings" "testing" "time" - owasm "github.com/bandprotocol/go-owasm/api" + "github.com/stretchr/testify/require" + types "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" + "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/stretchr/testify/require" - "github.com/bandprotocol/chain/v2/pkg/obi" - bandtesting "github.com/bandprotocol/chain/v2/testing" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + owasm "github.com/bandprotocol/go-owasm/api" + + "github.com/bandprotocol/chain/v3/pkg/obi" + bandtesting "github.com/bandprotocol/chain/v3/testing" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) type Account struct { @@ -120,15 +124,17 @@ func GenMsgActivate(account *Account) []sdk.Msg { } func GenSequenceOfTxs( + txEncoder sdk.TxEncoder, txConfig client.TxConfig, msgs []sdk.Msg, account *Account, numTxs int, -) []sdk.Tx { - txs := make([]sdk.Tx, numTxs) +) [][]byte { + txs := make([][]byte, numTxs) for i := 0; i < numTxs; i++ { - txs[i], _ = bandtesting.GenTx( + tx, _ := bandtesting.GenSignedMockTx( + rand.New(rand.NewSource(time.Now().UnixNano())), txConfig, msgs, sdk.Coins{sdk.NewInt64Coin("uband", 1)}, @@ -138,6 +144,8 @@ func GenSequenceOfTxs( []uint64{account.Seq}, account.PrivKey, ) + + txs[i], _ = txEncoder(tx) account.Seq++ } @@ -204,19 +212,19 @@ func InitOwasmTestEnv( return owasmVM, compiledCode, req } -func GetConsensusParams(maxGas int64) *tmproto.ConsensusParams { - return &tmproto.ConsensusParams{ - Block: &tmproto.BlockParams{ +func GetConsensusParams(maxGas int64) cmtproto.ConsensusParams { + return cmtproto.ConsensusParams{ + Block: &cmtproto.BlockParams{ MaxBytes: 200000, MaxGas: maxGas, }, - Evidence: &tmproto.EvidenceParams{ + Evidence: &cmtproto.EvidenceParams{ MaxAgeNumBlocks: 302400, MaxAgeDuration: 504 * time.Hour, }, - Validator: &tmproto.ValidatorParams{ + Validator: &cmtproto.ValidatorParams{ PubKeyTypes: []string{ - tmtypes.ABCIPubKeyTypeSecp256k1, + cmttypes.ABCIPubKeyTypeSecp256k1, }, }, } diff --git a/buf.yaml b/buf.yaml deleted file mode 100644 index 37f716cab..000000000 --- a/buf.yaml +++ /dev/null @@ -1,34 +0,0 @@ -version: v1beta1 - -build: - roots: - - proto - - third_party/proto - excludes: - - third_party/proto/google/protobuf -lint: - use: - - DEFAULT - - COMMENTS - - FILE_LOWER_SNAKE_CASE - except: - - UNARY_RPC - - COMMENT_FIELD - - SERVICE_SUFFIX - - PACKAGE_VERSION_SUFFIX - - RPC_REQUEST_STANDARD_NAME - ignore: - - tendermint - - gogoproto - - cosmos_proto - - google - - confio -breaking: - use: - - FILE - ignore: - - tendermint - - gogoproto - - cosmos_proto - - google - - confio diff --git a/client/grpc/node/query.pb.go b/client/grpc/node/query.pb.go index 7ba8f3c49..9ede18f78 100644 --- a/client/grpc/node/query.pb.go +++ b/client/grpc/node/query.pb.go @@ -29,22 +29,22 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// QueryChainIDRequest is request type for the Service/ChainID RPC method. -type QueryChainIDRequest struct { +// ChainIDRequest is request type for the Service/ChainID RPC method. +type ChainIDRequest struct { } -func (m *QueryChainIDRequest) Reset() { *m = QueryChainIDRequest{} } -func (m *QueryChainIDRequest) String() string { return proto.CompactTextString(m) } -func (*QueryChainIDRequest) ProtoMessage() {} -func (*QueryChainIDRequest) Descriptor() ([]byte, []int) { +func (m *ChainIDRequest) Reset() { *m = ChainIDRequest{} } +func (m *ChainIDRequest) String() string { return proto.CompactTextString(m) } +func (*ChainIDRequest) ProtoMessage() {} +func (*ChainIDRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a25c18d173830f62, []int{0} } -func (m *QueryChainIDRequest) XXX_Unmarshal(b []byte) error { +func (m *ChainIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryChainIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ChainIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryChainIDRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_ChainIDRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -54,35 +54,35 @@ func (m *QueryChainIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *QueryChainIDRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChainIDRequest.Merge(m, src) +func (m *ChainIDRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChainIDRequest.Merge(m, src) } -func (m *QueryChainIDRequest) XXX_Size() int { +func (m *ChainIDRequest) XXX_Size() int { return m.Size() } -func (m *QueryChainIDRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChainIDRequest.DiscardUnknown(m) +func (m *ChainIDRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ChainIDRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryChainIDRequest proto.InternalMessageInfo +var xxx_messageInfo_ChainIDRequest proto.InternalMessageInfo -// QueryChainIDResponse is response type for the Service/ChainID RPC method. -type QueryChainIDResponse struct { +// ChainIDResponse is response type for the Service/ChainID RPC method. +type ChainIDResponse struct { ChainID string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` } -func (m *QueryChainIDResponse) Reset() { *m = QueryChainIDResponse{} } -func (m *QueryChainIDResponse) String() string { return proto.CompactTextString(m) } -func (*QueryChainIDResponse) ProtoMessage() {} -func (*QueryChainIDResponse) Descriptor() ([]byte, []int) { +func (m *ChainIDResponse) Reset() { *m = ChainIDResponse{} } +func (m *ChainIDResponse) String() string { return proto.CompactTextString(m) } +func (*ChainIDResponse) ProtoMessage() {} +func (*ChainIDResponse) Descriptor() ([]byte, []int) { return fileDescriptor_a25c18d173830f62, []int{1} } -func (m *QueryChainIDResponse) XXX_Unmarshal(b []byte) error { +func (m *ChainIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryChainIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ChainIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryChainIDResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_ChainIDResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -92,41 +92,41 @@ func (m *QueryChainIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *QueryChainIDResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChainIDResponse.Merge(m, src) +func (m *ChainIDResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChainIDResponse.Merge(m, src) } -func (m *QueryChainIDResponse) XXX_Size() int { +func (m *ChainIDResponse) XXX_Size() int { return m.Size() } -func (m *QueryChainIDResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChainIDResponse.DiscardUnknown(m) +func (m *ChainIDResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ChainIDResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryChainIDResponse proto.InternalMessageInfo +var xxx_messageInfo_ChainIDResponse proto.InternalMessageInfo -func (m *QueryChainIDResponse) GetChainID() string { +func (m *ChainIDResponse) GetChainID() string { if m != nil { return m.ChainID } return "" } -// QueryEVMValidatorsRequest is request type for the Service/EVMValidators RPC method. -type QueryEVMValidatorsRequest struct { +// EVMValidatorsRequest is request type for the Service/EVMValidators RPC method. +type EVMValidatorsRequest struct { } -func (m *QueryEVMValidatorsRequest) Reset() { *m = QueryEVMValidatorsRequest{} } -func (m *QueryEVMValidatorsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryEVMValidatorsRequest) ProtoMessage() {} -func (*QueryEVMValidatorsRequest) Descriptor() ([]byte, []int) { +func (m *EVMValidatorsRequest) Reset() { *m = EVMValidatorsRequest{} } +func (m *EVMValidatorsRequest) String() string { return proto.CompactTextString(m) } +func (*EVMValidatorsRequest) ProtoMessage() {} +func (*EVMValidatorsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a25c18d173830f62, []int{2} } -func (m *QueryEVMValidatorsRequest) XXX_Unmarshal(b []byte) error { +func (m *EVMValidatorsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryEVMValidatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EVMValidatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryEVMValidatorsRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_EVMValidatorsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -136,38 +136,38 @@ func (m *QueryEVMValidatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (m *QueryEVMValidatorsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryEVMValidatorsRequest.Merge(m, src) +func (m *EVMValidatorsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_EVMValidatorsRequest.Merge(m, src) } -func (m *QueryEVMValidatorsRequest) XXX_Size() int { +func (m *EVMValidatorsRequest) XXX_Size() int { return m.Size() } -func (m *QueryEVMValidatorsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryEVMValidatorsRequest.DiscardUnknown(m) +func (m *EVMValidatorsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_EVMValidatorsRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryEVMValidatorsRequest proto.InternalMessageInfo +var xxx_messageInfo_EVMValidatorsRequest proto.InternalMessageInfo -// QueryEVMValidatorsResponse is response type for the Service/EVMValidators RPC method. -type QueryEVMValidatorsResponse struct { +// EVMValidatorsResponse is response type for the Service/EVMValidators RPC method. +type EVMValidatorsResponse struct { // BlockHeight is the latest block height BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` // Validators is list of validator's addresss and voting power Validators []ValidatorMinimal `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators"` } -func (m *QueryEVMValidatorsResponse) Reset() { *m = QueryEVMValidatorsResponse{} } -func (m *QueryEVMValidatorsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryEVMValidatorsResponse) ProtoMessage() {} -func (*QueryEVMValidatorsResponse) Descriptor() ([]byte, []int) { +func (m *EVMValidatorsResponse) Reset() { *m = EVMValidatorsResponse{} } +func (m *EVMValidatorsResponse) String() string { return proto.CompactTextString(m) } +func (*EVMValidatorsResponse) ProtoMessage() {} +func (*EVMValidatorsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_a25c18d173830f62, []int{3} } -func (m *QueryEVMValidatorsResponse) XXX_Unmarshal(b []byte) error { +func (m *EVMValidatorsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryEVMValidatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EVMValidatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryEVMValidatorsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_EVMValidatorsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -177,26 +177,26 @@ func (m *QueryEVMValidatorsResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *QueryEVMValidatorsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryEVMValidatorsResponse.Merge(m, src) +func (m *EVMValidatorsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_EVMValidatorsResponse.Merge(m, src) } -func (m *QueryEVMValidatorsResponse) XXX_Size() int { +func (m *EVMValidatorsResponse) XXX_Size() int { return m.Size() } -func (m *QueryEVMValidatorsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryEVMValidatorsResponse.DiscardUnknown(m) +func (m *EVMValidatorsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_EVMValidatorsResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryEVMValidatorsResponse proto.InternalMessageInfo +var xxx_messageInfo_EVMValidatorsResponse proto.InternalMessageInfo -func (m *QueryEVMValidatorsResponse) GetBlockHeight() int64 { +func (m *EVMValidatorsResponse) GetBlockHeight() int64 { if m != nil { return m.BlockHeight } return 0 } -func (m *QueryEVMValidatorsResponse) GetValidators() []ValidatorMinimal { +func (m *EVMValidatorsResponse) GetValidators() []ValidatorMinimal { if m != nil { return m.Validators } @@ -257,45 +257,45 @@ func (m *ValidatorMinimal) GetVotingPower() int64 { } func init() { - proto.RegisterType((*QueryChainIDRequest)(nil), "bandchain.v1.node.QueryChainIDRequest") - proto.RegisterType((*QueryChainIDResponse)(nil), "bandchain.v1.node.QueryChainIDResponse") - proto.RegisterType((*QueryEVMValidatorsRequest)(nil), "bandchain.v1.node.QueryEVMValidatorsRequest") - proto.RegisterType((*QueryEVMValidatorsResponse)(nil), "bandchain.v1.node.QueryEVMValidatorsResponse") + proto.RegisterType((*ChainIDRequest)(nil), "bandchain.v1.node.ChainIDRequest") + proto.RegisterType((*ChainIDResponse)(nil), "bandchain.v1.node.ChainIDResponse") + proto.RegisterType((*EVMValidatorsRequest)(nil), "bandchain.v1.node.EVMValidatorsRequest") + proto.RegisterType((*EVMValidatorsResponse)(nil), "bandchain.v1.node.EVMValidatorsResponse") proto.RegisterType((*ValidatorMinimal)(nil), "bandchain.v1.node.ValidatorMinimal") } func init() { proto.RegisterFile("bandchain/v1/node/query.proto", fileDescriptor_a25c18d173830f62) } var fileDescriptor_a25c18d173830f62 = []byte{ - // 447 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0x6e, 0x3a, 0x44, 0xc1, 0x05, 0x09, 0xcc, 0x40, 0x21, 0x0c, 0x6f, 0x04, 0x34, 0x76, 0x60, - 0xb1, 0x5a, 0xee, 0x1c, 0x0a, 0x48, 0x54, 0x68, 0x02, 0x8a, 0xb4, 0x03, 0x97, 0xca, 0x49, 0x2c, - 0xc7, 0x22, 0xf5, 0xcb, 0x12, 0x37, 0x08, 0x8e, 0x1c, 0x39, 0x21, 0xb8, 0xf1, 0x8b, 0x76, 0x9c, - 0xc4, 0x85, 0x53, 0x85, 0x52, 0x7e, 0x08, 0x8a, 0xd3, 0x14, 0x02, 0x41, 0xec, 0xe6, 0x7c, 0xef, - 0x7b, 0xdf, 0xfb, 0xf2, 0xf9, 0x19, 0xdd, 0xf4, 0x99, 0x0a, 0x83, 0x88, 0x49, 0x45, 0xf3, 0x01, - 0x55, 0x10, 0x72, 0x7a, 0x34, 0xe7, 0xe9, 0x5b, 0x2f, 0x49, 0x41, 0x03, 0xbe, 0xbc, 0x2e, 0x7b, - 0xf9, 0xc0, 0x2b, 0xcb, 0xce, 0x96, 0x00, 0x10, 0x31, 0xa7, 0x2c, 0x91, 0x94, 0x29, 0x05, 0x9a, - 0x69, 0x09, 0x2a, 0xab, 0x1a, 0x9c, 0x4d, 0x01, 0x02, 0xcc, 0x91, 0x96, 0xa7, 0x0a, 0x75, 0xaf, - 0xa2, 0x2b, 0x2f, 0x4a, 0xd5, 0x87, 0xa5, 0xd2, 0xf8, 0xd1, 0x84, 0x1f, 0xcd, 0x79, 0xa6, 0xdd, - 0x07, 0x68, 0xb3, 0x09, 0x67, 0x09, 0xa8, 0x8c, 0xe3, 0x5d, 0x74, 0xce, 0xcc, 0x9c, 0xca, 0xd0, - 0xb6, 0x76, 0xac, 0xbd, 0xf3, 0xa3, 0x7e, 0xb1, 0xd8, 0xee, 0xd5, 0xb4, 0x9e, 0x29, 0x8e, 0x43, - 0xf7, 0x06, 0xba, 0x6e, 0xfa, 0x1f, 0x1f, 0x1e, 0x1c, 0xb2, 0x58, 0x86, 0x4c, 0x43, 0x9a, 0xd5, - 0xe2, 0x1f, 0x2c, 0xe4, 0xb4, 0x55, 0x57, 0x33, 0x6e, 0xa1, 0x0b, 0x7e, 0x0c, 0xc1, 0xeb, 0x69, - 0xc4, 0xa5, 0x88, 0xb4, 0x99, 0xb3, 0x31, 0xe9, 0x1b, 0xec, 0x89, 0x81, 0xf0, 0x18, 0xa1, 0x7c, - 0xdd, 0x68, 0x77, 0x77, 0x36, 0xf6, 0xfa, 0xc3, 0xdb, 0xde, 0x5f, 0x89, 0x78, 0x6b, 0xf5, 0x03, - 0xa9, 0xe4, 0x8c, 0xc5, 0xa3, 0x33, 0xc7, 0x8b, 0xed, 0xce, 0xe4, 0xb7, 0x66, 0xf7, 0x19, 0xba, - 0xf4, 0x27, 0x0b, 0xdb, 0xa8, 0xc7, 0xc2, 0x30, 0xe5, 0x59, 0x56, 0xfd, 0xe4, 0xa4, 0xfe, 0x2c, - 0xbd, 0xe5, 0xa0, 0xa5, 0x12, 0xd3, 0x04, 0xde, 0xf0, 0xd4, 0xee, 0x56, 0xde, 0x2a, 0xec, 0x79, - 0x09, 0x0d, 0xbf, 0x74, 0x51, 0xef, 0x25, 0x4f, 0x73, 0x19, 0x70, 0xfc, 0x0e, 0xd5, 0xd1, 0xe0, - 0xdd, 0x16, 0x7b, 0x2d, 0xc9, 0x3b, 0x77, 0xff, 0xcb, 0xab, 0x62, 0x72, 0xc9, 0xfb, 0xaf, 0x3f, - 0x3e, 0x77, 0x6d, 0x7c, 0x8d, 0x36, 0x16, 0xa5, 0xbe, 0x1e, 0xfc, 0xc9, 0x42, 0x17, 0x1b, 0x01, - 0xe3, 0x7b, 0xff, 0x92, 0x6e, 0xbb, 0x25, 0x67, 0xff, 0x94, 0xec, 0x95, 0x9d, 0x3b, 0xc6, 0x0e, - 0xc1, 0x5b, 0x4d, 0x3b, 0x3c, 0x9f, 0xed, 0xff, 0x4a, 0x7b, 0xf4, 0xf4, 0xb8, 0x20, 0xd6, 0x49, - 0x41, 0xac, 0xef, 0x05, 0xb1, 0x3e, 0x2e, 0x49, 0xe7, 0x64, 0x49, 0x3a, 0xdf, 0x96, 0xa4, 0xf3, - 0x6a, 0x20, 0xa4, 0x8e, 0xe6, 0xbe, 0x17, 0xc0, 0xcc, 0x28, 0x98, 0xf5, 0x0c, 0x20, 0xa6, 0x2b, - 0xa9, 0x21, 0x0d, 0x62, 0xc9, 0x95, 0xa6, 0x22, 0x4d, 0x02, 0xf3, 0x1c, 0xfc, 0xb3, 0x86, 0x73, - 0xff, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x28, 0x13, 0x94, 0xa2, 0x2a, 0x03, 0x00, 0x00, + // 439 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xcf, 0x6b, 0xd4, 0x40, + 0x18, 0xdd, 0x6c, 0xc5, 0xd5, 0x59, 0x7f, 0xd4, 0xa1, 0x96, 0x10, 0xea, 0xb4, 0x8d, 0xa2, 0x7b, + 0x31, 0xc3, 0xb6, 0x27, 0xaf, 0xab, 0x82, 0x8b, 0x14, 0x25, 0x42, 0x0f, 0x5e, 0x96, 0x49, 0x32, + 0x4c, 0x06, 0xb3, 0xf3, 0xa5, 0xc9, 0x6c, 0xc4, 0xab, 0xa0, 0x78, 0x14, 0xfc, 0xa7, 0x7a, 0x2c, + 0x78, 0xf1, 0x54, 0x24, 0xeb, 0x1f, 0x22, 0x99, 0x6c, 0xa2, 0xa9, 0x8b, 0xbd, 0x4d, 0xde, 0x7b, + 0xdf, 0xcb, 0x9b, 0x37, 0x1f, 0xba, 0x17, 0x30, 0x15, 0x85, 0x31, 0x93, 0x8a, 0x16, 0x63, 0xaa, + 0x20, 0xe2, 0xf4, 0x64, 0xc1, 0xb3, 0x0f, 0x5e, 0x9a, 0x81, 0x06, 0x7c, 0xa7, 0xa5, 0xbd, 0x62, + 0xec, 0x55, 0xb4, 0xb3, 0x23, 0x00, 0x44, 0xc2, 0x29, 0x4b, 0x25, 0x65, 0x4a, 0x81, 0x66, 0x5a, + 0x82, 0xca, 0xeb, 0x01, 0x67, 0x4b, 0x80, 0x00, 0x73, 0xa4, 0xd5, 0xa9, 0x46, 0xdd, 0x4d, 0x74, + 0xeb, 0x69, 0x65, 0x32, 0x7d, 0xe6, 0xf3, 0x93, 0x05, 0xcf, 0xb5, 0xfb, 0x04, 0xdd, 0x6e, 0x91, + 0x3c, 0x05, 0x95, 0x73, 0xfc, 0x10, 0x5d, 0x33, 0x7f, 0x9a, 0xc9, 0xc8, 0xb6, 0xf6, 0xac, 0xd1, + 0xf5, 0xc9, 0xb0, 0x3c, 0xdf, 0x1d, 0x34, 0xb2, 0x81, 0x21, 0xa7, 0x91, 0xbb, 0x8d, 0xb6, 0x9e, + 0x1f, 0x1f, 0x1d, 0xb3, 0x44, 0x46, 0x4c, 0x43, 0x96, 0x37, 0x96, 0x9f, 0x2c, 0x74, 0xf7, 0x02, + 0xb1, 0x72, 0xde, 0x47, 0x37, 0x82, 0x04, 0xc2, 0x77, 0xb3, 0x98, 0x4b, 0x11, 0x6b, 0xe3, 0xbe, + 0xe1, 0x0f, 0x0d, 0xf6, 0xc2, 0x40, 0x78, 0x8a, 0x50, 0xd1, 0x0e, 0xda, 0xfd, 0xbd, 0x8d, 0xd1, + 0xf0, 0xe0, 0xbe, 0xf7, 0xcf, 0xed, 0xbd, 0xd6, 0xfd, 0x48, 0x2a, 0x39, 0x67, 0xc9, 0xe4, 0xca, + 0xe9, 0xf9, 0x6e, 0xcf, 0xff, 0x6b, 0xd8, 0x7d, 0x85, 0x36, 0x2f, 0xaa, 0xb0, 0x8d, 0x06, 0x2c, + 0x8a, 0x32, 0x9e, 0xe7, 0xf5, 0xd5, 0xfc, 0xe6, 0xb3, 0xca, 0x56, 0x80, 0x96, 0x4a, 0xcc, 0x52, + 0x78, 0xcf, 0x33, 0xbb, 0x5f, 0x67, 0xab, 0xb1, 0xd7, 0x15, 0x74, 0xf0, 0xb9, 0x8f, 0x06, 0x6f, + 0x78, 0x56, 0xc8, 0x90, 0xe3, 0x14, 0x35, 0x85, 0xe0, 0xfd, 0x35, 0xf1, 0xba, 0x2d, 0x3b, 0xee, + 0xff, 0x24, 0x75, 0x39, 0x2e, 0xf9, 0xf8, 0xfd, 0xd7, 0xb7, 0xbe, 0x8d, 0xb7, 0x69, 0x67, 0x15, + 0x9a, 0xa7, 0xc0, 0x5f, 0x2c, 0x74, 0xb3, 0x53, 0x2b, 0x7e, 0xb4, 0xc6, 0x75, 0xdd, 0x8b, 0x38, + 0xa3, 0xcb, 0x85, 0xab, 0x10, 0x0f, 0x4c, 0x08, 0x82, 0x77, 0xba, 0x21, 0x78, 0x31, 0x7f, 0xfc, + 0xa7, 0xd9, 0xc9, 0xcb, 0xd3, 0x92, 0x58, 0x67, 0x25, 0xb1, 0x7e, 0x96, 0xc4, 0xfa, 0xba, 0x24, + 0xbd, 0xb3, 0x25, 0xe9, 0xfd, 0x58, 0x92, 0xde, 0xdb, 0xb1, 0x90, 0x3a, 0x5e, 0x04, 0x5e, 0x08, + 0x73, 0xe3, 0x60, 0xd6, 0x2e, 0x84, 0x84, 0xae, 0xac, 0x0e, 0x69, 0x98, 0x48, 0xae, 0x34, 0x15, + 0x59, 0x1a, 0x9a, 0x35, 0x0f, 0xae, 0x1a, 0xcd, 0xe1, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe4, + 0x8f, 0x6b, 0xe9, 0x02, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -311,9 +311,9 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type ServiceClient interface { // ChainID queries the chain ID of this node - ChainID(ctx context.Context, in *QueryChainIDRequest, opts ...grpc.CallOption) (*QueryChainIDResponse, error) + ChainID(ctx context.Context, in *ChainIDRequest, opts ...grpc.CallOption) (*ChainIDResponse, error) // EVMValidators queries current list of validator's address and power - EVMValidators(ctx context.Context, in *QueryEVMValidatorsRequest, opts ...grpc.CallOption) (*QueryEVMValidatorsResponse, error) + EVMValidators(ctx context.Context, in *EVMValidatorsRequest, opts ...grpc.CallOption) (*EVMValidatorsResponse, error) } type serviceClient struct { @@ -324,8 +324,8 @@ func NewServiceClient(cc grpc1.ClientConn) ServiceClient { return &serviceClient{cc} } -func (c *serviceClient) ChainID(ctx context.Context, in *QueryChainIDRequest, opts ...grpc.CallOption) (*QueryChainIDResponse, error) { - out := new(QueryChainIDResponse) +func (c *serviceClient) ChainID(ctx context.Context, in *ChainIDRequest, opts ...grpc.CallOption) (*ChainIDResponse, error) { + out := new(ChainIDResponse) err := c.cc.Invoke(ctx, "/bandchain.v1.node.Service/ChainID", in, out, opts...) if err != nil { return nil, err @@ -333,8 +333,8 @@ func (c *serviceClient) ChainID(ctx context.Context, in *QueryChainIDRequest, op return out, nil } -func (c *serviceClient) EVMValidators(ctx context.Context, in *QueryEVMValidatorsRequest, opts ...grpc.CallOption) (*QueryEVMValidatorsResponse, error) { - out := new(QueryEVMValidatorsResponse) +func (c *serviceClient) EVMValidators(ctx context.Context, in *EVMValidatorsRequest, opts ...grpc.CallOption) (*EVMValidatorsResponse, error) { + out := new(EVMValidatorsResponse) err := c.cc.Invoke(ctx, "/bandchain.v1.node.Service/EVMValidators", in, out, opts...) if err != nil { return nil, err @@ -345,19 +345,19 @@ func (c *serviceClient) EVMValidators(ctx context.Context, in *QueryEVMValidator // ServiceServer is the server API for Service service. type ServiceServer interface { // ChainID queries the chain ID of this node - ChainID(context.Context, *QueryChainIDRequest) (*QueryChainIDResponse, error) + ChainID(context.Context, *ChainIDRequest) (*ChainIDResponse, error) // EVMValidators queries current list of validator's address and power - EVMValidators(context.Context, *QueryEVMValidatorsRequest) (*QueryEVMValidatorsResponse, error) + EVMValidators(context.Context, *EVMValidatorsRequest) (*EVMValidatorsResponse, error) } // UnimplementedServiceServer can be embedded to have forward compatible implementations. type UnimplementedServiceServer struct { } -func (*UnimplementedServiceServer) ChainID(ctx context.Context, req *QueryChainIDRequest) (*QueryChainIDResponse, error) { +func (*UnimplementedServiceServer) ChainID(ctx context.Context, req *ChainIDRequest) (*ChainIDResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ChainID not implemented") } -func (*UnimplementedServiceServer) EVMValidators(ctx context.Context, req *QueryEVMValidatorsRequest) (*QueryEVMValidatorsResponse, error) { +func (*UnimplementedServiceServer) EVMValidators(ctx context.Context, req *EVMValidatorsRequest) (*EVMValidatorsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EVMValidators not implemented") } @@ -366,7 +366,7 @@ func RegisterServiceServer(s grpc1.Server, srv ServiceServer) { } func _Service_ChainID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryChainIDRequest) + in := new(ChainIDRequest) if err := dec(in); err != nil { return nil, err } @@ -378,13 +378,13 @@ func _Service_ChainID_Handler(srv interface{}, ctx context.Context, dec func(int FullMethod: "/bandchain.v1.node.Service/ChainID", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).ChainID(ctx, req.(*QueryChainIDRequest)) + return srv.(ServiceServer).ChainID(ctx, req.(*ChainIDRequest)) } return interceptor(ctx, in, info, handler) } func _Service_EVMValidators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryEVMValidatorsRequest) + in := new(EVMValidatorsRequest) if err := dec(in); err != nil { return nil, err } @@ -396,7 +396,7 @@ func _Service_EVMValidators_Handler(srv interface{}, ctx context.Context, dec fu FullMethod: "/bandchain.v1.node.Service/EVMValidators", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).EVMValidators(ctx, req.(*QueryEVMValidatorsRequest)) + return srv.(ServiceServer).EVMValidators(ctx, req.(*EVMValidatorsRequest)) } return interceptor(ctx, in, info, handler) } @@ -418,7 +418,7 @@ var _Service_serviceDesc = grpc.ServiceDesc{ Metadata: "bandchain/v1/node/query.proto", } -func (m *QueryChainIDRequest) Marshal() (dAtA []byte, err error) { +func (m *ChainIDRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -428,12 +428,12 @@ func (m *QueryChainIDRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryChainIDRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *ChainIDRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryChainIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ChainIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -441,7 +441,7 @@ func (m *QueryChainIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryChainIDResponse) Marshal() (dAtA []byte, err error) { +func (m *ChainIDResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -451,12 +451,12 @@ func (m *QueryChainIDResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryChainIDResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *ChainIDResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryChainIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ChainIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -471,7 +471,7 @@ func (m *QueryChainIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryEVMValidatorsRequest) Marshal() (dAtA []byte, err error) { +func (m *EVMValidatorsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -481,12 +481,12 @@ func (m *QueryEVMValidatorsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryEVMValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *EVMValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryEVMValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EVMValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -494,7 +494,7 @@ func (m *QueryEVMValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *QueryEVMValidatorsResponse) Marshal() (dAtA []byte, err error) { +func (m *EVMValidatorsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -504,12 +504,12 @@ func (m *QueryEVMValidatorsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryEVMValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *EVMValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryEVMValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EVMValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -582,7 +582,7 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *QueryChainIDRequest) Size() (n int) { +func (m *ChainIDRequest) Size() (n int) { if m == nil { return 0 } @@ -591,7 +591,7 @@ func (m *QueryChainIDRequest) Size() (n int) { return n } -func (m *QueryChainIDResponse) Size() (n int) { +func (m *ChainIDResponse) Size() (n int) { if m == nil { return 0 } @@ -604,7 +604,7 @@ func (m *QueryChainIDResponse) Size() (n int) { return n } -func (m *QueryEVMValidatorsRequest) Size() (n int) { +func (m *EVMValidatorsRequest) Size() (n int) { if m == nil { return 0 } @@ -613,7 +613,7 @@ func (m *QueryEVMValidatorsRequest) Size() (n int) { return n } -func (m *QueryEVMValidatorsResponse) Size() (n int) { +func (m *EVMValidatorsResponse) Size() (n int) { if m == nil { return 0 } @@ -653,7 +653,7 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryChainIDRequest) Unmarshal(dAtA []byte) error { +func (m *ChainIDRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -676,10 +676,10 @@ func (m *QueryChainIDRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryChainIDRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ChainIDRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryChainIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ChainIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -703,7 +703,7 @@ func (m *QueryChainIDRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryChainIDResponse) Unmarshal(dAtA []byte) error { +func (m *ChainIDResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -726,10 +726,10 @@ func (m *QueryChainIDResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryChainIDResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ChainIDResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryChainIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ChainIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -785,7 +785,7 @@ func (m *QueryChainIDResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryEVMValidatorsRequest) Unmarshal(dAtA []byte) error { +func (m *EVMValidatorsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -808,10 +808,10 @@ func (m *QueryEVMValidatorsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryEVMValidatorsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: EVMValidatorsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryEVMValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EVMValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -835,7 +835,7 @@ func (m *QueryEVMValidatorsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryEVMValidatorsResponse) Unmarshal(dAtA []byte) error { +func (m *EVMValidatorsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -858,10 +858,10 @@ func (m *QueryEVMValidatorsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryEVMValidatorsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: EVMValidatorsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryEVMValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EVMValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/client/grpc/node/query.pb.gw.go b/client/grpc/node/query.pb.gw.go index 98fb0315b..47b3fdee6 100644 --- a/client/grpc/node/query.pb.gw.go +++ b/client/grpc/node/query.pb.gw.go @@ -34,7 +34,7 @@ var _ = descriptor.ForMessage var _ = metadata.Join func request_Service_ChainID_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryChainIDRequest + var protoReq ChainIDRequest var metadata runtime.ServerMetadata msg, err := client.ChainID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -43,7 +43,7 @@ func request_Service_ChainID_0(ctx context.Context, marshaler runtime.Marshaler, } func local_request_Service_ChainID_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryChainIDRequest + var protoReq ChainIDRequest var metadata runtime.ServerMetadata msg, err := server.ChainID(ctx, &protoReq) @@ -52,7 +52,7 @@ func local_request_Service_ChainID_0(ctx context.Context, marshaler runtime.Mars } func request_Service_EVMValidators_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryEVMValidatorsRequest + var protoReq EVMValidatorsRequest var metadata runtime.ServerMetadata msg, err := client.EVMValidators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -61,7 +61,7 @@ func request_Service_EVMValidators_0(ctx context.Context, marshaler runtime.Mars } func local_request_Service_EVMValidators_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryEVMValidatorsRequest + var protoReq EVMValidatorsRequest var metadata runtime.ServerMetadata msg, err := server.EVMValidators(ctx, &protoReq) diff --git a/client/grpc/node/service.go b/client/grpc/node/service.go index 5e4e63655..15619319e 100644 --- a/client/grpc/node/service.go +++ b/client/grpc/node/service.go @@ -4,17 +4,21 @@ import ( "context" "fmt" + "github.com/ethereum/go-ethereum/crypto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/cometbft/cometbft/crypto/secp256k1" + + gogogrpc "github.com/cosmos/gogoproto/grpc" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/server/config" sdk "github.com/cosmos/cosmos-sdk/types" - gogogrpc "github.com/cosmos/gogoproto/grpc" - "github.com/ethereum/go-ethereum/crypto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" ) // RegisterNodeService registers the node gRPC service on the provided gRPC router. -func RegisterNodeService(clientCtx client.Context, server gogogrpc.Server) { - RegisterServiceServer(server, NewQueryServer(clientCtx)) +func RegisterNodeService(clientCtx client.Context, server gogogrpc.Server, cfg config.Config) { + RegisterServiceServer(server, NewQueryServer(clientCtx, cfg)) } // RegisterGRPCGatewayRoutes mounts the node gRPC service's GRPC-gateway routes @@ -29,20 +33,22 @@ var _ ServiceServer = queryServer{} // queryServer implements ServiceServer type queryServer struct { clientCtx client.Context + cfg config.Config } // NewQueryServer returns new queryServer from provided client.Context -func NewQueryServer(clientCtx client.Context) ServiceServer { +func NewQueryServer(clientCtx client.Context, cfg config.Config) ServiceServer { return queryServer{ clientCtx: clientCtx, + cfg: cfg, } } // ChainID returns QueryChainIDResponse that has chain id from ctx -func (s queryServer) ChainID(ctx context.Context, _ *QueryChainIDRequest) (*QueryChainIDResponse, error) { +func (s queryServer) ChainID(ctx context.Context, _ *ChainIDRequest) (*ChainIDResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) - return &QueryChainIDResponse{ + return &ChainIDResponse{ ChainID: sdkCtx.ChainID(), }, nil } @@ -50,8 +56,8 @@ func (s queryServer) ChainID(ctx context.Context, _ *QueryChainIDRequest) (*Quer // EVMValidators returns top 100 validators' address and voting power order by voting power func (s queryServer) EVMValidators( ctx context.Context, - _ *QueryEVMValidatorsRequest, -) (*QueryEVMValidatorsResponse, error) { + _ *EVMValidatorsRequest, +) (*EVMValidatorsResponse, error) { node, err := s.clientCtx.GetNode() if err != nil { return nil, err @@ -65,7 +71,7 @@ func (s queryServer) EVMValidators( return nil, err } - evmValidatorsResponse := QueryEVMValidatorsResponse{} + evmValidatorsResponse := EVMValidatorsResponse{} evmValidatorsResponse.BlockHeight = validators.BlockHeight evmValidatorsResponse.Validators = []ValidatorMinimal{} diff --git a/client/grpc/oracle/proof/abi.go b/client/grpc/oracle/proof/abi.go index c85b5c366..d0b6ce230 100644 --- a/client/grpc/oracle/proof/abi.go +++ b/client/grpc/oracle/proof/abi.go @@ -11,27 +11,22 @@ var relayFormat = []byte(` }, { "internalType": "bytes32", - "name": "mintStoreMerkleHash", + "name": "paramsStoreMerkleHash", "type": "bytes32" }, { "internalType": "bytes32", - "name": "ibcToIcahostStoresMerkleHash", + "name": "slashingToStakingStoresMerkleHash", "type": "bytes32" }, { "internalType": "bytes32", - "name": "feegrantToGroupStoresMerkleHash", + "name": "transferToUpgradeStoresMerkleHash", "type": "bytes32" }, { "internalType": "bytes32", - "name": "authToEvidenceStoresMerkleHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "paramsToUpgradeStoresMerkleHash", + "name": "authToMintStoresMerkleHash", "type": "bytes32" } ], diff --git a/client/grpc/oracle/proof/block_header_merkle_parts.go b/client/grpc/oracle/proof/block_header_merkle_parts.go index 63ff7da57..5bc4fbb1d 100644 --- a/client/grpc/oracle/proof/block_header_merkle_parts.go +++ b/client/grpc/oracle/proof/block_header_merkle_parts.go @@ -1,9 +1,10 @@ package proof import ( + "github.com/ethereum/go-ethereum/common" + "github.com/cometbft/cometbft/crypto/merkle" "github.com/cometbft/cometbft/types" - "github.com/ethereum/go-ethereum/common" ) // BlockHeaderMerklePartsEthereum is an Ethereum version of BlockHeaderMerkleParts for solidity ABI-encoding. diff --git a/client/grpc/oracle/proof/block_header_merkle_parts_test.go b/client/grpc/oracle/proof/block_header_merkle_parts_test.go index 8f9226ab8..f308ce84c 100644 --- a/client/grpc/oracle/proof/block_header_merkle_parts_test.go +++ b/client/grpc/oracle/proof/block_header_merkle_parts_test.go @@ -3,10 +3,11 @@ package proof import ( "testing" + "github.com/stretchr/testify/require" + tmbytes "github.com/cometbft/cometbft/libs/bytes" tmversion "github.com/cometbft/cometbft/proto/tendermint/version" "github.com/cometbft/cometbft/types" - "github.com/stretchr/testify/require" ) /* diff --git a/client/grpc/oracle/proof/iavl_proof.go b/client/grpc/oracle/proof/iavl_proof.go index d3db1a477..0f9a2049a 100644 --- a/client/grpc/oracle/proof/iavl_proof.go +++ b/client/grpc/oracle/proof/iavl_proof.go @@ -4,8 +4,9 @@ import ( "encoding/binary" "math/big" - ics23 "github.com/confio/ics23/go" "github.com/ethereum/go-ethereum/common" + + ics23 "github.com/cosmos/ics23/go" ) // IAVLMerklePathEthereum is an Ethereum version of IAVLMerklePath for solidity ABI-encoding. diff --git a/client/grpc/oracle/proof/iavl_proof_test.go b/client/grpc/oracle/proof/iavl_proof_test.go index d40f9e4c8..0cbeebfa4 100644 --- a/client/grpc/oracle/proof/iavl_proof_test.go +++ b/client/grpc/oracle/proof/iavl_proof_test.go @@ -3,10 +3,13 @@ package proof import ( "testing" - "github.com/cometbft/cometbft/crypto/tmhash" - ics23 "github.com/confio/ics23/go" - storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/stretchr/testify/require" + + "github.com/cometbft/cometbft/crypto/tmhash" + + ics23 "github.com/cosmos/ics23/go" + + storetypes "cosmossdk.io/store/types" ) /* diff --git a/client/grpc/oracle/proof/multi_store.go b/client/grpc/oracle/proof/multi_store.go index 8d1efc380..011909aa2 100644 --- a/client/grpc/oracle/proof/multi_store.go +++ b/client/grpc/oracle/proof/multi_store.go @@ -1,40 +1,39 @@ package proof import ( - tmbytes "github.com/cometbft/cometbft/libs/bytes" - ics23 "github.com/confio/ics23/go" "github.com/ethereum/go-ethereum/common" + + tmbytes "github.com/cometbft/cometbft/libs/bytes" + + ics23 "github.com/cosmos/ics23/go" ) // MultiStoreProofEthereum is an Ethereum version of MultiStoreProof for solidity ABI-encoding. type MultiStoreProofEthereum struct { - OracleIAVLStateHash common.Hash - MintStoreMerkleHash common.Hash - IbcToIcahostStoresMerkleHash common.Hash - FeegrantToGroupStoresMerkleHash common.Hash - AuthToEvidenceStoresMerkleHash common.Hash - ParamsToUpgradeStoresMerkleHash common.Hash + OracleIAVLStateHash common.Hash + ParamsStoreMerkleHash common.Hash + SlashingToStakingStoresMerkleHash common.Hash + TransferToUpgradeStoresMerkleHash common.Hash + AuthToMintStoresMerkleHash common.Hash } func (m *MultiStoreProof) encodeToEthFormat() MultiStoreProofEthereum { return MultiStoreProofEthereum{ - OracleIAVLStateHash: common.BytesToHash(m.OracleIAVLStateHash), - MintStoreMerkleHash: common.BytesToHash(m.MintStoreMerkleHash), - IbcToIcahostStoresMerkleHash: common.BytesToHash(m.IbcToIcahostStoresMerkleHash), - FeegrantToGroupStoresMerkleHash: common.BytesToHash(m.FeegrantToGroupStoresMerkleHash), - AuthToEvidenceStoresMerkleHash: common.BytesToHash(m.AuthToEvidenceStoresMerkleHash), - ParamsToUpgradeStoresMerkleHash: common.BytesToHash(m.ParamsToUpgradeStoresMerkleHash), + OracleIAVLStateHash: common.BytesToHash(m.OracleIAVLStateHash), + ParamsStoreMerkleHash: common.BytesToHash(m.ParamsStoreMerkleHash), + SlashingToStakingStoresMerkleHash: common.BytesToHash(m.SlashingToStakingStoresMerkleHash), + TransferToUpgradeStoresMerkleHash: common.BytesToHash(m.TransferToUpgradeStoresMerkleHash), + AuthToMintStoresMerkleHash: common.BytesToHash(m.AuthToMintStoresMerkleHash), } } // GetMultiStoreProof compacts Multi store proof from Tendermint to MultiStoreProof version. func GetMultiStoreProof(multiStoreEp *ics23.ExistenceProof) MultiStoreProof { return MultiStoreProof{ - OracleIAVLStateHash: tmbytes.HexBytes(multiStoreEp.Value), - MintStoreMerkleHash: tmbytes.HexBytes(multiStoreEp.Path[0].Prefix[1:]), - IbcToIcahostStoresMerkleHash: tmbytes.HexBytes(multiStoreEp.Path[1].Prefix[1:]), - FeegrantToGroupStoresMerkleHash: tmbytes.HexBytes(multiStoreEp.Path[2].Prefix[1:]), - AuthToEvidenceStoresMerkleHash: tmbytes.HexBytes(multiStoreEp.Path[3].Prefix[1:]), - ParamsToUpgradeStoresMerkleHash: tmbytes.HexBytes(multiStoreEp.Path[4].Suffix), + OracleIAVLStateHash: tmbytes.HexBytes(multiStoreEp.Value), + ParamsStoreMerkleHash: tmbytes.HexBytes(multiStoreEp.Path[0].Suffix), + SlashingToStakingStoresMerkleHash: tmbytes.HexBytes(multiStoreEp.Path[1].Suffix), + TransferToUpgradeStoresMerkleHash: tmbytes.HexBytes(multiStoreEp.Path[2].Suffix), + AuthToMintStoresMerkleHash: tmbytes.HexBytes(multiStoreEp.Path[3].Prefix[1:]), } } diff --git a/client/grpc/oracle/proof/multi_store_test.go b/client/grpc/oracle/proof/multi_store_test.go index 3cf2b67fb..be44371e2 100644 --- a/client/grpc/oracle/proof/multi_store_test.go +++ b/client/grpc/oracle/proof/multi_store_test.go @@ -3,50 +3,53 @@ package proof import ( "testing" - "github.com/cometbft/cometbft/crypto/tmhash" - ics23 "github.com/confio/ics23/go" - storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/stretchr/testify/require" + + "github.com/cometbft/cometbft/crypto/tmhash" + + ics23 "github.com/cosmos/ics23/go" + + storetypes "cosmossdk.io/store/types" ) /* query at localhost:26657/abci_query?path="/store/oracle/key"&data=0xc000000000000000&prove=true { - "jsonrpc": "2.0", - "id": -1, - "result": { - "response": { - "code": 0, - "log": "", - "info": "", - "index": "0", + "jsonrpc": "2.0", + "id": -1, + "result": { + "response": { + "code": 0, + "log": "", + "info": "", + "index": "0", + "key": "wAAAAAAAAAA=", + "value": null, + "proofOps": { + "ops": [ + { + "type": "ics23:iavl", "key": "wAAAAAAAAAA=", - "value": null, - "proofOps": { - "ops": [ - { - "type": "ics23:iavl", - "key": "wAAAAAAAAAA=", - "data": "EtsCCgjAAAAAAAAAABKyAQoBBhIdCBAQEBiAAiCABChkMNCGA0ADSEZQgOCllrsRWAEaCwgBGAEgASoDAAICIisIARIEAgQCIBohIOtzm7IvSLfzBTqQuiuk/gf6smLK34ZkSJVlxQ/1Bbi9IikIARIlBAgEIAXcsCtAWTDFinCgKJK8wl81ZbWfgSdKDpbP2Wf47EO4ICIpCAESJQYQBCCKaIo830SxbCL1Qk0rvRoWDuKiCxVidDRpX7yqJwZ6YCAamQEKAfASBm9yYWNsZRoLCAEYASABKgMAAgIiKQgBEiUCBAIgYBmyUcOTZvAWUCIP0D+9tkdWu05jYdT58XI1aiWJin0gIikIARIlBAgEIAXcsCtAWTDFinCgKJK8wl81ZbWfgSdKDpbP2Wf47EO4ICIpCAESJQYQBCCKaIo830SxbCL1Qk0rvRoWDuKiCxVidDRpX7yqJwZ6YCA=" - }, - { - "type": "ics23:simple", - "key": "b3JhY2xl", - "data": "CvoBCgZvcmFjbGUSIKPQ574oserr40+EoLhlrRgTGdrpgYViYEujG7W9rVBXGgkIARgBIAEqAQAiJQgBEiEBszziiEyGhp8/QWWNpdXqtweFbE6u087DWf5LXq0L+TIiJQgBEiEB3e3II3T8dhCPmDUxvJ1pJX5rydODMevJMyFcgoCkKOoiJQgBEiEBFpkM5/i+rVeuJ7iT04lRhhji55+3UobQFAvRoy5bAaIiJQgBEiEBTbPwtCi+YzaPpM9Zk+1Z73qE27/GXJESOD/JanvndjYiJwgBEgEBGiD3/25dJyNfa+hHLtAoLdyt2kECqzbUMTuiMuTW8f/kbA==" - } - ] - }, - "height": "2813", - "codespace": "" - } + "data": "ErUDCgjAAAAAAAAAABLeAQoBBhIdCBAQEBiAAiCABChkMNCGA0ADSEZQgOCllrsRWAEaCwgBGAEgASoDAAICIikIARIlAgQ6IO7X4GoH3/B39qoS7kwXqpew2/xCytzm0c+1hXCrE18wICIrCAESBAQIOiAaISAqCGxacs/wly0s3f0cm3A5hWPEqt5K3ZkZukgMN8Jh8yIpCAESJQYQOiBq45JAWFuyTlcQl3041dlnafT8p/xriWG6aYZVV2cOXCAiKggBEiYIHIAEIL8475jthvcKtmoUWgCwMuysVcVJ8A0LBt29Ppz6JFA4IBrHAQoB8BIGb3JhY2xlGgsIARgBIAEqAwACAiIrCAESBAIEOiAaISDATq3d36m92dob4c0uJUMWi53SOBVeGZi57Tlv4scCRiIpCAESJQQIOiCobCbU/uzI8AHz+5KI8jmmceLGnVLfV8D67kSpM9sLbSAiKQgBEiUGEDogauOSQFhbsk5XEJd9ONXZZ2n0/Kf8a4lhummGVVdnDlwgIioIARImCByABCC/OO+Y7Yb3CrZqFFoAsDLsrFXFSfANCwbdvT6c+iRQOCA=" + }, + { + "type": "ics23:simple", + "key": "b3JhY2xl", + "data": "CtcBCgZvcmFjbGUSIGc/gPOe8DTh4zWomosnmmV1wYko2vDCkkSY2bBCyBqwGgkIARgBIAEqAQAiJwgBEgEBGiAxNQ4L0hzy/N+VrkNUjx9H/v8IJH93ZhhXEPjufSivtyInCAESAQEaIP0NvxoPsBcWmTkGZ2ul74DYHqh4tDZivlB3QV0k8F/TIicIARIBARogtps/fryeI7RxDCD2zsLuFvtPY2nRPc6ZZTBTAVNUyG4iJQgBEiEBPUI4cA6YgD+R99n7HJ85590HWfl1TOQyVGZqghIsTRE=" + } + ] + }, + "height": "256", + "codespace": "" } + } } */ func TestGetMultiStoreProof(t *testing.T) { key := []byte("oracle") data := base64ToBytes( - "CvoBCgZvcmFjbGUSIKPQ574oserr40+EoLhlrRgTGdrpgYViYEujG7W9rVBXGgkIARgBIAEqAQAiJQgBEiEBszziiEyGhp8/QWWNpdXqtweFbE6u087DWf5LXq0L+TIiJQgBEiEB3e3II3T8dhCPmDUxvJ1pJX5rydODMevJMyFcgoCkKOoiJQgBEiEBFpkM5/i+rVeuJ7iT04lRhhji55+3UobQFAvRoy5bAaIiJQgBEiEBTbPwtCi+YzaPpM9Zk+1Z73qE27/GXJESOD/JanvndjYiJwgBEgEBGiD3/25dJyNfa+hHLtAoLdyt2kECqzbUMTuiMuTW8f/kbA==", + "CtcBCgZvcmFjbGUSIGc/gPOe8DTh4zWomosnmmV1wYko2vDCkkSY2bBCyBqwGgkIARgBIAEqAQAiJwgBEgEBGiAxNQ4L0hzy/N+VrkNUjx9H/v8IJH93ZhhXEPjufSivtyInCAESAQEaIP0NvxoPsBcWmTkGZ2ul74DYHqh4tDZivlB3QV0k8F/TIicIARIBARogtps/fryeI7RxDCD2zsLuFvtPY2nRPc6ZZTBTAVNUyG4iJQgBEiEBPUI4cA6YgD+R99n7HJ85590HWfl1TOQyVGZqghIsTRE=", ) var multistoreOps storetypes.CommitmentOp @@ -71,20 +74,17 @@ func TestGetMultiStoreProof(t *testing.T) { prefix = append(prefix, 32) // size of result hash must be 32 apphash := innerHash( + m.AuthToMintStoresMerkleHash, innerHash( - m.AuthToEvidenceStoresMerkleHash, innerHash( - m.FeegrantToGroupStoresMerkleHash, innerHash( - m.IbcToIcahostStoresMerkleHash, - innerHash( - m.MintStoreMerkleHash, - leafHash(append(prefix, tmhash.Sum(m.OracleIAVLStateHash)...)), - ), + leafHash(append(prefix, tmhash.Sum(m.OracleIAVLStateHash)...)), + m.ParamsStoreMerkleHash, ), + m.SlashingToStakingStoresMerkleHash, ), + m.TransferToUpgradeStoresMerkleHash, ), - m.ParamsToUpgradeStoresMerkleHash, ) require.Equal(t, expectAppHash, apphash) diff --git a/client/grpc/oracle/proof/proof.go b/client/grpc/oracle/proof/proof.go index 66de4e9f4..32f52f7aa 100644 --- a/client/grpc/oracle/proof/proof.go +++ b/client/grpc/oracle/proof/proof.go @@ -6,11 +6,15 @@ import ( "fmt" "math/big" + "github.com/ethereum/go-ethereum/accounts/abi" + rpcclient "github.com/cometbft/cometbft/rpc/client" - ics23 "github.com/confio/ics23/go" + + ics23 "github.com/cosmos/ics23/go" + + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/client" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - "github.com/ethereum/go-ethereum/accounts/abi" ) var ( diff --git a/client/grpc/oracle/proof/proof.pb.go b/client/grpc/oracle/proof/proof.pb.go index b6a0ff449..24c27a3a1 100644 --- a/client/grpc/oracle/proof/proof.pb.go +++ b/client/grpc/oracle/proof/proof.pb.go @@ -6,7 +6,7 @@ package proof import ( context "context" fmt "fmt" - types "github.com/bandprotocol/chain/v2/x/oracle/types" + types "github.com/bandprotocol/chain/v3/x/oracle/types" github_com_cometbft_cometbft_libs_bytes "github.com/cometbft/cometbft/libs/bytes" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -31,26 +31,26 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// QueryProofRequest is request type for the Service/Proof RPC method. -type QueryProofRequest struct { +// ProofRequest is request type for the Service/Proof RPC method. +type ProofRequest struct { // RequestID is ID of an oracle request RequestId uint64 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // height is block height Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` } -func (m *QueryProofRequest) Reset() { *m = QueryProofRequest{} } -func (m *QueryProofRequest) String() string { return proto.CompactTextString(m) } -func (*QueryProofRequest) ProtoMessage() {} -func (*QueryProofRequest) Descriptor() ([]byte, []int) { +func (m *ProofRequest) Reset() { *m = ProofRequest{} } +func (m *ProofRequest) String() string { return proto.CompactTextString(m) } +func (*ProofRequest) ProtoMessage() {} +func (*ProofRequest) Descriptor() ([]byte, []int) { return fileDescriptor_ae72765f9c902173, []int{0} } -func (m *QueryProofRequest) XXX_Unmarshal(b []byte) error { +func (m *ProofRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryProofRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ProofRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryProofRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_ProofRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -60,52 +60,52 @@ func (m *QueryProofRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *QueryProofRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProofRequest.Merge(m, src) +func (m *ProofRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProofRequest.Merge(m, src) } -func (m *QueryProofRequest) XXX_Size() int { +func (m *ProofRequest) XXX_Size() int { return m.Size() } -func (m *QueryProofRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProofRequest.DiscardUnknown(m) +func (m *ProofRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ProofRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryProofRequest proto.InternalMessageInfo +var xxx_messageInfo_ProofRequest proto.InternalMessageInfo -func (m *QueryProofRequest) GetRequestId() uint64 { +func (m *ProofRequest) GetRequestId() uint64 { if m != nil { return m.RequestId } return 0 } -func (m *QueryProofRequest) GetHeight() int64 { +func (m *ProofRequest) GetHeight() int64 { if m != nil { return m.Height } return 0 } -// QueryChainIDResponse is response type for the Service/Proof RPC method. -type QueryProofResponse struct { +// ProofResponse is response type for the Service/Proof RPC method. +type ProofResponse struct { // height is block height Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` // result is the proof - Result SingleProofResponse `protobuf:"bytes,2,opt,name=result,proto3" json:"result"` + Result SingleProofResult `protobuf:"bytes,2,opt,name=result,proto3" json:"result"` } -func (m *QueryProofResponse) Reset() { *m = QueryProofResponse{} } -func (m *QueryProofResponse) String() string { return proto.CompactTextString(m) } -func (*QueryProofResponse) ProtoMessage() {} -func (*QueryProofResponse) Descriptor() ([]byte, []int) { +func (m *ProofResponse) Reset() { *m = ProofResponse{} } +func (m *ProofResponse) String() string { return proto.CompactTextString(m) } +func (*ProofResponse) ProtoMessage() {} +func (*ProofResponse) Descriptor() ([]byte, []int) { return fileDescriptor_ae72765f9c902173, []int{1} } -func (m *QueryProofResponse) XXX_Unmarshal(b []byte) error { +func (m *ProofResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryProofResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_ProofResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -115,50 +115,50 @@ func (m *QueryProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *QueryProofResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProofResponse.Merge(m, src) +func (m *ProofResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProofResponse.Merge(m, src) } -func (m *QueryProofResponse) XXX_Size() int { +func (m *ProofResponse) XXX_Size() int { return m.Size() } -func (m *QueryProofResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProofResponse.DiscardUnknown(m) +func (m *ProofResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ProofResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryProofResponse proto.InternalMessageInfo +var xxx_messageInfo_ProofResponse proto.InternalMessageInfo -func (m *QueryProofResponse) GetHeight() int64 { +func (m *ProofResponse) GetHeight() int64 { if m != nil { return m.Height } return 0 } -func (m *QueryProofResponse) GetResult() SingleProofResponse { +func (m *ProofResponse) GetResult() SingleProofResult { if m != nil { return m.Result } - return SingleProofResponse{} + return SingleProofResult{} } -// QueryMultiProofRequest is request type for the Service/MultiProof RPC method. -type QueryMultiProofRequest struct { +// MultiProofRequest is request type for the Service/MultiProof RPC method. +type MultiProofRequest struct { // request_ids is the list of request IDs RequestIds []uint64 `protobuf:"varint,1,rep,packed,name=request_ids,json=requestIds,proto3" json:"request_ids,omitempty"` } -func (m *QueryMultiProofRequest) Reset() { *m = QueryMultiProofRequest{} } -func (m *QueryMultiProofRequest) String() string { return proto.CompactTextString(m) } -func (*QueryMultiProofRequest) ProtoMessage() {} -func (*QueryMultiProofRequest) Descriptor() ([]byte, []int) { +func (m *MultiProofRequest) Reset() { *m = MultiProofRequest{} } +func (m *MultiProofRequest) String() string { return proto.CompactTextString(m) } +func (*MultiProofRequest) ProtoMessage() {} +func (*MultiProofRequest) Descriptor() ([]byte, []int) { return fileDescriptor_ae72765f9c902173, []int{2} } -func (m *QueryMultiProofRequest) XXX_Unmarshal(b []byte) error { +func (m *MultiProofRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryMultiProofRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MultiProofRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryMultiProofRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_MultiProofRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -168,43 +168,43 @@ func (m *QueryMultiProofRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *QueryMultiProofRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMultiProofRequest.Merge(m, src) +func (m *MultiProofRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MultiProofRequest.Merge(m, src) } -func (m *QueryMultiProofRequest) XXX_Size() int { +func (m *MultiProofRequest) XXX_Size() int { return m.Size() } -func (m *QueryMultiProofRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMultiProofRequest.DiscardUnknown(m) +func (m *MultiProofRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MultiProofRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryMultiProofRequest proto.InternalMessageInfo +var xxx_messageInfo_MultiProofRequest proto.InternalMessageInfo -func (m *QueryMultiProofRequest) GetRequestIds() []uint64 { +func (m *MultiProofRequest) GetRequestIds() []uint64 { if m != nil { return m.RequestIds } return nil } -// QueryMultiProofResponse is response type for the Service/MultiProof RPC method. -type QueryMultiProofResponse struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Result MultiProofResponse `protobuf:"bytes,2,opt,name=result,proto3" json:"result"` +// MultiProofResponse is response type for the Service/MultiProof RPC method. +type MultiProofResponse struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Result MultiProofResult `protobuf:"bytes,2,opt,name=result,proto3" json:"result"` } -func (m *QueryMultiProofResponse) Reset() { *m = QueryMultiProofResponse{} } -func (m *QueryMultiProofResponse) String() string { return proto.CompactTextString(m) } -func (*QueryMultiProofResponse) ProtoMessage() {} -func (*QueryMultiProofResponse) Descriptor() ([]byte, []int) { +func (m *MultiProofResponse) Reset() { *m = MultiProofResponse{} } +func (m *MultiProofResponse) String() string { return proto.CompactTextString(m) } +func (*MultiProofResponse) ProtoMessage() {} +func (*MultiProofResponse) Descriptor() ([]byte, []int) { return fileDescriptor_ae72765f9c902173, []int{3} } -func (m *QueryMultiProofResponse) XXX_Unmarshal(b []byte) error { +func (m *MultiProofResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryMultiProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MultiProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryMultiProofResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MultiProofResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -214,48 +214,48 @@ func (m *QueryMultiProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *QueryMultiProofResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMultiProofResponse.Merge(m, src) +func (m *MultiProofResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MultiProofResponse.Merge(m, src) } -func (m *QueryMultiProofResponse) XXX_Size() int { +func (m *MultiProofResponse) XXX_Size() int { return m.Size() } -func (m *QueryMultiProofResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMultiProofResponse.DiscardUnknown(m) +func (m *MultiProofResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MultiProofResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryMultiProofResponse proto.InternalMessageInfo +var xxx_messageInfo_MultiProofResponse proto.InternalMessageInfo -func (m *QueryMultiProofResponse) GetHeight() int64 { +func (m *MultiProofResponse) GetHeight() int64 { if m != nil { return m.Height } return 0 } -func (m *QueryMultiProofResponse) GetResult() MultiProofResponse { +func (m *MultiProofResponse) GetResult() MultiProofResult { if m != nil { return m.Result } - return MultiProofResponse{} + return MultiProofResult{} } -// QueryRequestCountProofRequest is request type for the Service/RequestCountProof RPC method. -type QueryRequestCountProofRequest struct { +// RequestCountProofRequest is request type for the Service/RequestCountProof RPC method. +type RequestCountProofRequest struct { } -func (m *QueryRequestCountProofRequest) Reset() { *m = QueryRequestCountProofRequest{} } -func (m *QueryRequestCountProofRequest) String() string { return proto.CompactTextString(m) } -func (*QueryRequestCountProofRequest) ProtoMessage() {} -func (*QueryRequestCountProofRequest) Descriptor() ([]byte, []int) { +func (m *RequestCountProofRequest) Reset() { *m = RequestCountProofRequest{} } +func (m *RequestCountProofRequest) String() string { return proto.CompactTextString(m) } +func (*RequestCountProofRequest) ProtoMessage() {} +func (*RequestCountProofRequest) Descriptor() ([]byte, []int) { return fileDescriptor_ae72765f9c902173, []int{4} } -func (m *QueryRequestCountProofRequest) XXX_Unmarshal(b []byte) error { +func (m *RequestCountProofRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryRequestCountProofRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RequestCountProofRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryRequestCountProofRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_RequestCountProofRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -265,36 +265,36 @@ func (m *QueryRequestCountProofRequest) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } -func (m *QueryRequestCountProofRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryRequestCountProofRequest.Merge(m, src) +func (m *RequestCountProofRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestCountProofRequest.Merge(m, src) } -func (m *QueryRequestCountProofRequest) XXX_Size() int { +func (m *RequestCountProofRequest) XXX_Size() int { return m.Size() } -func (m *QueryRequestCountProofRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryRequestCountProofRequest.DiscardUnknown(m) +func (m *RequestCountProofRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RequestCountProofRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryRequestCountProofRequest proto.InternalMessageInfo +var xxx_messageInfo_RequestCountProofRequest proto.InternalMessageInfo -// QueryRequestCountProofResponse is response type for the Service/RequestCountProof RPC method. -type QueryRequestCountProofResponse struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Result CountProofResponse `protobuf:"bytes,2,opt,name=result,proto3" json:"result"` +// RequestCountProofResponse is response type for the Service/RequestCountProof RPC method. +type RequestCountProofResponse struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Result CountProofResult `protobuf:"bytes,2,opt,name=result,proto3" json:"result"` } -func (m *QueryRequestCountProofResponse) Reset() { *m = QueryRequestCountProofResponse{} } -func (m *QueryRequestCountProofResponse) String() string { return proto.CompactTextString(m) } -func (*QueryRequestCountProofResponse) ProtoMessage() {} -func (*QueryRequestCountProofResponse) Descriptor() ([]byte, []int) { +func (m *RequestCountProofResponse) Reset() { *m = RequestCountProofResponse{} } +func (m *RequestCountProofResponse) String() string { return proto.CompactTextString(m) } +func (*RequestCountProofResponse) ProtoMessage() {} +func (*RequestCountProofResponse) Descriptor() ([]byte, []int) { return fileDescriptor_ae72765f9c902173, []int{5} } -func (m *QueryRequestCountProofResponse) XXX_Unmarshal(b []byte) error { +func (m *RequestCountProofResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryRequestCountProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RequestCountProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryRequestCountProofResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_RequestCountProofResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -304,50 +304,50 @@ func (m *QueryRequestCountProofResponse) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } -func (m *QueryRequestCountProofResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryRequestCountProofResponse.Merge(m, src) +func (m *RequestCountProofResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestCountProofResponse.Merge(m, src) } -func (m *QueryRequestCountProofResponse) XXX_Size() int { +func (m *RequestCountProofResponse) XXX_Size() int { return m.Size() } -func (m *QueryRequestCountProofResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryRequestCountProofResponse.DiscardUnknown(m) +func (m *RequestCountProofResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RequestCountProofResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryRequestCountProofResponse proto.InternalMessageInfo +var xxx_messageInfo_RequestCountProofResponse proto.InternalMessageInfo -func (m *QueryRequestCountProofResponse) GetHeight() int64 { +func (m *RequestCountProofResponse) GetHeight() int64 { if m != nil { return m.Height } return 0 } -func (m *QueryRequestCountProofResponse) GetResult() CountProofResponse { +func (m *RequestCountProofResponse) GetResult() CountProofResult { if m != nil { return m.Result } - return CountProofResponse{} + return CountProofResult{} } // SingleProofResponse is the data structure for response of single proof -type SingleProofResponse struct { +type SingleProofResult struct { Proof SingleProof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof"` EvmProofBytes github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,2,opt,name=evm_proof_bytes,json=evmProofBytes,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"evm_proof_bytes,omitempty"` } -func (m *SingleProofResponse) Reset() { *m = SingleProofResponse{} } -func (m *SingleProofResponse) String() string { return proto.CompactTextString(m) } -func (*SingleProofResponse) ProtoMessage() {} -func (*SingleProofResponse) Descriptor() ([]byte, []int) { +func (m *SingleProofResult) Reset() { *m = SingleProofResult{} } +func (m *SingleProofResult) String() string { return proto.CompactTextString(m) } +func (*SingleProofResult) ProtoMessage() {} +func (*SingleProofResult) Descriptor() ([]byte, []int) { return fileDescriptor_ae72765f9c902173, []int{6} } -func (m *SingleProofResponse) XXX_Unmarshal(b []byte) error { +func (m *SingleProofResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SingleProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *SingleProofResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SingleProofResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_SingleProofResult.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -357,50 +357,50 @@ func (m *SingleProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *SingleProofResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SingleProofResponse.Merge(m, src) +func (m *SingleProofResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_SingleProofResult.Merge(m, src) } -func (m *SingleProofResponse) XXX_Size() int { +func (m *SingleProofResult) XXX_Size() int { return m.Size() } -func (m *SingleProofResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SingleProofResponse.DiscardUnknown(m) +func (m *SingleProofResult) XXX_DiscardUnknown() { + xxx_messageInfo_SingleProofResult.DiscardUnknown(m) } -var xxx_messageInfo_SingleProofResponse proto.InternalMessageInfo +var xxx_messageInfo_SingleProofResult proto.InternalMessageInfo -func (m *SingleProofResponse) GetProof() SingleProof { +func (m *SingleProofResult) GetProof() SingleProof { if m != nil { return m.Proof } return SingleProof{} } -func (m *SingleProofResponse) GetEvmProofBytes() github_com_cometbft_cometbft_libs_bytes.HexBytes { +func (m *SingleProofResult) GetEvmProofBytes() github_com_cometbft_cometbft_libs_bytes.HexBytes { if m != nil { return m.EvmProofBytes } return nil } -// MultiProofResponse is the data structure for response of multi proof -type MultiProofResponse struct { +// MultiProofResult is the data structure for response of multi proof +type MultiProofResult struct { Proof MultiProof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof"` EvmProofBytes github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,2,opt,name=evm_proof_bytes,json=evmProofBytes,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"evm_proof_bytes,omitempty"` } -func (m *MultiProofResponse) Reset() { *m = MultiProofResponse{} } -func (m *MultiProofResponse) String() string { return proto.CompactTextString(m) } -func (*MultiProofResponse) ProtoMessage() {} -func (*MultiProofResponse) Descriptor() ([]byte, []int) { +func (m *MultiProofResult) Reset() { *m = MultiProofResult{} } +func (m *MultiProofResult) String() string { return proto.CompactTextString(m) } +func (*MultiProofResult) ProtoMessage() {} +func (*MultiProofResult) Descriptor() ([]byte, []int) { return fileDescriptor_ae72765f9c902173, []int{7} } -func (m *MultiProofResponse) XXX_Unmarshal(b []byte) error { +func (m *MultiProofResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MultiProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MultiProofResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MultiProofResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MultiProofResult.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -410,50 +410,50 @@ func (m *MultiProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *MultiProofResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MultiProofResponse.Merge(m, src) +func (m *MultiProofResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_MultiProofResult.Merge(m, src) } -func (m *MultiProofResponse) XXX_Size() int { +func (m *MultiProofResult) XXX_Size() int { return m.Size() } -func (m *MultiProofResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MultiProofResponse.DiscardUnknown(m) +func (m *MultiProofResult) XXX_DiscardUnknown() { + xxx_messageInfo_MultiProofResult.DiscardUnknown(m) } -var xxx_messageInfo_MultiProofResponse proto.InternalMessageInfo +var xxx_messageInfo_MultiProofResult proto.InternalMessageInfo -func (m *MultiProofResponse) GetProof() MultiProof { +func (m *MultiProofResult) GetProof() MultiProof { if m != nil { return m.Proof } return MultiProof{} } -func (m *MultiProofResponse) GetEvmProofBytes() github_com_cometbft_cometbft_libs_bytes.HexBytes { +func (m *MultiProofResult) GetEvmProofBytes() github_com_cometbft_cometbft_libs_bytes.HexBytes { if m != nil { return m.EvmProofBytes } return nil } -// CountProofResponse is the data structure for response of count proof -type CountProofResponse struct { +// CountProofResult is the data structure for response of count proof +type CountProofResult struct { Proof CountProof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof"` EvmProofBytes github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,2,opt,name=evm_proof_bytes,json=evmProofBytes,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"evm_proof_bytes,omitempty"` } -func (m *CountProofResponse) Reset() { *m = CountProofResponse{} } -func (m *CountProofResponse) String() string { return proto.CompactTextString(m) } -func (*CountProofResponse) ProtoMessage() {} -func (*CountProofResponse) Descriptor() ([]byte, []int) { +func (m *CountProofResult) Reset() { *m = CountProofResult{} } +func (m *CountProofResult) String() string { return proto.CompactTextString(m) } +func (*CountProofResult) ProtoMessage() {} +func (*CountProofResult) Descriptor() ([]byte, []int) { return fileDescriptor_ae72765f9c902173, []int{8} } -func (m *CountProofResponse) XXX_Unmarshal(b []byte) error { +func (m *CountProofResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *CountProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *CountProofResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_CountProofResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_CountProofResult.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -463,26 +463,26 @@ func (m *CountProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *CountProofResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CountProofResponse.Merge(m, src) +func (m *CountProofResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_CountProofResult.Merge(m, src) } -func (m *CountProofResponse) XXX_Size() int { +func (m *CountProofResult) XXX_Size() int { return m.Size() } -func (m *CountProofResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CountProofResponse.DiscardUnknown(m) +func (m *CountProofResult) XXX_DiscardUnknown() { + xxx_messageInfo_CountProofResult.DiscardUnknown(m) } -var xxx_messageInfo_CountProofResponse proto.InternalMessageInfo +var xxx_messageInfo_CountProofResult proto.InternalMessageInfo -func (m *CountProofResponse) GetProof() CountProof { +func (m *CountProofResult) GetProof() CountProof { if m != nil { return m.Proof } return CountProof{} } -func (m *CountProofResponse) GetEvmProofBytes() github_com_cometbft_cometbft_libs_bytes.HexBytes { +func (m *CountProofResult) GetEvmProofBytes() github_com_cometbft_cometbft_libs_bytes.HexBytes { if m != nil { return m.EvmProofBytes } @@ -884,31 +884,30 @@ func (m *BlockRelayProof) GetSignatures() []TMSignature { // // ____________________[AppHash]____________________ // / \ -// ___________[N19]____________ ____[N20]_____ -// / \ / \ -// _____[N15]_____ ____[N16]______ __[N17]__ [K] -// / \ / \ / \ -// __[N8]_ __[N9]_ _[N10]_ _[N11]_ [N12] [N13] +// ___________[N19]____________ ______[N20]_______ +// / \ / \ +// _____[N15]_____ ____[N16]______ __[N17]__ __[N18]__ +// / \ / \ / \ / \ +// __[N8]_ __[N9]_ _[N10]_ _[N11]_ [N12] [N13] [K] [L] // / \ / \ / \ / \ / \ / \ // [N0] [N1] [N2] [N3] [N4] [N5] [N6] [N7] [G] [H] [I] [J] // / \ / \ / \ / \ / \ / \ / \ / \ // [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [A] [B] [C] [D] [E] [F] // -// [0] - acc (auth) [1] - authz [2] - bank [3] - capability [4] - consensus [5] - crisis -// [6] - dist [7] - evidence [8] - feegrant [9] - globalfee [A] - gov [B] - group -// [C] - ibccore [D] - icahost [E] - mint [F] - oracle [G] - params [H] - slashing -// [I] - staking [J] - transfer [K] - upgrade +// [0] - acc (auth) [1] - authz [2] - bank [3] - capability [4] - consensus [5] - crisis +// [6] - dist [7] - evidence [8] - feegrant [9] - feeibc [A] - globalfee [B] - gov +// [C] - group [D] - ibccore [E] - icahost [F] - mint [G] - oracle [H] - params +// [I] - slashing [J] - staking [K] - transfer [L] - upgrade // // Notice that NOT all leaves of the Merkle tree are needed in order to compute the Merkle // root hash, since we only want to validate the correctness of [F] In fact, only // [E], [N6], [N10], [N15], and [N20] are needed in order to compute [AppHash]. type MultiStoreProof struct { - OracleIAVLStateHash github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,1,opt,name=oracle_iavl_state_hash,json=oracleIavlStateHash,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"oracle_iavl_state_hash,omitempty"` - MintStoreMerkleHash github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,2,opt,name=mint_store_merkle_hash,json=mintStoreMerkleHash,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"mint_store_merkle_hash,omitempty"` - IbcToIcahostStoresMerkleHash github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,3,opt,name=ibc_to_icahost_stores_merkle_hash,json=ibcToIcahostStoresMerkleHash,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"ibc_to_icahost_stores_merkle_hash,omitempty"` - FeegrantToGroupStoresMerkleHash github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,4,opt,name=feegrant_to_group_stores_merkle_hash,json=feegrantToGroupStoresMerkleHash,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"feegrant_to_group_stores_merkle_hash,omitempty"` - AuthToEvidenceStoresMerkleHash github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,5,opt,name=auth_to_evidence_stores_merkle_hash,json=authToEvidenceStoresMerkleHash,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"auth_to_evidence_stores_merkle_hash,omitempty"` - ParamsToUpgradeStoresMerkleHash github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,6,opt,name=params_to_upgrade_stores_merkle_hash,json=paramsToUpgradeStoresMerkleHash,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"params_to_upgrade_stores_merkle_hash,omitempty"` + OracleIAVLStateHash github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,1,opt,name=oracle_iavl_state_hash,json=oracleIavlStateHash,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"oracle_iavl_state_hash,omitempty"` + ParamsStoreMerkleHash github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,2,opt,name=params_store_merkle_hash,json=paramsStoreMerkleHash,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"params_store_merkle_hash,omitempty"` + SlashingToStakingStoresMerkleHash github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,3,opt,name=slashing_to_staking_stores_merkle_hash,json=slashingToStakingStoresMerkleHash,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"slashing_to_staking_stores_merkle_hash,omitempty"` + TransferToUpgradeStoresMerkleHash github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,4,opt,name=transfer_to_upgrade_stores_merkle_hash,json=transferToUpgradeStoresMerkleHash,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"transfer_to_upgrade_stores_merkle_hash,omitempty"` + AuthToMintStoresMerkleHash github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,5,opt,name=auth_to_mint_stores_merkle_hash,json=authToMintStoresMerkleHash,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"auth_to_mint_stores_merkle_hash,omitempty"` } func (m *MultiStoreProof) Reset() { *m = MultiStoreProof{} } @@ -951,37 +950,30 @@ func (m *MultiStoreProof) GetOracleIAVLStateHash() github_com_cometbft_cometbft_ return nil } -func (m *MultiStoreProof) GetMintStoreMerkleHash() github_com_cometbft_cometbft_libs_bytes.HexBytes { +func (m *MultiStoreProof) GetParamsStoreMerkleHash() github_com_cometbft_cometbft_libs_bytes.HexBytes { if m != nil { - return m.MintStoreMerkleHash + return m.ParamsStoreMerkleHash } return nil } -func (m *MultiStoreProof) GetIbcToIcahostStoresMerkleHash() github_com_cometbft_cometbft_libs_bytes.HexBytes { +func (m *MultiStoreProof) GetSlashingToStakingStoresMerkleHash() github_com_cometbft_cometbft_libs_bytes.HexBytes { if m != nil { - return m.IbcToIcahostStoresMerkleHash + return m.SlashingToStakingStoresMerkleHash } return nil } -func (m *MultiStoreProof) GetFeegrantToGroupStoresMerkleHash() github_com_cometbft_cometbft_libs_bytes.HexBytes { +func (m *MultiStoreProof) GetTransferToUpgradeStoresMerkleHash() github_com_cometbft_cometbft_libs_bytes.HexBytes { if m != nil { - return m.FeegrantToGroupStoresMerkleHash + return m.TransferToUpgradeStoresMerkleHash } return nil } -func (m *MultiStoreProof) GetAuthToEvidenceStoresMerkleHash() github_com_cometbft_cometbft_libs_bytes.HexBytes { +func (m *MultiStoreProof) GetAuthToMintStoresMerkleHash() github_com_cometbft_cometbft_libs_bytes.HexBytes { if m != nil { - return m.AuthToEvidenceStoresMerkleHash - } - return nil -} - -func (m *MultiStoreProof) GetParamsToUpgradeStoresMerkleHash() github_com_cometbft_cometbft_libs_bytes.HexBytes { - if m != nil { - return m.ParamsToUpgradeStoresMerkleHash + return m.AuthToMintStoresMerkleHash } return nil } @@ -1300,15 +1292,15 @@ func (m *RequestsCountProof) GetMerklePaths() []IAVLMerklePath { } func init() { - proto.RegisterType((*QueryProofRequest)(nil), "bandchain.v1.oracle.QueryProofRequest") - proto.RegisterType((*QueryProofResponse)(nil), "bandchain.v1.oracle.QueryProofResponse") - proto.RegisterType((*QueryMultiProofRequest)(nil), "bandchain.v1.oracle.QueryMultiProofRequest") - proto.RegisterType((*QueryMultiProofResponse)(nil), "bandchain.v1.oracle.QueryMultiProofResponse") - proto.RegisterType((*QueryRequestCountProofRequest)(nil), "bandchain.v1.oracle.QueryRequestCountProofRequest") - proto.RegisterType((*QueryRequestCountProofResponse)(nil), "bandchain.v1.oracle.QueryRequestCountProofResponse") - proto.RegisterType((*SingleProofResponse)(nil), "bandchain.v1.oracle.SingleProofResponse") + proto.RegisterType((*ProofRequest)(nil), "bandchain.v1.oracle.ProofRequest") + proto.RegisterType((*ProofResponse)(nil), "bandchain.v1.oracle.ProofResponse") + proto.RegisterType((*MultiProofRequest)(nil), "bandchain.v1.oracle.MultiProofRequest") proto.RegisterType((*MultiProofResponse)(nil), "bandchain.v1.oracle.MultiProofResponse") - proto.RegisterType((*CountProofResponse)(nil), "bandchain.v1.oracle.CountProofResponse") + proto.RegisterType((*RequestCountProofRequest)(nil), "bandchain.v1.oracle.RequestCountProofRequest") + proto.RegisterType((*RequestCountProofResponse)(nil), "bandchain.v1.oracle.RequestCountProofResponse") + proto.RegisterType((*SingleProofResult)(nil), "bandchain.v1.oracle.SingleProofResult") + proto.RegisterType((*MultiProofResult)(nil), "bandchain.v1.oracle.MultiProofResult") + proto.RegisterType((*CountProofResult)(nil), "bandchain.v1.oracle.CountProofResult") proto.RegisterType((*SingleProof)(nil), "bandchain.v1.oracle.SingleProof") proto.RegisterType((*MultiProof)(nil), "bandchain.v1.oracle.MultiProof") proto.RegisterType((*CountProof)(nil), "bandchain.v1.oracle.CountProof") @@ -1325,105 +1317,102 @@ func init() { func init() { proto.RegisterFile("bandchain/v1/oracle/proof.proto", fileDescriptor_ae72765f9c902173) } var fileDescriptor_ae72765f9c902173 = []byte{ - // 1553 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcb, 0x6e, 0x1b, 0x47, - 0x16, 0x55, 0x8b, 0x94, 0xec, 0xb9, 0x94, 0x2c, 0xa9, 0x64, 0x4b, 0xb4, 0x60, 0x93, 0x12, 0xed, - 0xb1, 0xe4, 0xf1, 0x80, 0x1c, 0xc9, 0xb3, 0x31, 0x66, 0x36, 0x92, 0xc7, 0x1e, 0x69, 0xc6, 0xaf, - 0x90, 0x8a, 0x02, 0x04, 0x01, 0x3a, 0xc5, 0xee, 0x12, 0x59, 0x71, 0xb3, 0x8b, 0xee, 0x2a, 0x12, - 0xb2, 0x03, 0x23, 0x2f, 0x24, 0x41, 0xb2, 0x08, 0xf2, 0xf8, 0x8b, 0x6c, 0x8c, 0x6c, 0xf2, 0x0d, - 0x5e, 0x1a, 0xc8, 0x22, 0x01, 0x02, 0x38, 0x86, 0x9c, 0x55, 0x3e, 0x21, 0xab, 0xa0, 0x1e, 0x4d, - 0x76, 0x93, 0xcd, 0x48, 0x36, 0x6d, 0xaf, 0xd8, 0x5d, 0xbc, 0x75, 0xce, 0xb9, 0x8f, 0xba, 0x55, - 0x5d, 0x90, 0xaf, 0x62, 0xdf, 0x75, 0xea, 0x98, 0xfa, 0xa5, 0xf6, 0x6a, 0x89, 0x05, 0xd8, 0xf1, - 0x48, 0xa9, 0x19, 0x30, 0xb6, 0x5b, 0x6c, 0x06, 0x4c, 0x30, 0x34, 0xdb, 0x31, 0x28, 0xb6, 0x57, - 0x8b, 0xda, 0x60, 0xe1, 0x54, 0x8d, 0xb1, 0x9a, 0x47, 0x4a, 0xb8, 0x49, 0x4b, 0xd8, 0xf7, 0x99, - 0xc0, 0x82, 0x32, 0x9f, 0xeb, 0x29, 0x0b, 0xc7, 0x6b, 0xac, 0xc6, 0xd4, 0x63, 0x49, 0x3e, 0x99, - 0xd1, 0x39, 0x03, 0xde, 0xa1, 0xd1, 0xe3, 0x85, 0xff, 0xc1, 0xcc, 0x6b, 0x2d, 0x12, 0xdc, 0xbd, - 0x25, 0x49, 0xcb, 0xe4, 0x4e, 0x8b, 0x70, 0x81, 0x4e, 0x03, 0x04, 0xfa, 0xd1, 0xa6, 0x6e, 0xd6, - 0x5a, 0xb4, 0x56, 0xd2, 0xe5, 0xbf, 0x98, 0x91, 0x2d, 0x17, 0xcd, 0xc1, 0x78, 0x9d, 0xd0, 0x5a, - 0x5d, 0x64, 0x47, 0x17, 0xad, 0x95, 0x54, 0xd9, 0xbc, 0x15, 0x04, 0xa0, 0x28, 0x16, 0x6f, 0x32, - 0x9f, 0x93, 0x88, 0xb5, 0x15, 0xb5, 0x46, 0x57, 0x61, 0x3c, 0x20, 0xbc, 0xe5, 0x69, 0x94, 0xcc, - 0xda, 0x4a, 0x31, 0xc1, 0xd7, 0x62, 0x85, 0xfa, 0x35, 0x8f, 0xc4, 0x10, 0x37, 0xd2, 0x0f, 0x1f, - 0xe7, 0x47, 0xca, 0x66, 0x76, 0xe1, 0x12, 0xcc, 0x29, 0xd6, 0xeb, 0x2d, 0x4f, 0xd0, 0x98, 0x1b, - 0x79, 0xc8, 0x74, 0xdd, 0xe0, 0x59, 0x6b, 0x31, 0xb5, 0x92, 0x2e, 0x43, 0xc7, 0x0f, 0x5e, 0xd8, - 0x83, 0xf9, 0xbe, 0xa9, 0x07, 0xa8, 0xbe, 0xd2, 0xa3, 0x7a, 0x39, 0x51, 0x75, 0x3f, 0x60, 0x8f, - 0xe8, 0x3c, 0x9c, 0x56, 0xcc, 0x46, 0xea, 0x65, 0xd6, 0xf2, 0x45, 0x54, 0x7b, 0xe1, 0x3d, 0xc8, - 0x0d, 0x32, 0x78, 0x21, 0x0a, 0xfb, 0x01, 0x7b, 0x14, 0x7e, 0x67, 0xc1, 0x6c, 0x42, 0xf0, 0xd1, - 0xbf, 0x61, 0x4c, 0x15, 0xa8, 0x62, 0xcd, 0xac, 0x2d, 0x1e, 0x94, 0x35, 0x03, 0xab, 0x27, 0xa1, - 0xb7, 0x60, 0x8a, 0xb4, 0x1b, 0xb6, 0x7a, 0xb1, 0xab, 0x77, 0x05, 0xe1, 0x4a, 0xe5, 0xc4, 0xc6, - 0x3f, 0x7f, 0x7f, 0x9c, 0xff, 0x47, 0x8d, 0x8a, 0x7a, 0xab, 0x5a, 0x74, 0x58, 0xa3, 0xe4, 0xb0, - 0x06, 0x11, 0xd5, 0x5d, 0xd1, 0x7d, 0xf0, 0x68, 0x95, 0x97, 0xd4, 0x94, 0xe2, 0x26, 0xd9, 0xdb, - 0x90, 0x0f, 0xe5, 0x49, 0xd2, 0x6e, 0x68, 0x16, 0xf9, 0x5a, 0x78, 0x60, 0x01, 0x4a, 0xc8, 0xe5, - 0xbf, 0xe2, 0x92, 0xf3, 0x07, 0xa4, 0xec, 0x55, 0x2b, 0x4e, 0xc8, 0xed, 0xa1, 0x14, 0x77, 0xe7, - 0xbd, 0x4a, 0xc5, 0x4f, 0x2c, 0xc8, 0x44, 0xd2, 0x8b, 0x96, 0x60, 0xa2, 0xea, 0x31, 0xe7, 0xb6, - 0x1d, 0x29, 0xc6, 0x74, 0x39, 0xa3, 0xc6, 0x36, 0x75, 0x45, 0xee, 0xc0, 0x8c, 0x96, 0x6c, 0xbb, - 0x58, 0x60, 0x2d, 0xcc, 0x14, 0xe7, 0xd9, 0x44, 0xcf, 0x6e, 0xaa, 0x9f, 0xff, 0x60, 0x81, 0xa3, - 0xee, 0x4d, 0xb1, 0xf8, 0xb0, 0xc4, 0xd5, 0xd4, 0x01, 0xf1, 0xf0, 0x5d, 0x83, 0x9b, 0xfa, 0x13, - 0xdc, 0x0d, 0x69, 0x5d, 0x96, 0xc6, 0x31, 0xdc, 0x6a, 0x7c, 0xb8, 0xf0, 0x9b, 0x05, 0xd0, 0x2d, - 0x87, 0xc3, 0x78, 0x88, 0x61, 0x3e, 0xea, 0x61, 0x43, 0x4e, 0xee, 0xf8, 0x99, 0x7a, 0x46, 0x3f, - 0x8f, 0x77, 0xfd, 0x8c, 0xa8, 0x78, 0x59, 0xce, 0xfe, 0x68, 0x01, 0x74, 0x2b, 0xe9, 0x30, 0xce, - 0xde, 0x80, 0x8c, 0x23, 0x27, 0xc4, 0x12, 0x99, 0xdc, 0x65, 0x4c, 0xf7, 0xe2, 0x7d, 0xa5, 0x0a, - 0x4e, 0x97, 0xf2, 0x65, 0x79, 0xf6, 0xad, 0x05, 0x53, 0x3d, 0x11, 0x46, 0xa5, 0x4e, 0x73, 0xd4, - 0x2b, 0x6b, 0x26, 0xc4, 0x6c, 0xaf, 0x16, 0xcb, 0xea, 0x8f, 0x78, 0x1b, 0x44, 0x59, 0x38, 0xd2, - 0x26, 0x01, 0xa7, 0xcc, 0x57, 0x8e, 0xa6, 0xcb, 0xe1, 0x2b, 0xba, 0x06, 0x13, 0x0d, 0x12, 0xdc, - 0xf6, 0x88, 0xdd, 0xc4, 0xa2, 0xce, 0xb3, 0x29, 0x95, 0xe8, 0x33, 0x89, 0x8a, 0xb7, 0xd6, 0x77, - 0xae, 0x5d, 0x57, 0xc6, 0xb7, 0xb0, 0xa8, 0x1b, 0x8a, 0x4c, 0xa3, 0x33, 0xc2, 0x0b, 0x1f, 0x8f, - 0xc2, 0xb1, 0xb8, 0x15, 0x5a, 0x86, 0x69, 0xca, 0x75, 0x41, 0x31, 0xdf, 0x0e, 0x3a, 0xe9, 0x38, - 0x5a, 0x9e, 0xa4, 0x5c, 0xba, 0x74, 0xd3, 0x2f, 0xab, 0x84, 0xfc, 0x15, 0x8e, 0xf1, 0x56, 0x55, - 0x04, 0x84, 0xd8, 0x91, 0x7d, 0x79, 0xb2, 0x3c, 0x69, 0x46, 0x4d, 0xde, 0x96, 0x60, 0x22, 0x34, - 0xe3, 0xf4, 0x1e, 0x51, 0x21, 0x4e, 0x97, 0x33, 0x66, 0xac, 0x42, 0xef, 0x11, 0xb4, 0x0c, 0x53, - 0xa1, 0x49, 0xe8, 0x75, 0x5a, 0x59, 0x85, 0x04, 0x3b, 0xc6, 0xf9, 0x37, 0x60, 0x82, 0xd3, 0xaa, - 0x47, 0xfd, 0x9a, 0x5d, 0xc7, 0xbc, 0x9e, 0x1d, 0x1b, 0xa2, 0xc1, 0x64, 0x0c, 0xd2, 0x26, 0xe6, - 0xf5, 0xc2, 0xe7, 0x29, 0x98, 0xea, 0xc9, 0xaf, 0x2c, 0x10, 0xbd, 0xa2, 0xb8, 0x60, 0x01, 0xb1, - 0xa3, 0x9d, 0xf1, 0xec, 0xe0, 0x5e, 0x5e, 0x91, 0xc6, 0xb1, 0x02, 0x69, 0xc4, 0x87, 0x91, 0x07, - 0x27, 0xc3, 0x5a, 0xc7, 0x2e, 0x09, 0xec, 0x4e, 0x3a, 0x03, 0xc1, 0x4d, 0x59, 0x5f, 0x18, 0x5c, - 0x80, 0x9b, 0x6a, 0x52, 0x98, 0xaf, 0x40, 0x70, 0x43, 0x33, 0x57, 0x4d, 0xfc, 0x17, 0x51, 0xc8, - 0x3a, 0xac, 0xd1, 0x60, 0xbe, 0x4d, 0x7c, 0x87, 0xb9, 0xc4, 0xb5, 0xdb, 0x4c, 0x68, 0x36, 0x53, - 0xed, 0x7f, 0x1b, 0xd0, 0xe6, 0xe5, 0xa4, 0x2b, 0x7a, 0xce, 0x0e, 0x13, 0x0a, 0xce, 0x70, 0x9d, - 0x70, 0x92, 0xfe, 0x44, 0x57, 0x01, 0x38, 0xad, 0xf9, 0x58, 0xb4, 0x02, 0xc2, 0xb3, 0x69, 0x55, - 0x98, 0xc9, 0x1b, 0xf5, 0xf6, 0xf5, 0x4a, 0x68, 0x18, 0xae, 0xcc, 0xee, 0xcc, 0xc2, 0x17, 0xe3, - 0x30, 0xd5, 0x13, 0x4b, 0xf4, 0xbe, 0x05, 0xe6, 0x2c, 0x69, 0x53, 0xdc, 0xf6, 0x6c, 0x2e, 0xb0, - 0x20, 0xba, 0x08, 0x2c, 0x55, 0x04, 0xff, 0xdf, 0x7f, 0x9c, 0x9f, 0xd5, 0xeb, 0x4e, 0x16, 0x74, - 0x45, 0xfe, 0x2f, 0x53, 0xfb, 0x5c, 0xb5, 0x31, 0xab, 0xa9, 0xb6, 0x70, 0xdb, 0xeb, 0x00, 0x21, - 0x0a, 0x73, 0x0d, 0xea, 0x0b, 0x53, 0x0e, 0x26, 0x6b, 0x4a, 0xc1, 0x30, 0xfb, 0xdc, 0xac, 0xc4, - 0x54, 0x8e, 0xea, 0xac, 0x29, 0xaa, 0xfb, 0xb0, 0x44, 0xab, 0x8e, 0x2d, 0x98, 0x4d, 0x1d, 0x5c, - 0x67, 0xdc, 0x90, 0xf2, 0x18, 0x6b, 0x6a, 0x08, 0xd6, 0x53, 0xb4, 0xea, 0x6c, 0xb3, 0x2d, 0x0d, - 0xae, 0xd8, 0x79, 0x84, 0xfe, 0x23, 0x0b, 0xce, 0xee, 0x12, 0x52, 0x0b, 0xb0, 0x2f, 0xa4, 0x88, - 0x5a, 0xc0, 0x5a, 0xcd, 0x24, 0x09, 0xe9, 0x21, 0x24, 0xe4, 0x43, 0x86, 0x6d, 0xf6, 0x5f, 0x89, - 0xdf, 0xa7, 0xe2, 0x03, 0x0b, 0xce, 0xe0, 0x96, 0xa8, 0x4b, 0x05, 0xa4, 0x4d, 0x5d, 0xe2, 0x3b, - 0x24, 0x49, 0xc4, 0x30, 0x4d, 0x20, 0x27, 0x09, 0xb6, 0xd9, 0x15, 0x03, 0x9f, 0x18, 0x89, 0x26, - 0x0e, 0x70, 0x83, 0x4b, 0x15, 0xad, 0x66, 0x2d, 0xc0, 0x6e, 0xa2, 0x88, 0xf1, 0x61, 0x22, 0xa1, - 0x19, 0xb6, 0xd9, 0xeb, 0x1a, 0xbf, 0x57, 0x45, 0xe1, 0xfb, 0x31, 0x98, 0x4b, 0x5e, 0xfc, 0xc8, - 0x87, 0x93, 0xa6, 0x65, 0xda, 0xd8, 0x77, 0x6d, 0xb5, 0xd0, 0x6c, 0xea, 0x46, 0x57, 0xc6, 0xf3, - 0x89, 0x3a, 0x61, 0x60, 0xd7, 0x7d, 0xf7, 0xb2, 0x04, 0xdd, 0x72, 0x55, 0x40, 0xe2, 0x1f, 0x61, - 0xe9, 0xce, 0xf1, 0x3f, 0x0f, 0x19, 0x41, 0x1b, 0xc4, 0xe6, 0xc4, 0x61, 0xbe, 0x6b, 0x9a, 0x3c, - 0xc8, 0xa1, 0x8a, 0x1a, 0x41, 0x2b, 0x30, 0xad, 0x0c, 0x7c, 0xec, 0xb3, 0xd0, 0x2a, 0xad, 0xf6, - 0x8b, 0x63, 0x72, 0xfc, 0x06, 0xf6, 0x99, 0xb1, 0x7c, 0x07, 0xe6, 0x3d, 0xcc, 0x85, 0xad, 0x9b, - 0x24, 0x75, 0x95, 0x63, 0x4c, 0xd4, 0x49, 0x30, 0x54, 0xaa, 0x67, 0x25, 0xa8, 0x8a, 0xe2, 0x96, - 0xbb, 0xee, 0xbb, 0x37, 0x25, 0x20, 0xfa, 0xd4, 0x82, 0x73, 0x3e, 0xd9, 0x13, 0x76, 0x1b, 0x7b, - 0xd4, 0xc5, 0x82, 0x05, 0x2a, 0x72, 0x3a, 0x96, 0xf2, 0x4c, 0xec, 0xf3, 0x16, 0x1f, 0x3e, 0xc3, - 0x4b, 0x92, 0x63, 0x27, 0xa4, 0x90, 0x81, 0x94, 0x61, 0x0d, 0xf1, 0x55, 0x60, 0xdf, 0x86, 0x19, - 0xe5, 0xb5, 0x3e, 0x00, 0x18, 0xce, 0x23, 0x43, 0x70, 0x4e, 0x49, 0x38, 0x7d, 0xb8, 0xd0, 0x0c, - 0x77, 0x60, 0xa1, 0xb3, 0x8c, 0xa4, 0x7f, 0xcd, 0x80, 0x35, 0x19, 0x27, 0xda, 0xe3, 0xec, 0xd1, - 0x21, 0xa8, 0xe6, 0x43, 0xdc, 0x75, 0xdf, 0xbd, 0x65, 0x50, 0x55, 0xe1, 0xfe, 0x62, 0xc1, 0x89, - 0xc4, 0x8d, 0x04, 0x55, 0x01, 0xc9, 0x8e, 0x4f, 0xdc, 0xf0, 0x70, 0x4e, 0x76, 0xe9, 0xde, 0x50, - 0x05, 0x3b, 0xad, 0xf1, 0xf4, 0xa1, 0x4b, 0xa2, 0xf5, 0x72, 0xf0, 0xd6, 0xae, 0xe4, 0x18, 0x7d, - 0x31, 0x1c, 0x15, 0x85, 0x56, 0xf8, 0x64, 0x14, 0x32, 0x91, 0xdd, 0x0c, 0x6d, 0x80, 0x15, 0x0c, - 0xe5, 0x86, 0x15, 0x48, 0x8c, 0xe1, 0xbe, 0x9d, 0x2c, 0x8e, 0x26, 0xc0, 0x6a, 0xab, 0x55, 0x38, - 0x59, 0xb6, 0xda, 0x08, 0xc3, 0x4c, 0xb8, 0xfb, 0xcb, 0xc5, 0xc6, 0x05, 0x6e, 0x34, 0x87, 0x6a, - 0xde, 0xd3, 0x06, 0x6e, 0x3b, 0x44, 0x2b, 0x7c, 0x6d, 0x01, 0xea, 0x3f, 0x77, 0xa3, 0xe3, 0x30, - 0xa6, 0xce, 0xdc, 0xe6, 0x44, 0xaf, 0x5f, 0x5e, 0xd5, 0xf1, 0x76, 0xed, 0xe7, 0x14, 0x1c, 0xa9, - 0x90, 0xa0, 0x4d, 0x1d, 0x82, 0x3e, 0xb3, 0x60, 0x4c, 0x6b, 0x3a, 0x97, 0x88, 0xd6, 0x77, 0x1f, - 0xb5, 0xb0, 0x7c, 0xa0, 0x9d, 0xfe, 0x6e, 0x2e, 0x94, 0x3e, 0xfc, 0xe1, 0xd7, 0x6f, 0x46, 0xcf, - 0xa3, 0xe5, 0xd2, 0xc0, 0x8b, 0xb5, 0xd2, 0xbb, 0xdd, 0x3b, 0xa1, 0xfb, 0xe8, 0xab, 0xf8, 0xa7, - 0xde, 0x85, 0xc1, 0x44, 0x7d, 0xd7, 0x4b, 0x0b, 0x7f, 0x3f, 0x9c, 0xb1, 0x91, 0xb6, 0xa2, 0xa4, - 0x15, 0xd0, 0x62, 0xa2, 0xb4, 0xc8, 0x17, 0x23, 0x7a, 0x60, 0xc1, 0x4c, 0xdf, 0xb5, 0x0f, 0x5a, - 0x1b, 0xcc, 0x36, 0xe8, 0x12, 0x69, 0xe1, 0xe2, 0x33, 0xcd, 0x31, 0x42, 0x57, 0x95, 0xd0, 0x0b, - 0xe8, 0x7c, 0xa2, 0x50, 0x13, 0x3c, 0x6e, 0x47, 0x3e, 0x01, 0x37, 0x2a, 0x0f, 0xf7, 0x73, 0xd6, - 0xa3, 0xfd, 0x9c, 0xf5, 0x64, 0x3f, 0x67, 0x7d, 0xf9, 0x34, 0x37, 0xf2, 0xe8, 0x69, 0x6e, 0xe4, - 0xa7, 0xa7, 0xb9, 0x91, 0x37, 0x2f, 0x45, 0x0a, 0x5a, 0xc2, 0xa9, 0x4b, 0x47, 0x87, 0x79, 0x25, - 0x83, 0xbb, 0x56, 0x72, 0x3c, 0x4a, 0x7c, 0x51, 0xaa, 0x05, 0x4d, 0x27, 0x96, 0xa7, 0xea, 0xb8, - 0xb2, 0xbd, 0xf8, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x6f, 0x30, 0x2a, 0x24, 0x15, 0x00, - 0x00, + // 1514 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0xc6, 0x4e, 0x5a, 0x9e, 0x93, 0x26, 0x99, 0xb4, 0xa9, 0x1b, 0x41, 0x9c, 0x2e, 0x6d, + 0x93, 0x52, 0xe1, 0x25, 0x6d, 0x2f, 0x08, 0x2e, 0x49, 0x5b, 0x94, 0x88, 0xa6, 0xad, 0xec, 0x10, + 0x24, 0x84, 0xb4, 0x8c, 0x77, 0x27, 0xf6, 0xd2, 0xdd, 0x19, 0x77, 0x67, 0x6c, 0xa5, 0x45, 0x08, + 0x84, 0x04, 0x48, 0x9c, 0x50, 0xf9, 0x1b, 0xb8, 0x20, 0x21, 0x6e, 0x9c, 0xf8, 0x03, 0x7a, 0xac, + 0xc4, 0x01, 0x4e, 0xa5, 0x4a, 0x39, 0xf1, 0x27, 0x70, 0x42, 0xf3, 0x63, 0xed, 0xb5, 0xbd, 0x69, + 0x42, 0xdd, 0xf6, 0xe4, 0xdd, 0xf1, 0x9b, 0xef, 0xfb, 0xde, 0xbc, 0x6f, 0xdf, 0xce, 0x0e, 0x94, + 0x6a, 0x98, 0xfa, 0x5e, 0x03, 0x07, 0xd4, 0x69, 0xaf, 0x38, 0x2c, 0xc6, 0x5e, 0x48, 0x9c, 0x66, + 0xcc, 0xd8, 0x4e, 0xb9, 0x19, 0x33, 0xc1, 0xd0, 0x6c, 0x27, 0xa0, 0xdc, 0x5e, 0x29, 0xeb, 0x80, + 0xf9, 0x57, 0xeb, 0x8c, 0xd5, 0x43, 0xe2, 0xe0, 0x66, 0xe0, 0x60, 0x4a, 0x99, 0xc0, 0x22, 0x60, + 0x94, 0xeb, 0x29, 0xf3, 0xc7, 0xeb, 0xac, 0xce, 0xd4, 0xa5, 0x23, 0xaf, 0xcc, 0xe8, 0x9c, 0x01, + 0xef, 0xd0, 0xe8, 0x71, 0xfb, 0x1a, 0x4c, 0xdc, 0x92, 0x7c, 0x15, 0x72, 0xa7, 0x45, 0xb8, 0x40, + 0xaf, 0x01, 0xc4, 0xfa, 0xd2, 0x0d, 0xfc, 0xa2, 0xb5, 0x68, 0x2d, 0xe7, 0x2b, 0xaf, 0x98, 0x91, + 0x0d, 0x1f, 0xcd, 0xc1, 0x78, 0x83, 0x04, 0xf5, 0x86, 0x28, 0x8e, 0x2e, 0x5a, 0xcb, 0xb9, 0x8a, + 0xb9, 0xb3, 0x23, 0x98, 0x34, 0x30, 0xbc, 0xc9, 0x28, 0x27, 0xa9, 0x40, 0x2b, 0x1d, 0x88, 0xae, + 0xc2, 0x78, 0x4c, 0x78, 0x2b, 0xd4, 0x00, 0x85, 0x8b, 0xe7, 0xca, 0x19, 0x19, 0x96, 0xab, 0x01, + 0xad, 0x87, 0x24, 0x41, 0x6c, 0x85, 0x62, 0x2d, 0xff, 0xe0, 0x51, 0x69, 0xa4, 0x62, 0xe6, 0xda, + 0x97, 0x61, 0x66, 0xb3, 0x15, 0x8a, 0xa0, 0x47, 0x7a, 0x09, 0x0a, 0x5d, 0xe9, 0xbc, 0x68, 0x2d, + 0xe6, 0x96, 0xf3, 0x15, 0xe8, 0x68, 0xe7, 0xf6, 0x1d, 0x40, 0xe9, 0x59, 0x07, 0x28, 0xbd, 0xd2, + 0xa7, 0xf4, 0x6c, 0xa6, 0xd2, 0x1e, 0xc0, 0x41, 0xa1, 0xf3, 0x50, 0x34, 0xf2, 0xae, 0xb0, 0x16, + 0x15, 0x69, 0xbd, 0xf6, 0x2e, 0x9c, 0xca, 0xf8, 0xef, 0xb9, 0xa8, 0xea, 0x01, 0x1c, 0x54, 0xf5, + 0x8b, 0x05, 0x33, 0x03, 0x4b, 0x8c, 0xde, 0x85, 0x31, 0x65, 0x3d, 0xc5, 0x58, 0xb8, 0xb8, 0x78, + 0x50, 0x65, 0x0c, 0xa8, 0x9e, 0x84, 0x3e, 0x86, 0x29, 0xd2, 0x8e, 0x5c, 0x75, 0xe3, 0xd6, 0xee, + 0x0a, 0xc2, 0x95, 0xc2, 0x89, 0xb5, 0xcb, 0xff, 0x3e, 0x2a, 0xbd, 0x55, 0x0f, 0x44, 0xa3, 0x55, + 0x2b, 0x7b, 0x2c, 0x72, 0x3c, 0x16, 0x11, 0x51, 0xdb, 0x11, 0xdd, 0x8b, 0x30, 0xa8, 0x71, 0x47, + 0x4d, 0x29, 0xaf, 0x93, 0xdd, 0x35, 0x79, 0x51, 0x99, 0x24, 0xed, 0x48, 0xb3, 0xc8, 0x5b, 0xfb, + 0x67, 0x0b, 0xa6, 0xfb, 0x97, 0x1a, 0xbd, 0xd3, 0x2b, 0xb8, 0x74, 0x40, 0x81, 0x5e, 0xb6, 0xde, + 0xfe, 0x22, 0x1c, 0x4e, 0x6f, 0x77, 0xd6, 0xcb, 0xd4, 0xfb, 0xd8, 0x82, 0x42, 0xaa, 0xb4, 0xe8, + 0x34, 0x4c, 0xd4, 0x42, 0xe6, 0xdd, 0x76, 0x53, 0x26, 0xcc, 0x57, 0x0a, 0x6a, 0x6c, 0x5d, 0x3b, + 0x71, 0x1b, 0x66, 0xb4, 0x64, 0xd7, 0xc7, 0x02, 0x6b, 0x61, 0xc6, 0x94, 0x67, 0x32, 0x33, 0xbb, + 0xa9, 0x7e, 0xae, 0x62, 0x81, 0xd3, 0xe9, 0x4d, 0xb1, 0xde, 0x61, 0x89, 0xab, 0xa9, 0x63, 0x12, + 0xe2, 0xbb, 0x06, 0x37, 0xf7, 0x14, 0xdc, 0x35, 0x19, 0x5d, 0x91, 0xc1, 0x3d, 0xb8, 0xb5, 0xde, + 0x61, 0xfb, 0x1f, 0x0b, 0xa0, 0x6b, 0x86, 0xc3, 0x64, 0x88, 0xe1, 0x64, 0x3a, 0xc3, 0x48, 0x4e, + 0xee, 0xe4, 0x99, 0xfb, 0x9f, 0x79, 0x1e, 0xef, 0xe6, 0x99, 0x52, 0xf1, 0xa2, 0x92, 0xfd, 0xc3, + 0x02, 0xe8, 0x3a, 0xe9, 0x30, 0xc9, 0xde, 0x80, 0x82, 0x27, 0x27, 0xf4, 0x14, 0x72, 0x29, 0x53, + 0x83, 0xe9, 0x5a, 0x7c, 0xc0, 0xaa, 0xe0, 0x75, 0x29, 0x5f, 0x54, 0x66, 0x3f, 0x59, 0x30, 0xd5, + 0xb7, 0xc2, 0xc8, 0xe9, 0x34, 0x45, 0xfd, 0x64, 0xcd, 0x24, 0x98, 0xed, 0x95, 0x72, 0x56, 0x03, + 0x44, 0x45, 0x38, 0xd2, 0x26, 0x31, 0x0f, 0x18, 0x55, 0x89, 0xe6, 0x2b, 0xc9, 0x2d, 0xba, 0x0e, + 0x13, 0x11, 0x89, 0x6f, 0x87, 0xc4, 0x6d, 0x62, 0xd1, 0xe0, 0xc5, 0x9c, 0x2a, 0xf4, 0xeb, 0x99, + 0x8a, 0x37, 0x56, 0xb7, 0xaf, 0x6f, 0xaa, 0xe0, 0x5b, 0x58, 0x34, 0x0c, 0x45, 0x21, 0xea, 0x8c, + 0x70, 0xfb, 0xeb, 0x51, 0x38, 0xd6, 0x1b, 0x85, 0x96, 0x60, 0x3a, 0xe0, 0xda, 0x50, 0x8c, 0xba, + 0x71, 0xa7, 0x1c, 0x47, 0x2b, 0x93, 0x01, 0x97, 0x29, 0xdd, 0xa4, 0x15, 0x55, 0x90, 0xb3, 0x70, + 0x8c, 0xb7, 0x6a, 0x22, 0x26, 0xc4, 0x4d, 0xbd, 0x72, 0x27, 0x2b, 0x93, 0x66, 0xd4, 0xd4, 0xed, + 0x34, 0x4c, 0x24, 0x61, 0x3c, 0xb8, 0x47, 0xd4, 0x12, 0xe7, 0x2b, 0x05, 0x33, 0x56, 0x0d, 0xee, + 0x11, 0xb4, 0x04, 0x53, 0x49, 0x48, 0x92, 0x75, 0x5e, 0x45, 0x25, 0x04, 0xdb, 0x26, 0xf9, 0x0f, + 0x61, 0x82, 0x07, 0xb5, 0x30, 0xa0, 0x75, 0xb7, 0x81, 0x79, 0xa3, 0x38, 0x36, 0x44, 0x83, 0x29, + 0x18, 0xa4, 0x75, 0xcc, 0x1b, 0xf6, 0x77, 0x39, 0x98, 0xea, 0xab, 0xaf, 0x34, 0x88, 0x7e, 0xa2, + 0xb8, 0x60, 0x31, 0x71, 0xd3, 0x9d, 0xf1, 0xcc, 0xfe, 0x9d, 0xbc, 0x2a, 0x83, 0x7b, 0x0c, 0x12, + 0xf5, 0x0e, 0xa3, 0x10, 0x4e, 0x25, 0x5e, 0xc7, 0x3e, 0x89, 0xdd, 0x4e, 0x39, 0x63, 0xc1, 0x8d, + 0xad, 0x2f, 0xec, 0x6f, 0xc0, 0x75, 0x35, 0x29, 0xa9, 0x57, 0x2c, 0xb8, 0xa1, 0x99, 0xab, 0x65, + 0xfe, 0x8b, 0x02, 0x28, 0x7a, 0x2c, 0x8a, 0x18, 0x75, 0x09, 0xf5, 0x98, 0x4f, 0x7c, 0xb7, 0xcd, + 0x84, 0x66, 0x33, 0x6e, 0x7f, 0x63, 0x9f, 0x36, 0x2f, 0x27, 0x5d, 0xd3, 0x73, 0xb6, 0x99, 0x50, + 0x70, 0x86, 0xeb, 0x84, 0x97, 0xf5, 0x27, 0x7a, 0x0f, 0x80, 0x07, 0x75, 0x8a, 0x45, 0x2b, 0x26, + 0xbc, 0x98, 0x57, 0xc6, 0xcc, 0x7e, 0x49, 0x6f, 0x6d, 0x56, 0x93, 0xc0, 0xe4, 0xc9, 0xec, 0xce, + 0xb4, 0xef, 0x8f, 0xc1, 0x54, 0xdf, 0x5a, 0xa2, 0x2f, 0x2d, 0x30, 0x3b, 0x44, 0x37, 0xc0, 0xed, + 0xd0, 0xe5, 0x02, 0x0b, 0xa2, 0x4d, 0x60, 0x29, 0x13, 0xbc, 0xbf, 0xf7, 0xa8, 0x34, 0xab, 0x9f, + 0x3b, 0x69, 0xe8, 0xaa, 0xfc, 0x5f, 0x96, 0xf6, 0x99, 0xbc, 0x31, 0xab, 0xa9, 0x36, 0x70, 0x3b, + 0xec, 0x00, 0xa1, 0x08, 0x8a, 0x4d, 0x1c, 0xe3, 0x88, 0x1b, 0x43, 0x98, 0xba, 0x29, 0x0d, 0xc3, + 0xbc, 0xe9, 0x4e, 0x68, 0x54, 0x95, 0xac, 0xae, 0x9c, 0xa2, 0xfb, 0xd6, 0x82, 0x73, 0x3c, 0xc4, + 0xbc, 0x21, 0xdd, 0x2e, 0x98, 0xcc, 0xf8, 0xb6, 0xbc, 0x54, 0xe4, 0xbc, 0x87, 0x3d, 0x37, 0x04, + 0xfb, 0xe9, 0x84, 0x63, 0x8b, 0x55, 0x35, 0x83, 0x12, 0xc2, 0xfb, 0x94, 0x88, 0x18, 0x53, 0xbe, + 0x43, 0x62, 0xa9, 0xa4, 0xd5, 0xac, 0xc7, 0xd8, 0x27, 0x59, 0x4a, 0xf2, 0xc3, 0x28, 0x49, 0x38, + 0xb6, 0xd8, 0x07, 0x9a, 0x61, 0x40, 0xc9, 0x5d, 0x28, 0xe1, 0x96, 0x68, 0x48, 0x11, 0x51, 0x40, + 0x45, 0x96, 0x82, 0x61, 0x5a, 0xc2, 0xbc, 0x04, 0xdf, 0x62, 0x9b, 0x01, 0x15, 0xfd, 0xd4, 0xf6, + 0xaf, 0x63, 0x30, 0x97, 0xfd, 0x00, 0x22, 0x0a, 0xa7, 0x4c, 0xdb, 0x72, 0x31, 0xf5, 0x5d, 0x65, + 0x76, 0x37, 0xf0, 0xd3, 0xee, 0x7c, 0x46, 0x67, 0x18, 0xd8, 0x55, 0xea, 0x5f, 0x91, 0xa0, 0x1b, + 0xbe, 0x5a, 0x85, 0xde, 0x6f, 0x9c, 0x7c, 0x67, 0xeb, 0x5d, 0x82, 0x82, 0x08, 0x22, 0xe2, 0x72, + 0xe2, 0x31, 0xea, 0x9b, 0x46, 0x0b, 0x72, 0xa8, 0xaa, 0x46, 0xd0, 0x32, 0x4c, 0xab, 0x00, 0x8a, + 0x29, 0x4b, 0xa2, 0xf2, 0xaa, 0x67, 0x1f, 0x93, 0xe3, 0x37, 0x30, 0x65, 0x26, 0xf2, 0x53, 0x38, + 0x19, 0x62, 0x2e, 0x5c, 0xdd, 0xa8, 0x02, 0x5f, 0x25, 0xc6, 0x44, 0x83, 0xc4, 0x43, 0x2d, 0xf0, + 0xac, 0x04, 0x55, 0xab, 0xb8, 0xe1, 0xaf, 0x52, 0xff, 0xa6, 0x04, 0x54, 0xf6, 0xa2, 0x64, 0x57, + 0xb8, 0x6d, 0x1c, 0x06, 0x3e, 0x16, 0x2c, 0x56, 0x2b, 0xa7, 0xd7, 0x52, 0x7e, 0x6b, 0x50, 0xde, + 0xe2, 0x7a, 0x31, 0xc7, 0x87, 0xb1, 0x97, 0xe4, 0xd8, 0x4e, 0x28, 0xe4, 0x42, 0xca, 0x65, 0x4d, + 0xf0, 0xd5, 0xc2, 0x7e, 0x02, 0x33, 0x2a, 0x6b, 0xfd, 0x12, 0x36, 0x9c, 0x47, 0x86, 0xe0, 0x9c, + 0x92, 0x70, 0xfa, 0x05, 0xaf, 0x19, 0xee, 0xc0, 0x3c, 0x69, 0x07, 0x3e, 0xa1, 0x1e, 0x51, 0xf9, + 0x35, 0x63, 0xd6, 0x64, 0x9c, 0xe8, 0x8c, 0x8b, 0x47, 0x87, 0xa0, 0x3a, 0x99, 0xe0, 0xae, 0x52, + 0xff, 0x96, 0x41, 0x55, 0xc6, 0xfd, 0xcb, 0x82, 0x13, 0x99, 0xcd, 0x1c, 0xd5, 0x00, 0xc9, 0xae, + 0x4b, 0xfc, 0x64, 0x83, 0x4c, 0x76, 0x82, 0xdd, 0xa1, 0x0c, 0x3b, 0xad, 0xf1, 0xf4, 0xc6, 0x47, + 0xa2, 0xf5, 0x73, 0xf0, 0xd6, 0x8e, 0xe4, 0x18, 0x7d, 0x3e, 0x1c, 0x55, 0x85, 0x66, 0x7f, 0x33, + 0x0a, 0x85, 0xd4, 0x1b, 0x05, 0xad, 0x81, 0x15, 0x0f, 0x95, 0x86, 0x15, 0x4b, 0x8c, 0xe1, 0xbe, + 0x5f, 0x2c, 0x8e, 0x26, 0xc0, 0x6a, 0xab, 0xa7, 0x70, 0xb2, 0x62, 0xb5, 0x11, 0x86, 0x99, 0xe4, + 0x0d, 0x2c, 0x1f, 0x36, 0x2e, 0x70, 0xd4, 0x1c, 0xaa, 0x5f, 0x4e, 0x1b, 0xb8, 0xad, 0x04, 0xcd, + 0xbe, 0x6f, 0x01, 0x1a, 0xdc, 0xfb, 0xa2, 0xe3, 0x30, 0xa6, 0xf6, 0xbd, 0x66, 0x57, 0xad, 0x6f, + 0x5e, 0xd6, 0x16, 0xf3, 0xe2, 0x6f, 0x39, 0x38, 0x52, 0x25, 0x71, 0x3b, 0xf0, 0x08, 0xfa, 0x02, + 0xc6, 0xcc, 0x7e, 0x3f, 0x13, 0x2c, 0x7d, 0xfa, 0x30, 0x6f, 0x3f, 0x2d, 0x44, 0x1f, 0x42, 0xd8, + 0xce, 0x57, 0xbf, 0xff, 0xfd, 0xc3, 0xe8, 0x79, 0xb4, 0xe4, 0xec, 0x7b, 0x4e, 0xe5, 0x7c, 0xd6, + 0x3d, 0x73, 0xf9, 0x5c, 0xf6, 0x9a, 0xf4, 0x37, 0xd6, 0xb9, 0x03, 0x8f, 0x4c, 0xb4, 0x96, 0xa5, + 0x83, 0x8f, 0x56, 0xb4, 0xa0, 0x65, 0x25, 0xc8, 0x46, 0x8b, 0x99, 0x82, 0x52, 0x1f, 0x68, 0xe8, + 0x47, 0x0b, 0x66, 0x06, 0x4e, 0x57, 0xd0, 0x9b, 0x4f, 0xfb, 0x9e, 0x19, 0x38, 0xa1, 0x99, 0x2f, + 0x1f, 0x36, 0xdc, 0xc8, 0x5b, 0x51, 0xf2, 0x2e, 0xa0, 0xf3, 0x99, 0xf2, 0xcc, 0x42, 0x71, 0x37, + 0xf5, 0x9d, 0xb5, 0x56, 0x7d, 0xb0, 0xb7, 0x60, 0x3d, 0xdc, 0x5b, 0xb0, 0x1e, 0xef, 0x2d, 0x58, + 0xdf, 0x3f, 0x59, 0x18, 0x79, 0xf8, 0x64, 0x61, 0xe4, 0xcf, 0x27, 0x0b, 0x23, 0x1f, 0xbd, 0x9d, + 0x72, 0xac, 0x84, 0x53, 0xe7, 0x75, 0x1e, 0x0b, 0x1d, 0x83, 0x7b, 0xc9, 0xf1, 0xc2, 0x80, 0x50, + 0xe1, 0xd4, 0xe3, 0xa6, 0xd7, 0x53, 0x93, 0xda, 0xb8, 0x8a, 0xbd, 0xf4, 0x5f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x22, 0xe7, 0xb8, 0xff, 0x5f, 0x14, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1439,11 +1428,11 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type ServiceClient interface { // Proof queries the proof for given request ID - Proof(ctx context.Context, in *QueryProofRequest, opts ...grpc.CallOption) (*QueryProofResponse, error) + Proof(ctx context.Context, in *ProofRequest, opts ...grpc.CallOption) (*ProofResponse, error) // MultiProof queries multiple proofs for given list of request IDs - MultiProof(ctx context.Context, in *QueryMultiProofRequest, opts ...grpc.CallOption) (*QueryMultiProofResponse, error) + MultiProof(ctx context.Context, in *MultiProofRequest, opts ...grpc.CallOption) (*MultiProofResponse, error) // RequestCountProof queries the count proof - RequestCountProof(ctx context.Context, in *QueryRequestCountProofRequest, opts ...grpc.CallOption) (*QueryRequestCountProofResponse, error) + RequestCountProof(ctx context.Context, in *RequestCountProofRequest, opts ...grpc.CallOption) (*RequestCountProofResponse, error) } type serviceClient struct { @@ -1454,8 +1443,8 @@ func NewServiceClient(cc grpc1.ClientConn) ServiceClient { return &serviceClient{cc} } -func (c *serviceClient) Proof(ctx context.Context, in *QueryProofRequest, opts ...grpc.CallOption) (*QueryProofResponse, error) { - out := new(QueryProofResponse) +func (c *serviceClient) Proof(ctx context.Context, in *ProofRequest, opts ...grpc.CallOption) (*ProofResponse, error) { + out := new(ProofResponse) err := c.cc.Invoke(ctx, "/bandchain.v1.oracle.Service/Proof", in, out, opts...) if err != nil { return nil, err @@ -1463,8 +1452,8 @@ func (c *serviceClient) Proof(ctx context.Context, in *QueryProofRequest, opts . return out, nil } -func (c *serviceClient) MultiProof(ctx context.Context, in *QueryMultiProofRequest, opts ...grpc.CallOption) (*QueryMultiProofResponse, error) { - out := new(QueryMultiProofResponse) +func (c *serviceClient) MultiProof(ctx context.Context, in *MultiProofRequest, opts ...grpc.CallOption) (*MultiProofResponse, error) { + out := new(MultiProofResponse) err := c.cc.Invoke(ctx, "/bandchain.v1.oracle.Service/MultiProof", in, out, opts...) if err != nil { return nil, err @@ -1472,8 +1461,8 @@ func (c *serviceClient) MultiProof(ctx context.Context, in *QueryMultiProofReque return out, nil } -func (c *serviceClient) RequestCountProof(ctx context.Context, in *QueryRequestCountProofRequest, opts ...grpc.CallOption) (*QueryRequestCountProofResponse, error) { - out := new(QueryRequestCountProofResponse) +func (c *serviceClient) RequestCountProof(ctx context.Context, in *RequestCountProofRequest, opts ...grpc.CallOption) (*RequestCountProofResponse, error) { + out := new(RequestCountProofResponse) err := c.cc.Invoke(ctx, "/bandchain.v1.oracle.Service/RequestCountProof", in, out, opts...) if err != nil { return nil, err @@ -1484,24 +1473,24 @@ func (c *serviceClient) RequestCountProof(ctx context.Context, in *QueryRequestC // ServiceServer is the server API for Service service. type ServiceServer interface { // Proof queries the proof for given request ID - Proof(context.Context, *QueryProofRequest) (*QueryProofResponse, error) + Proof(context.Context, *ProofRequest) (*ProofResponse, error) // MultiProof queries multiple proofs for given list of request IDs - MultiProof(context.Context, *QueryMultiProofRequest) (*QueryMultiProofResponse, error) + MultiProof(context.Context, *MultiProofRequest) (*MultiProofResponse, error) // RequestCountProof queries the count proof - RequestCountProof(context.Context, *QueryRequestCountProofRequest) (*QueryRequestCountProofResponse, error) + RequestCountProof(context.Context, *RequestCountProofRequest) (*RequestCountProofResponse, error) } // UnimplementedServiceServer can be embedded to have forward compatible implementations. type UnimplementedServiceServer struct { } -func (*UnimplementedServiceServer) Proof(ctx context.Context, req *QueryProofRequest) (*QueryProofResponse, error) { +func (*UnimplementedServiceServer) Proof(ctx context.Context, req *ProofRequest) (*ProofResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Proof not implemented") } -func (*UnimplementedServiceServer) MultiProof(ctx context.Context, req *QueryMultiProofRequest) (*QueryMultiProofResponse, error) { +func (*UnimplementedServiceServer) MultiProof(ctx context.Context, req *MultiProofRequest) (*MultiProofResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiProof not implemented") } -func (*UnimplementedServiceServer) RequestCountProof(ctx context.Context, req *QueryRequestCountProofRequest) (*QueryRequestCountProofResponse, error) { +func (*UnimplementedServiceServer) RequestCountProof(ctx context.Context, req *RequestCountProofRequest) (*RequestCountProofResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RequestCountProof not implemented") } @@ -1510,7 +1499,7 @@ func RegisterServiceServer(s grpc1.Server, srv ServiceServer) { } func _Service_Proof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryProofRequest) + in := new(ProofRequest) if err := dec(in); err != nil { return nil, err } @@ -1522,13 +1511,13 @@ func _Service_Proof_Handler(srv interface{}, ctx context.Context, dec func(inter FullMethod: "/bandchain.v1.oracle.Service/Proof", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).Proof(ctx, req.(*QueryProofRequest)) + return srv.(ServiceServer).Proof(ctx, req.(*ProofRequest)) } return interceptor(ctx, in, info, handler) } func _Service_MultiProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryMultiProofRequest) + in := new(MultiProofRequest) if err := dec(in); err != nil { return nil, err } @@ -1540,13 +1529,13 @@ func _Service_MultiProof_Handler(srv interface{}, ctx context.Context, dec func( FullMethod: "/bandchain.v1.oracle.Service/MultiProof", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).MultiProof(ctx, req.(*QueryMultiProofRequest)) + return srv.(ServiceServer).MultiProof(ctx, req.(*MultiProofRequest)) } return interceptor(ctx, in, info, handler) } func _Service_RequestCountProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryRequestCountProofRequest) + in := new(RequestCountProofRequest) if err := dec(in); err != nil { return nil, err } @@ -1558,7 +1547,7 @@ func _Service_RequestCountProof_Handler(srv interface{}, ctx context.Context, de FullMethod: "/bandchain.v1.oracle.Service/RequestCountProof", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).RequestCountProof(ctx, req.(*QueryRequestCountProofRequest)) + return srv.(ServiceServer).RequestCountProof(ctx, req.(*RequestCountProofRequest)) } return interceptor(ctx, in, info, handler) } @@ -1584,7 +1573,7 @@ var _Service_serviceDesc = grpc.ServiceDesc{ Metadata: "bandchain/v1/oracle/proof.proto", } -func (m *QueryProofRequest) Marshal() (dAtA []byte, err error) { +func (m *ProofRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1594,12 +1583,12 @@ func (m *QueryProofRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryProofRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *ProofRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryProofRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ProofRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1617,7 +1606,7 @@ func (m *QueryProofRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryProofResponse) Marshal() (dAtA []byte, err error) { +func (m *ProofResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1627,12 +1616,12 @@ func (m *QueryProofResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryProofResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *ProofResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1655,7 +1644,7 @@ func (m *QueryProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryMultiProofRequest) Marshal() (dAtA []byte, err error) { +func (m *MultiProofRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1665,12 +1654,12 @@ func (m *QueryMultiProofRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryMultiProofRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *MultiProofRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryMultiProofRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MultiProofRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1696,7 +1685,7 @@ func (m *QueryMultiProofRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryMultiProofResponse) Marshal() (dAtA []byte, err error) { +func (m *MultiProofResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1706,12 +1695,12 @@ func (m *QueryMultiProofResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryMultiProofResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MultiProofResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryMultiProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MultiProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1734,7 +1723,7 @@ func (m *QueryMultiProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryRequestCountProofRequest) Marshal() (dAtA []byte, err error) { +func (m *RequestCountProofRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1744,12 +1733,12 @@ func (m *QueryRequestCountProofRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryRequestCountProofRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *RequestCountProofRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryRequestCountProofRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RequestCountProofRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1757,7 +1746,7 @@ func (m *QueryRequestCountProofRequest) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *QueryRequestCountProofResponse) Marshal() (dAtA []byte, err error) { +func (m *RequestCountProofResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1767,12 +1756,12 @@ func (m *QueryRequestCountProofResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryRequestCountProofResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *RequestCountProofResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryRequestCountProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RequestCountProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1795,7 +1784,7 @@ func (m *QueryRequestCountProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *SingleProofResponse) Marshal() (dAtA []byte, err error) { +func (m *SingleProofResult) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1805,12 +1794,12 @@ func (m *SingleProofResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SingleProofResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *SingleProofResult) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SingleProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SingleProofResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1835,7 +1824,7 @@ func (m *SingleProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MultiProofResponse) Marshal() (dAtA []byte, err error) { +func (m *MultiProofResult) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1845,12 +1834,12 @@ func (m *MultiProofResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MultiProofResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MultiProofResult) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MultiProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MultiProofResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1875,7 +1864,7 @@ func (m *MultiProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *CountProofResponse) Marshal() (dAtA []byte, err error) { +func (m *CountProofResult) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1885,12 +1874,12 @@ func (m *CountProofResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CountProofResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *CountProofResult) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *CountProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *CountProofResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2257,38 +2246,31 @@ func (m *MultiStoreProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.ParamsToUpgradeStoresMerkleHash) > 0 { - i -= len(m.ParamsToUpgradeStoresMerkleHash) - copy(dAtA[i:], m.ParamsToUpgradeStoresMerkleHash) - i = encodeVarintProof(dAtA, i, uint64(len(m.ParamsToUpgradeStoresMerkleHash))) - i-- - dAtA[i] = 0x32 - } - if len(m.AuthToEvidenceStoresMerkleHash) > 0 { - i -= len(m.AuthToEvidenceStoresMerkleHash) - copy(dAtA[i:], m.AuthToEvidenceStoresMerkleHash) - i = encodeVarintProof(dAtA, i, uint64(len(m.AuthToEvidenceStoresMerkleHash))) + if len(m.AuthToMintStoresMerkleHash) > 0 { + i -= len(m.AuthToMintStoresMerkleHash) + copy(dAtA[i:], m.AuthToMintStoresMerkleHash) + i = encodeVarintProof(dAtA, i, uint64(len(m.AuthToMintStoresMerkleHash))) i-- dAtA[i] = 0x2a } - if len(m.FeegrantToGroupStoresMerkleHash) > 0 { - i -= len(m.FeegrantToGroupStoresMerkleHash) - copy(dAtA[i:], m.FeegrantToGroupStoresMerkleHash) - i = encodeVarintProof(dAtA, i, uint64(len(m.FeegrantToGroupStoresMerkleHash))) + if len(m.TransferToUpgradeStoresMerkleHash) > 0 { + i -= len(m.TransferToUpgradeStoresMerkleHash) + copy(dAtA[i:], m.TransferToUpgradeStoresMerkleHash) + i = encodeVarintProof(dAtA, i, uint64(len(m.TransferToUpgradeStoresMerkleHash))) i-- dAtA[i] = 0x22 } - if len(m.IbcToIcahostStoresMerkleHash) > 0 { - i -= len(m.IbcToIcahostStoresMerkleHash) - copy(dAtA[i:], m.IbcToIcahostStoresMerkleHash) - i = encodeVarintProof(dAtA, i, uint64(len(m.IbcToIcahostStoresMerkleHash))) + if len(m.SlashingToStakingStoresMerkleHash) > 0 { + i -= len(m.SlashingToStakingStoresMerkleHash) + copy(dAtA[i:], m.SlashingToStakingStoresMerkleHash) + i = encodeVarintProof(dAtA, i, uint64(len(m.SlashingToStakingStoresMerkleHash))) i-- dAtA[i] = 0x1a } - if len(m.MintStoreMerkleHash) > 0 { - i -= len(m.MintStoreMerkleHash) - copy(dAtA[i:], m.MintStoreMerkleHash) - i = encodeVarintProof(dAtA, i, uint64(len(m.MintStoreMerkleHash))) + if len(m.ParamsStoreMerkleHash) > 0 { + i -= len(m.ParamsStoreMerkleHash) + copy(dAtA[i:], m.ParamsStoreMerkleHash) + i = encodeVarintProof(dAtA, i, uint64(len(m.ParamsStoreMerkleHash))) i-- dAtA[i] = 0x12 } @@ -2519,7 +2501,7 @@ func encodeVarintProof(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *QueryProofRequest) Size() (n int) { +func (m *ProofRequest) Size() (n int) { if m == nil { return 0 } @@ -2534,7 +2516,7 @@ func (m *QueryProofRequest) Size() (n int) { return n } -func (m *QueryProofResponse) Size() (n int) { +func (m *ProofResponse) Size() (n int) { if m == nil { return 0 } @@ -2548,7 +2530,7 @@ func (m *QueryProofResponse) Size() (n int) { return n } -func (m *QueryMultiProofRequest) Size() (n int) { +func (m *MultiProofRequest) Size() (n int) { if m == nil { return 0 } @@ -2564,7 +2546,7 @@ func (m *QueryMultiProofRequest) Size() (n int) { return n } -func (m *QueryMultiProofResponse) Size() (n int) { +func (m *MultiProofResponse) Size() (n int) { if m == nil { return 0 } @@ -2578,7 +2560,7 @@ func (m *QueryMultiProofResponse) Size() (n int) { return n } -func (m *QueryRequestCountProofRequest) Size() (n int) { +func (m *RequestCountProofRequest) Size() (n int) { if m == nil { return 0 } @@ -2587,7 +2569,7 @@ func (m *QueryRequestCountProofRequest) Size() (n int) { return n } -func (m *QueryRequestCountProofResponse) Size() (n int) { +func (m *RequestCountProofResponse) Size() (n int) { if m == nil { return 0 } @@ -2601,7 +2583,7 @@ func (m *QueryRequestCountProofResponse) Size() (n int) { return n } -func (m *SingleProofResponse) Size() (n int) { +func (m *SingleProofResult) Size() (n int) { if m == nil { return 0 } @@ -2616,7 +2598,7 @@ func (m *SingleProofResponse) Size() (n int) { return n } -func (m *MultiProofResponse) Size() (n int) { +func (m *MultiProofResult) Size() (n int) { if m == nil { return 0 } @@ -2631,7 +2613,7 @@ func (m *MultiProofResponse) Size() (n int) { return n } -func (m *CountProofResponse) Size() (n int) { +func (m *CountProofResult) Size() (n int) { if m == nil { return 0 } @@ -2774,23 +2756,19 @@ func (m *MultiStoreProof) Size() (n int) { if l > 0 { n += 1 + l + sovProof(uint64(l)) } - l = len(m.MintStoreMerkleHash) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - l = len(m.IbcToIcahostStoresMerkleHash) + l = len(m.ParamsStoreMerkleHash) if l > 0 { n += 1 + l + sovProof(uint64(l)) } - l = len(m.FeegrantToGroupStoresMerkleHash) + l = len(m.SlashingToStakingStoresMerkleHash) if l > 0 { n += 1 + l + sovProof(uint64(l)) } - l = len(m.AuthToEvidenceStoresMerkleHash) + l = len(m.TransferToUpgradeStoresMerkleHash) if l > 0 { n += 1 + l + sovProof(uint64(l)) } - l = len(m.ParamsToUpgradeStoresMerkleHash) + l = len(m.AuthToMintStoresMerkleHash) if l > 0 { n += 1 + l + sovProof(uint64(l)) } @@ -2903,7 +2881,7 @@ func sovProof(x uint64) (n int) { func sozProof(x uint64) (n int) { return sovProof(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryProofRequest) Unmarshal(dAtA []byte) error { +func (m *ProofRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2926,10 +2904,10 @@ func (m *QueryProofRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryProofRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ProofRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProofRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ProofRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2991,7 +2969,7 @@ func (m *QueryProofRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryProofResponse) Unmarshal(dAtA []byte) error { +func (m *ProofResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3014,10 +2992,10 @@ func (m *QueryProofResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryProofResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ProofResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3093,7 +3071,7 @@ func (m *QueryProofResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMultiProofRequest) Unmarshal(dAtA []byte) error { +func (m *MultiProofRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3116,10 +3094,10 @@ func (m *QueryMultiProofRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMultiProofRequest: wiretype end group for non-group") + return fmt.Errorf("proto: MultiProofRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMultiProofRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MultiProofRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3219,7 +3197,7 @@ func (m *QueryMultiProofRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMultiProofResponse) Unmarshal(dAtA []byte) error { +func (m *MultiProofResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3242,10 +3220,10 @@ func (m *QueryMultiProofResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMultiProofResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MultiProofResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMultiProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MultiProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3321,7 +3299,7 @@ func (m *QueryMultiProofResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryRequestCountProofRequest) Unmarshal(dAtA []byte) error { +func (m *RequestCountProofRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3344,10 +3322,10 @@ func (m *QueryRequestCountProofRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryRequestCountProofRequest: wiretype end group for non-group") + return fmt.Errorf("proto: RequestCountProofRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRequestCountProofRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RequestCountProofRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -3371,7 +3349,7 @@ func (m *QueryRequestCountProofRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryRequestCountProofResponse) Unmarshal(dAtA []byte) error { +func (m *RequestCountProofResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3394,10 +3372,10 @@ func (m *QueryRequestCountProofResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryRequestCountProofResponse: wiretype end group for non-group") + return fmt.Errorf("proto: RequestCountProofResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRequestCountProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RequestCountProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3473,7 +3451,7 @@ func (m *QueryRequestCountProofResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *SingleProofResponse) Unmarshal(dAtA []byte) error { +func (m *SingleProofResult) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3496,10 +3474,10 @@ func (m *SingleProofResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SingleProofResponse: wiretype end group for non-group") + return fmt.Errorf("proto: SingleProofResult: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SingleProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SingleProofResult: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3590,7 +3568,7 @@ func (m *SingleProofResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MultiProofResponse) Unmarshal(dAtA []byte) error { +func (m *MultiProofResult) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3613,10 +3591,10 @@ func (m *MultiProofResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MultiProofResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MultiProofResult: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MultiProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MultiProofResult: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3707,7 +3685,7 @@ func (m *MultiProofResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *CountProofResponse) Unmarshal(dAtA []byte) error { +func (m *CountProofResult) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3730,10 +3708,10 @@ func (m *CountProofResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CountProofResponse: wiretype end group for non-group") + return fmt.Errorf("proto: CountProofResult: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CountProofResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CountProofResult: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4775,7 +4753,7 @@ func (m *MultiStoreProof) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MintStoreMerkleHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ParamsStoreMerkleHash", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -4802,14 +4780,14 @@ func (m *MultiStoreProof) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MintStoreMerkleHash = append(m.MintStoreMerkleHash[:0], dAtA[iNdEx:postIndex]...) - if m.MintStoreMerkleHash == nil { - m.MintStoreMerkleHash = []byte{} + m.ParamsStoreMerkleHash = append(m.ParamsStoreMerkleHash[:0], dAtA[iNdEx:postIndex]...) + if m.ParamsStoreMerkleHash == nil { + m.ParamsStoreMerkleHash = []byte{} } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IbcToIcahostStoresMerkleHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SlashingToStakingStoresMerkleHash", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -4836,14 +4814,14 @@ func (m *MultiStoreProof) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.IbcToIcahostStoresMerkleHash = append(m.IbcToIcahostStoresMerkleHash[:0], dAtA[iNdEx:postIndex]...) - if m.IbcToIcahostStoresMerkleHash == nil { - m.IbcToIcahostStoresMerkleHash = []byte{} + m.SlashingToStakingStoresMerkleHash = append(m.SlashingToStakingStoresMerkleHash[:0], dAtA[iNdEx:postIndex]...) + if m.SlashingToStakingStoresMerkleHash == nil { + m.SlashingToStakingStoresMerkleHash = []byte{} } iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeegrantToGroupStoresMerkleHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TransferToUpgradeStoresMerkleHash", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -4870,48 +4848,14 @@ func (m *MultiStoreProof) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FeegrantToGroupStoresMerkleHash = append(m.FeegrantToGroupStoresMerkleHash[:0], dAtA[iNdEx:postIndex]...) - if m.FeegrantToGroupStoresMerkleHash == nil { - m.FeegrantToGroupStoresMerkleHash = []byte{} + m.TransferToUpgradeStoresMerkleHash = append(m.TransferToUpgradeStoresMerkleHash[:0], dAtA[iNdEx:postIndex]...) + if m.TransferToUpgradeStoresMerkleHash == nil { + m.TransferToUpgradeStoresMerkleHash = []byte{} } iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthToEvidenceStoresMerkleHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AuthToEvidenceStoresMerkleHash = append(m.AuthToEvidenceStoresMerkleHash[:0], dAtA[iNdEx:postIndex]...) - if m.AuthToEvidenceStoresMerkleHash == nil { - m.AuthToEvidenceStoresMerkleHash = []byte{} - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParamsToUpgradeStoresMerkleHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AuthToMintStoresMerkleHash", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -4938,9 +4882,9 @@ func (m *MultiStoreProof) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ParamsToUpgradeStoresMerkleHash = append(m.ParamsToUpgradeStoresMerkleHash[:0], dAtA[iNdEx:postIndex]...) - if m.ParamsToUpgradeStoresMerkleHash == nil { - m.ParamsToUpgradeStoresMerkleHash = []byte{} + m.AuthToMintStoresMerkleHash = append(m.AuthToMintStoresMerkleHash[:0], dAtA[iNdEx:postIndex]...) + if m.AuthToMintStoresMerkleHash == nil { + m.AuthToMintStoresMerkleHash = []byte{} } iNdEx = postIndex default: diff --git a/client/grpc/oracle/proof/proof.pb.gw.go b/client/grpc/oracle/proof/proof.pb.gw.go index 226603125..eb7cd51ad 100644 --- a/client/grpc/oracle/proof/proof.pb.gw.go +++ b/client/grpc/oracle/proof/proof.pb.gw.go @@ -38,7 +38,7 @@ var ( ) func request_Service_Proof_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProofRequest + var protoReq ProofRequest var metadata runtime.ServerMetadata var ( @@ -72,7 +72,7 @@ func request_Service_Proof_0(ctx context.Context, marshaler runtime.Marshaler, c } func local_request_Service_Proof_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProofRequest + var protoReq ProofRequest var metadata runtime.ServerMetadata var ( @@ -110,7 +110,7 @@ var ( ) func request_Service_MultiProof_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryMultiProofRequest + var protoReq MultiProofRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { @@ -126,7 +126,7 @@ func request_Service_MultiProof_0(ctx context.Context, marshaler runtime.Marshal } func local_request_Service_MultiProof_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryMultiProofRequest + var protoReq MultiProofRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { @@ -142,7 +142,7 @@ func local_request_Service_MultiProof_0(ctx context.Context, marshaler runtime.M } func request_Service_RequestCountProof_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequestCountProofRequest + var protoReq RequestCountProofRequest var metadata runtime.ServerMetadata msg, err := client.RequestCountProof(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -151,7 +151,7 @@ func request_Service_RequestCountProof_0(ctx context.Context, marshaler runtime. } func local_request_Service_RequestCountProof_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequestCountProofRequest + var protoReq RequestCountProofRequest var metadata runtime.ServerMetadata msg, err := server.RequestCountProof(ctx, &protoReq) diff --git a/client/grpc/oracle/proof/proof_test.go b/client/grpc/oracle/proof/proof_test.go index 38ac53a65..5c3cf06fc 100644 --- a/client/grpc/oracle/proof/proof_test.go +++ b/client/grpc/oracle/proof/proof_test.go @@ -4,10 +4,11 @@ import ( "encoding/hex" "testing" - "github.com/cometbft/cometbft/crypto/tmhash" "github.com/stretchr/testify/require" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/cometbft/cometbft/crypto/tmhash" + + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) func hexToBytes(hexstr string) []byte { @@ -34,21 +35,18 @@ func TestEncodeRelay(t *testing.T) { OracleIAVLStateHash: hexToBytes( "5248463E932D16F7D092E268C0DED87B23D3B0E71856F1C6AE2AA91F6C713320", ), - MintStoreMerkleHash: hexToBytes( + ParamsStoreMerkleHash: hexToBytes( "7FD5F5C7C2920C187618542901CDC5717BE8204F24BE856E80902A1BB04737E4", ), - IbcToIcahostStoresMerkleHash: hexToBytes( + SlashingToStakingStoresMerkleHash: hexToBytes( "F981716562A49DE06E3DCAFBFB6388C294BAA4FA9D45777E25740A92F81CF65E", ), - FeegrantToGroupStoresMerkleHash: hexToBytes( + TransferToUpgradeStoresMerkleHash: hexToBytes( "E8E27CBB44BB654F64EEEF4667868AD48667CEB28E3DB5C4DF7A4B4B87F0C04B", ), - AuthToEvidenceStoresMerkleHash: hexToBytes( + AuthToMintStoresMerkleHash: hexToBytes( "FC96CFFD30E5B8979EA66F9D0DA1CBAB16F69669E8B2A1FB2E1BEB457C9726E8", ), - ParamsToUpgradeStoresMerkleHash: hexToBytes( - "C9C8849ED125CC7681329C4D27B83B1FC8ACF7A865C9D1D1DF575CCA56F48DBE", - ), }, BlockHeaderMerkleParts: BlockHeaderMerkleParts{ VersionAndChainIdHash: hexToBytes( @@ -106,7 +104,7 @@ func TestEncodeRelay(t *testing.T) { result, err := block.encodeToEthData() require.Nil(t, err) expect := hexToBytes( - "5248463e932d16f7d092e268c0ded87b23d3b0e71856f1c6ae2aa91f6c7133207fd5f5c7c2920c187618542901cdc5717be8204f24be856e80902a1bb04737e4f981716562a49de06e3dcafbfb6388c294baa4fa9d45777e25740a92f81cf65ee8e27cbb44bb654f64eeef4667868ad48667ceb28e3db5c4df7a4b4b87f0c04bfc96cffd30e5b8979ea66f9d0da1cbab16f69669e8b2a1fb2e1beb457c9726e8c9c8849ed125cc7681329c4d27b83b1fc8acf7a865c9d1d1df575cca56f48dbe3f02642d9e70d5c1c493a4f732bfe9c9b95a4a42651703b816edcfc8fada531200000000000000000000000000000000000000000000000000000000000061a8000000000000000000000000000000000000000000000000000000006125894b000000000000000000000000000000000000000000000000000000001152f9089b4825c99c3e739e1dc171ffb0e2bf34e99eee41b34e407e40cf594834427b09bf23413f237906b07202b3355e7311651ace6bd2a34fd6fc3bd98efe4fb787559fb9c7533caf1d218da3af6d277f6b101c42e3c3b75d784242da663604dd53c27d11a74e40884411901bd7a70631734990b1fdbf5de9e4c92c63b7650a6a6659000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000f080211a86100000000000022480a20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000261224080112206bf91efba26a4cd86ebbd0e54dcfc9bd2c790859cfa96215661a47e4921a63010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002c084b8585b71240fee0e674952b79ed25d793f1b31b42dd37b80f75b98510b57541ec44dd7c5389474df8e5c25cc6ed8b573cca2e009aa824ee825bdc693935927000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b08cd9296890610eae9963d000000000000000000000000000000000000000000394365193f819cf539381366d31b6c5849aaa31ae8ba6f95c62c5c80656bfb5c6a07e4a3c0abceae5f854d492df699438fb84762f152f739ddeac48ddcfcb5cc000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b08cd9296890610ea9286330000000000000000000000000000000000000000005d7b4be7b21b00d08ad7dbe48cf2761ceccb599e64aab10b2901a0dd58f003257160ef689a533c1e983707507fc8466daea1d0dc7a889e3a27d1bb1d09cec030000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b08cd929689061086fab2390000000000000000000000000000000000000000005654a44fb89330c34cf2d862f940763194a145b72ed3bb0add5759e1e68fd1452ac795d02a9c574cf12343fdfc67fdced8a24f88ec8138c7f8230f6eb442b726000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b08cd9296890610f0e1f733000000000000000000000000000000000000000000", + "5248463e932d16f7d092e268c0ded87b23d3b0e71856f1c6ae2aa91f6c7133207fd5f5c7c2920c187618542901cdc5717be8204f24be856e80902a1bb04737e4f981716562a49de06e3dcafbfb6388c294baa4fa9d45777e25740a92f81cf65ee8e27cbb44bb654f64eeef4667868ad48667ceb28e3db5c4df7a4b4b87f0c04bfc96cffd30e5b8979ea66f9d0da1cbab16f69669e8b2a1fb2e1beb457c9726e83f02642d9e70d5c1c493a4f732bfe9c9b95a4a42651703b816edcfc8fada531200000000000000000000000000000000000000000000000000000000000061a8000000000000000000000000000000000000000000000000000000006125894b000000000000000000000000000000000000000000000000000000001152f9089b4825c99c3e739e1dc171ffb0e2bf34e99eee41b34e407e40cf594834427b09bf23413f237906b07202b3355e7311651ace6bd2a34fd6fc3bd98efe4fb787559fb9c7533caf1d218da3af6d277f6b101c42e3c3b75d784242da663604dd53c27d11a74e40884411901bd7a70631734990b1fdbf5de9e4c92c63b7650a6a665900000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000f080211a86100000000000022480a20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000261224080112206bf91efba26a4cd86ebbd0e54dcfc9bd2c790859cfa96215661a47e4921a63010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002c084b8585b71240fee0e674952b79ed25d793f1b31b42dd37b80f75b98510b57541ec44dd7c5389474df8e5c25cc6ed8b573cca2e009aa824ee825bdc693935927000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b08cd9296890610eae9963d000000000000000000000000000000000000000000394365193f819cf539381366d31b6c5849aaa31ae8ba6f95c62c5c80656bfb5c6a07e4a3c0abceae5f854d492df699438fb84762f152f739ddeac48ddcfcb5cc000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b08cd9296890610ea9286330000000000000000000000000000000000000000005d7b4be7b21b00d08ad7dbe48cf2761ceccb599e64aab10b2901a0dd58f003257160ef689a533c1e983707507fc8466daea1d0dc7a889e3a27d1bb1d09cec030000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b08cd929689061086fab2390000000000000000000000000000000000000000005654a44fb89330c34cf2d862f940763194a145b72ed3bb0add5759e1e68fd1452ac795d02a9c574cf12343fdfc67fdced8a24f88ec8138c7f8230f6eb442b726000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b08cd9296890610f0e1f733000000000000000000000000000000000000000000", ) require.Equal(t, expect, result) } diff --git a/client/grpc/oracle/proof/result.go b/client/grpc/oracle/proof/result.go index f61f484ce..1799b1d18 100644 --- a/client/grpc/oracle/proof/result.go +++ b/client/grpc/oracle/proof/result.go @@ -1,7 +1,7 @@ package proof import ( - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) // ResultEthereum is an Ethereum version of Result for solidity ABI-encoding. diff --git a/client/grpc/oracle/proof/service.go b/client/grpc/oracle/proof/service.go index 3dd5f95d4..5f6bea0ae 100644 --- a/client/grpc/oracle/proof/service.go +++ b/client/grpc/oracle/proof/service.go @@ -6,18 +6,22 @@ import ( "encoding/json" "fmt" - rpcclient "github.com/cometbft/cometbft/rpc/client" - "github.com/cosmos/cosmos-sdk/client" - gogogrpc "github.com/cosmos/gogoproto/grpc" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/bandprotocol/chain/v2/x/oracle/types" + rpcclient "github.com/cometbft/cometbft/rpc/client" + + gogogrpc "github.com/cosmos/gogoproto/grpc" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/server/config" + + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // RegisterProofService registers the node gRPC service on the provided gRPC router. -func RegisterProofService(clientCtx client.Context, server gogogrpc.Server) { - RegisterServiceServer(server, NewProofServer(clientCtx)) +func RegisterProofService(clientCtx client.Context, server gogogrpc.Server, cfg config.Config) { + RegisterServiceServer(server, NewProofServer(clientCtx, cfg)) } // RegisterGRPCGatewayRoutes mounts the node gRPC service's GRPC-gateway routes @@ -32,17 +36,19 @@ var _ ServiceServer = proofServer{} // proofServer implements ServiceServer type proofServer struct { clientCtx client.Context + cfg config.Config } // NewProofServer returns new proofServer from provided client.Context -func NewProofServer(clientCtx client.Context) ServiceServer { +func NewProofServer(clientCtx client.Context, cfg config.Config) ServiceServer { return proofServer{ clientCtx: clientCtx, + cfg: cfg, } } // Proof returns a proof from provided request ID and block height -func (s proofServer) Proof(ctx context.Context, req *QueryProofRequest) (*QueryProofResponse, error) { +func (s proofServer) Proof(ctx context.Context, req *ProofRequest) (*ProofResponse, error) { cliCtx := s.clientCtx // Set the height in the client context to the requested height cliCtx.Height = req.Height @@ -55,7 +61,6 @@ func (s proofServer) Proof(ctx context.Context, req *QueryProofRequest) (*QueryP // Convert the request ID to the appropriate type requestID := types.RequestID(req.RequestId) - // Get the commit at the specified height from the client commit, err := cliCtx.Client.Commit(context.Background(), height) if err != nil { @@ -126,10 +131,10 @@ func (s proofServer) Proof(ctx context.Context, req *QueryProofRequest) (*QueryP return nil, fmt.Errorf("negative height in response") } - // Return a QueryProofResponse object with the relevant information - return &QueryProofResponse{ + // Return a ProofResponse object with the relevant information + return &ProofResponse{ Height: cliCtx.Height, - Result: SingleProofResponse{ + Result: SingleProofResult{ Proof: SingleProof{ BlockHeight: uint64(commit.Height), OracleDataProof: oracleData, @@ -141,7 +146,7 @@ func (s proofServer) Proof(ctx context.Context, req *QueryProofRequest) (*QueryP } // MultiProof returns a proof for multiple request IDs -func (s proofServer) MultiProof(ctx context.Context, req *QueryMultiProofRequest) (*QueryMultiProofResponse, error) { +func (s proofServer) MultiProof(ctx context.Context, req *MultiProofRequest) (*MultiProofResponse, error) { // Get the client context from the server context cliCtx := s.clientCtx height := &cliCtx.Height @@ -243,10 +248,10 @@ func (s proofServer) MultiProof(ctx context.Context, req *QueryMultiProofRequest return nil, fmt.Errorf("negative height in response") } - // Return a QueryMultiProofResponse object with the relevant information - return &QueryMultiProofResponse{ + // Return a MultiProofResponse object with the relevant information + return &MultiProofResponse{ Height: cliCtx.Height, - Result: MultiProofResponse{ + Result: MultiProofResult{ Proof: MultiProof{ BlockHeight: uint64(commit.Height), OracleDataMultiProof: oracleDataList, @@ -260,8 +265,8 @@ func (s proofServer) MultiProof(ctx context.Context, req *QueryMultiProofRequest // RequestCountProof returns a count proof func (s proofServer) RequestCountProof( ctx context.Context, - req *QueryRequestCountProofRequest, -) (*QueryRequestCountProofResponse, error) { + req *RequestCountProofRequest, +) (*RequestCountProofResponse, error) { // Get the client context from the server context cliCtx := s.clientCtx height := &cliCtx.Height @@ -339,10 +344,10 @@ func (s proofServer) RequestCountProof( return nil, fmt.Errorf("negative height in response") } - // Return the QueryRequestCountProofResponse object with the relevant information - return &QueryRequestCountProofResponse{ + // Return the RequestCountProofResponse object with the relevant information + return &RequestCountProofResponse{ Height: cliCtx.Height, - Result: CountProofResponse{ + Result: CountProofResult{ Proof: CountProof{ BlockHeight: uint64(commit.Height), CountProof: requestsCountProof, diff --git a/client/grpc/oracle/proof/signature.go b/client/grpc/oracle/proof/signature.go index 3c9577dd1..f6dc4374e 100644 --- a/client/grpc/oracle/proof/signature.go +++ b/client/grpc/oracle/proof/signature.go @@ -4,13 +4,14 @@ import ( "fmt" "sort" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/cometbft/cometbft/crypto/secp256k1" "github.com/cometbft/cometbft/crypto/tmhash" "github.com/cometbft/cometbft/libs/protoio" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cometbft/cometbft/types" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" ) // TMSignatureEthereum is an Ethereum version of TMSignature for solidity ABI-encoding. @@ -47,10 +48,9 @@ func recoverETHAddress(msg, sig, signer []byte) ([]byte, uint8, error) { return nil, 0, fmt.Errorf("no match address found") } -func GetPrefix(t tmproto.SignedMsgType, height int64, round int64) ([]byte, error) { - fmt.Println(t, height, round) +func GetPrefix(t cmtproto.SignedMsgType, height int64, round int64) ([]byte, error) { prefix, err := protoio.MarshalDelimited( - &tmproto.CanonicalVote{ + &cmtproto.CanonicalVote{ Type: t, Height: height, Round: round, @@ -65,11 +65,15 @@ func GetPrefix(t tmproto.SignedMsgType, height int64, round int64) ([]byte, erro } // GetSignaturesAndPrefix returns a list of TMSignature from Tendermint signed header. -func GetSignaturesAndPrefix(info *types.SignedHeader) ([]TMSignature, CommonEncodedVotePart, error) { +func GetSignaturesAndPrefix(info *cmttypes.SignedHeader) ([]TMSignature, CommonEncodedVotePart, error) { addrs := []string{} mapAddrs := map[string]TMSignature{} - prefix, err := GetPrefix(tmproto.SignedMsgType(info.Commit.Type()), info.Commit.Height, int64(info.Commit.Round)) + prefix, err := GetPrefix( + cmtproto.SignedMsgType(byte(cmtproto.PrecommitType)), + info.Commit.Height, + int64(info.Commit.Round), + ) if err != nil { return nil, CommonEncodedVotePart{}, err } @@ -81,7 +85,7 @@ func GetSignaturesAndPrefix(info *types.SignedHeader) ([]TMSignature, CommonEnco prefix = append(prefix, []byte{34, 72, 10, 32}...) suffix, err := protoio.MarshalDelimited( - &tmproto.CanonicalPartSetHeader{ + &cmtproto.CanonicalPartSetHeader{ Total: info.Commit.BlockID.PartSetHeader.Total, Hash: info.Commit.BlockID.PartSetHeader.Hash, }, @@ -102,7 +106,7 @@ func GetSignaturesAndPrefix(info *types.SignedHeader) ([]TMSignature, CommonEnco encodedChainIDConstant := append([]byte{50, uint8(len(chainIDBytes))}, chainIDBytes...) for _, vote := range info.Commit.Signatures { - if !vote.ForBlock() { + if vote.BlockIDFlag != cmttypes.BlockIDFlagCommit { continue } diff --git a/client/grpc/oracle/proof/signature_test.go b/client/grpc/oracle/proof/signature_test.go index 60785fd55..380aabed6 100644 --- a/client/grpc/oracle/proof/signature_test.go +++ b/client/grpc/oracle/proof/signature_test.go @@ -4,20 +4,21 @@ import ( "encoding/hex" "testing" - "github.com/cometbft/cometbft/crypto/tmhash" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cometbft/cometbft/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/require" + + "github.com/cometbft/cometbft/crypto/tmhash" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cometbft/cometbft/types" ) func TestGetPrefix(t *testing.T) { - prefix, err := GetPrefix(tmproto.SignedMsgType(2), 25000, 0) + prefix, err := GetPrefix(cmtproto.SignedMsgType(2), 25000, 0) require.NoError(t, err) require.Equal(t, "080211a861000000000000", hex.EncodeToString(prefix)) - prefix, err = GetPrefix(tmproto.SignedMsgType(2), 25000, 1) + prefix, err = GetPrefix(cmtproto.SignedMsgType(2), 25000, 1) require.NoError(t, err) require.Equal(t, "080211a861000000000000190100000000000000", hex.EncodeToString(prefix)) } diff --git a/client/grpc/oracle/proof/util.go b/client/grpc/oracle/proof/util.go index 842ce86fb..882d365a3 100644 --- a/client/grpc/oracle/proof/util.go +++ b/client/grpc/oracle/proof/util.go @@ -8,6 +8,7 @@ import ( "time" tmbytes "github.com/cometbft/cometbft/libs/bytes" + gogotypes "github.com/cosmos/gogoproto/types" ) diff --git a/cmd/bandd/cmd/genaccounts.go b/cmd/bandd/cmd/genaccounts.go deleted file mode 100644 index 463e2d618..000000000 --- a/cmd/bandd/cmd/genaccounts.go +++ /dev/null @@ -1,194 +0,0 @@ -package cmd - -import ( - "bufio" - "encoding/json" - "errors" - "fmt" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/cosmos/cosmos-sdk/server" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/spf13/cobra" -) - -const ( - flagVestingStart = "vesting-start-time" - flagVestingEnd = "vesting-end-time" - flagVestingAmt = "vesting-amount" -) - -// AddGenesisAccountCmd returns add-genesis-account cobra Command. -func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command { - cmd := &cobra.Command{ - Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]", - Short: "Add a genesis account to genesis.json", - Long: `Add a genesis account to genesis.json. The provided account must specify -the account address or key name and a list of initial coins. If a key name is given, -the address will be looked up in the local Keybase. The list of initial tokens must -contain valid denominations. Accounts may optionally be supplied with vesting parameters. -`, - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - cdc := clientCtx.Codec - - serverCtx := server.GetServerContextFromCmd(cmd) - config := serverCtx.Config - - config.SetRoot(clientCtx.HomeDir) - - addr, err := sdk.AccAddressFromBech32(args[0]) - if err != nil { - inBuf := bufio.NewReader(cmd.InOrStdin()) - keyringBackend, err := cmd.Flags().GetString(flags.FlagKeyringBackend) - if err != nil { - return err - } - - // attempt to lookup address from Keybase if no address was provided - kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.HomeDir, inBuf, cdc) - if err != nil { - return err - } - - info, err := kb.Key(args[0]) - if err != nil { - return fmt.Errorf("failed to get address from Keybase: %w", err) - } - - addr, err = info.GetAddress() - if err != nil { - return err - } - } - - coins, err := sdk.ParseCoinsNormalized(args[1]) - if err != nil { - return fmt.Errorf("failed to parse coins: %w", err) - } - - vestingStart, err := cmd.Flags().GetInt64(flagVestingStart) - if err != nil { - return err - } - vestingEnd, err := cmd.Flags().GetInt64(flagVestingEnd) - if err != nil { - return err - } - vestingAmtStr, err := cmd.Flags().GetString(flagVestingAmt) - if err != nil { - return err - } - - vestingAmt, err := sdk.ParseCoinsNormalized(vestingAmtStr) - if err != nil { - return fmt.Errorf("failed to parse vesting amount: %w", err) - } - - // create concrete account type based on input parameters - var genAccount authtypes.GenesisAccount - - balances := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} - baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) - - if !vestingAmt.IsZero() { - baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) - - if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || - baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { - return errors.New("vesting amount cannot be greater than total amount") - } - - switch { - case vestingStart != 0 && vestingEnd != 0: - genAccount = authvesting.NewContinuousVestingAccountRaw(baseVestingAccount, vestingStart) - - case vestingEnd != 0: - genAccount = authvesting.NewDelayedVestingAccountRaw(baseVestingAccount) - - default: - return errors.New("invalid vesting parameters; must supply start and end time or end time") - } - } else { - genAccount = baseAccount - } - - if err := genAccount.Validate(); err != nil { - return fmt.Errorf("failed to validate new genesis account: %w", err) - } - - genFile := config.GenesisFile() - appState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFile) - if err != nil { - return fmt.Errorf("failed to unmarshal genesis state: %w", err) - } - - authGenState := authtypes.GetGenesisStateFromAppState(cdc, appState) - - accs, err := authtypes.UnpackAccounts(authGenState.Accounts) - if err != nil { - return fmt.Errorf("failed to get accounts from any: %w", err) - } - - if accs.Contains(addr) { - return fmt.Errorf("cannot add account at existing address %s", addr) - } - - // Add the new account to the set of genesis accounts and sanitize the - // accounts afterwards. - accs = append(accs, genAccount) - accs = authtypes.SanitizeGenesisAccounts(accs) - - genAccs, err := authtypes.PackAccounts(accs) - if err != nil { - return fmt.Errorf("failed to convert accounts into any's: %w", err) - } - authGenState.Accounts = genAccs - - authGenStateBz, err := cdc.MarshalJSON(&authGenState) - if err != nil { - return fmt.Errorf("failed to marshal auth genesis state: %w", err) - } - - appState[authtypes.ModuleName] = authGenStateBz - - bankGenState := banktypes.GetGenesisStateFromAppState(cdc, appState) - bankGenState.Balances = append(bankGenState.Balances, balances) - bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) - bankGenState.Supply = bankGenState.Supply.Add(balances.Coins...) - - bankGenStateBz, err := cdc.MarshalJSON(bankGenState) - if err != nil { - return fmt.Errorf("failed to marshal bank genesis state: %w", err) - } - - appState[banktypes.ModuleName] = bankGenStateBz - - appStateJSON, err := json.Marshal(appState) - if err != nil { - return fmt.Errorf("failed to marshal application genesis state: %w", err) - } - - genDoc.AppState = appStateJSON - return genutil.ExportGenesisFile(genDoc, genFile) - }, - } - - cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") - cmd.Flags(). - String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)") - cmd.Flags().String(flagVestingAmt, "", "amount of coins for vesting accounts") - cmd.Flags().Int64(flagVestingStart, 0, "schedule start time (unix epoch) for vesting accounts") - cmd.Flags().Int64(flagVestingEnd, 0, "schedule end time (unix epoch) for vesting accounts") - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/cmd/bandd/cmd/gends.go b/cmd/bandd/cmd/gends.go index 0ba3a395d..1530a2e3f 100644 --- a/cmd/bandd/cmd/gends.go +++ b/cmd/bandd/cmd/gends.go @@ -6,16 +6,18 @@ import ( "os" "path/filepath" + "github.com/spf13/cobra" + "github.com/cometbft/cometbft/libs/cli" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/spf13/cobra" - "github.com/bandprotocol/chain/v2/pkg/filecache" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/pkg/filecache" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // AddGenesisDataSourceCmd returns add-data-source cobra Command. diff --git a/cmd/bandd/cmd/genos.go b/cmd/bandd/cmd/genos.go index 20f68354e..dcab0ad82 100644 --- a/cmd/bandd/cmd/genos.go +++ b/cmd/bandd/cmd/genos.go @@ -6,17 +6,20 @@ import ( "os" "path/filepath" - "github.com/bandprotocol/go-owasm/api" + "github.com/spf13/cobra" + "github.com/cometbft/cometbft/libs/cli" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/spf13/cobra" - "github.com/bandprotocol/chain/v2/pkg/filecache" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/go-owasm/api" + + "github.com/bandprotocol/chain/v3/pkg/filecache" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // AddGenesisOracleScriptCmd returns add-oracle-script cobra Command. diff --git a/cmd/bandd/cmd/init.go b/cmd/bandd/cmd/init.go index a04408627..65050543a 100644 --- a/cmd/bandd/cmd/init.go +++ b/cmd/bandd/cmd/init.go @@ -7,34 +7,44 @@ import ( "fmt" "os" "path/filepath" - "time" + + "github.com/spf13/cobra" cfg "github.com/cometbft/cometbft/config" - "github.com/cometbft/cometbft/crypto/secp256k1" - "github.com/cometbft/cometbft/libs/cli" - tmos "github.com/cometbft/cometbft/libs/os" - tmrand "github.com/cometbft/cometbft/libs/rand" + cmtsecp256k1 "github.com/cometbft/cometbft/crypto/secp256k1" + cmtos "github.com/cometbft/cometbft/libs/os" + "github.com/cometbft/cometbft/p2p" "github.com/cometbft/cometbft/privval" - "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" + + "github.com/cosmos/go-bip39" + + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/math/unsafe" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/input" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/genutil" - "github.com/cosmos/go-bip39" - "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/x/genutil/types" + + band "github.com/bandprotocol/chain/v3/app" ) const ( // FlagOverwrite defines a flag to overwrite an existing genesis JSON file. FlagOverwrite = "overwrite" - // FlagRecover defines a flag to initialize the private validator key from a specific seed. + // FlagSeed defines a flag to initialize the private validator key from a specific seed. FlagRecover = "recover" - // FlagTimeoutCommit defines a flag to set timeout commit of node. - FlagTimeoutCommit = "timeout-commit" + // FlagDefaultBondDenom defines the default denom to use in the genesis file. + FlagDefaultBondDenom = "default-denom" ) type printInfo struct { @@ -56,74 +66,37 @@ func newPrintInfo(moniker, chainID, nodeID, genTxsDir string, appMessage json.Ra } func displayInfo(info printInfo) error { - out, err := json.MarshalIndent(info, "", "") + out, err := json.MarshalIndent(info, "", " ") if err != nil { return err } - _, err = fmt.Fprintf(os.Stderr, "%s\n", string(sdk.MustSortJSON(out))) - return err -} -func genFilePVIfNotExists(keyFilePath, stateFilePath string) error { - if !tmos.FileExists(keyFilePath) { - pv := privval.NewFilePV(secp256k1.GenPrivKey(), keyFilePath, stateFilePath) - // privKey := - - // pv := &privval.FilePV{ - // Key: privval.FilePVKey{ - // Address: privKey.PubKey().Address(), - // PubKey: privKey.PubKey(), - // PrivKey: privKey, - - // }, - // LastSignState: privval.FilePVLastSignState{ - // Step: 0, - // }, - // } - pv.Save() - // jsonBytes, err := json.MarshalIndent(pv.Key, "", " ") - // if err != nil { - // return err - // } - // if err = tempfile.WriteFileAtomic(keyFilePath, jsonBytes, 0600); err != nil { - // return err - // } - // jsonBytes, err = json.MarshalIndent(pv.LastSignState, "", " ") - // if err != nil { - // return err - // } - // if err = tempfile.WriteFileAtomic(stateFilePath, jsonBytes, 0600); err != nil { - // return err - // } - } - return nil + _, err = fmt.Fprintf(os.Stderr, "%s\n", out) + + return err } -// InitCmd returns a command that initializes all files needed for Tendermint and BandChain app. -func InitCmd(customAppState map[string]json.RawMessage, defaultNodeHome string) *cobra.Command { +func InitCmd(defaultNodeHome string) *cobra.Command { cmd := &cobra.Command{ Use: "init [moniker]", Short: "Initialize private validator, p2p, genesis, and application configuration files", + Long: `Initialize validators's and node's configuration files.`, Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) + cdc := clientCtx.Codec serverCtx := server.GetServerContextFromCmd(cmd) config := serverCtx.Config - config.SetRoot(clientCtx.HomeDir) - timeoutCommit, err := cmd.Flags().GetInt(FlagTimeoutCommit) - if err != nil { - return err - } - config.Consensus.TimeoutCommit = time.Duration(timeoutCommit) * time.Millisecond - if err := genFilePVIfNotExists(config.PrivValidatorKeyFile(), config.PrivValidatorStateFile()); err != nil { - return err - } chainID, _ := cmd.Flags().GetString(flags.FlagChainID) - if chainID == "" { - chainID = fmt.Sprintf("test-chain-%v", tmrand.Str(6)) + switch { + case chainID != "": + case clientCtx.ChainID != "": + chainID = clientCtx.ChainID + default: + chainID = fmt.Sprintf("test-chain-%v", unsafe.Str(6)) } // Get bip39 mnemonic @@ -131,17 +104,24 @@ func InitCmd(customAppState map[string]json.RawMessage, defaultNodeHome string) recover, _ := cmd.Flags().GetBool(FlagRecover) if recover { inBuf := bufio.NewReader(cmd.InOrStdin()) - mnemonic, err := input.GetString("Enter your bip39 mnemonic", inBuf) + value, err := input.GetString("Enter your bip39 mnemonic", inBuf) if err != nil { return err } + mnemonic = value if !bip39.IsMnemonicValid(mnemonic) { return errors.New("invalid mnemonic") } } - nodeID, _, err := genutil.InitializeNodeValidatorFilesFromMnemonic(config, mnemonic) + // Get initial height + initHeight, _ := cmd.Flags().GetInt64(flags.FlagInitHeight) + if initHeight < 1 { + initHeight = 1 + } + + nodeID, _, err := InitializeNodeValidatorFilesFromMnemonic(config, mnemonic) if err != nil { return err } @@ -150,45 +130,144 @@ func InitCmd(customAppState map[string]json.RawMessage, defaultNodeHome string) genFile := config.GenesisFile() overwrite, _ := cmd.Flags().GetBool(FlagOverwrite) + defaultDenom, _ := cmd.Flags().GetString(FlagDefaultBondDenom) - if !overwrite && tmos.FileExists(genFile) { + // use os.Stat to check if the file exists + _, err = os.Stat(genFile) + if !overwrite && !os.IsNotExist(err) { return fmt.Errorf("genesis.json file already exists: %v", genFile) } - appState, err := json.MarshalIndent(customAppState, "", "") + + // Overwrites the SDK default denom for side-effects + if defaultDenom != "" { + sdk.DefaultBondDenom = defaultDenom + } + + appGenState := band.NewDefaultGenesisState(cdc) + + appState, err := json.MarshalIndent(appGenState, "", " ") if err != nil { - return err + return errorsmod.Wrap(err, "Failed to marshal default genesis state") } - genDoc := &types.GenesisDoc{} + + appGenesis := &types.AppGenesis{} if _, err := os.Stat(genFile); err != nil { if !os.IsNotExist(err) { return err } } else { - genDoc, err = types.GenesisDocFromFile(genFile) + appGenesis, err = types.AppGenesisFromFile(genFile) if err != nil { - return err + return errorsmod.Wrap(err, "Failed to read genesis doc from file") } } - genDoc.ChainID = chainID - genDoc.Validators = nil - genDoc.AppState = appState - genDoc.ConsensusParams = types.DefaultConsensusParams() - - genDoc.ConsensusParams.Block.MaxBytes = 3000000 // 3M bytes - genDoc.ConsensusParams.Block.MaxGas = 50000000 // 50M gas - genDoc.ConsensusParams.Validator.PubKeyTypes = []string{types.ABCIPubKeyTypeSecp256k1} - if err = genutil.ExportGenesisFile(genDoc, genFile); err != nil { - return err + + appGenesis.AppName = version.AppName + appGenesis.AppVersion = version.Version + appGenesis.ChainID = chainID + appGenesis.AppState = appState + appGenesis.InitialHeight = initHeight + + consensusParams := cmttypes.DefaultConsensusParams() + consensusParams.Block = cmttypes.BlockParams{ + MaxBytes: 3000000, + MaxGas: 50000000, } - toPrint := newPrintInfo(config.Moniker, chainID, nodeID, "", appState) + consensusParams.Validator = cmttypes.ValidatorParams{ + PubKeyTypes: []string{ + cmttypes.ABCIPubKeyTypeSecp256k1, + }, + } + + appGenesis.Consensus = &types.ConsensusGenesis{ + Params: consensusParams, + Validators: nil, + } + + if err = genutil.ExportGenesisFile(appGenesis, genFile); err != nil { + return errorsmod.Wrap(err, "Failed to export genesis file") + } + cfg.WriteConfigFile(filepath.Join(config.RootDir, "config", "config.toml"), config) + toPrint := newPrintInfo(config.Moniker, chainID, nodeID, "", appState) return displayInfo(toPrint) }, } - cmd.Flags().String(cli.HomeFlag, defaultNodeHome, "node's home directory") + + cmd.Flags().String(flags.FlagHome, defaultNodeHome, "node's home directory") cmd.Flags().BoolP(FlagOverwrite, "o", false, "overwrite the genesis.json file") cmd.Flags().Bool(FlagRecover, false, "provide seed phrase to recover existing key instead of creating") cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created") - cmd.Flags().Int(FlagTimeoutCommit, 1500, "timeout commit of the node in ms") + cmd.Flags(). + String(FlagDefaultBondDenom, "", "genesis file default denomination, if left blank default value is 'stake'") + cmd.Flags().Int64(flags.FlagInitHeight, 1, "specify the initial block height at genesis") + return cmd } + +// InitializeNodeValidatorFilesFromMnemonic creates private validator and p2p configuration files using the given mnemonic. +// If no valid mnemonic is given, a random one will be used instead. +func InitializeNodeValidatorFilesFromMnemonic( + config *cfg.Config, + mnemonic string, +) (nodeID string, valPubKey cryptotypes.PubKey, err error) { + if len(mnemonic) > 0 && !bip39.IsMnemonicValid(mnemonic) { + return "", nil, fmt.Errorf("invalid mnemonic") + } + nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile()) + if err != nil { + return "", nil, err + } + + nodeID = string(nodeKey.ID()) + + pvKeyFile := config.PrivValidatorKeyFile() + if err := os.MkdirAll(filepath.Dir(pvKeyFile), 0o777); err != nil { + return "", nil, fmt.Errorf("could not create directory %q: %w", filepath.Dir(pvKeyFile), err) + } + + pvStateFile := config.PrivValidatorStateFile() + if err := os.MkdirAll(filepath.Dir(pvStateFile), 0o777); err != nil { + return "", nil, fmt.Errorf("could not create directory %q: %w", filepath.Dir(pvStateFile), err) + } + + var filePV *privval.FilePV + if len(mnemonic) == 0 { + filePV = LoadOrGenFilePV(pvKeyFile, pvStateFile) + } else { + privKey := cmtsecp256k1.GenPrivKeySecp256k1([]byte(mnemonic)) + filePV = privval.NewFilePV(privKey, pvKeyFile, pvStateFile) + filePV.Save() + } + + tmValPubKey, err := filePV.GetPubKey() + if err != nil { + return "", nil, err + } + + valPubKey, err = cryptocodec.FromCmtPubKeyInterface(tmValPubKey) + if err != nil { + return "", nil, err + } + + return nodeID, valPubKey, nil +} + +// LoadOrGenFilePV loads a FilePV from the given filePaths +// or else generates a new one and saves it to the filePaths. +func LoadOrGenFilePV(keyFilePath, stateFilePath string) *privval.FilePV { + var pv *privval.FilePV + if cmtos.FileExists(keyFilePath) { + pv = privval.LoadFilePV(keyFilePath, stateFilePath) + } else { + pv = GenFilePV(keyFilePath, stateFilePath) + pv.Save() + } + return pv +} + +// GenFilePV generates a new validator with randomly generated private key +// and sets the filePaths, but does not call Save(). +func GenFilePV(keyFilePath, stateFilePath string) *privval.FilePV { + return privval.NewFilePV(cmtsecp256k1.GenPrivKey(), keyFilePath, stateFilePath) +} diff --git a/cmd/bandd/cmd/multi_send.go b/cmd/bandd/cmd/multi_send.go deleted file mode 100644 index b624e3c6f..000000000 --- a/cmd/bandd/cmd/multi_send.go +++ /dev/null @@ -1,51 +0,0 @@ -package cmd - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/spf13/cobra" -) - -// MultiSendTxCmd creates a multi-send tx and signs it with the given key. -func MultiSendTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "multi-send [amount_per_account] [to_address1] [to_address2] ....", - Short: "Send token to multiple accounts", - Long: "Send equal amount of token to multiple accounts", - Args: cobra.MinimumNArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - sender := clientCtx.GetFromAddress() - - // Parse the coins we are trying to send - coins, err := sdk.ParseCoinsNormalized(args[0]) - if err != nil { - return err - } - accounts := args[1:] - inputCoins := sdk.NewCoins() - outputs := make([]banktypes.Output, 0, len(accounts)) - for _, acc := range accounts { - to, err := sdk.AccAddressFromBech32(acc) - if err != nil { - return err - } - outputs = append(outputs, banktypes.NewOutput(to, coins)) - inputCoins = inputCoins.Add(coins...) - } - msg := banktypes.NewMsgMultiSend( - []banktypes.Input{banktypes.NewInput(sender, inputCoins)}, - outputs, - ) - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - flags.AddTxFlagsToCmd(cmd) - return cmd -} diff --git a/cmd/bandd/cmd/root.go b/cmd/bandd/cmd/root.go index 671ea3de7..6af6be108 100644 --- a/cmd/bandd/cmd/root.go +++ b/cmd/bandd/cmd/root.go @@ -4,128 +4,242 @@ import ( "errors" "io" "os" + "path/filepath" - dbm "github.com/cometbft/cometbft-db" - tmcfg "github.com/cometbft/cometbft/config" + "github.com/spf13/cast" + "github.com/spf13/cobra" + "github.com/spf13/viper" + + cmtcfg "github.com/cometbft/cometbft/config" tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cometbft/cometbft/libs/log" + + dbm "github.com/cosmos/cosmos-db" + + "cosmossdk.io/client/v2/autocli" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/snapshots" + snapshottypes "cosmossdk.io/store/snapshots/types" + storetypes "cosmossdk.io/store/types" + confixcmd "cosmossdk.io/tools/confix/cmd" + rosettaCmd "cosmossdk.io/tools/rosetta/cmd" + + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" - "github.com/cosmos/cosmos-sdk/client/debug" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/keys" "github.com/cosmos/cosmos-sdk/client/pruning" "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/client/snapshot" + "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/server" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/types/tx/signing" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" + "github.com/cosmos/cosmos-sdk/x/auth/tx" + authtxconfig "github.com/cosmos/cosmos-sdk/x/auth/tx/config" "github.com/cosmos/cosmos-sdk/x/auth/types" - vestingcli "github.com/cosmos/cosmos-sdk/x/auth/vesting/client/cli" "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - "github.com/spf13/cast" - "github.com/spf13/cobra" - - band "github.com/bandprotocol/chain/v2/app" - "github.com/bandprotocol/chain/v2/app/params" -) + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" -const ( - flagWithEmitter = "with-emitter" - flagWithPricer = "with-pricer" - flagWithRequestSearch = "with-request-search" - flagRequestSearchCacheSize = "request-search-cache-size" - flagWithOwasmCacheSize = "oracle-script-cache-size" + band "github.com/bandprotocol/chain/v3/app" + "github.com/bandprotocol/chain/v3/x/oracle" ) // NewRootCmd creates a new root command for simd. It is called once in the // main function. -func NewRootCmd() (*cobra.Command, params.EncodingConfig) { - encodingConfig := band.MakeEncodingConfig() +func NewRootCmd() *cobra.Command { + // we "pre"-instantiate the application for getting the injected/configured encoding configuration + initAppOptions := viper.New() + tempDir := tempDir() + initAppOptions.Set(flags.FlagHome, tempDir) + tempApplication := band.NewBandApp( + log.NewNopLogger(), + dbm.NewMemDB(), + nil, + true, + map[int64]bool{}, + tempDir, + initAppOptions, + 100, + ) + defer func() { + if err := tempApplication.Close(); err != nil { + panic(err) + } + }() + initClientCtx := client.Context{}. - WithCodec(encodingConfig.Marshaler). - WithInterfaceRegistry(encodingConfig.InterfaceRegistry). - WithTxConfig(encodingConfig.TxConfig). - WithLegacyAmino(encodingConfig.Amino). + WithCodec(tempApplication.AppCodec()). + WithInterfaceRegistry(tempApplication.InterfaceRegistry()). + WithLegacyAmino(tempApplication.LegacyAmino()). WithInput(os.Stdin). WithAccountRetriever(types.AccountRetriever{}). WithHomeDir(band.DefaultNodeHome). - WithViper("BAND") + WithViper("") rootCmd := &cobra.Command{ Use: "bandd", Short: "BandChain App", PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { - // set the default command outputs cmd.SetOut(cmd.OutOrStdout()) cmd.SetErr(cmd.ErrOrStderr()) + initClientCtx = initClientCtx.WithCmdContext(cmd.Context()) initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) if err != nil { return err } + initClientCtx, err = config.ReadFromClientConfig(initClientCtx) if err != nil { return err } + + // This needs to go after ReadFromClientConfig, as that function + // sets the RPC client needed for SIGN_MODE_TEXTUAL. This sign mode + // is only available if the client is online. + if !initClientCtx.Offline { + txConfigOpts := tx.ConfigOptions{ + EnabledSignModes: append(tx.DefaultSignModes, signing.SignMode_SIGN_MODE_TEXTUAL), + TextualCoinMetadataQueryFn: authtxconfig.NewGRPCCoinMetadataQueryFn(initClientCtx), + } + txConfigWithTextual, err := tx.NewTxConfigWithOptions( + initClientCtx.Codec, + txConfigOpts, + ) + if err != nil { + return err + } + initClientCtx = initClientCtx.WithTxConfig(txConfigWithTextual) + } + if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { return err } - srvCfg := serverconfig.DefaultConfig() - cfg := tmcfg.DefaultConfig() - return server.InterceptConfigsPreRunHandler(cmd, serverconfig.DefaultConfigTemplate, srvCfg, cfg) + customAppTemplate, customAppConfig := initAppConfig() + customCometConfig := initCometConfig() + + return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customCometConfig) }, } - initRootCmd(rootCmd, encodingConfig) + initRootCmd( + rootCmd, + tempApplication.ModuleBasics, + tempApplication.AppCodec(), + tempApplication.InterfaceRegistry(), + tempApplication.GetTxConfig(), + ) + + autoCliOpts := enrichAutoCliOpts(tempApplication.AutoCliOpts(), initClientCtx) + if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil { + panic(err) + } + + return rootCmd +} + +func enrichAutoCliOpts(autoCliOpts autocli.AppOptions, clientCtx client.Context) autocli.AppOptions { + autoCliOpts.AddressCodec = addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()) + autoCliOpts.ValidatorAddressCodec = addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()) + autoCliOpts.ConsensusAddressCodec = addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()) + + autoCliOpts.ClientCtx = clientCtx + + return autoCliOpts +} - return rootCmd, encodingConfig +// initCometConfig helps to override default CometBFT Config values. +// return cmtcfg.DefaultConfig if no custom configuration is required for the application. +func initCometConfig() *cmtcfg.Config { + cfg := cmtcfg.DefaultConfig() + + // these values put a higher strain on node memory + // cfg.P2P.MaxNumInboundPeers = 100 + // cfg.P2P.MaxNumOutboundPeers = 40 + + return cfg +} + +func initAppConfig() (string, interface{}) { + // Can optionally overwrite the SDK's default server config. + srvCfg := serverconfig.DefaultConfig() + srvCfg.StateSync.SnapshotInterval = 20000 + srvCfg.StateSync.SnapshotKeepRecent = 10 + + return serverconfig.DefaultConfigTemplate, srvCfg } -func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { +func initRootCmd( + rootCmd *cobra.Command, + basicManager module.BasicManager, + cdc codec.Codec, + interfaceRegistry codectypes.InterfaceRegistry, + txConfig client.TxConfig, +) { + cfg := sdk.GetConfig() + cfg.Seal() + + ac := appCreator{} + rootCmd.AddCommand( - InitCmd(band.NewDefaultGenesisState(), band.DefaultNodeHome), - genesisCommand( - encodingConfig, - AddGenesisDataSourceCmd(band.DefaultNodeHome), - AddGenesisOracleScriptCmd(band.DefaultNodeHome), - ), + InitCmd(band.DefaultNodeHome), tmcli.NewCompletionCmd(rootCmd, true), - // testnetCmd(band.ModuleBasics, banktypes.GenesisBalancesIterator{}), - debug.Cmd(), - config.Cmd(), - pruning.Cmd(newApp, band.DefaultNodeHome), - snapshot.Cmd(newApp), + confixcmd.ConfigCommand(), + pruning.Cmd(ac.newApp, band.DefaultNodeHome), + snapshot.Cmd(ac.newApp), ) - server.AddCommands(rootCmd, band.DefaultNodeHome, newApp, appExport, addModuleInitFlags) + server.AddCommands(rootCmd, band.DefaultNodeHome, ac.newApp, ac.appExport, addModuleInitFlags) // add keybase, auxiliary RPC, query, and tx child commands rootCmd.AddCommand( - rpc.StatusCommand(), + server.StatusCommand(), + genesisCommand( + txConfig, + basicManager, + AddGenesisDataSourceCmd(band.DefaultNodeHome), + AddGenesisOracleScriptCmd(band.DefaultNodeHome), + ), queryCommand(), - txCommand(), - keys.Commands(band.DefaultNodeHome), + txCommand(basicManager), + keys.Commands(), ) + + // add rosetta + rootCmd.AddCommand(rosettaCmd.RosettaCommand(interfaceRegistry, cdc)) } func addModuleInitFlags(startCmd *cobra.Command) { crisis.AddModuleInitFlags(startCmd) - startCmd.Flags().Uint32(flagWithOwasmCacheSize, 100, "[Experimental] Number of oracle scripts to cache") - startCmd.Flags().String(flagWithRequestSearch, "", "[Experimental] Enable mode to save request in sql database") + oracle.AddModuleInitFlags(startCmd) + + // Add hooks flag + startCmd.Flags(). + String(band.FlagWithRequestSearch, "", "[Experimental] Enable mode to save request in sql database") startCmd.Flags(). - Int(flagRequestSearchCacheSize, 10, "[Experimental] indicates number of latest oracle requests to be stored in database") - startCmd.Flags().String(flagWithEmitter, "", "[Experimental] Enable mode to save request in sql database") + Int(band.FlagRequestSearchCacheSize, 10, "[Experimental] indicates number of latest oracle requests to be stored in database") + startCmd.Flags().String(band.FlagWithEmitter, "", "[Experimental] Enable mode to save request in sql database") startCmd.Flags(). - String(flagWithPricer, "", "[Experimental] Enable collecting standard price reference provided by given oracle script id and save in level db (Input format: [id-comma-separated]/[defaultAskCount]/[defaultMinCount])") + String(band.FlagWithPricer, "", "[Experimental] Enable collecting standard price reference provided by given oracle script id and save in level db (Input format: [id-comma-separated]/[defaultAskCount]/[defaultMinCount])") } // genesisCommand builds genesis-related `bandd genesis` command. Users may provide application specific commands as a parameter -func genesisCommand(encodingConfig params.EncodingConfig, cmds ...*cobra.Command) *cobra.Command { - cmd := genutilcli.GenesisCoreCommand(encodingConfig.TxConfig, band.ModuleBasics, band.DefaultNodeHome) +func genesisCommand( + txConfig client.TxConfig, + basicManager module.BasicManager, + cmds ...*cobra.Command, +) *cobra.Command { + cmd := genutilcli.GenesisCoreCommand(txConfig, basicManager, band.DefaultNodeHome) for _, subCmd := range cmds { cmd.AddCommand(subCmd) @@ -144,20 +258,20 @@ func queryCommand() *cobra.Command { } cmd.AddCommand( - authcmd.GetAccountCmd(), rpc.ValidatorCommand(), - rpc.BlockCommand(), + server.QueryBlocksCmd(), + server.QueryBlockCmd(), + server.QueryBlockResultsCmd(), authcmd.QueryTxsByEventsCmd(), authcmd.QueryTxCmd(), ) - band.ModuleBasics.AddQueryCommands(cmd) cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") return cmd } -func txCommand() *cobra.Command { +func txCommand(basicManager module.BasicManager) *cobra.Command { cmd := &cobra.Command{ Use: "tx", Short: "Transactions subcommands", @@ -170,50 +284,105 @@ func txCommand() *cobra.Command { authcmd.GetSignCommand(), authcmd.GetSignBatchCommand(), authcmd.GetMultiSignCommand(), + authcmd.GetMultiSignBatchCmd(), authcmd.GetValidateSignaturesCommand(), - MultiSendTxCmd(), flags.LineBreak, authcmd.GetBroadcastCommand(), authcmd.GetEncodeCommand(), authcmd.GetDecodeCommand(), - flags.LineBreak, - vestingcli.GetTxCmd(), ) - band.ModuleBasics.AddTxCommands(cmd) + // NOTE: this must be registered for now so that submit-legacy-proposal + // message (e.g. consumer-addition proposal) can be routed to the its handler and processed correctly. + basicManager.AddTxCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") return cmd } +type appCreator struct{} + // newApp is an AppCreator -func newApp( +func (a appCreator) newApp( logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions, ) servertypes.Application { - baseappOptions := server.DefaultBaseappOptions(appOpts) + var cache storetypes.MultiStorePersistentCache + if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) { + cache = store.NewCommitKVStoreCacheManager() + } + + pruningOpts, err := server.GetPruningOptionsFromFlags(appOpts) + if err != nil { + panic(err) + } skipUpgradeHeights := make(map[int64]bool) for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) { skipUpgradeHeights[int64(h)] = true } + homeDir := cast.ToString(appOpts.Get(flags.FlagHome)) + chainID := cast.ToString(appOpts.Get(flags.FlagChainID)) + if chainID == "" { + // fallback to genesis chain-id + genDocFile := filepath.Join(homeDir, cast.ToString(appOpts.Get("genesis_file"))) + appGenesis, err := genutiltypes.AppGenesisFromFile(genDocFile) + if err != nil { + panic(err) + } + + chainID = appGenesis.ChainID + } + + snapshotDir := filepath.Join(homeDir, "data", "snapshots") + snapshotDB, err := dbm.NewDB("metadata", server.GetAppDBBackend(appOpts), snapshotDir) + if err != nil { + panic(err) + } + snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir) + if err != nil { + panic(err) + } + + // BaseApp Opts + snapshotOptions := snapshottypes.NewSnapshotOptions( + cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval)), + cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent)), + ) + baseappOptions := []func(*baseapp.BaseApp){ + baseapp.SetChainID(chainID), + baseapp.SetPruning(pruningOpts), + baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))), + baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))), + baseapp.SetHaltTime(cast.ToUint64(appOpts.Get(server.FlagHaltTime))), + baseapp.SetMinRetainBlocks(cast.ToUint64(appOpts.Get(server.FlagMinRetainBlocks))), + baseapp.SetInterBlockCache(cache), + baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))), + baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))), + baseapp.SetSnapshot(snapshotStore, snapshotOptions), + baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(server.FlagIAVLCacheSize))), + } + bandApp := band.NewBandApp( - logger, db, traceStore, true, skipUpgradeHeights, + logger, + db, + traceStore, + true, + skipUpgradeHeights, + cast.ToString(appOpts.Get(flags.FlagHome)), appOpts, - cast.ToUint32(appOpts.Get(flagWithOwasmCacheSize)), - cast.ToString(appOpts.Get(flagWithEmitter)), - cast.ToString(appOpts.Get(flagWithRequestSearch)), - cast.ToString(appOpts.Get(flagWithPricer)), + cast.ToUint32(appOpts.Get(oracle.FlagWithOwasmCacheSize)), baseappOptions..., ) return bandApp } -func appExport( +func (a appCreator) appExport( logger log.Logger, db dbm.DB, traceStore io.Writer, @@ -223,27 +392,36 @@ func appExport( appOpts servertypes.AppOptions, modulesToExport []string, ) (servertypes.ExportedApp, error) { + var bandApp *band.BandApp + homePath, ok := appOpts.Get(flags.FlagHome).(string) if !ok || homePath == "" { return servertypes.ExportedApp{}, errors.New("application home not set") } + // InvCheckPeriod + viperAppOpts, ok := appOpts.(*viper.Viper) + if !ok { + return servertypes.ExportedApp{}, errors.New("appOpts is not viper.Viper") + } + // overwrite the FlagInvCheckPeriod + viperAppOpts.Set(server.FlagInvCheckPeriod, 1) + appOpts = viperAppOpts + var loadLatest bool if height == -1 { loadLatest = true } - bandApp := band.NewBandApp( + bandApp = band.NewBandApp( logger, db, traceStore, loadLatest, map[int64]bool{}, + homePath, appOpts, - cast.ToUint32(appOpts.Get(flagWithOwasmCacheSize)), - cast.ToString(appOpts.Get(flagWithEmitter)), - cast.ToString(appOpts.Get(flagWithRequestSearch)), - cast.ToString(appOpts.Get(flagWithPricer)), + cast.ToUint32(appOpts.Get(oracle.FlagWithOwasmCacheSize)), ) if height != -1 { @@ -254,3 +432,13 @@ func appExport( return bandApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) } + +var tempDir = func() string { + dir, err := os.MkdirTemp("", ".band") + if err != nil { + dir = band.DefaultNodeHome + } + defer os.RemoveAll(dir) + + return dir +} diff --git a/cmd/bandd/main.go b/cmd/bandd/main.go index 9afd7fc8b..c31670082 100644 --- a/cmd/bandd/main.go +++ b/cmd/bandd/main.go @@ -3,25 +3,18 @@ package main import ( "os" - "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" sdk "github.com/cosmos/cosmos-sdk/types" - app "github.com/bandprotocol/chain/v2/app" - "github.com/bandprotocol/chain/v2/cmd/bandd/cmd" + app "github.com/bandprotocol/chain/v3/app" + "github.com/bandprotocol/chain/v3/cmd/bandd/cmd" ) func main() { app.SetBech32AddressPrefixesAndBip44CoinTypeAndSeal(sdk.GetConfig()) - rootCmd, _ := cmd.NewRootCmd() + rootCmd := cmd.NewRootCmd() if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { - switch e := err.(type) { - case server.ErrorCode: - os.Exit(e.Code) - - default: - os.Exit(1) - } + os.Exit(1) } } diff --git a/cmd/faucet/context.go b/cmd/faucet/context.go index 33e49ef79..5128f8111 100644 --- a/cmd/faucet/context.go +++ b/cmd/faucet/context.go @@ -2,11 +2,15 @@ package main import ( rpcclient "github.com/cometbft/cometbft/rpc/client" + "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" + + band "github.com/bandprotocol/chain/v3/app" ) type Context struct { + bandApp *band.BandApp client rpcclient.Client gasPrices sdk.DecCoins keys chan keyring.Record diff --git a/cmd/faucet/handler.go b/cmd/faucet/handler.go index 8b21b52c3..9fb542753 100644 --- a/cmd/faucet/handler.go +++ b/cmd/faucet/handler.go @@ -1,18 +1,18 @@ package main import ( + "context" "fmt" "net/http" + "github.com/gin-gonic/gin" + "github.com/gin-gonic/gin/binding" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/gin-gonic/gin" - "github.com/gin-gonic/gin/binding" - - band "github.com/bandprotocol/chain/v2/app" ) type Request struct { @@ -23,8 +23,6 @@ type Response struct { TxHash string `json:"txHash"` } -var cdc, _ = band.MakeCodecs() - func handleRequest(gc *gin.Context, c *Context) { key := <-c.keys defer func() { @@ -49,17 +47,13 @@ func handleRequest(gc *gin.Context, c *Context) { } msg := banktypes.NewMsgSend(address, to, c.amount) - if err := msg.ValidateBasic(); err != nil { - gc.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) - return - } clientCtx := client.Context{ Client: c.client, - Codec: cdc, - TxConfig: band.MakeEncodingConfig().TxConfig, + Codec: c.bandApp.AppCodec(), + TxConfig: c.bandApp.GetTxConfig(), BroadcastMode: "async", - InterfaceRegistry: band.MakeEncodingConfig().InterfaceRegistry, + InterfaceRegistry: c.bandApp.InterfaceRegistry(), } accountRetriever := authtypes.AccountRetriever{} acc, err := accountRetriever.GetAccount(clientCtx, address) @@ -71,7 +65,7 @@ func handleRequest(gc *gin.Context, c *Context) { txf := tx.Factory{}. WithAccountNumber(acc.GetAccountNumber()). WithSequence(acc.GetSequence()). - WithTxConfig(band.MakeEncodingConfig().TxConfig). + WithTxConfig(c.bandApp.GetTxConfig()). WithGas(200000).WithGasAdjustment(1). WithChainID(cfg.ChainID). WithMemo(""). @@ -85,7 +79,7 @@ func handleRequest(gc *gin.Context, c *Context) { return } - err = tx.Sign(txf, key.Name, txb, true) + err = tx.Sign(context.Background(), txf, key.Name, txb, true) if err != nil { gc.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) return diff --git a/cmd/faucet/keys.go b/cmd/faucet/keys.go index 938bb612b..22a638a53 100644 --- a/cmd/faucet/keys.go +++ b/cmd/faucet/keys.go @@ -4,12 +4,14 @@ import ( "bufio" "fmt" + "github.com/spf13/cobra" + + "github.com/cosmos/go-bip39" + "github.com/cosmos/cosmos-sdk/client/input" "github.com/cosmos/cosmos-sdk/crypto/hd" - "github.com/cosmos/go-bip39" - "github.com/spf13/cobra" - band "github.com/bandprotocol/chain/v2/app" + band "github.com/bandprotocol/chain/v3/app" ) const ( diff --git a/cmd/faucet/main.go b/cmd/faucet/main.go index 9b42b229b..7458d3978 100644 --- a/cmd/faucet/main.go +++ b/cmd/faucet/main.go @@ -5,13 +5,18 @@ import ( "os" "path" + "github.com/spf13/cobra" + "github.com/spf13/viper" + + dbm "github.com/cosmos/cosmos-db" + + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/cobra" - "github.com/spf13/viper" - band "github.com/bandprotocol/chain/v2/app" + band "github.com/bandprotocol/chain/v3/app" ) const ( @@ -71,10 +76,26 @@ func main() { return err } - keybase, err = keyring.New("band", keyring.BackendTest, home, nil, cdc) + initAppOptions := viper.New() + tempDir := tempDir() + initAppOptions.Set(flags.FlagHome, tempDir) + tempApplication := band.NewBandApp( + log.NewNopLogger(), + dbm.NewMemDB(), + nil, + true, + map[int64]bool{}, + tempDir, + initAppOptions, + 100, + ) + ctx.bandApp = tempApplication + + keybase, err = keyring.New("band", keyring.BackendTest, home, nil, tempApplication.AppCodec()) if err != nil { return err } + return initConfig(rootCmd) } rootCmd.PersistentFlags().String(flags.FlagHome, os.ExpandEnv("$HOME/.faucet"), "home directory") @@ -83,3 +104,13 @@ func main() { os.Exit(1) } } + +var tempDir = func() string { + dir, err := os.MkdirTemp("", ".band") + if err != nil { + dir = band.DefaultNodeHome + } + defer os.RemoveAll(dir) + + return dir +} diff --git a/cmd/faucet/run.go b/cmd/faucet/run.go index 4ce1f3d63..82e11da94 100644 --- a/cmd/faucet/run.go +++ b/cmd/faucet/run.go @@ -3,14 +3,18 @@ package main import ( "errors" - httpclient "github.com/cometbft/cometbft/rpc/client/http" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" "github.com/spf13/cobra" "github.com/spf13/viper" + + httpclient "github.com/cometbft/cometbft/rpc/client/http" + + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + sdk "github.com/cosmos/cosmos-sdk/types" ) func runCmd(c *Context) *cobra.Command { @@ -42,7 +46,7 @@ func runCmd(c *Context) *cobra.Command { if err != nil { return err } - c.amount = sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(cfg.Amount))) + c.amount = sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(cfg.Amount))) r := gin.Default() // add cors diff --git a/cmd/yoda/main.go b/cmd/yoda/main.go index 319471162..efeab46d0 100644 --- a/cmd/yoda/main.go +++ b/cmd/yoda/main.go @@ -1,6 +1,6 @@ package main -import "github.com/bandprotocol/chain/v2/yoda" +import "github.com/bandprotocol/chain/v3/yoda" func main() { yoda.Main() diff --git a/docker-compose.yaml b/docker-compose.yaml index 307738316..bdfa68851 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -69,7 +69,7 @@ services: - 443:443 - 9091:9091 volumes: - - ./../ssl/cert.pem:/etc/nginx/ssl/cert.pem + - ./../ssl/fullchain.pem:/etc/nginx/ssl/fullchain.pem - ./../ssl/privkey.pem:/etc/nginx/ssl/privkey.pem postgres: @@ -122,13 +122,13 @@ services: flusher-init: build: context: flusher - image: bandchain_flusher:latest + image: band-flusher:latest networks: bandchain: command: sh -c "sleep 30 && python main.py init bandchain test replay --db postgres:postgrespassword@postgres:5432/postgres" flusher-daemon: - image: bandchain_flusher:latest + image: band-flusher:latest networks: - bandchain restart: always diff --git a/docker-config/app.toml b/docker-config/app.toml index 371ca573c..0c63ace20 100644 --- a/docker-config/app.toml +++ b/docker-config/app.toml @@ -7,18 +7,21 @@ # The minimum gas prices a validator is willing to accept for processing a # transaction. A transaction's fees must meet the minimum of any denomination -# specified in this config (e.g. 0.25token1;0.0001token2). +# specified in this config (e.g. 0.25token1,0.0001token2). minimum-gas-prices = "0.0025uband" -# default: the last 100 states are kept in addition to every 500th state; pruning at 10 block intervals +# The maximum gas a query coming over rest/grpc may consume. +# If this is set to zero, the query can consume an unbounded amount of gas. +query-gas-limit = "0" + +# default: the last 362880 states are kept, pruning at 10 block intervals # nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) -# everything: all saved states will be deleted, storing only the current state; pruning at 10 block intervals -# custom: allow pruning options to be manually specified through 'pruning-keep-recent', 'pruning-keep-every', and 'pruning-interval' +# everything: 2 latest states will be kept; pruning at 10 block intervals. +# custom: allow pruning options to be manually specified through 'pruning-keep-recent', and 'pruning-interval' pruning = "default" # These are applied if and only if the pruning strategy is custom. pruning-keep-recent = "0" -pruning-keep-every = "0" pruning-interval = "0" # HaltHeight contains a non-zero block height at which a node will gracefully @@ -54,12 +57,24 @@ min-retain-blocks = 0 inter-block-cache = true # IndexEvents defines the set of events in the form {eventType}.{attributeKey}, -# which informs Tendermint what to index. If empty, all events will be indexed. +# which informs CometBFT what to index. If empty, all events will be indexed. # # Example: # ["message.sender", "message.recipient"] index-events = [] +# IavlCacheSize set the size of the iavl tree cache (in number of nodes). +iavl-cache-size = 781250 + +# IAVLDisableFastNode enables or disables the fast node feature of IAVL. +# Default is false. +iavl-disable-fastnode = false + +# AppDBBackend defines the database backend type to use for the application and snapshots DBs. +# An empty string indicates that a fallback will be used. +# The fallback is the db_backend value set in CometBFT's config.toml. +app-db-backend = "" + ############################################################################### ### Telemetry Configuration ### ############################################################################### @@ -133,8 +148,15 @@ enabled-unsafe-cors = true enable = true # Address defines the gRPC server address to bind to. -address = "0.0.0.0:9090" +address = "localhost:9090" + +# MaxRecvMsgSize defines the max message size in bytes the server can receive. +# The default value is 10MB. +max-recv-msg-size = "10485760" +# MaxSendMsgSize defines the max message size in bytes the server can send. +# The default value is math.MaxInt32. +max-send-msg-size = "2147483647" ############################################################################### ### gRPC Web Configuration ### @@ -144,14 +166,9 @@ address = "0.0.0.0:9090" # GRPCWebEnable defines if the gRPC-web should be enabled. # NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op. +# NOTE: gRPC-Web uses the same address as the API server. enable = true -# Address defines the gRPC-web server address to bind to. -address = "0.0.0.0:9091" - -# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). -enable-unsafe-cors = true - ############################################################################### ### State Sync Configuration ### ############################################################################### @@ -161,8 +178,47 @@ enable-unsafe-cors = true [state-sync] # snapshot-interval specifies the block interval at which local state sync snapshots are -# taken (0 to disable). Must be a multiple of pruning-keep-every. +# taken (0 to disable). snapshot-interval = 0 # snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). snapshot-keep-recent = 2 + +############################################################################### +### State Streaming ### +############################################################################### + +# Streaming allows nodes to stream state to external systems. +[streaming] + +# streaming.abci specifies the configuration for the ABCI Listener streaming service. +[streaming.abci] + +# List of kv store keys to stream out via gRPC. +# The store key names MUST match the module's StoreKey name. +# +# Example: +# ["acc", "bank", "gov", "staking", "mint"[,...]] +# ["*"] to expose all keys. +keys = [] + +# The plugin name used for streaming via gRPC. +# Streaming is only enabled if this is set. +# Supported plugins: abci +plugin = "" + +# stop-node-on-err specifies whether to stop the node on message delivery error. +stop-node-on-err = true + +############################################################################### +### Mempool ### +############################################################################### + +[mempool] +# Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool. +# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool (no-op mempool). +# Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount. +# +# Note, this configuration only applies to SDK built-in app-side mempool +# implementations. +max-txs = -1 diff --git a/docker-config/start_docker.sh b/docker-config/start_docker.sh index 289966373..1db271458 100755 --- a/docker-config/start_docker.sh +++ b/docker-config/start_docker.sh @@ -107,9 +107,10 @@ bandd genesis collect-gentxs # copy genesis to the proper location! cp ~/.band/config/genesis.json $DIR/genesis.json +cat <<< $(jq '.app_state.gov.params.voting_period = "60s"' $DIR/genesis.json) > $DIR/genesis.json # Build -docker-compose up -d --build +docker-compose up -d --build --force-recreate sleep 10 @@ -127,14 +128,14 @@ do # wait for activation transaction success sleep 4 - for i in $(eval echo {1..1}) + for i in $(eval echo {1..4}) do # add reporter key yoda keys add reporter$i done # send band tokens to reporters - echo "y" | bandd tx bank send validator$v $(yoda keys list -a) 1000000uband --keyring-backend test --chain-id bandchain --gas-prices 0.0025uband -b sync + echo "y" | bandd tx bank multi-send validator$v $(yoda keys list -a) 1000000uband --keyring-backend test --chain-id bandchain --gas-prices 0.0025uband -b sync # wait for sending band tokens transaction success sleep 4 @@ -142,12 +143,12 @@ do # add reporter to bandchain echo "y" | bandd tx oracle add-reporters $(yoda keys list -a) --from validator$v --keyring-backend test --chain-id bandchain --gas-prices 0.0025uband -b sync - # wait for addding reporter transaction success + # wait for adding reporter transaction success sleep 4 - docker create --network chain_bandchain --name bandchain_oracle${v} band-validator:latest yoda r - docker cp ~/.yoda bandchain_oracle${v}:/root/.yoda - docker start bandchain_oracle${v} + docker create --network chain_bandchain --name bandchain-yoda${v} band-validator:latest yoda r + docker cp ~/.yoda bandchain-yoda${v}:/root/.yoda + docker start bandchain-yoda${v} done # Create faucet container @@ -155,6 +156,7 @@ rm -rf ~/.faucet faucet config chain-id bandchain faucet config node tcp://query-node:26657 faucet config port 5005 +faucet config gas-prices "0.0025uband" for i in $(eval echo {1..5}) do # add worker key @@ -163,10 +165,10 @@ do # send band tokens to worker echo "y" | bandd tx bank send requester $(faucet keys show worker$i) 1000000000000uband --keyring-backend test --chain-id bandchain --gas-prices 0.0025uband -b sync - # wait for addding reporter transaction success + # wait for adding token transaction success sleep 4 done -docker create --network chain_bandchain --name bandchain_faucet -p 5005:5005 band-validator:latest faucet r -docker cp ~/.faucet bandchain_faucet:/root/.faucet -docker start bandchain_faucet +docker create --network chain_bandchain --name bandchain-faucet -p 5005:5005 band-validator:latest faucet r +docker cp ~/.faucet bandchain-faucet:/root/.faucet +docker start bandchain-faucet diff --git a/go.mod b/go.mod index bb6d7d712..86c0cfab2 100644 --- a/go.mod +++ b/go.mod @@ -1,76 +1,90 @@ -module github.com/bandprotocol/chain/v2 +module github.com/bandprotocol/chain/v3 go 1.22.3 require ( - cosmossdk.io/api v0.3.1 + cosmossdk.io/api v0.7.6 + cosmossdk.io/client/v2 v2.0.0-beta.3 + cosmossdk.io/core v0.11.2 cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 + cosmossdk.io/store v1.1.1 + cosmossdk.io/tools/confix v0.1.2 + cosmossdk.io/tools/rosetta v0.2.1-0.20230613133644-0a778132a60f + cosmossdk.io/x/evidence v0.1.1 + cosmossdk.io/x/feegrant v0.1.1 + cosmossdk.io/x/tx v0.13.5 + cosmossdk.io/x/upgrade v0.1.4 github.com/bandprotocol/go-owasm v0.3.1 github.com/bytecodealliance/wasmtime-go/v20 v20.0.0 - github.com/cometbft/cometbft v0.37.9 - github.com/cometbft/cometbft-db v0.10.0 - github.com/confio/ics23/go v0.9.0 + github.com/cometbft/cometbft v0.38.12 + github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 - github.com/cosmos/cosmos-sdk v0.47.13 + github.com/cosmos/cosmos-sdk v0.50.10 github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-go/v7 v7.7.0 - github.com/ethereum/go-ethereum v1.14.7 - github.com/gin-gonic/gin v1.8.1 - github.com/go-sql-driver/mysql v1.7.0 + github.com/cosmos/gogoproto v1.7.0 + github.com/cosmos/ibc-go/modules/capability v1.0.1 + github.com/cosmos/ibc-go/v8 v8.5.1 + github.com/cosmos/ics23/go v0.11.0 + github.com/ethereum/go-ethereum v1.14.8 github.com/golang/protobuf v1.5.4 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 - github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/kyokomi/emoji v2.2.4+incompatible github.com/levigross/grequests v0.0.0-20190908174114-253788527a1a github.com/lib/pq v1.10.7 github.com/mattn/go-sqlite3 v1.14.22 - github.com/oasisprotocol/oasis-core/go v0.0.0-20200730171716-3be2b460b3ac - github.com/patrickmn/go-cache v2.1.0+incompatible + github.com/oasisprotocol/oasis-core/go v0.2202.7 github.com/peterbourgon/diskv v2.0.1+incompatible - github.com/prometheus/client_golang v1.14.0 - github.com/rakyll/statik v0.1.7 - github.com/segmentio/kafka-go v0.4.47 - github.com/spf13/cast v1.6.0 + github.com/prometheus/client_golang v1.20.1 + github.com/spf13/cast v1.7.0 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 + go.uber.org/mock v0.4.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d + google.golang.org/grpc v1.66.2 + google.golang.org/protobuf v1.35.1 + sigs.k8s.io/yaml v1.4.0 +) + +// extra/rest deps +require ( + cosmossdk.io/collections v0.4.0 + github.com/gin-gonic/gin v1.8.1 + github.com/go-sql-driver/mysql v1.8.1 + github.com/patrickmn/go-cache v2.1.0+incompatible + github.com/segmentio/kafka-go v0.4.47 github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d golang.org/x/time v0.5.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 - google.golang.org/grpc v1.65.0 - google.golang.org/protobuf v1.34.2 gorm.io/driver/mysql v1.5.7 gorm.io/driver/postgres v1.5.9 gorm.io/driver/sqlite v1.5.6 gorm.io/gorm v1.25.11 - sigs.k8s.io/yaml v1.4.0 ) require ( - cloud.google.com/go v0.112.1 // indirect + cloud.google.com/go v0.115.0 // indirect + cloud.google.com/go/auth v0.6.0 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect cloud.google.com/go/compute/metadata v0.3.0 // indirect - cloud.google.com/go/iam v1.1.6 // indirect - cloud.google.com/go/storage v1.38.0 // indirect - cosmossdk.io/core v0.5.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/log v1.3.1 // indirect - cosmossdk.io/tools/rosetta v0.2.1 // indirect - filippo.io/edwards25519 v1.0.0 // indirect + cloud.google.com/go/iam v1.1.9 // indirect + cloud.google.com/go/storage v1.41.0 // indirect + cosmossdk.io/depinject v1.0.0 // indirect + cosmossdk.io/x/circuit v0.1.1 // indirect + filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect - github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect - github.com/DataDog/zstd v1.5.2 // indirect - github.com/armon/go-metrics v0.4.1 // indirect - github.com/aws/aws-sdk-go v1.44.203 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.5 // indirect + github.com/aws/aws-sdk-go v1.44.224 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/btcsuite/btcd v0.20.1-beta // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/bytedance/sonic v1.8.0 // indirect + github.com/bits-and-blooms/bitset v1.10.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect + github.com/bytedance/sonic v1.9.1 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -84,24 +98,28 @@ require ( github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect + github.com/cometbft/cometbft-db v0.11.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v0.20.1 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect + github.com/cosmos/iavl v1.2.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect - github.com/creachadair/taskgroup v0.4.2 // indirect + github.com/creachadair/atomicfile v0.3.1 // indirect + github.com/creachadair/tomledit v0.0.24 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.1 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-kit/kit v0.12.0 // indirect @@ -111,7 +129,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.11.2 // indirect + github.com/go-playground/validator/v10 v10.14.0 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect @@ -127,24 +145,28 @@ require ( github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.3 // indirect - github.com/gorilla/handlers v1.5.1 // indirect - github.com/gorilla/websocket v1.5.0 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/googleapis/gax-go/v2 v2.12.5 // indirect + github.com/gorilla/handlers v1.5.2 // indirect + github.com/gorilla/mux v1.8.1 // indirect + github.com/gorilla/websocket v1.5.3 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/gtank/merlin v0.1.1 // indirect - github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-getter v1.7.5 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect - github.com/holiman/uint256 v1.3.0 // indirect + github.com/holiman/uint256 v1.3.1 // indirect github.com/huandu/skiplist v1.2.0 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect @@ -156,18 +178,16 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.2 // indirect - github.com/klauspost/cpuid/v2 v2.0.9 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/leodido/go-urn v1.2.1 // indirect - github.com/linxGnu/grocksdb v1.8.11 // indirect + github.com/leodido/go-urn v1.2.4 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect @@ -175,18 +195,21 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/oklog/run v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect - github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pierrec/lz4/v4 v4.1.15 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect - github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.32.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/rs/zerolog v1.33.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect @@ -195,53 +218,49 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ugorji/go/codec v1.2.9 // indirect + github.com/ugorji/go/codec v1.2.11 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect - go.etcd.io/bbolt v1.3.8 // indirect + go.etcd.io/bbolt v1.3.10 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.9.0 // indirect - golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect - golang.org/x/crypto v0.23.0 // indirect - golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/oauth2 v0.20.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/term v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - google.golang.org/api v0.171.0 // indirect - google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/arch v0.3.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect + google.golang.org/api v0.186.0 // indirect + google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.5.1 // indirect nhooyr.io/websocket v1.8.6 // indirect pgregory.net/rapid v1.1.0 // indirect ) replace ( - // cosmos keyring + // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // dgrijalva/jwt-go is deprecated and doesn't receive security updates. // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 // Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 - github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 + github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.1 // replace broken goleveldb github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - // stick with compatible version or x/exp in v0.47.x line - golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb - // stick with compatible version of rapid in v0.47.x line - pgregory.net/rapid => pgregory.net/rapid v0.5.5 ) diff --git a/go.sum b/go.sum index 205013b69..5e7a96c53 100644 --- a/go.sum +++ b/go.sum @@ -30,8 +30,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= -cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= +cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= +cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -46,6 +46,10 @@ cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjby cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/auth v0.6.0 h1:5x+d6b5zdezZ7gmLWD1m/xNjnaQ2YDhmIz/HH3doy1g= +cloud.google.com/go/auth v0.6.0/go.mod h1:b4acV+jLQDyjwm4OXHYjNvRi4jvGBzHWJRtJcy+2P4g= +cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= +cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= @@ -96,7 +100,6 @@ cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1 cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= @@ -108,8 +111,8 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= -cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= +cloud.google.com/go/iam v1.1.9 h1:oSkYLVtVme29uGYrOcKcvJRht7cHJpYD09GM9JaR0TE= +cloud.google.com/go/iam v1.1.9/go.mod h1:Nt1eDWNYH9nGQg3d/mY7U1hvfGmsaG9o/kLGoLoLXjQ= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= @@ -170,8 +173,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= -cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= +cloud.google.com/go/storage v1.41.0 h1:RusiwatSu6lHeEXe3kglxakAmAbfV+rhtPqA6i8RBx0= +cloud.google.com/go/storage v1.41.0/go.mod h1:J1WCa/Z2FcgdEDuPUY8DxT5I+d9mFKsCepp5vR6Sq80= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -183,35 +186,51 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= -cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= -cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= -cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= +cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/client/v2 v2.0.0-beta.3 h1:+TTuH0DwQYsUq2JFAl3fDZzKq5gQG7nt3dAattkjFDU= +cosmossdk.io/client/v2 v2.0.0-beta.3/go.mod h1:CZcL41HpJPOOayTCO28j8weNBQprG+SRiKX39votypo= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.2 h1:20PXbQxhWRKA83pSYW76OXrc1MI2E93flbMAGSVFlyc= +cosmossdk.io/core v0.11.2/go.mod h1:q137AJUo+/BFZ0hTTgx+7enPAar5c3Nr0h042BgcZMY= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= 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/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= -cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= +cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= -cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= -filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4= +cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo= +cosmossdk.io/tools/rosetta v0.2.1-0.20230613133644-0a778132a60f h1:p/pez1Q7Xwh9AiHWMA0uHxsB+XpReABHr6xCyMWdDAg= +cosmossdk.io/tools/rosetta v0.2.1-0.20230613133644-0a778132a60f/go.mod h1:kzkqn95F9UonJTmjS+aydreXxsWiaGKe/b4HxHZvwHM= +cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= +cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= +cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= +cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= +cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= +cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= +cosmossdk.io/x/tx v0.13.5 h1:FdnU+MdmFWn1pTsbfU0OCf2u6mJ8cqc1H4OMG418MLw= +cosmossdk.io/x/tx v0.13.5/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= -github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= -github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= @@ -219,15 +238,12 @@ github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEV github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/RoaringBitmap/roaring v0.4.21/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06Mq5mKs52e1TwOo= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= -github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -240,20 +256,17 @@ github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.44.203 h1:pcsP805b9acL3wUqa4JR2vg1k2wnItkDYNvfmcy6F+U= -github.com/aws/aws-sdk-go v1.44.203/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.224 h1:09CiaaF35nRmxrzWZ2uRq5v6Ghg/d2RiPjZnSgtt+RQ= +github.com/aws/aws-sdk-go v1.44.224/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/bandprotocol/go-owasm v0.3.1 h1:L38qAEmb0KyTICHBHJaBoo6yy5+BlbOzQeQ+ioUV5Uw= github.com/bandprotocol/go-owasm v0.3.1/go.mod h1:SAzGihlBl8eZDXA1dO2aeAZLm8J2QkNd+KvnA2Dw9Kg= -github.com/benbjohnson/clock v1.0.2/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -263,45 +276,25 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/blevesearch/bleve v1.0.9/go.mod h1:tb04/rbU29clbtNgorgFd8XdJea4x3ybYaOjWKr+UBU= -github.com/blevesearch/blevex v0.0.0-20190916190636-152f0fe5c040/go.mod h1:WH+MU2F4T0VmSdaPX+Wu5GYoZBrYWdOZWSjzvYcDmqQ= -github.com/blevesearch/go-porterstemmer v1.0.3/go.mod h1:angGc5Ht+k2xhJdZi511LtmxuEf0OVpvUUNrwmM1P7M= -github.com/blevesearch/mmap-go v1.0.2/go.mod h1:ol2qBqYaOUsGdm7aRMRrYGgPvnwLe6Y+7LMvAB5IbSA= -github.com/blevesearch/segment v0.9.0/go.mod h1:9PfHYUdQCgHktBgvtUOF4x+pc4/l8rdH0u5spnW85UQ= -github.com/blevesearch/snowballstem v0.9.0/go.mod h1:PivSj3JMc8WuaFkTSRDW2SlrulNWPl4ABg1tC/hlgLs= -github.com/blevesearch/zap/v11 v11.0.9/go.mod h1:47hzinvmY2EvvJruzsSCJpro7so8L1neseaGjrtXHOY= -github.com/blevesearch/zap/v12 v12.0.9/go.mod h1:paQuvxy7yXor+0Mx8p2KNmJgygQbQNN+W6HRfL5Hvwc= -github.com/blevesearch/zap/v13 v13.0.1/go.mod h1:XmyNLMvMf8Z5FjLANXwUeDW3e1+o77TTGUWrth7T9WI= -github.com/blevesearch/zap/v14 v14.0.0/go.mod h1:sUc/gPGJlFbSQ2ZUh/wGRYwkKx+Dg/5p+dd+eq6QMXk= -github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= -github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= -github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= -github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= -github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= -github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= -github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88= +github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= github.com/bytecodealliance/wasmtime-go/v20 v20.0.0 h1:xO8EMdztxRALMRoru7WCIlr10co225tFFUoJ/Ygzdv4= github.com/bytecodealliance/wasmtime-go/v20 v20.0.0/go.mod h1:Va362hmt7aqwyb2Vu73yHbmx6NkSvGmvHOzJa2xMECQ= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= -github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/cenkalti/backoff/v4 v4.0.0/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -357,92 +350,76 @@ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1: github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.37.9 h1:zsW0wfjcnV9L+D4y3FkVQFSFPSbNWJneS9p3gCsWx8o= -github.com/cometbft/cometbft v0.37.9/go.mod h1:j0Q3RqrCd+cztWCugs3obbzC4NyHGBPZZjtm/fWV00I= -github.com/cometbft/cometbft-db v0.10.0 h1:VMBQh88zXn64jXVvj39tlu/IgsGR84T7ImjS523DCiU= -github.com/cometbft/cometbft-db v0.10.0/go.mod h1:7RR7NRv99j7keWJ5IkE9iZibUTKYdtepXTp7Ra0FxKk= -github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= -github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= +github.com/cometbft/cometbft v0.38.12 h1:OWsLZN2KcSSFe8bet9xCn07VwhBnavPea3VyPnNq1bg= +github.com/cometbft/cometbft v0.38.12/go.mod h1:GPHp3/pehPqgX1930HmK1BpBLZPxB75v/dZg8Viwy+o= +github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= +github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= +github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= +github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/cosmos-sdk v0.47.13 h1:9d57rl2ilSgc8a6u1JAulqNX/E5w8lbqbRe3NON3Jb4= -github.com/cosmos/cosmos-sdk v0.47.13/go.mod h1:pYMzhTfKFn9AJB5X64Epwe9NgYk0y3v7XN8Ks5xqWoo= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= +github.com/cosmos/cosmos-sdk v0.50.10 h1:zXfeu/z653tWZARr/jESzAEiCUYjgJwwG4ytnYWMoDM= +github.com/cosmos/cosmos-sdk v0.50.10/go.mod h1:6Eesrx3ZE7vxBZWpK++30H+Uc7Q4ahQWCL7JKU/LEdU= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= -github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-go/v7 v7.7.0 h1:/ndLv4GiAkOaHQKpcoQyoGIZpGpT4d+9kjl5n3DsaVQ= -github.com/cosmos/ibc-go/v7 v7.7.0/go.mod h1:zzFhtp9g9RrN/UxXWrdUu5VyonBALCAHujXQCzrZSu8= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= +github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= +github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI= +github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E= +github.com/cosmos/ibc-go/v8 v8.5.1 h1:3JleEMKBjRKa3FeTKt4fjg22za/qygLBo7mDkoYTNBs= +github.com/cosmos/ibc-go/v8 v8.5.1/go.mod h1:P5hkAvq0Qbg0h18uLxDVA9q1kOJ0l36htMsskiNwXbo= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= -github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= +github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= +github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= -github.com/couchbase/ghistogram v0.1.0/go.mod h1:s1Jhy76zqfEecpNWJfWUiKZookAFaiGOEoyzgHt9i7k= -github.com/couchbase/moss v0.1.0/go.mod h1:9MaHIaRuy9pvLPUJxB8sh8OrLfyDczECVL37grCIubs= -github.com/couchbase/vellum v1.0.1/go.mod h1:FcwrEivFpNi24R3jLOs3n+fs5RnuQnQqCLBJ1uAg1W4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= -github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= +github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= +github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= +github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= +github.com/creachadair/tomledit v0.0.24/go.mod h1:9qHbShRWQzSCcn617cMzg4eab1vbLCOjOshAWSzWr8U= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cznic/b v0.0.0-20181122101859-a26611c4d92d/go.mod h1:URriBxXwVq5ijiJ12C7iIZqlA69nTlI+LgI6/pwftG8= -github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM= -github.com/cznic/strutil v0.0.0-20181122101858-275e90344537/go.mod h1:AHHPPPXTw0h6pVabbcbyGRK1DckRn7r/STdZEeIDzZc= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018/go.mod h1:rQYf4tfk5sSwFsnDg3qYaBxSjsD9S8+59vW0dKUgme4= -github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= -github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= +github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger v1.6.1/go.mod h1:FRmFw3uxvcpa8zG3Rxs0th+hCLIuaQg8HlNV5bjgnuU= -github.com/dgraph-io/badger/v2 v2.0.3/go.mod h1:3KY8+bsP8wI0OEnQJAKpd4wIJW/Mm32yw2j/9FUVnIM= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -453,11 +430,12 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= -github.com/eapache/channels v1.1.0/go.mod h1:jMm2qB5Ubtg9zLd+inMZd2/NUvXgzmWXsDaLyQIGfH0= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= +github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -469,13 +447,12 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/go-ethereum v1.14.7 h1:EHpv3dE8evQmpVEQ/Ne2ahB06n2mQptdwqaMNhAT29g= -github.com/ethereum/go-ethereum v1.14.7/go.mod h1:Mq0biU2jbdmKSZoqOj29017ygFrMnB5/Rifwp980W4o= -github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= -github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= +github.com/ethereum/go-ethereum v1.14.8 h1:NgOWvXS+lauK+zFukEvi85UmmsS/OkV0N23UZ1VTIig= +github.com/ethereum/go-ethereum v1.14.8/go.mod h1:TJhyuDq0JDppAkFXgqjwpdlQApywnu/m10kFPxh8vvs= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= @@ -488,23 +465,26 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/fxamacker/cbor/v2 v2.2.1-0.20200526031912-58b82b5bfc05/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= -github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= -github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= -github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -523,11 +503,12 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= -github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= +github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= +github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= @@ -535,7 +516,6 @@ github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= @@ -556,7 +536,6 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -593,7 +572,6 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= @@ -626,14 +604,13 @@ github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 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/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= -github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= +github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -656,7 +633,6 @@ github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -675,46 +651,32 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA= -github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4= +github.com/googleapis/gax-go/v2 v2.12.5 h1:8gw9KZK8TiVKB6q3zHY3SBzLnrGp6HQjyfYBYGmXdxA= +github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= -github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= -github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= -github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= -github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= -github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -723,14 +685,17 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-getter v1.7.5 h1:dT58k9hQ/vbxNMwoI5+xFYAJuv6152UNvdHokfI5wE4= github.com/hashicorp/go-getter v1.7.5/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= -github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -738,17 +703,17 @@ github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoD github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -757,19 +722,20 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= -github.com/holiman/uint256 v1.3.0 h1:4wdcm/tnd0xXdu7iS3ruNvxkWwrb4aeBQv19ayYn8F4= -github.com/holiman/uint256 v1.3.0/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= +github.com/holiman/uint256 v1.3.1 h1:JfTzmih28bittyHM8z360dCjIA9dbPIBlcTI6lmctQs= +github.com/holiman/uint256 v1.3.1/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= -github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= @@ -778,28 +744,6 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= -github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= -github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= -github.com/ipfs/go-cid v0.0.4/go.mod h1:4LLaPOQwmk5z9LBgQnpkivrx8BJjUyGwTXCd5Xfj6+M= -github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= -github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= -github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= -github.com/ipfs/go-datastore v0.4.1/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= -github.com/ipfs/go-datastore v0.4.4/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= -github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= -github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= -github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= -github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= -github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= -github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= -github.com/ipfs/go-log v1.0.2/go.mod h1:1MNjMxe0u6xvJZgeqbJ8vdo2TKaGwZ1a0Bpza+sr2Sk= -github.com/ipfs/go-log v1.0.3/go.mod h1:OsLySYkwIbiSUR/yBTdv1qPtcE4FW3WPWk/ewz9Ru+A= -github.com/ipfs/go-log v1.0.4/go.mod h1:oDCg2FkjogeFOhqqb+N39l2RpTNPL6F/StPkB3kPgcs= -github.com/ipfs/go-log/v2 v2.0.2/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= -github.com/ipfs/go-log/v2 v2.0.3/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= -github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= -github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= @@ -808,18 +752,8 @@ github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw= github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= -github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2/go.mod h1:8GXXJV31xl8whumTzdZsTt3RnUIiPqzkyf7mxToRCMs= -github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPwbGVtZVWC34vc5WLsDk= -github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8/go.mod h1:Ly/wlsjFq/qrU3Rar62tu1gASgGw6chQbSh/XgIIXCY= -github.com/jbenet/goprocess v0.1.3/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= -github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= -github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= -github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= @@ -833,7 +767,6 @@ github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -846,128 +779,60 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= -github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/kljensen/snowball v0.6.0/go.mod h1:27N7E8fVU5H68RlUmnWwZCfxgt4POBJfENGMvNRhldw= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/kyokomi/emoji v2.2.4+incompatible h1:np0woGKwx9LiHAQmwZx79Oc0rHpNw3o+3evou4BEPv4= github.com/kyokomi/emoji v2.2.4+incompatible/go.mod h1:mZ6aGCD7yk8j6QY6KICwnZ2pxoszVseX1DNoGtU2tBA= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/levigross/grequests v0.0.0-20190908174114-253788527a1a h1:DGFy/362j92vQRE3ThU1yqg9TuJS8YJOSbQuB7BP9cA= github.com/levigross/grequests v0.0.0-20190908174114-253788527a1a/go.mod h1:jVntzcUU+2BtVohZBQmSHWUmh8B55LCNfPhcNCIvvIg= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E= -github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= -github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= -github.com/libp2p/go-conn-security-multistream v0.2.0/go.mod h1:hZN4MjlNetKD3Rq5Jb/P5ohUnFLNzEAR4DLSzpn2QLU= -github.com/libp2p/go-eventbus v0.2.1/go.mod h1:jc2S4SoEVPP48H9Wpzm5aiGwUCBMfGhVhhBjyhhCJs8= -github.com/libp2p/go-flow-metrics v0.0.1/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZxBdp967ls1g+k8= -github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= -github.com/libp2p/go-libp2p v0.10.2/go.mod h1:BYckt6lmS/oA1SlRETSPWSUulCQKiZuTVsymVMc//HQ= -github.com/libp2p/go-libp2p-autonat v0.3.1/go.mod h1:0OzOi1/cVc7UcxfOddemYD5vzEqi4fwRbnZcJGLi68U= -github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ= -github.com/libp2p/go-libp2p-circuit v0.3.1/go.mod h1:8RMIlivu1+RxhebipJwFDA45DasLx+kkrp4IlJj53F4= -github.com/libp2p/go-libp2p-connmgr v0.2.4/go.mod h1:YV0b/RIm8NGPnnNWM7hG9Q38OeQiQfKhHCCs1++ufn0= -github.com/libp2p/go-libp2p-core v0.0.1/go.mod h1:g/VxnTZ/1ygHxH3dKok7Vno1VfpvGcGip57wjTU4fco= -github.com/libp2p/go-libp2p-core v0.2.0/go.mod h1:X0eyB0Gy93v0DZtSYbEM7RnMChm9Uv3j7yRXjO77xSI= -github.com/libp2p/go-libp2p-core v0.3.0/go.mod h1:ACp3DmS3/N64c2jDzcV429ukDpicbL6+TrrxANBjPGw= -github.com/libp2p/go-libp2p-core v0.3.1/go.mod h1:thvWy0hvaSBhnVBaW37BvzgVV68OUhgJJLAa6almrII= -github.com/libp2p/go-libp2p-core v0.5.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= -github.com/libp2p/go-libp2p-core v0.5.1/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= -github.com/libp2p/go-libp2p-core v0.5.4/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= -github.com/libp2p/go-libp2p-core v0.5.5/go.mod h1:vj3awlOr9+GMZJFH9s4mpt9RHHgGqeHCopzbYKZdRjM= -github.com/libp2p/go-libp2p-core v0.5.6/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= -github.com/libp2p/go-libp2p-core v0.5.7/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= -github.com/libp2p/go-libp2p-core v0.6.0/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= -github.com/libp2p/go-libp2p-core v0.6.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= -github.com/libp2p/go-libp2p-discovery v0.5.0/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= -github.com/libp2p/go-libp2p-loggables v0.1.0/go.mod h1:EyumB2Y6PrYjr55Q3/tiJ/o3xoDasoRYM7nOzEpoa90= -github.com/libp2p/go-libp2p-mplex v0.2.1/go.mod h1:SC99Rxs8Vuzrf/6WhmH41kNn13TiYdAWNYHrwImKLnE= -github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek= -github.com/libp2p/go-libp2p-mplex v0.2.4/go.mod h1:mI7iOezdWFOisvUwaYd3IDrJ4oVmgoXK8H331ui39CE= -github.com/libp2p/go-libp2p-nat v0.0.6/go.mod h1:iV59LVhB3IkFvS6S6sauVTSOrNEANnINbI/fkaLimiw= -github.com/libp2p/go-libp2p-netutil v0.1.0/go.mod h1:3Qv/aDqtMLTUyQeundkKsA+YCThNdbQD54k3TqjpbFU= -github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= -github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= -github.com/libp2p/go-libp2p-pubsub v0.3.3/go.mod h1:DTMSVmZZfXodB/pvdTGrY2eHPZ9W2ev7hzTH83OKHrI= -github.com/libp2p/go-libp2p-secio v0.2.2/go.mod h1:wP3bS+m5AUnFA+OFO7Er03uO1mncHG0uVwGrwvjYlNY= -github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= -github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= -github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= -github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40sKitV4c50uI1M= -github.com/libp2p/go-libp2p-transport-upgrader v0.2.0/go.mod h1:mQcrHj4asu6ArfSoMuyojOdjx73Q47cYD7s5+gZOlns= -github.com/libp2p/go-libp2p-transport-upgrader v0.3.0/go.mod h1:i+SKzbRnvXdVbU3D1dwydnTmKRPXiAR/fyvi1dXuL4o= -github.com/libp2p/go-libp2p-yamux v0.2.8/go.mod h1:/t6tDqeuZf0INZMTgd0WxIRbtK2EzI2h7HbFm9eAKI4= -github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M= -github.com/libp2p/go-mplex v0.1.0/go.mod h1:SXgmdki2kwCUlCCbfGLEgHjC4pFqhTp0ZoV6aiKgxDU= -github.com/libp2p/go-mplex v0.1.2/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= -github.com/libp2p/go-msgio v0.0.4/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= -github.com/libp2p/go-msgio v0.0.6/go.mod h1:4ecVB6d9f4BDSL5fqvPiC4A3KivjWn+Venn/1ALLMWA= -github.com/libp2p/go-nat v0.0.5/go.mod h1:B7NxsVNPZmRLvMOwiEO1scOSyjA56zxYAGv1yQgRkEU= -github.com/libp2p/go-netroute v0.1.2/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= -github.com/libp2p/go-netroute v0.1.3/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= -github.com/libp2p/go-openssl v0.0.4/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-openssl v0.0.5/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-reuseport v0.0.1/go.mod h1:jn6RmB1ufnQwl0Q1f+YxAj8isJgDCQzaaxIFYDhcYEA= -github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2Wb5JSyHNncjf1Oi2dEbzM= -github.com/libp2p/go-sockaddr v0.0.2/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= -github.com/libp2p/go-stream-muxer-multistream v0.3.0/go.mod h1:yDh8abSIzmZtqtOt64gFJUXEryejzNb0lisTt+fAMJA= -github.com/libp2p/go-tcp-transport v0.2.0/go.mod h1:vX2U0CnWimU4h0SGSEsg++AzvBcroCGYw28kh94oLe0= -github.com/libp2p/go-ws-transport v0.3.1/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1fiZuEaBYusP5zsk= -github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.11 h1:BGol9e5gB1BrsTvOxloC88pe70TCqgrfLNwkyWW0kD8= -github.com/linxGnu/grocksdb v1.8.11/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= @@ -976,28 +841,13 @@ github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.30/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= -github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= -github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= -github.com/minio/sha256-simd v0.0.0-20190328051042-05b4dd3047e5/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= -github.com/minio/sha256-simd v0.1.0/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= -github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= -github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= @@ -1014,44 +864,10 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= -github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= -github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= -github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= -github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= -github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= -github.com/multiformats/go-multiaddr v0.0.1/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= -github.com/multiformats/go-multiaddr v0.0.2/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= -github.com/multiformats/go-multiaddr v0.0.4/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= -github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= -github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4= -github.com/multiformats/go-multiaddr v0.2.1/go.mod h1:s/Apk6IyxfvMjDafnhJgJ3/46z7tZ04iMk5wP4QMGGE= -github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u0xW5UouOmQQrn6a3Y= -github.com/multiformats/go-multiaddr-dns v0.2.0/go.mod h1:TJ5pr5bBO7Y1B18djPuRsVkduhQH2YqYSbxWJzYGdK0= -github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo= -github.com/multiformats/go-multiaddr-net v0.1.2/go.mod h1:QsWt3XK/3hwvNxZJp92iMQKME1qHfpYmyIjFVsSOY6Y= -github.com/multiformats/go-multiaddr-net v0.1.3/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= -github.com/multiformats/go-multiaddr-net v0.1.4/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= -github.com/multiformats/go-multiaddr-net v0.1.5/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= -github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= -github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= -github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= -github.com/multiformats/go-multihash v0.0.5/go.mod h1:lt/HCbqlQwlPBz7lv0sQCdtfcMtlJvakRUn/0Ual8po= -github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= -github.com/multiformats/go-multihash v0.0.10/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= -github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= -github.com/multiformats/go-multistream v0.1.2/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= -github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -1067,27 +883,26 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oasisprotocol/deoxysii v0.0.0-20200527154044-851aec403956/go.mod h1:cE5EgXTIhq5oAVdZ7LZd1FjTRLALPEzv93CWzBtDkyI= -github.com/oasisprotocol/ed25519 v0.0.0-20200528083105-55566edd6df0/go.mod h1:IZbb50w3AB72BVobEF6qG93NNSrTw/V2QlboxqSu3Xw= -github.com/oasisprotocol/oasis-core/go v0.0.0-20200730171716-3be2b460b3ac h1:RS9fjC/s+ebh2nyqr7FGJzRQuWms9xmghvChw7l+m28= -github.com/oasisprotocol/oasis-core/go v0.0.0-20200730171716-3be2b460b3ac/go.mod h1:DD7nvKy+YbFcksSeu2P+LyrW6/6Xa2hgmPSdyJA4z+M= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/oasisprotocol/oasis-core/go v0.2202.7 h1:BAaqQMc474ctQeith+vkckPXi7Lpgag+9QI0QpUK60g= +github.com/oasisprotocol/oasis-core/go v0.2202.7/go.mod h1:hKUgtuPPq371HokUQL5ashT5MZLZxK/VkWNKRLb9m+w= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= -github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= +github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -1099,7 +914,6 @@ github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= @@ -1114,16 +928,15 @@ github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaR github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= -github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0= @@ -1142,64 +955,51 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +github.com/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8= +github.com/prometheus/client_golang v1.20.1/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= -github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= -github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= -github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1212,7 +1012,6 @@ github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0 github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/segmentio/kafka-go v0.4.47 h1:IqziR4pA3vrZq7YdRxaT3w1/5fvIH5qpCwstUanQQB0= github.com/segmentio/kafka-go v0.4.47/go.mod h1:HjF6XbOKh0Pjlkr5GVZxt6CsjjwnmhVOfURM5KMd8qg= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -1224,14 +1023,10 @@ github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0 github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY= -github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= -github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0= -github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -1239,11 +1034,10 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= -github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -1252,13 +1046,8 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.6.3/go.mod h1:jUMtyi0/lB5yZH/FjyGAoH7IMNrIhlBf6pXZmbMDvzw= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= -github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= -github.com/steveyen/gtreap v0.1.0/go.mod h1:kl/5J7XbrOmlIbYIXdRHDDE5QxHqpk0cmkT7Z4dM9/Y= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -1275,52 +1064,34 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= 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/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= -github.com/tendermint/go-amino v0.14.1/go.mod h1:i/UKE5Uocn+argJJBb12qTZsCDBcAYMbR92AaJVmKso= -github.com/tendermint/go-amino v0.15.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= 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= -github.com/tendermint/tendermint v0.33.6/go.mod h1:0yUs9eIuuDq07nQql9BmI30FtYGcEC60Tu5JzB5IezM= -github.com/tendermint/tm-db v0.5.1/go.mod h1:g92zWjHpCYlEvQXvy9M168Su8V1IBEeawpXVVBaK4f4= -github.com/thepudds/fzgo v0.2.2/go.mod h1:ZgigL1toyKrar3rWdXz7Fuv7bUpKZ4BAYN49TpEFMCI= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= +github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= +github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= -github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h1:8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc= -github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= -github.com/whyrusleeping/go-logging v0.0.1/go.mod h1:lDPYj54zutzG1XYfHAhcc7oNXEburHQBn+Iqd4yS4vE= -github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= -github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= -github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee/go.mod h1:m2aV4LZI4Aez7dP5PMyVKEHhUyEJ/RjmPEDOpDvudHg= -github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= -github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= @@ -1339,14 +1110,9 @@ github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= -gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec/go.mod h1:BZ1RAoRPbCxum9Grlv5aeksu2H8BiKehBYooU2LFiOQ= -gitlab.com/yawning/dynlib.git v0.0.0-20200603163025-35fe007b0761/go.mod h1:U41r+zgpFRTlkSzMhBjUqbupvVBafgokFFkKn0j+874= -gitlab.com/yawning/slice.git v0.0.0-20190714152416-bc4ae2510529/go.mod h1:sgaKGjNNjAAVrZvQQhE3oYIbnFZVaCBE2T7PmbpKJ4U= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= +go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1367,59 +1133,61 @@ go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= -go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= -go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= +go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= +go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= -go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190225124518-7f87c0fbb88b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191119213627-4f8c1d86b1ba/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200406173513-056763e48d71/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1432,18 +1200,19 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1455,19 +1224,16 @@ golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1481,7 +1247,6 @@ golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -1508,13 +1273,12 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1540,8 +1304,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= -golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1557,8 +1321,8 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1568,29 +1332,21 @@ golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190219092855-153ac476189d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190405154228-4b34438f7a67/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190526052359-791d8a0f4d09/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1598,6 +1354,7 @@ golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1613,7 +1370,6 @@ golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200722175500-76b94024e4b6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1639,6 +1395,8 @@ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1655,28 +1413,28 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1688,12 +1446,12 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1704,10 +1462,10 @@ golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181130052023-1c3d964395ce/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1716,17 +1474,17 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1734,6 +1492,7 @@ golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1761,7 +1520,6 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1822,8 +1580,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.171.0 h1:w174hnBPqut76FzW5Qaupt7zY8Kql6fiVjgys4f58sU= -google.golang.org/api v0.171.0/go.mod h1:Hnq5AHm4OTMt2BUVjael2CWZFD6vksJdWCWiUAmjC9o= +google.golang.org/api v0.186.0 h1:n2OPp+PPXX0Axh4GuSsL5QL8xQCTb2oDwyzPnQvqUug= +google.golang.org/api v0.186.0/go.mod h1:hvRbBmgoje49RV3xqVXrmP6w93n6ehGgIVPYrGtBFFc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1832,7 +1590,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1939,13 +1696,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= -google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw= -google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGrVb2hFXuQ+ZMbCNdakARIn/aHMmG8= +google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= +google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d h1:Aqf0fiIdUQEj0Gn9mKFFXoQfTTEaNopWpfVyYADxiSg= +google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d/go.mod h1:Od4k8V1LQSizPRUK4OzZ7TBE/20k+jPczUDAEyvn69Y= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1960,7 +1716,6 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= @@ -1988,10 +1743,9 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo= +google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= -google.golang.org/grpc/security/advancedtls v0.0.0-20200504170109-c8482678eb49/go.mod h1:MqvBVrZckRvDn3WrLNRHuHWrNGuZISOF4ohGDsL+tK4= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -2007,8 +1761,9 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -2021,12 +1776,9 @@ gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/src-d/go-cli.v0 v0.0.0-20181105080154-d492247bbc0d/go.mod h1:z+K8VcOYVYcSwSjGebuDL6176A1XskgbtNl64NSg+n8= -gopkg.in/src-d/go-log.v1 v1.0.1/go.mod h1:GN34hKP0g305ysm2/hctJ0Y8nWP3zxXXJ8GFabTyABE= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= @@ -2053,7 +1805,6 @@ gorm.io/driver/sqlite v1.5.6/go.mod h1:U+J8craQU6Fzkcvu8oLeAQmi50TkwPEhHDEjQZXDa gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= gorm.io/gorm v1.25.11 h1:/Wfyg1B/je1hnDx3sMkX+gAlxrlZpn6X0BXRlwXlvHg= gorm.io/gorm v1.25.11/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -2066,8 +1817,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= -pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/hooks/common/hook.go b/hooks/common/hook.go index 5d5233ca8..57fdd064f 100644 --- a/hooks/common/hook.go +++ b/hooks/common/hook.go @@ -2,45 +2,47 @@ package common import ( abci "github.com/cometbft/cometbft/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) type Hooks []Hook // Hook is an interface of hook that can process along with abci application type Hook interface { - AfterInitChain(ctx sdk.Context, req abci.RequestInitChain, res abci.ResponseInitChain) - AfterBeginBlock(ctx sdk.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) - AfterDeliverTx(ctx sdk.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) - AfterEndBlock(ctx sdk.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) + AfterInitChain(ctx sdk.Context, req *abci.RequestInitChain, res *abci.ResponseInitChain) + // Receive context that has been finalized on that block + AfterBeginBlock(ctx sdk.Context, req *abci.RequestFinalizeBlock, events []abci.Event) + AfterDeliverTx(ctx sdk.Context, tx sdk.Tx, res *abci.ExecTxResult) + AfterEndBlock(ctx sdk.Context, events []abci.Event) RequestSearch(req *types.QueryRequestSearchRequest) (*types.QueryRequestSearchResponse, bool, error) RequestPrice(req *types.QueryRequestPriceRequest) (*types.QueryRequestPriceResponse, bool, error) BeforeCommit() } -func (h Hooks) AfterInitChain(ctx sdk.Context, req abci.RequestInitChain, res abci.ResponseInitChain) { +func (h Hooks) AfterInitChain(ctx sdk.Context, req *abci.RequestInitChain, res *abci.ResponseInitChain) { for _, hook := range h { hook.AfterInitChain(ctx, req, res) } } -func (h Hooks) AfterBeginBlock(ctx sdk.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) { +func (h Hooks) AfterBeginBlock(ctx sdk.Context, req *abci.RequestFinalizeBlock, events []abci.Event) { for _, hook := range h { - hook.AfterBeginBlock(ctx, req, res) + hook.AfterBeginBlock(ctx, req, events) } } -func (h Hooks) AfterDeliverTx(ctx sdk.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) { +func (h Hooks) AfterDeliverTx(ctx sdk.Context, tx sdk.Tx, res *abci.ExecTxResult) { for _, hook := range h { - hook.AfterDeliverTx(ctx, req, res) + hook.AfterDeliverTx(ctx, tx, res) } } -func (h Hooks) AfterEndBlock(ctx sdk.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) { +func (h Hooks) AfterEndBlock(ctx sdk.Context, events []abci.Event) { for _, hook := range h { - hook.AfterEndBlock(ctx, req, res) + hook.AfterEndBlock(ctx, events) } } diff --git a/hooks/common/query.go b/hooks/common/query.go index 56cb2d29c..e8554af1a 100644 --- a/hooks/common/query.go +++ b/hooks/common/query.go @@ -1,8 +1,9 @@ package common import ( - errorsmod "cosmossdk.io/errors" abci "github.com/cometbft/cometbft/abci/types" + + errorsmod "cosmossdk.io/errors" ) func QueryResultError(err error) abci.ResponseQuery { diff --git a/hooks/emitter/authz.go b/hooks/emitter/authz.go index 4296de97a..0975c0c8a 100644 --- a/hooks/emitter/authz.go +++ b/hooks/emitter/authz.go @@ -1,11 +1,13 @@ package emitter import ( + abci "github.com/cometbft/cometbft/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" - "github.com/bandprotocol/chain/v2/hooks/common" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/hooks/common" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) func (h *Hook) handleMsgGrant(msg *authz.MsgGrant, detail common.JsDict) { @@ -47,7 +49,7 @@ func (h *Hook) handleMsgExec( ctx sdk.Context, txHash []byte, emsg *authz.MsgExec, - log sdk.ABCIMessageLog, + events []abci.Event, detail common.JsDict, ) { msgs, _ := emsg.GetMessages() @@ -61,13 +63,16 @@ func (h *Hook) handleMsgExec( h.handleMsgReportData(ctx, txHash, msg, grantee) default: // add signers for this message into the transaction - signers := msg.GetSigners() + signers, _, err := h.cdc.GetMsgV1Signers(msg) + if err != nil { + continue + } addrs := make([]string, len(signers)) for idx, signer := range signers { - addrs[idx] = signer.String() + addrs[idx] = sdk.AccAddress(signer).String() } h.AddAccountsInTx(addrs...) - h.handleMsg(ctx, txHash, msg, log, subMsgs[i]["msg"].(common.JsDict)) + h.handleMsg(ctx, txHash, msg, events, subMsgs[i]["msg"].(common.JsDict)) } } } diff --git a/hooks/emitter/bank.go b/hooks/emitter/bank.go index 493c2982e..8f63945db 100644 --- a/hooks/emitter/bank.go +++ b/hooks/emitter/bank.go @@ -3,7 +3,7 @@ package emitter import ( "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/bandprotocol/chain/v2/hooks/common" + "github.com/bandprotocol/chain/v3/hooks/common" ) // handleMsgSend implements emitter handler for MsgSend. diff --git a/hooks/emitter/channel.go b/hooks/emitter/channel.go index 21f4da146..01382b71c 100644 --- a/hooks/emitter/channel.go +++ b/hooks/emitter/channel.go @@ -5,14 +5,16 @@ import ( "fmt" "strings" + abci "github.com/cometbft/cometbft/abci/types" + + icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" + ibcxfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + sdk "github.com/cosmos/cosmos-sdk/types" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - ibcxfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - "github.com/bandprotocol/chain/v2/hooks/common" - oraclekeeper "github.com/bandprotocol/chain/v2/x/oracle/keeper" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/hooks/common" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) func (h *Hook) emitSetChannel(ctx sdk.Context, portId string, channelId string) { @@ -211,7 +213,7 @@ func (h *Hook) extractOracleRequestPacket( if events, ok := evMap[oracletypes.EventTypeRequest+"."+oracletypes.AttributeKeyID]; ok { var prepareGasUsed uint64 if eventRequestGasUsed, ok := evMap[oracletypes.EventTypeRequest+"."+oracletypes.AttributeKeyGasUsed]; ok { - prepareGasUsed = oraclekeeper.ConvertToGas(common.Atoui(eventRequestGasUsed[0])) + prepareGasUsed = ConvertToGas(common.Atoui(eventRequestGasUsed[0])) } id := oracletypes.RequestID(common.Atoi(events[0])) @@ -295,8 +297,8 @@ func (h *Hook) extractInterchainAccountPacket( ctx sdk.Context, txHash []byte, dataOfPacket []byte, + events []abci.Event, evMap common.EvMap, - log sdk.ABCIMessageLog, detail common.JsDict, packet common.JsDict, ) bool { @@ -326,13 +328,16 @@ func (h *Hook) extractInterchainAccountPacket( var innerMessages []common.JsDict switch data.Type { case icatypes.EXECUTE_TX: - msgs, _ = icatypes.DeserializeCosmosTx(h.cdc, data.Data) + msgs, _ = icatypes.DeserializeCosmosTx(h.cdc, data.Data, icatypes.EncodingProtobuf) for _, msg := range msgs { // add signers for this message into the transaction - signers := msg.GetSigners() + signers, _, err := h.cdc.GetMsgV1Signers(msg) + if err != nil { + continue + } addrs := make([]string, len(signers)) for idx, signer := range signers { - addrs[idx] = signer.String() + addrs[idx] = sdk.AccAddress(signer).String() } h.AddAccountsInTx(addrs...) @@ -346,7 +351,7 @@ func (h *Hook) extractInterchainAccountPacket( // call handler for this message if ack is success if status == "success" { - h.handleMsg(ctx, txHash, msg, log, msgDetail) + h.handleMsg(ctx, txHash, msg, events, msgDetail) } } default: @@ -377,8 +382,8 @@ func (h *Hook) handleMsgRecvPacket( ctx sdk.Context, txHash []byte, msg *types.MsgRecvPacket, + events []abci.Event, evMap common.EvMap, - log sdk.ABCIMessageLog, detail common.JsDict, ) { packet := newPacket( @@ -399,7 +404,7 @@ func (h *Hook) handleMsgRecvPacket( h.Write("NEW_INCOMING_PACKET", packet) return } - if ok := h.extractInterchainAccountPacket(ctx, txHash, msg.Packet.Data, evMap, log, detail, packet); ok { + if ok := h.extractInterchainAccountPacket(ctx, txHash, msg.Packet.Data, events, evMap, detail, packet); ok { h.Write("NEW_INCOMING_PACKET", packet) return } diff --git a/hooks/emitter/client.go b/hooks/emitter/client.go index 6940848c5..e2722cb91 100644 --- a/hooks/emitter/client.go +++ b/hooks/emitter/client.go @@ -1,13 +1,14 @@ package emitter import ( + "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + "github.com/cosmos/ibc-go/v8/modules/core/exported" + solomachinetypes "github.com/cosmos/ibc-go/v8/modules/light-clients/06-solomachine" + ibctmtypes "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - "github.com/cosmos/ibc-go/v7/modules/core/exported" - solomachinetypes "github.com/cosmos/ibc-go/v7/modules/light-clients/06-solomachine" - ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - "github.com/bandprotocol/chain/v2/hooks/common" + "github.com/bandprotocol/chain/v3/hooks/common" ) func getChainId(clientState exported.ClientState) string { diff --git a/hooks/emitter/connection.go b/hooks/emitter/connection.go index 9464f1bbe..1bac4ed84 100644 --- a/hooks/emitter/connection.go +++ b/hooks/emitter/connection.go @@ -1,10 +1,11 @@ package emitter import ( + "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - "github.com/bandprotocol/chain/v2/hooks/common" + "github.com/bandprotocol/chain/v3/hooks/common" ) func (h *Hook) emitConnection(ctx sdk.Context, connectionId string) { diff --git a/hooks/emitter/decoder.go b/hooks/emitter/decoder.go index ba3cb6e44..653df18e6 100644 --- a/hooks/emitter/decoder.go +++ b/hooks/emitter/decoder.go @@ -3,24 +3,26 @@ package emitter import ( "encoding/hex" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + + feegranttypes "cosmossdk.io/x/feegrant" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - feegranttypes "github.com/cosmos/cosmos-sdk/x/feegrant" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/group" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - "github.com/bandprotocol/chain/v2/hooks/common" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/hooks/common" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) func DecodeMsg(msg sdk.Msg, detail common.JsDict) { @@ -45,8 +47,6 @@ func DecodeMsg(msg sdk.Msg, detail common.JsDict) { DecodeMsgUpdateClient(msg, detail) case *clienttypes.MsgUpgradeClient: DecodeMsgUpgradeClient(msg, detail) - case *clienttypes.MsgSubmitMisbehaviour: - DecodeMsgSubmitMisbehaviour(msg, detail) case *connectiontypes.MsgConnectionOpenInit: DecodeMsgConnectionOpenInit(msg, detail) case *connectiontypes.MsgConnectionOpenTry: @@ -369,7 +369,7 @@ func DecodeMsgSubmitProposal(msg *govv1.MsgSubmitProposal, detail common.JsDict) func DecodeV1beta1MsgSubmitProposal(msg *govv1beta1.MsgSubmitProposal, detail common.JsDict) { detail["content"] = msg.GetContent() detail["initial_deposit"] = msg.GetInitialDeposit() - detail["proposer"] = msg.GetProposer() + detail["proposer"] = msg.Proposer } func DecodeMsgDeposit(msg *govv1.MsgDeposit, detail common.JsDict) { @@ -417,10 +417,13 @@ func DecodeMsgCreateValidator(msg *stakingtypes.MsgCreateValidator, detail commo detail["description"] = DecodeDescription(msg.Description) detail["commission"] = msg.Commission detail["min_self_delegation"] = msg.MinSelfDelegation - detail["delegator_address"] = msg.DelegatorAddress detail["validator_address"] = msg.ValidatorAddress detail["pubkey"] = hexConsPubKey detail["value"] = msg.Value + + // delegatorAddress is deprecated. need to convert from validatorAddress + addr, _ := sdk.ValAddressFromBech32(msg.ValidatorAddress) + detail["delegator_address"] = sdk.AccAddress(addr).String() } func DecodeMsgEditValidator(msg *stakingtypes.MsgEditValidator, detail common.JsDict) { @@ -467,6 +470,9 @@ func DecodeMsgUpgradeClient(msg *clienttypes.MsgUpgradeClient, detail common.JsD detail["signer"] = msg.Signer } +// MsgSubmitMisbehaviour is deprecated but still use able. +// +//nolint:staticcheck func DecodeMsgSubmitMisbehaviour(msg *clienttypes.MsgSubmitMisbehaviour, detail common.JsDict) { misbehaviour, _ := clienttypes.UnpackClientMessage(msg.Misbehaviour) detail["client_id"] = msg.ClientId diff --git a/hooks/emitter/decoder_test.go b/hooks/emitter/decoder_test.go index d2ffcc96b..fd484e7e9 100644 --- a/hooks/emitter/decoder_test.go +++ b/hooks/emitter/decoder_test.go @@ -8,6 +8,18 @@ import ( "testing" "time" + "github.com/stretchr/testify/suite" + + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + commitmenttypes "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types" + ibctmtypes "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" + ibctesting "github.com/cosmos/ibc-go/v8/testing" + + "cosmossdk.io/math" + upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,19 +28,17 @@ import ( govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" - ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - "github.com/stretchr/testify/suite" - "github.com/bandprotocol/chain/v2/hooks/common" - "github.com/bandprotocol/chain/v2/hooks/emitter" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/testing/ibctesting" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + band "github.com/bandprotocol/chain/v3/app" + "github.com/bandprotocol/chain/v3/hooks/common" + "github.com/bandprotocol/chain/v3/hooks/emitter" + bandtesting "github.com/bandprotocol/chain/v3/testing" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" +) + +const ( + TestDefaultPrepareGas uint64 = 40000 + TestDefaultExecuteGas uint64 = 300000 ) var ( @@ -43,21 +53,31 @@ var ( GranterAddress = sdk.AccAddress(genAddresFromString("Granter")) GranteeAddress = sdk.AccAddress(genAddresFromString("Grantee")) + Coins1000000uband = sdk.NewCoins(sdk.NewInt64Coin("uband", 1000000)) + Coins100000000uband = sdk.NewCoins(sdk.NewInt64Coin("uband", 100000000)) + clientHeight = clienttypes.NewHeight(0, 10) - Delegation = stakingtypes.NewDelegation(DelegatorAddress, ValAddress, sdk.NewDec(1)) - SelfDelegation = sdk.NewCoin("uband", sdk.NewInt(1)) - MinSelfDelegation = sdk.NewInt(1) + SelfDelegation = sdk.NewInt64Coin("uband", 1) + MinSelfDelegation = math.NewInt(1) Description = stakingtypes.NewDescription("moniker", "identity", "website", "securityContact", "details") - CommissionRate = stakingtypes.NewCommissionRates(sdk.NewDec(1), sdk.NewDec(5), sdk.NewDec(5)) - NewRate = sdk.NewDec(1) - PubKey = newPubKey("0B485CFC0EECC619440448436F8FC9DF40566F2369E72400281454CB552AFB50") - Amount = sdk.NewCoin("uband", sdk.NewInt(1)) + CommissionRate = stakingtypes.NewCommissionRates( + math.LegacyNewDec(1), + math.LegacyNewDec(5), + math.LegacyNewDec(5), + ) + NewRate = math.LegacyNewDec(1) + PubKey = newPubKey("0B485CFC0EECC619440448436F8FC9DF40566F2369E72400281454CB552AFB50") + Amount = sdk.NewCoin("uband", math.NewInt(1)) - content, _ = govv1beta1.ContentFromProposalType("Title", "Desc", "Text") - proposalMsg = banktypes.NewMsgSend(SenderAddress, ReceiverAddress, sdk.Coins{Amount}) + content, _ = govv1beta1.ContentFromProposalType("Title", "Desc", "Text") ) +func init() { + band.SetBech32AddressPrefixesAndBip44CoinTypeAndSeal(sdk.GetConfig()) + sdk.DefaultBondDenom = "uband" +} + type DecoderTestSuite struct { suite.Suite @@ -68,15 +88,19 @@ type DecoderTestSuite struct { } func (suite *DecoderTestSuite) SetupTest() { + ibctesting.DefaultTestingAppInit = bandtesting.CreateTestingAppFn(suite.T()) + suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) - suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0)) - suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(1)) + suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(1)) + suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(2)) } func NewOraclePath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { path := ibctesting.NewPath(chainA, chainB) - path.EndpointA.ChannelConfig.PortID = ibctesting.OraclePort - path.EndpointB.ChannelConfig.PortID = ibctesting.OraclePort + path.EndpointA.ChannelConfig.PortID = oracletypes.ModuleName + path.EndpointA.ChannelConfig.Version = oracletypes.Version + path.EndpointB.ChannelConfig.PortID = oracletypes.ModuleName + path.EndpointB.ChannelConfig.Version = oracletypes.Version return path } @@ -100,7 +124,7 @@ func newPubKey(pk string) (res cryptotypes.PubKey) { func (suite *DecoderTestSuite) testCompareJson(msg common.JsDict, expect string) { res, _ := json.Marshal(msg) - suite.Require().Equal(string(res), expect) + suite.Require().Equal(expect, string(res)) } func (suite *DecoderTestSuite) testContains(msg common.JsDict, expect string) { @@ -190,9 +214,9 @@ func (suite *DecoderTestSuite) TestDecodeMsgRequestData() { 1, 1, "cleint_id", - bandtesting.Coins100000000uband, - bandtesting.TestDefaultPrepareGas, - bandtesting.TestDefaultExecuteGas, + Coins100000000uband, + TestDefaultPrepareGas, + TestDefaultExecuteGas, SenderAddress, ) emitter.DecodeMsgRequestData(msg, detail) @@ -230,7 +254,7 @@ func (suite *DecoderTestSuite) TestDecodeMsgCreateDataSource() { "name", "desc", []byte("exec"), - bandtesting.Coins1000000uband, + Coins1000000uband, TreasuryAddress, OwnerAddress, SenderAddress, @@ -267,7 +291,7 @@ func (suite *DecoderTestSuite) TestDecodeMsgEditDataSource() { "name", "desc", []byte("exec"), - bandtesting.Coins1000000uband, + Coins1000000uband, TreasuryAddress, OwnerAddress, SenderAddress, @@ -325,18 +349,16 @@ func (suite *DecoderTestSuite) TestDecodeMsgCreateClient() { emitter.DecodeMsgCreateClient(msg, detail) suite.testCompareJson(detail, fmt.Sprintf( - "{\"client_state\":{\"chain_id\":\"testchain0\",\"trust_level\":{\"numerator\":1,\"denominator\":3},\"trusting_period\":1209600000000000,\"unbonding_period\":1814400000000000,\"max_clock_drift\":10000000000,\"frozen_height\":{},\"latest_height\":{\"revision_height\":10},\"proof_specs\":[{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":33,\"min_prefix_length\":4,\"max_prefix_length\":12,\"hash\":1}},{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":32,\"min_prefix_length\":1,\"max_prefix_length\":1,\"hash\":1}}],\"upgrade_path\":[\"upgrade\",\"upgradedIBCState\"]},\"consensus_state\":{\"timestamp\":\"2020-01-02T00:00:00Z\",\"root\":{\"hash\":\"%s\"},\"next_validators_hash\":\"%s\"},\"signer\":\"band12djkuer9wgqqqqqqqqqqqqqqqqqqqqqqck96t0\"}", + "{\"client_state\":{\"chain_id\":\"testchain1-1\",\"trust_level\":{\"numerator\":1,\"denominator\":3},\"trusting_period\":1209600000000000,\"unbonding_period\":1814400000000000,\"max_clock_drift\":10000000000,\"frozen_height\":{},\"latest_height\":{\"revision_height\":10},\"proof_specs\":[{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":33,\"min_prefix_length\":4,\"max_prefix_length\":12,\"hash\":1}},{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":32,\"min_prefix_length\":1,\"max_prefix_length\":1,\"hash\":1}}],\"upgrade_path\":[\"upgrade\",\"upgradedIBCState\"]},\"consensus_state\":{\"timestamp\":\"2020-01-02T00:00:00Z\",\"root\":{\"hash\":\"%s\"},\"next_validators_hash\":\"%s\"},\"signer\":\"band12djkuer9wgqqqqqqqqqqqqqqqqqqqqqqck96t0\"}", b64RootHash, consensus.NextValidatorsHash, ), ) - // MsgCreateClient example - // {"client_state":{"chain_id":"testchain0","trust_level":{"numerator":1,"denominator":3},"trusting_period":1209600000000000,"unbonding_period":1814400000000000,"max_clock_drift":10000000000,"frozen_height":{},"latest_height":{"revision_height":10},"proof_specs":[{"leaf_spec":{"hash":1,"prehash_value":1,"length":1,"prefix":"AA=="},"inner_spec":{"child_order":[0,1],"child_size":33,"min_prefix_length":4,"max_prefix_length":12,"hash":1}},{"leaf_spec":{"hash":1,"prehash_value":1,"length":1,"prefix":"AA=="},"inner_spec":{"child_order":[0,1],"child_size":32,"min_prefix_length":1,"max_prefix_length":1,"hash":1}}],"upgrade_path":["upgrade","upgradedIBCState"]},"consensus_state":{"timestamp":"2020-01-02T00:00:00Z","root":{"hash":"I0ofcG04FYhAyDFzygf8Q/6JEpBactgfhm68fSXwBro="},"next_validators_hash":"C8277795F71B45089E58F0994DCF4F88BECD5770C7E492A9A25B706888D6BF2F"},"signer":"band12djkuer9wgqqqqqqqqqqqqqqqqqqqqqqck96t0"} } func (suite *DecoderTestSuite) TestDecodeV1beta1MsgSubmitProposal() { detail := make(common.JsDict) - msg, _ := govv1beta1.NewMsgSubmitProposal(content, bandtesting.Coins1000000uband, SenderAddress) + msg, _ := govv1beta1.NewMsgSubmitProposal(content, Coins1000000uband, SenderAddress) emitter.DecodeV1beta1MsgSubmitProposal(msg, detail) suite.testCompareJson( detail, @@ -345,14 +367,16 @@ func (suite *DecoderTestSuite) TestDecodeV1beta1MsgSubmitProposal() { } func (suite *DecoderTestSuite) TestDecodeMsgSubmitProposal() { + fmt.Println(sdk.GetConfig().GetBech32AccountAddrPrefix()) detail := make(common.JsDict) msg, _ := govv1.NewMsgSubmitProposal( - []sdk.Msg{proposalMsg}, - bandtesting.Coins1000000uband, + []sdk.Msg{banktypes.NewMsgSend(SenderAddress, ReceiverAddress, sdk.Coins{Amount})}, + Coins1000000uband, SenderAddress.String(), "metadata", "title", "summary", + true, ) emitter.DecodeMsgSubmitProposal(msg, detail) suite.testCompareJson( @@ -363,7 +387,7 @@ func (suite *DecoderTestSuite) TestDecodeMsgSubmitProposal() { func (suite *DecoderTestSuite) TestDecodeV1beta1MsgDeposit() { detail := make(common.JsDict) - msg := govv1beta1.NewMsgDeposit(SenderAddress, 1, bandtesting.Coins1000000uband) + msg := govv1beta1.NewMsgDeposit(SenderAddress, 1, Coins1000000uband) emitter.DecodeV1beta1MsgDeposit(msg, detail) suite.testCompareJson( detail, @@ -373,7 +397,7 @@ func (suite *DecoderTestSuite) TestDecodeV1beta1MsgDeposit() { func (suite *DecoderTestSuite) TestDecodeMsgDeposit() { detail := make(common.JsDict) - msg := govv1.NewMsgDeposit(SenderAddress, 1, bandtesting.Coins1000000uband) + msg := govv1.NewMsgDeposit(SenderAddress, 1, Coins1000000uband) emitter.DecodeMsgDeposit(msg, detail) suite.testCompareJson( detail, @@ -402,8 +426,9 @@ func (suite *DecoderTestSuite) TestDecodeMsgVote() { func (suite *DecoderTestSuite) TestDecodeMsgCreateValidator() { detail := make(common.JsDict) + fmt.Println(ValAddress.String()) msg, _ := stakingtypes.NewMsgCreateValidator( - ValAddress, + ValAddress.String(), PubKey, SelfDelegation, Description, @@ -420,7 +445,7 @@ func (suite *DecoderTestSuite) TestDecodeMsgCreateValidator() { func (suite *DecoderTestSuite) TestDecodeMsgEditValidator() { detail := make(common.JsDict) - msg := stakingtypes.NewMsgEditValidator(ValAddress, Description, &NewRate, &MinSelfDelegation) + msg := stakingtypes.NewMsgEditValidator(ValAddress.String(), Description, &NewRate, &MinSelfDelegation) emitter.DecodeMsgEditValidator(msg, detail) suite.testCompareJson( @@ -431,7 +456,7 @@ func (suite *DecoderTestSuite) TestDecodeMsgEditValidator() { func (suite *DecoderTestSuite) TestDecodeMsgDelegate() { detail := make(common.JsDict) - msg := stakingtypes.NewMsgDelegate(DelegatorAddress, ValAddress, Amount) + msg := stakingtypes.NewMsgDelegate(DelegatorAddress.String(), ValAddress.String(), Amount) emitter.DecodeMsgDelegate(msg, detail) suite.testCompareJson( @@ -442,7 +467,7 @@ func (suite *DecoderTestSuite) TestDecodeMsgDelegate() { func (suite *DecoderTestSuite) TestDecodeMsgUndelegate() { detail := make(common.JsDict) - msg := stakingtypes.NewMsgUndelegate(DelegatorAddress, ValAddress, Amount) + msg := stakingtypes.NewMsgUndelegate(DelegatorAddress.String(), ValAddress.String(), Amount) emitter.DecodeMsgUndelegate(msg, detail) suite.testCompareJson( @@ -453,7 +478,12 @@ func (suite *DecoderTestSuite) TestDecodeMsgUndelegate() { func (suite *DecoderTestSuite) TestDecodeMsgBeginRedelegate() { detail := make(common.JsDict) - msg := stakingtypes.NewMsgBeginRedelegate(DelegatorAddress, ValAddress, ValAddress, Amount) + msg := stakingtypes.NewMsgBeginRedelegate( + DelegatorAddress.String(), + ValAddress.String(), + ValAddress.String(), + Amount, + ) emitter.DecodeMsgBeginRedelegate(msg, detail) suite.testCompareJson( @@ -472,10 +502,8 @@ func (suite *DecoderTestSuite) TestDecodeMsgUpdateClient() { emitter.DecodeMsgUpdateClient(msg, detail) suite.testContains( detail, - "{\"client_id\":\"tendermint\",\"header\":{\"signed_header\":{\"header\":{\"version\":{\"block\":11,\"app\":2},\"chain_id\":\"testchain0\",\"height\":3,\"time\":\"2020-01-02T00:00:00Z\",\"last_block_id\":{\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"part_set_header\":{\"total\":10000,\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"}}", + "{\"client_id\":\"tendermint\",\"header\":{\"signed_header\":{\"header\":{\"version\":{\"block\":11,\"app\":2},\"chain_id\":\"testchain1-1\",\"height\":2,\"time\":\"2020-01-02T00:00:00Z\",\"last_block_id\":{\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"part_set_header\":{\"total\":10000,\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"}}", ) - // MsgUpdateClient - // "{\"client_id\":\"tendermint\",\"header\":{\"signed_header\":{\"header\":{\"version\":{\"block\":11,\"app\":2},\"chain_id\":\"testchain0\",\"height\":3,\"time\":\"2020-01-02T00:00:00Z\",\"last_block_id\":{\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"part_set_header\":{\"total\":10000,\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"}},\"last_commit_hash\":\"VnnIEw5Rphpyx5BgGrYlqa65CvjT8weLaOs/wbJaknQ=\",\"data_hash\":\"bW4ouLmLUycELqUKV91G5syFHHLlKL3qpu/e7v5moLg=\",\"validators_hash\":\"35jAWHlQWSshlZrerDcsJd5H8LuvI80BB4ezq6fHiJw=\",\"next_validators_hash\":\"35jAWHlQWSshlZrerDcsJd5H8LuvI80BB4ezq6fHiJw=\",\"consensus_hash\":\"5eVmxB7Vfj/4zBDxhBeHiLj6pgKwfPH0JSF72BefHyQ=\",\"app_hash\":\"VnnIEw5Rphpyx5BgGrYlqa65CvjT8weLaOs/wbJaknQ=\",\"last_results_hash\":\"CS4FhjAkftYAmGOhLu4RfSbNnQi1rcqrN/KrNdtHWjc=\",\"evidence_hash\":\"c4ZdsI9J1YQokF04mrTKS5bkWjIGx6adQ6Xcc3LmBxQ=\",\"proposer_address\":\"f/nWW2sIpnlCMZ1XYLa/jtNzVak=\"},\"commit\":{\"height\":3,\"round\":1,\"block_id\":{\"hash\":\"Vo4riCF+F1W/yPgGPEjyunesQNWSSMyp5nE8r12NQV0=\",\"part_set_header\":{\"total\":3,\"hash\":\"hwgKOc/jNqZj6lwNm97vSTq9wYt8Pj4MjmYTVMGDFDI=\"}},\"signatures\":[{\"block_id_flag\":2,\"validator_address\":\"f/nWW2sIpnlCMZ1XYLa/jtNzVak=\",\"timestamp\":\"2020-01-02T00:00:00Z\",\"signature\":\"fvGxOLWnEYK5HxqogNmQ63b037/zi1LT3wC6ES/msdMst6yBsIRg44StmbzNUsZlWMfBWVs39myGcQgTYzgkUg==\"}]}},\"validator_set\":{\"validators\":[{\"address\":\"f/nWW2sIpnlCMZ1XYLa/jtNzVak=\",\"pub_key\":{\"Sum\":{\"secp256k1\":\"Arn/2FLDO4dVHxEGAx6QsWKxjHj1HEpjgtW4asUV8lIy\"}},\"voting_power\":1}],\"proposer\":{\"address\":\"f/nWW2sIpnlCMZ1XYLa/jtNzVak=\",\"pub_key\":{\"Sum\":{\"secp256k1\":\"Arn/2FLDO4dVHxEGAx6QsWKxjHj1HEpjgtW4asUV8lIy\"}},\"voting_power\":1},\"total_voting_power\":1},\"trusted_height\":{}},\"signer\":\"band12djkuer9wgqqqqqqqqqqqqqqqqqqqqqqck96t0\"}" } func (suite *DecoderTestSuite) TestDecodeMsgUpgradeClient() { @@ -485,7 +513,7 @@ func (suite *DecoderTestSuite) TestDecodeMsgUpgradeClient() { detail := make(common.JsDict) lastHeight := clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) - cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState( + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState( suite.chainA.GetContext(), path.EndpointA.ClientID, ) @@ -525,7 +553,7 @@ func (suite *DecoderTestSuite) TestDecodeMsgUpgradeClient() { "{\"client_id\":\"07-tendermint-0\",\"client_state\":{\"chain_id\":\"newChainId\",\"trust_level\":{\"numerator\":1,\"denominator\":3},\"trusting_period\":1209600000000000,\"unbonding_period\":3024000000000000,\"max_clock_drift\":10000000000,\"frozen_height\":{},\"latest_height\":{\"revision_number\":1,\"revision_height\":1},\"proof_specs\":[{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":33,\"min_prefix_length\":4,\"max_prefix_length\":12,\"hash\":1}},{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":32,\"min_prefix_length\":1,\"max_prefix_length\":1,\"hash\":1}}],\"upgrade_path\":[\"upgrade\",\"upgradedIBCState\"]},\"consensus_state\":{\"timestamp\":\"0001-01-01T00:00:00Z\",\"root\":{},\"next_validators_hash\":\"6E65787456616C7348617368\"},", ) // MsgUpgradeClient - // "{\"client_id\":\"07-tendermint-0\",\"client_state\":{\"chain_id\":\"newChainId\",\"trust_level\":{\"numerator\":1,\"denominator\":3},\"trusting_period\":1209600000000000,\"unbonding_period\":3024000000000000,\"max_clock_drift\":10000000000,\"frozen_height\":{},\"latest_height\":{\"revision_number\":1,\"revision_height\":1},\"proof_specs\":[{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":33,\"min_prefix_length\":4,\"max_prefix_length\":12,\"hash\":1}},{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":32,\"min_prefix_length\":1,\"max_prefix_length\":1,\"hash\":1}}],\"upgrade_path\":[\"upgrade\",\"upgradedIBCState\"]},\"consensus_state\":{\"timestamp\":\"0001-01-01T00:00:00Z\",\"root\":{},\"next_validators_hash\":\"6E65787456616C7348617368\"},\"proof_upgrade_client\":\"CiYSJAoidXBncmFkZWRJQkNTdGF0ZS8xOC91cGdyYWRlZENsaWVudAquAQqrAQoHdXBncmFkZRIg47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFUaCQgBGAEgASoBACIlCAESIQG2RppbdEWeFVF5h90HmJZ/OIvuBr5jbE7mh/4a8ey+lSIlCAESIQHZm7f7BAECvMg69fhmRvif+axXjaVvh7wuDvibWJVoJiIlCAESIQGbHEApyKCI6yWJSWKQnvxTXX67FeS/avKzkttknO4VoA==\",\"proof_upgrade_consensus_state\":\"CikSJwoldXBncmFkZWRJQkNTdGF0ZS8xOC91cGdyYWRlZENvbnNTdGF0ZQquAQqrAQoHdXBncmFkZRIg47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFUaCQgBGAEgASoBACIlCAESIQG2RppbdEWeFVF5h90HmJZ/OIvuBr5jbE7mh/4a8ey+lSIlCAESIQHZm7f7BAECvMg69fhmRvif+axXjaVvh7wuDvibWJVoJiIlCAESIQGbHEApyKCI6yWJSWKQnvxTXX67FeS/avKzkttknO4VoA==\",\"signer\":\"band1ws6lm89d6xenm3cms264ejvxk8rurw55t4vpl9\"}" does not contain "{\"client_id\":\"tendermint\",\"header\":{\"signed_header\":{\"header\":{\"version\":{\"block\":11,\"app\":2},\"chain_id\":\"testchain0\",\"height\":3,\"time\":\"2020-01-02T00:00:00Z\",\"last_block_id\":{\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"part_set_header\":{\"total\":10000,\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"}}" + // "{\"client_id\":\"07-tendermint-0\",\"client_state\":{\"chain_id\":\"newChainId\",\"trust_level\":{\"numerator\":1,\"denominator\":3},\"trusting_period\":1209600000000000,\"unbonding_period\":3024000000000000,\"max_clock_drift\":10000000000,\"frozen_height\":{},\"latest_height\":{\"revision_number\":1,\"revision_height\":1},\"proof_specs\":[{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":33,\"min_prefix_length\":4,\"max_prefix_length\":12,\"hash\":1}},{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":32,\"min_prefix_length\":1,\"max_prefix_length\":1,\"hash\":1}}],\"upgrade_path\":[\"upgrade\",\"upgradedIBCState\"]},\"consensus_state\":{\"timestamp\":\"0001-01-01T00:00:00Z\",\"root\":{},\"next_validators_hash\":\"6E65787456616C7348617368\"},\"proof_upgrade_client\":\"CiYSJAoidXBncmFkZWRJQkNTdGF0ZS8xOC91cGdyYWRlZENsaWVudAquAQqrAQoHdXBncmFkZRIg47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFUaCQgBGAEgASoBACIlCAESIQG2RppbdEWeFVF5h90HmJZ/OIvuBr5jbE7mh/4a8ey+lSIlCAESIQHZm7f7BAECvMg69fhmRvif+axXjaVvh7wuDvibWJVoJiIlCAESIQGbHEApyKCI6yWJSWKQnvxTXX67FeS/avKzkttknO4VoA==\",\"proof_upgrade_consensus_state\":\"CikSJwoldXBncmFkZWRJQkNTdGF0ZS8xOC91cGdyYWRlZENvbnNTdGF0ZQquAQqrAQoHdXBncmFkZRIg47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFUaCQgBGAEgASoBACIlCAESIQG2RppbdEWeFVF5h90HmJZ/OIvuBr5jbE7mh/4a8ey+lSIlCAESIQHZm7f7BAECvMg69fhmRvif+axXjaVvh7wuDvibWJVoJiIlCAESIQGbHEApyKCI6yWJSWKQnvxTXX67FeS/avKzkttknO4VoA==\",\"signer\":\"band1ws6lm89d6xenm3cms264ejvxk8rurw55t4vpl9\"}" does not contain "{\"client_id\":\"tendermint\",\"header\":{\"signed_header\":{\"header\":{\"version\":{\"block\":11,\"app\":2},\"chain_id\":\"testchain1-1\",\"height\":3,\"time\":\"2020-01-02T00:00:00Z\",\"last_block_id\":{\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"part_set_header\":{\"total\":10000,\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"}}" } func (suite *DecoderTestSuite) TestDecodeMsgSubmitMisbehaviour() { @@ -540,6 +568,7 @@ func (suite *DecoderTestSuite) TestDecodeMsgSubmitMisbehaviour() { suite.chainA.CurrentHeader.Time, suite.chainA.Vals, suite.chainA.Vals, + suite.chainA.Vals, suite.chainA.Signers, ) header2 := suite.chainA.CreateTMClientHeader( @@ -549,6 +578,7 @@ func (suite *DecoderTestSuite) TestDecodeMsgSubmitMisbehaviour() { suite.chainA.CurrentHeader.Time.Add(time.Minute), suite.chainA.Vals, suite.chainA.Vals, + suite.chainA.Vals, suite.chainA.Signers, ) @@ -563,10 +593,8 @@ func (suite *DecoderTestSuite) TestDecodeMsgSubmitMisbehaviour() { emitter.DecodeMsgSubmitMisbehaviour(msg, detail) suite.testContains( detail, - "{\"client_id\":\"tendermint\",\"misbehaviour\":{\"client_id\":\"tendermint\",\"header_1\":{\"signed_header\":{\"header\":{\"version\":{\"block\":11,\"app\":2},\"chain_id\":\"testchain0\",\"height\":3,\"time\":\"2020-01-02T00:00:00Z\",\"last_block_id\":{\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"part_set_header\":{\"total\":10000,\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"}},\"last_commit_hash\":", + "{\"client_id\":\"tendermint\",\"misbehaviour\":{\"client_id\":\"tendermint\",\"header_1\":{\"signed_header\":{\"header\":{\"version\":{\"block\":11,\"app\":2},\"chain_id\":\"testchain1-1\",\"height\":2,\"time\":\"2020-01-02T00:00:00Z\",\"last_block_id\":{\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"part_set_header\":{\"total\":10000,\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"}},\"last_commit_hash\":", ) - // MsgSubmitMisbehaviour - // "{\"client_id\":\"tendermint\",\"misbehaviour\":{\"client_id\":\"tendermint\",\"header_1\":{\"signed_header\":{\"header\":{\"version\":{\"block\":11,\"app\":2},\"chain_id\":\"testchain0\",\"height\":3,\"time\":\"2020-01-02T00:00:00Z\",\"last_block_id\":{\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"part_set_header\":{\"total\":10000,\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"}},\"last_commit_hash\":\"Gy7QPczOYJhyvkFumSNmNOYFi0beSQP7K1T3U73ZPL0=\",\"data_hash\":\"bW4ouLmLUycELqUKV91G5syFHHLlKL3qpu/e7v5moLg=\",\"validators_hash\":\"UWHAFzvn3gBH0c928WeqdiwEY4ozNcuJsbO7i/ykGlI=\",\"next_validators_hash\":\"UWHAFzvn3gBH0c928WeqdiwEY4ozNcuJsbO7i/ykGlI=\",\"consensus_hash\":\"5eVmxB7Vfj/4zBDxhBeHiLj6pgKwfPH0JSF72BefHyQ=\",\"app_hash\":\"Gy7QPczOYJhyvkFumSNmNOYFi0beSQP7K1T3U73ZPL0=\",\"last_results_hash\":\"CS4FhjAkftYAmGOhLu4RfSbNnQi1rcqrN/KrNdtHWjc=\",\"evidence_hash\":\"c4ZdsI9J1YQokF04mrTKS5bkWjIGx6adQ6Xcc3LmBxQ=\",\"proposer_address\":\"H6sPOQrXCVy4QN7pv0ealpUP1zE=\"},\"commit\":{\"height\":3,\"round\":1,\"block_id\":{\"hash\":\"4BHQI7RdQzVdZjXlV5cFTWUX8FUUyZlRZlcJz57HDzU=\",\"part_set_header\":{\"total\":3,\"hash\":\"hwgKOc/jNqZj6lwNm97vSTq9wYt8Pj4MjmYTVMGDFDI=\"}},\"signatures\":[{\"block_id_flag\":2,\"validator_address\":\"H6sPOQrXCVy4QN7pv0ealpUP1zE=\",\"timestamp\":\"2020-01-02T00:00:00Z\",\"signature\":\"QBI8sEcCn1EQv3uDlWOatFxlyfKSj8Yq9eUdrbL8Y4Yfhr5+oByFD4D91N45Cg9GFPbYpLtlb3CvEsH7oyvSHg==\"}]}},\"validator_set\":{\"validators\":[{\"address\":\"H6sPOQrXCVy4QN7pv0ealpUP1zE=\",\"pub_key\":{\"Sum\":{\"secp256k1\":\"A6/xRIwBfvDbU2TkJs4rgKexroILGVJkTRUDkDMcbUX8\"}},\"voting_power\":1}],\"proposer\":{\"address\":\"H6sPOQrXCVy4QN7pv0ealpUP1zE=\",\"pub_key\":{\"Sum\":{\"secp256k1\":\"A6/xRIwBfvDbU2TkJs4rgKexroILGVJkTRUDkDMcbUX8\"}},\"voting_power\":1},\"total_voting_power\":1},\"trusted_height\":{\"revision_height\":2},\"trusted_validators\":{\"validators\":[{\"address\":\"H6sPOQrXCVy4QN7pv0ealpUP1zE=\",\"pub_key\":{\"Sum\":{\"secp256k1\":\"A6/xRIwBfvDbU2TkJs4rgKexroILGVJkTRUDkDMcbUX8\"}},\"voting_power\":1}],\"proposer\":{\"address\":\"H6sPOQrXCVy4QN7pv0ealpUP1zE=\",\"pub_key\":{\"Sum\":{\"secp256k1\":\"A6/xRIwBfvDbU2TkJs4rgKexroILGVJkTRUDkDMcbUX8\"}},\"voting_power\":1},\"total_voting_power\":1}},\"header_2\":{\"signed_header\":{\"header\":{\"version\":{\"block\":11,\"app\":2},\"chain_id\":\"testchain0\",\"height\":3,\"time\":\"2020-01-02T00:01:00Z\",\"last_block_id\":{\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"part_set_header\":{\"total\":10000,\"hash\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"}},\"last_commit_hash\":\"Gy7QPczOYJhyvkFumSNmNOYFi0beSQP7K1T3U73ZPL0=\",\"data_hash\":\"bW4ouLmLUycELqUKV91G5syFHHLlKL3qpu/e7v5moLg=\",\"validators_hash\":\"UWHAFzvn3gBH0c928WeqdiwEY4ozNcuJsbO7i/ykGlI=\",\"next_validators_hash\":\"UWHAFzvn3gBH0c928WeqdiwEY4ozNcuJsbO7i/ykGlI=\",\"consensus_hash\":\"5eVmxB7Vfj/4zBDxhBeHiLj6pgKwfPH0JSF72BefHyQ=\",\"app_hash\":\"Gy7QPczOYJhyvkFumSNmNOYFi0beSQP7K1T3U73ZPL0=\",\"last_results_hash\":\"CS4FhjAkftYAmGOhLu4RfSbNnQi1rcqrN/KrNdtHWjc=\",\"evidence_hash\":\"c4ZdsI9J1YQokF04mrTKS5bkWjIGx6adQ6Xcc3LmBxQ=\",\"proposer_address\":\"H6sPOQrXCVy4QN7pv0ealpUP1zE=\"},\"commit\":{\"height\":3,\"round\":1,\"block_id\":{\"hash\":\"OIlOUMldL7DwSF/CwxhzwvbCkB06ZIMKLn91cGqmye4=\",\"part_set_header\":{\"total\":3,\"hash\":\"hwgKOc/jNqZj6lwNm97vSTq9wYt8Pj4MjmYTVMGDFDI=\"}},\"signatures\":[{\"block_id_flag\":2,\"validator_address\":\"H6sPOQrXCVy4QN7pv0ealpUP1zE=\",\"timestamp\":\"2020-01-02T00:01:00Z\",\"signature\":\"2IrQF/dca6yjumwFw0BK7xbfxa5r3nxV2tpYh1my3IkDYRbTM/vmCyW6BiCRSCivuhM/9eoHKK/YAQAAZh8zcg==\"}]}},\"validator_set\":{\"validators\":[{\"address\":\"H6sPOQrXCVy4QN7pv0ealpUP1zE=\",\"pub_key\":{\"Sum\":{\"secp256k1\":\"A6/xRIwBfvDbU2TkJs4rgKexroILGVJkTRUDkDMcbUX8\"}},\"voting_power\":1}],\"proposer\":{\"address\":\"H6sPOQrXCVy4QN7pv0ealpUP1zE=\",\"pub_key\":{\"Sum\":{\"secp256k1\":\"A6/xRIwBfvDbU2TkJs4rgKexroILGVJkTRUDkDMcbUX8\"}},\"voting_power\":1},\"total_voting_power\":1},\"trusted_height\":{\"revision_height\":2},\"trusted_validators\":{\"validators\":[{\"address\":\"H6sPOQrXCVy4QN7pv0ealpUP1zE=\",\"pub_key\":{\"Sum\":{\"secp256k1\":\"A6/xRIwBfvDbU2TkJs4rgKexroILGVJkTRUDkDMcbUX8\"}},\"voting_power\":1}],\"proposer\":{\"address\":\"H6sPOQrXCVy4QN7pv0ealpUP1zE=\",\"pub_key\":{\"Sum\":{\"secp256k1\":\"A6/xRIwBfvDbU2TkJs4rgKexroILGVJkTRUDkDMcbUX8\"}},\"voting_power\":1},\"total_voting_power\":1}}},\"signer\":\"band1r74s7wg26uy4ewzqmm5m73u6j62sl4e38zpnws\"}" } func (suite *DecoderTestSuite) TestDecodeMsgConnectionOpenInit() { @@ -621,7 +649,7 @@ func (suite *DecoderTestSuite) TestDecodeMsgConnectionOpenTry() { emitter.DecodeMsgConnectionOpenTry(msg, detail) suite.testCompareJson( detail, - "{\"client_id\":\"07-tendermint-0\",\"client_state\":{\"chain_id\":\"testchain0\",\"trust_level\":{\"numerator\":1,\"denominator\":3},\"trusting_period\":1209600000000000,\"unbonding_period\":1814400000000000,\"max_clock_drift\":10000000000,\"frozen_height\":{},\"latest_height\":{\"revision_height\":10},\"proof_specs\":[{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":33,\"min_prefix_length\":4,\"max_prefix_length\":12,\"hash\":1}},{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":32,\"min_prefix_length\":1,\"max_prefix_length\":1,\"hash\":1}}],\"upgrade_path\":[\"upgrade\",\"upgradedIBCState\"]},\"consensus_height\":{\"revision_height\":10,\"revision_number\":0},\"counterparty\":{\"client_id\":\"07-tendermint-0\",\"connection_id\":\"connection-0\",\"prefix\":{\"key_prefix\":\"c3RvcmVQcmVmaXhLZXk=\"}},\"counterparty_versions\":[{\"identifier\":\"1\",\"features\":[\"ORDER_ORDERED\",\"ORDER_UNORDERED\"]}],\"delay_period\":500,\"previous_connection_id\":\"\",\"proof_client\":\"\",\"proof_consensus\":\"\",\"proof_height\":{\"revision_height\":10,\"revision_number\":0},\"proof_init\":\"\",\"signer\":\"band12d5kwmn9wgqqqqqqqqqqqqqqqqqqqqqqr057wh\"}", + "{\"client_id\":\"07-tendermint-0\",\"client_state\":{\"chain_id\":\"testchain1-1\",\"trust_level\":{\"numerator\":1,\"denominator\":3},\"trusting_period\":1209600000000000,\"unbonding_period\":1814400000000000,\"max_clock_drift\":10000000000,\"frozen_height\":{},\"latest_height\":{\"revision_height\":10},\"proof_specs\":[{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":33,\"min_prefix_length\":4,\"max_prefix_length\":12,\"hash\":1}},{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":32,\"min_prefix_length\":1,\"max_prefix_length\":1,\"hash\":1}}],\"upgrade_path\":[\"upgrade\",\"upgradedIBCState\"]},\"consensus_height\":{\"revision_height\":10,\"revision_number\":0},\"counterparty\":{\"client_id\":\"07-tendermint-0\",\"connection_id\":\"connection-0\",\"prefix\":{\"key_prefix\":\"c3RvcmVQcmVmaXhLZXk=\"}},\"counterparty_versions\":[{\"identifier\":\"1\",\"features\":[\"ORDER_ORDERED\",\"ORDER_UNORDERED\"]}],\"delay_period\":500,\"previous_connection_id\":\"\",\"proof_client\":\"\",\"proof_consensus\":\"\",\"proof_height\":{\"revision_height\":10,\"revision_number\":0},\"proof_init\":\"\",\"signer\":\"band12d5kwmn9wgqqqqqqqqqqqqqqqqqqqqqqr057wh\"}", ) } @@ -653,7 +681,7 @@ func (suite *DecoderTestSuite) TestDecodeMsgConnectionOpenAck() { emitter.DecodeMsgConnectionOpenAck(msg, detail) suite.testCompareJson( detail, - "{\"client_state\":{\"chain_id\":\"testchain0\",\"trust_level\":{\"numerator\":1,\"denominator\":3},\"trusting_period\":1209600000000000,\"unbonding_period\":1814400000000000,\"max_clock_drift\":10000000000,\"frozen_height\":{},\"latest_height\":{\"revision_height\":10},\"proof_specs\":[{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":33,\"min_prefix_length\":4,\"max_prefix_length\":12,\"hash\":1}},{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":32,\"min_prefix_length\":1,\"max_prefix_length\":1,\"hash\":1}}],\"upgrade_path\":[\"upgrade\",\"upgradedIBCState\"]},\"connection_id\":\"\",\"consensus_height\":{\"revision_height\":10,\"revision_number\":0},\"counterparty_connection_id\":\"\",\"proof_client\":\"\",\"proof_consensus\":\"\",\"proof_height\":{\"revision_height\":10,\"revision_number\":0},\"proof_try\":\"\",\"signer\":\"band12d5kwmn9wgqqqqqqqqqqqqqqqqqqqqqqr057wh\",\"version\":{\"identifier\":\"1\",\"features\":[\"ORDER_ORDERED\",\"ORDER_UNORDERED\"]}}", + "{\"client_state\":{\"chain_id\":\"testchain1-1\",\"trust_level\":{\"numerator\":1,\"denominator\":3},\"trusting_period\":1209600000000000,\"unbonding_period\":1814400000000000,\"max_clock_drift\":10000000000,\"frozen_height\":{},\"latest_height\":{\"revision_height\":10},\"proof_specs\":[{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":33,\"min_prefix_length\":4,\"max_prefix_length\":12,\"hash\":1}},{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":32,\"min_prefix_length\":1,\"max_prefix_length\":1,\"hash\":1}}],\"upgrade_path\":[\"upgrade\",\"upgradedIBCState\"]},\"connection_id\":\"\",\"consensus_height\":{\"revision_height\":10,\"revision_number\":0},\"counterparty_connection_id\":\"\",\"proof_client\":\"\",\"proof_consensus\":\"\",\"proof_height\":{\"revision_height\":10,\"revision_number\":0},\"proof_try\":\"\",\"signer\":\"band12d5kwmn9wgqqqqqqqqqqqqqqqqqqqqqqr057wh\",\"version\":{\"identifier\":\"1\",\"features\":[\"ORDER_ORDERED\",\"ORDER_UNORDERED\"]}}", ) } diff --git a/hooks/emitter/distribution.go b/hooks/emitter/distribution.go index 0f5a51351..3c0af87bf 100644 --- a/hooks/emitter/distribution.go +++ b/hooks/emitter/distribution.go @@ -4,15 +4,15 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/bandprotocol/chain/v2/hooks/common" + "github.com/bandprotocol/chain/v3/hooks/common" ) func (h *Hook) getCurrentRewardAndCurrentRatio(ctx sdk.Context, addr sdk.ValAddress) (string, string) { currentReward := "0" currentRatio := "0" - reward := h.distrKeeper.GetValidatorCurrentRewards(ctx, addr) - latestReward := h.distrKeeper.GetValidatorHistoricalRewards(ctx, addr, reward.Period-1) + reward, _ := h.distrKeeper.GetValidatorCurrentRewards(ctx, addr) + latestReward, _ := h.distrKeeper.GetValidatorHistoricalRewards(ctx, addr, reward.Period-1) if !reward.Rewards.IsZero() { currentReward = reward.Rewards[0].Amount.String() @@ -26,7 +26,8 @@ func (h *Hook) getCurrentRewardAndCurrentRatio(ctx sdk.Context, addr sdk.ValAddr func (h *Hook) emitUpdateValidatorRewardAndAccumulatedCommission(ctx sdk.Context, addr sdk.ValAddress) { currentReward, currentRatio := h.getCurrentRewardAndCurrentRatio(ctx, addr) - accCommission, _ := h.distrKeeper.GetValidatorAccumulatedCommission(ctx, addr).Commission.TruncateDecimal() + valCommission, _ := h.distrKeeper.GetValidatorAccumulatedCommission(ctx, addr) + accCommission, _ := valCommission.Commission.TruncateDecimal() h.Write("UPDATE_VALIDATOR", common.JsDict{ "operator_address": addr.String(), "current_reward": currentReward, @@ -50,7 +51,7 @@ func (h *Hook) handleMsgWithdrawDelegatorReward( ) { valAddr, _ := sdk.ValAddressFromBech32(msg.ValidatorAddress) delAddr, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) - withdrawAddr := h.distrKeeper.GetDelegatorWithdrawAddr(ctx, delAddr) + withdrawAddr, _ := h.distrKeeper.GetDelegatorWithdrawAddr(ctx, delAddr) h.AddAccountsInTx(withdrawAddr.String()) h.emitUpdateValidatorReward(ctx, valAddr) h.emitDelegationAfterWithdrawReward(ctx, valAddr, withdrawAddr) @@ -73,7 +74,7 @@ func (h *Hook) handleMsgWithdrawValidatorCommission( ) { delAddr, _ := sdk.AccAddressFromBech32(msg.ValidatorAddress) valAddr, _ := sdk.ValAddressFromBech32(msg.ValidatorAddress) - withdrawAddr := h.distrKeeper.GetDelegatorWithdrawAddr(ctx, delAddr) + withdrawAddr, _ := h.distrKeeper.GetDelegatorWithdrawAddr(ctx, delAddr) h.AddAccountsInTx(withdrawAddr.String()) h.emitUpdateValidatorRewardAndAccumulatedCommission(ctx, valAddr) val, _ := h.stakingKeeper.GetValidator(ctx, valAddr) diff --git a/hooks/emitter/emitter.go b/hooks/emitter/emitter.go index e2b0fde59..d06e9266f 100644 --- a/hooks/emitter/emitter.go +++ b/hooks/emitter/emitter.go @@ -3,16 +3,29 @@ package emitter import ( "context" "encoding/json" + "fmt" "strings" "time" + "github.com/segmentio/kafka-go" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/crypto/tmhash" tmjson "github.com/cometbft/cometbft/libs/json" + types1 "github.com/cometbft/cometbft/proto/tendermint/types" + + icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper" + clientkeeper "github.com/cosmos/ibc-go/v8/modules/core/02-client/keeper" + connectionkeeper "github.com/cosmos/ibc-go/v8/modules/core/03-connection/keeper" + channelkeeper "github.com/cosmos/ibc-go/v8/modules/core/04-channel/keeper" + + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" "github.com/cosmos/cosmos-sdk/x/authz" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -26,23 +39,16 @@ import ( mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" - clientkeeper "github.com/cosmos/ibc-go/v7/modules/core/02-client/keeper" - connectionkeeper "github.com/cosmos/ibc-go/v7/modules/core/03-connection/keeper" - channelkeeper "github.com/cosmos/ibc-go/v7/modules/core/04-channel/keeper" - "github.com/segmentio/kafka-go" - "github.com/bandprotocol/chain/v2/app/params" - "github.com/bandprotocol/chain/v2/hooks/common" - oraclekeeper "github.com/bandprotocol/chain/v2/x/oracle/keeper" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/hooks/common" + oraclekeeper "github.com/bandprotocol/chain/v3/x/oracle/keeper" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) // Hook uses Kafka functionality to act as an event producer for all events in the blockchains. type Hook struct { - cdc codec.Codec - legecyAmino *codec.LegacyAmino - encodingConfig params.EncodingConfig + cdc codec.Codec + txConfig client.TxConfig // Main Kafka writer instance. writer *kafka.Writer // Temporary variables that are reset on every block. @@ -56,7 +62,7 @@ type Hook struct { stakingKeeper *stakingkeeper.Keeper mintKeeper mintkeeper.Keeper distrKeeper distrkeeper.Keeper - govKeeper govkeeper.Keeper + govKeeper *govkeeper.Keeper groupKeeper groupkeeper.Keeper oracleKeeper oraclekeeper.Keeper icahostKeeper icahostkeeper.Keeper @@ -72,14 +78,13 @@ type Hook struct { // NewHook creates an emitter hook instance that will be added in Band App. func NewHook( cdc codec.Codec, - legecyAmino *codec.LegacyAmino, - encodingConfig params.EncodingConfig, + txConfig client.TxConfig, accountKeeper authkeeper.AccountKeeper, bankKeeper bankkeeper.Keeper, stakingKeeper *stakingkeeper.Keeper, mintKeeper mintkeeper.Keeper, distrKeeper distrkeeper.Keeper, - govKeeper govkeeper.Keeper, + govKeeper *govkeeper.Keeper, groupKeeper groupkeeper.Keeper, oracleKeeper oraclekeeper.Keeper, icahostKeeper icahostkeeper.Keeper, @@ -92,9 +97,8 @@ func NewHook( ) *Hook { paths := strings.SplitN(kafkaURI, "@", 2) return &Hook{ - cdc: cdc, - legecyAmino: legecyAmino, - encodingConfig: encodingConfig, + cdc: cdc, + txConfig: txConfig, writer: kafka.NewWriter(kafka.WriterConfig{ Brokers: paths[1:], Topic: paths[0], @@ -152,7 +156,7 @@ func (h *Hook) FlushMessages() { } // AfterInitChain specify actions need to do after chain initialization (app.Hook interface). -func (h *Hook) AfterInitChain(ctx sdk.Context, req abci.RequestInitChain, res abci.ResponseInitChain) { +func (h *Hook) AfterInitChain(ctx sdk.Context, req *abci.RequestInitChain, res *abci.ResponseInitChain) { var genesisState map[string]json.RawMessage if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { panic(err) @@ -172,7 +176,7 @@ func (h *Hook) AfterInitChain(ctx sdk.Context, req abci.RequestInitChain, res ab h.cdc.MustUnmarshalJSON(genesisState[genutiltypes.ModuleName], &genutilState) for _, genTx := range genutilState.GenTxs { var tx sdk.Tx - tx, err := h.encodingConfig.TxConfig.TxJSONDecoder()(genTx) + tx, err := h.txConfig.TxJSONDecoder()(genTx) if err != nil { panic(err) } @@ -187,7 +191,7 @@ func (h *Hook) AfterInitChain(ctx sdk.Context, req abci.RequestInitChain, res ab var stakingState stakingtypes.GenesisState h.cdc.MustUnmarshalJSON(genesisState[stakingtypes.ModuleName], &stakingState) for _, val := range stakingState.Validators { - h.emitSetValidator(ctx, val.GetOperator()) + h.emitSetValidator(ctx, MustParseValAddress(val.GetOperator())) } for _, del := range stakingState.Delegations { @@ -318,7 +322,7 @@ func (h *Hook) AfterInitChain(ctx sdk.Context, req abci.RequestInitChain, res ab } // AfterBeginBlock specify actions need to do after begin block period (app.Hook interface). -func (h *Hook) AfterBeginBlock(ctx sdk.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) { +func (h *Hook) AfterBeginBlock(ctx sdk.Context, req *abci.RequestFinalizeBlock, events []abci.Event) { h.accsInBlock = make(map[string]bool) h.accsInTx = make(map[string]bool) h.msgs = []common.Message{} @@ -327,15 +331,15 @@ func (h *Hook) AfterBeginBlock(ctx sdk.Context, req abci.RequestBeginBlock, res // h.emitStartState = false // h.emitNonHistoricalState(ctx) } else { - for _, val := range req.GetLastCommitInfo().Votes { - validator := h.stakingKeeper.ValidatorByConsAddr(ctx, val.GetValidator().Address) + for _, val := range req.DecidedLastCommit.Votes { + validator, _ := h.stakingKeeper.ValidatorByConsAddr(ctx, val.Validator.Address) conAddr, _ := validator.GetConsAddr() h.Write("NEW_VALIDATOR_VOTE", common.JsDict{ - "consensus_address": conAddr.String(), - "block_height": req.Header.GetHeight() - 1, - "voted": val.GetSignedLastBlock(), + "consensus_address": sdk.ConsAddress(conAddr).String(), + "block_height": req.Height - 1, + "voted": val.BlockIdFlag == types1.BlockIDFlagCommit, }) - h.emitUpdateValidatorRewardAndAccumulatedCommission(ctx, validator.GetOperator()) + h.emitUpdateValidatorRewardAndAccumulatedCommission(ctx, MustParseValAddress(validator.GetOperator())) } } totalSupply := make([]string, 0) @@ -343,29 +347,28 @@ func (h *Hook) AfterBeginBlock(ctx sdk.Context, req abci.RequestBeginBlock, res totalSupply = append(totalSupply, coin.String()) return true }) + minter, _ := h.mintKeeper.Minter.Get(ctx) + h.Write("NEW_BLOCK", common.JsDict{ - "height": req.Header.GetHeight(), + "height": ctx.BlockHeight(), "timestamp": ctx.BlockTime().UnixNano(), - "proposer": sdk.ConsAddress(req.Header.GetProposerAddress()).String(), - "hash": req.GetHash(), - "inflation": h.mintKeeper.GetMinter(ctx).Inflation.String(), + // "proposer": sdk.ConsAddress(req.Header.GetProposerAddress()).String(), + "proposer": sdk.ConsAddress(ctx.BlockHeader().ProposerAddress).String(), + "hash": ctx.HeaderHash(), + "inflation": minter.Inflation.String(), "supply": totalSupply, }) - for _, event := range res.Events { + for _, event := range events { h.handleBeginBlockEndBlockEvent(ctx, event) } } // AfterDeliverTx specify actions need to do after transaction has been processed (app.Hook interface). -func (h *Hook) AfterDeliverTx(ctx sdk.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) { +func (h *Hook) AfterDeliverTx(ctx sdk.Context, tx sdk.Tx, res *abci.ExecTxResult) { if ctx.BlockHeight() == 0 { return } h.accsInTx = make(map[string]bool) - tx, err := h.encodingConfig.TxConfig.TxDecoder()(req.Tx) - if err != nil { - return - } feeTx, ok := tx.(sdk.FeeTx) if !ok { return @@ -375,44 +378,52 @@ func (h *Hook) AfterDeliverTx(ctx sdk.Context, req abci.RequestDeliverTx, res ab return } - txHash := tmhash.Sum(req.Tx) - var errMsg *string - if !res.IsOK() { - errMsg = &res.Log + sigTx, ok := tx.(authsigning.SigVerifiableTx) + if !ok { + return } + rawTx, _ := h.txConfig.TxEncoder()(tx) + txHash := tmhash.Sum(rawTx) + + signers, _ := sigTx.GetSigners() + txDict := common.JsDict{ "hash": txHash, "block_height": ctx.BlockHeight(), "gas_used": res.GasUsed, "gas_limit": feeTx.GetGas(), "gas_fee": feeTx.GetFee().String(), - "err_msg": errMsg, - "sender": tx.GetMsgs()[0].GetSigners()[0].String(), + "sender": sdk.AccAddress(signers[0]).String(), "success": res.IsOK(), "memo": memoTx.GetMemo(), - "fee_payer": feeTx.FeeGranter(), + "fee_payer": sdk.AccAddress(feeTx.FeeGranter()).String(), + } + if !res.IsOK() { + txDict["err_msg"] = fmt.Sprintf("Error on codespace %s: with code %d", res.Codespace, res.Code) } + // NOTE: We add txDict to the list of pending Kafka messages here, but it will still be // mutated in the loop below as we know the messages won't get flushed until ABCI Commit. h.Write("NEW_TRANSACTION", txDict) - logs, _ := sdk.ParseABCILogs(res.Log) // Error must always be nil if res.IsOK is true. messages := []map[string]interface{}{} - for idx, msg := range tx.GetMsgs() { + txMsgs := tx.GetMsgs() + // Tx events not used yet + _, events := splitTxEvents(len(txMsgs), res.Events) + for i, msg := range txMsgs { detail := make(common.JsDict) DecodeMsg(msg, detail) if res.IsOK() { - h.handleMsg(ctx, txHash, msg, logs[idx], detail) + h.handleMsg(ctx, txHash, msg, events[i], detail) } messages = append(messages, common.JsDict{ "msg": detail, "type": sdk.MsgTypeURL(msg), }) } - signers := tx.GetMsgs()[0].GetSigners() addrs := make([]string, len(signers)) for idx, signer := range signers { - addrs[idx] = signer.String() + addrs[idx] = sdk.AccAddress(signer).String() } h.AddAccountsInTx(addrs...) relatedAccounts := make([]string, 0, len(h.accsInBlock)) @@ -429,21 +440,21 @@ func (h *Hook) AfterDeliverTx(ctx sdk.Context, req abci.RequestDeliverTx, res ab } // AfterEndBlock specify actions need to do after end block period (app.Hook interface). -func (h *Hook) AfterEndBlock(ctx sdk.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) { +func (h *Hook) AfterEndBlock(ctx sdk.Context, events []abci.Event) { // update group proposals when voting period is end timeBytes := sdk.FormatTimeBytes(ctx.BlockTime().UTC()) lenTimeByte := byte(len(timeBytes)) prefix := []byte{groupkeeper.ProposalsByVotingPeriodEndPrefix} iterator := ctx.KVStore(h.groupStoreKey). - Iterator(prefix, sdk.PrefixEndBytes(append(append(prefix, lenTimeByte), timeBytes...))) + Iterator(prefix, storetypes.PrefixEndBytes(append(append(prefix, lenTimeByte), timeBytes...))) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { proposalID, _ := splitKeyWithTime(iterator.Key()) h.doUpdateGroupProposal(ctx, proposalID) } - for _, event := range res.Events { + for _, event := range events { h.handleBeginBlockEndBlockEvent(ctx, event) } // Update balances of all affected accounts on this block. @@ -461,7 +472,7 @@ func (h *Hook) AfterEndBlock(ctx sdk.Context, req abci.RequestEndBlock, res abci } h.msgs = append(modifiedMsgs, h.msgs[1:]...) - h.Write("COMMIT", common.JsDict{"height": req.Height}) + h.Write("COMMIT", common.JsDict{"height": ctx.BlockHeight()}) } func (h *Hook) RequestSearch( diff --git a/hooks/emitter/gov.go b/hooks/emitter/gov.go index 4e64926d7..5271b548d 100644 --- a/hooks/emitter/gov.go +++ b/hooks/emitter/gov.go @@ -1,12 +1,14 @@ package emitter import ( + "cosmossdk.io/collections" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/bandprotocol/chain/v2/hooks/common" + "github.com/bandprotocol/chain/v3/hooks/common" ) var ( @@ -16,7 +18,7 @@ var ( ) func (h *Hook) emitSetDeposit(ctx sdk.Context, txHash []byte, id uint64, depositor sdk.AccAddress) { - deposit, _ := h.govKeeper.GetDeposit(ctx, id, depositor) + deposit, _ := h.govKeeper.Deposits.Get(ctx, collections.Join(id, depositor)) h.Write("SET_DEPOSIT", common.JsDict{ "proposal_id": id, "depositor": depositor, @@ -26,7 +28,7 @@ func (h *Hook) emitSetDeposit(ctx sdk.Context, txHash []byte, id uint64, deposit } func (h *Hook) emitUpdateProposalAfterDeposit(ctx sdk.Context, id uint64) { - proposal, _ := h.govKeeper.GetProposal(ctx, id) + proposal, _ := h.govKeeper.Proposals.Get(ctx, id) h.Write("UPDATE_PROPOSAL", common.JsDict{ "id": id, "status": int(proposal.Status), @@ -85,7 +87,7 @@ func (h *Hook) handleMsgSubmitProposal( ctx sdk.Context, txHash []byte, msg *v1.MsgSubmitProposal, evMap common.EvMap, detail common.JsDict, ) { proposalId := uint64(common.Atoi(evMap[types.EventTypeSubmitProposal+"."+types.AttributeKeyProposalID][0])) - proposal, _ := h.govKeeper.GetProposal(ctx, proposalId) + proposal, _ := h.govKeeper.Proposals.Get(ctx, proposalId) subMsg := proposal.Messages[0].GetCachedValue() switch subMsg := subMsg.(type) { @@ -136,7 +138,7 @@ func (h *Hook) handleV1beta1MsgSubmitProposal( ctx sdk.Context, txHash []byte, msg *v1beta1.MsgSubmitProposal, evMap common.EvMap, detail common.JsDict, ) { proposalId := uint64(common.Atoi(evMap[types.EventTypeSubmitProposal+"."+types.AttributeKeyProposalID][0])) - proposal, _ := h.govKeeper.GetProposal(ctx, proposalId) + proposal, _ := h.govKeeper.Proposals.Get(ctx, proposalId) content := msg.GetContent() h.Write("NEW_PROPOSAL", common.JsDict{ @@ -166,7 +168,7 @@ func (h *Hook) handleMsgDeposit( depositor, _ := sdk.AccAddressFromBech32(msg.Depositor) h.emitSetDeposit(ctx, txHash, msg.ProposalId, depositor) h.emitUpdateProposalAfterDeposit(ctx, msg.ProposalId) - proposal, _ := h.govKeeper.GetProposal(ctx, msg.ProposalId) + proposal, _ := h.govKeeper.Proposals.Get(ctx, msg.ProposalId) detail["title"] = proposal.Title } @@ -178,7 +180,7 @@ func (h *Hook) handleV1beta1MsgDeposit( depositor, _ := sdk.AccAddressFromBech32(msg.Depositor) h.emitSetDeposit(ctx, txHash, msg.ProposalId, depositor) h.emitUpdateProposalAfterDeposit(ctx, msg.ProposalId) - proposal, _ := h.govKeeper.GetProposal(ctx, msg.ProposalId) + proposal, _ := h.govKeeper.Proposals.Get(ctx, msg.ProposalId) detail["title"] = proposal.Title } @@ -192,7 +194,7 @@ func (h *Hook) handleMsgVote( "tx_hash": txHash, } h.emitSetVoteWeighted(setVoteWeighted, v1.NewNonSplitVoteOption(msg.Option)) - proposal, _ := h.govKeeper.GetProposal(ctx, msg.ProposalId) + proposal, _ := h.govKeeper.Proposals.Get(ctx, msg.ProposalId) detail["title"] = proposal.Title } @@ -206,7 +208,7 @@ func (h *Hook) handleV1beta1MsgVote( "tx_hash": txHash, } h.emitV1beta1SetVoteWeighted(setVoteWeighted, v1beta1.NewNonSplitVoteOption(msg.Option)) - proposal, _ := h.govKeeper.GetProposal(ctx, msg.ProposalId) + proposal, _ := h.govKeeper.Proposals.Get(ctx, msg.ProposalId) detail["title"] = proposal.Title } @@ -220,7 +222,7 @@ func (h *Hook) handleMsgVoteWeighted( "tx_hash": txHash, } h.emitSetVoteWeighted(setVoteWeighted, msg.Options) - proposal, _ := h.govKeeper.GetProposal(ctx, msg.ProposalId) + proposal, _ := h.govKeeper.Proposals.Get(ctx, msg.ProposalId) detail["title"] = proposal.Title } @@ -234,7 +236,7 @@ func (h *Hook) handleV1beta1MsgVoteWeighted( "tx_hash": txHash, } h.emitV1beta1SetVoteWeighted(setVoteWeighted, msg.Options) - proposal, _ := h.govKeeper.GetProposal(ctx, msg.ProposalId) + proposal, _ := h.govKeeper.Proposals.Get(ctx, msg.ProposalId) detail["title"] = proposal.Title } @@ -247,11 +249,12 @@ func (h *Hook) handleEventInactiveProposal(evMap common.EvMap) { func (h *Hook) handleEventTypeActiveProposal(ctx sdk.Context, evMap common.EvMap) { id := uint64(common.Atoi(evMap[types.EventTypeActiveProposal+"."+types.AttributeKeyProposalID][0])) - proposal, _ := h.govKeeper.GetProposal(ctx, id) + proposal, _ := h.govKeeper.Proposals.Get(ctx, id) + totalBond, _ := h.stakingKeeper.TotalBondedTokens(ctx) h.Write("UPDATE_PROPOSAL", common.JsDict{ "id": id, "status": int(proposal.Status), - "total_bonded_tokens": h.stakingKeeper.TotalBondedTokens(ctx), + "total_bonded_tokens": totalBond, "yes_vote": proposal.FinalTallyResult.YesCount, "no_vote": proposal.FinalTallyResult.NoCount, "no_with_veto_vote": proposal.FinalTallyResult.NoWithVetoCount, diff --git a/hooks/emitter/group.go b/hooks/emitter/group.go index bb1f79cc9..8da32908a 100644 --- a/hooks/emitter/group.go +++ b/hooks/emitter/group.go @@ -4,12 +4,13 @@ import ( "encoding/json" "strings" + proto "github.com/cosmos/gogoproto/proto" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/group" - proto "github.com/cosmos/gogoproto/proto" - "github.com/bandprotocol/chain/v2/hooks/common" + "github.com/bandprotocol/chain/v3/hooks/common" ) func extractStringFromEventMap(evMap common.EvMap, event string, topic string) string { @@ -24,7 +25,7 @@ func (h *Hook) handleGroupMsgCreateGroup( common.Atoi(extractStringFromEventMap(evMap, proto.MessageName(&group.EventCreateGroup{}), "group_id")), ) groupInfoResponse, _ := h.groupKeeper.GroupInfo( - sdk.WrapSDKContext(ctx), + ctx, &group.QueryGroupInfoRequest{GroupId: groupId}, ) groupInfo := groupInfoResponse.Info @@ -45,7 +46,7 @@ func (h *Hook) handleGroupMsgCreateGroupPolicy( ) { policyAddress := extractStringFromEventMap(evMap, proto.MessageName(&group.EventCreateGroupPolicy{}), "address") groupPolicyResponse, _ := h.groupKeeper.GroupPolicyInfo( - sdk.WrapSDKContext(ctx), + ctx, &group.QueryGroupPolicyInfoRequest{ Address: policyAddress, }, @@ -80,7 +81,7 @@ func (h *Hook) handleGroupMsgSubmitProposal( common.Atoi(extractStringFromEventMap(evMap, proto.MessageName(&group.EventSubmitProposal{}), "proposal_id")), ) proposalResponse, _ := h.groupKeeper.Proposal( - sdk.WrapSDKContext(ctx), + ctx, &group.QueryProposalRequest{ProposalId: proposalId}, ) proposal := proposalResponse.Proposal @@ -122,7 +123,7 @@ func (h *Hook) handleGroupMsgVote( common.Atoi(extractStringFromEventMap(evMap, proto.MessageName(&group.EventVote{}), "proposal_id")), ) voteResponse, err := h.groupKeeper.VoteByProposalVoter( - sdk.WrapSDKContext(ctx), + ctx, &group.QueryVoteByProposalVoterRequest{ ProposalId: proposalId, Voter: msg.Voter, @@ -279,7 +280,7 @@ func (h *Hook) handleGroupEventProposalPruned( func (h *Hook) doUpdateGroup(ctx sdk.Context, groupId uint64) { groupInfoResponse, _ := h.groupKeeper.GroupInfo( - sdk.WrapSDKContext(ctx), + ctx, &group.QueryGroupInfoRequest{GroupId: groupId}, ) groupInfo := groupInfoResponse.Info @@ -295,7 +296,7 @@ func (h *Hook) doUpdateGroup(ctx sdk.Context, groupId uint64) { func (h *Hook) doUpdateGroupPolicy(ctx sdk.Context, policyAddress string) { groupPolicyResponse, _ := h.groupKeeper.GroupPolicyInfo( - sdk.WrapSDKContext(ctx), + ctx, &group.QueryGroupPolicyInfoRequest{ Address: policyAddress, }, @@ -317,7 +318,7 @@ func (h *Hook) doUpdateGroupPolicy(ctx sdk.Context, policyAddress string) { func (h *Hook) doAbortProposals(ctx sdk.Context, policyAddress string) { groupProposalsResponse, _ := h.groupKeeper.ProposalsByGroupPolicy( - sdk.WrapSDKContext(ctx), + ctx, &group.QueryProposalsByGroupPolicyRequest{ Address: policyAddress, }, @@ -333,7 +334,7 @@ func (h *Hook) doAbortProposals(ctx sdk.Context, policyAddress string) { break } groupProposalsResponse, _ = h.groupKeeper.ProposalsByGroupPolicy( - sdk.WrapSDKContext(ctx), + ctx, &group.QueryProposalsByGroupPolicyRequest{ Address: policyAddress, Pagination: &query.PageRequest{ @@ -346,7 +347,7 @@ func (h *Hook) doAbortProposals(ctx sdk.Context, policyAddress string) { func (h *Hook) doUpdateGroupProposal(ctx sdk.Context, proposalId uint64) { proposalResponse, _ := h.groupKeeper.Proposal( - sdk.WrapSDKContext(ctx), + ctx, &group.QueryProposalRequest{ProposalId: proposalId}, ) proposal := proposalResponse.Proposal @@ -382,7 +383,7 @@ func (h *Hook) doUpdateGroupProposal(ctx sdk.Context, proposalId uint64) { func (h *Hook) doAddGroupMembers(ctx sdk.Context, groupId uint64) { groupMembersResponse, _ := h.groupKeeper.GroupMembers( - sdk.WrapSDKContext(ctx), + ctx, &group.QueryGroupMembersRequest{GroupId: groupId}, ) for { @@ -400,7 +401,7 @@ func (h *Hook) doAddGroupMembers(ctx sdk.Context, groupId uint64) { break } groupMembersResponse, _ = h.groupKeeper.GroupMembers( - sdk.WrapSDKContext(ctx), + ctx, &group.QueryGroupMembersRequest{ GroupId: groupId, Pagination: &query.PageRequest{ diff --git a/hooks/emitter/handler.go b/hooks/emitter/handler.go index a20d917b8..97f4b4841 100644 --- a/hooks/emitter/handler.go +++ b/hooks/emitter/handler.go @@ -4,6 +4,13 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" + + proto "github.com/cosmos/gogoproto/proto" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" "github.com/cosmos/cosmos-sdk/x/authz" @@ -15,17 +22,12 @@ import ( "github.com/cosmos/cosmos-sdk/x/group" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - proto "github.com/cosmos/gogoproto/proto" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - "github.com/bandprotocol/chain/v2/hooks/common" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/hooks/common" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) -func parseEvents(events sdk.StringEvents) common.EvMap { +func parseEvents(events []abci.Event) common.EvMap { evMap := make(common.EvMap) for _, event := range events { for _, kv := range event.Attributes { @@ -38,8 +40,8 @@ func parseEvents(events sdk.StringEvents) common.EvMap { // handleMsg handles the given message by publishing relevant events and populates accounts // that need balance update in 'h.accs'. Also fills in extra info for this message. -func (h *Hook) handleMsg(ctx sdk.Context, txHash []byte, msg sdk.Msg, log sdk.ABCIMessageLog, detail common.JsDict) { - evMap := parseEvents(log.Events) +func (h *Hook) handleMsg(ctx sdk.Context, txHash []byte, msg sdk.Msg, events []abci.Event, detail common.JsDict) { + evMap := parseEvents(events) switch msg := msg.(type) { case *oracletypes.MsgRequestData: h.handleMsgRequestData(ctx, txHash, msg, evMap, detail) @@ -94,7 +96,7 @@ func (h *Hook) handleMsg(ctx sdk.Context, txHash []byte, msg sdk.Msg, log sdk.AB case *govv1.MsgDeposit: h.handleMsgDeposit(ctx, txHash, msg, detail) case *channeltypes.MsgRecvPacket: - h.handleMsgRecvPacket(ctx, txHash, msg, evMap, log, detail) + h.handleMsgRecvPacket(ctx, txHash, msg, events, evMap, detail) case *transfertypes.MsgTransfer: h.handleMsgTransfer(ctx, txHash, msg, evMap, detail) case *clienttypes.MsgCreateClient: @@ -124,7 +126,7 @@ func (h *Hook) handleMsg(ctx sdk.Context, txHash []byte, msg sdk.Msg, log sdk.AB case *authz.MsgRevoke: h.handleMsgRevoke(msg, detail) case *authz.MsgExec: - h.handleMsgExec(ctx, txHash, msg, log, detail) + h.handleMsgExec(ctx, txHash, msg, events, detail) case *group.MsgCreateGroup: h.handleGroupMsgCreateGroup(ctx, evMap) case *group.MsgCreateGroupPolicy: @@ -160,8 +162,7 @@ func (h *Hook) handleMsg(ctx sdk.Context, txHash []byte, msg sdk.Msg, log sdk.AB } func (h *Hook) handleBeginBlockEndBlockEvent(ctx sdk.Context, event abci.Event) { - events := sdk.StringifyEvents([]abci.Event{event}) - evMap := parseEvents(events) + evMap := parseEvents([]abci.Event{event}) switch event.Type { case oracletypes.EventTypeResolve: h.handleEventRequestExecute(ctx, evMap) diff --git a/hooks/emitter/oracle.go b/hooks/emitter/oracle.go index bb6493c28..b981e25dc 100644 --- a/hooks/emitter/oracle.go +++ b/hooks/emitter/oracle.go @@ -1,11 +1,12 @@ package emitter import ( + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/hooks/common" - oraclekeeper "github.com/bandprotocol/chain/v2/x/oracle/keeper" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/hooks/common" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) func parseBytes(b []byte) []byte { @@ -60,9 +61,9 @@ func (h *Hook) emitRawRequestAndValRequest( for id, raw := range req.RawRequests { fee, err := sdk.ParseCoinNormalized(evMap[types.EventTypeRawRequest+"."+types.AttributeKeyFee][id]) if err != nil { - fee = sdk.NewCoin("uband", sdk.NewInt(0)) + fee = sdk.NewCoin("uband", math.NewInt(0)) } - fee.Amount = fee.Amount.Mul(sdk.NewInt(int64(len(req.RequestedValidators)))) + fee.Amount = fee.Amount.Mul(math.NewInt(int64(len(req.RequestedValidators)))) h.Write("NEW_RAW_REQUEST", common.JsDict{ "request_id": requestID, "external_id": raw.ExternalID, @@ -127,7 +128,7 @@ func (h *Hook) handleMsgRequestData( ) { var prepareGasUsed uint64 if eventRequestGasUsed, ok := evMap[types.EventTypeRequest+"."+types.AttributeKeyGasUsed]; ok { - prepareGasUsed = oraclekeeper.ConvertToGas(common.Atoui(eventRequestGasUsed[0])) + prepareGasUsed = ConvertToGas(common.Atoui(eventRequestGasUsed[0])) } id := types.RequestID(common.Atoi(evMap[types.EventTypeRequest+"."+types.AttributeKeyID][0])) @@ -222,7 +223,7 @@ func (h *Hook) handleMsgEditOracleScript( func (h *Hook) handleEventRequestExecute(ctx sdk.Context, evMap common.EvMap) { var executeGasUsed uint64 if eventResolveGasUsed, ok := evMap[types.EventTypeResolve+"."+types.AttributeKeyGasUsed]; ok { - executeGasUsed = oraclekeeper.ConvertToGas(common.Atoui(eventResolveGasUsed[0])) + executeGasUsed = ConvertToGas(common.Atoui(eventResolveGasUsed[0])) } if reasons, ok := evMap[types.EventTypeResolve+"."+types.AttributeKeyReason]; ok { diff --git a/hooks/emitter/slashing.go b/hooks/emitter/slashing.go index 2e740d07e..27443105c 100644 --- a/hooks/emitter/slashing.go +++ b/hooks/emitter/slashing.go @@ -4,7 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/bandprotocol/chain/v2/hooks/common" + "github.com/bandprotocol/chain/v3/hooks/common" ) // handleEventSlash implements emitter handler for Slashing event. diff --git a/hooks/emitter/staking.go b/hooks/emitter/staking.go index b25a7595c..e797cb8a1 100644 --- a/hooks/emitter/staking.go +++ b/hooks/emitter/staking.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/bandprotocol/chain/v2/hooks/common" + "github.com/bandprotocol/chain/v3/hooks/common" ) var ( @@ -18,7 +18,8 @@ var ( func (h *Hook) emitSetValidator(ctx sdk.Context, addr sdk.ValAddress) types.Validator { val, _ := h.stakingKeeper.GetValidator(ctx, addr) currentReward, currentRatio := h.getCurrentRewardAndCurrentRatio(ctx, addr) - accCommission, _ := h.distrKeeper.GetValidatorAccumulatedCommission(ctx, addr).Commission.TruncateDecimal() + valAccComm, _ := h.distrKeeper.GetValidatorAccumulatedCommission(ctx, addr) + accCommission, _ := valAccComm.Commission.TruncateDecimal() pub, _ := val.ConsPubKey() h.Write("SET_VALIDATOR", common.JsDict{ @@ -46,8 +47,8 @@ func (h *Hook) emitSetValidator(ctx sdk.Context, addr sdk.ValAddress) types.Vali } func (h *Hook) emitUpdateValidator(ctx sdk.Context, addr sdk.ValAddress) (types.Validator, bool) { - val, found := h.stakingKeeper.GetValidator(ctx, addr) - if !found { + val, err := h.stakingKeeper.GetValidator(ctx, addr) + if err != nil { h.Write("UPDATE_VALIDATOR", common.JsDict{ "operator_address": addr.String(), "tokens": 0, @@ -94,19 +95,19 @@ func (h *Hook) emitDelegationAfterWithdrawReward( } func (h *Hook) emitDelegation(ctx sdk.Context, operatorAddress sdk.ValAddress, delegatorAddress sdk.AccAddress) { - delegation, found := h.stakingKeeper.GetDelegation(ctx, delegatorAddress, operatorAddress) - if found { - _, ratio := h.getCurrentRewardAndCurrentRatio(ctx, operatorAddress) - h.Write("SET_DELEGATION", common.JsDict{ + delegation, err := h.stakingKeeper.GetDelegation(ctx, delegatorAddress, operatorAddress) + if err != nil { + h.Write("REMOVE_DELEGATION", common.JsDict{ "delegator_address": delegatorAddress, "operator_address": operatorAddress, - "shares": delegation.Shares.String(), - "last_ratio": ratio, }) } else { - h.Write("REMOVE_DELEGATION", common.JsDict{ + _, ratio := h.getCurrentRewardAndCurrentRatio(ctx, operatorAddress) + h.Write("SET_DELEGATION", common.JsDict{ "delegator_address": delegatorAddress, "operator_address": operatorAddress, + "shares": delegation.Shares.String(), + "last_ratio": ratio, }) } } @@ -116,9 +117,8 @@ func (h *Hook) handleMsgCreateValidator( ctx sdk.Context, msg *types.MsgCreateValidator, detail common.JsDict, ) { valAddr, _ := sdk.ValAddressFromBech32(msg.ValidatorAddress) - delAddr, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) val := h.emitSetValidator(ctx, valAddr) - h.emitDelegation(ctx, valAddr, delAddr) + h.emitDelegation(ctx, valAddr, sdk.AccAddress(valAddr)) detail["moniker"] = val.Description.Moniker detail["identity"] = val.Description.Identity } diff --git a/hooks/emitter/transfer.go b/hooks/emitter/transfer.go index ca1ec58d5..e7c226aea 100644 --- a/hooks/emitter/transfer.go +++ b/hooks/emitter/transfer.go @@ -3,11 +3,12 @@ package emitter import ( "encoding/hex" + "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - "github.com/bandprotocol/chain/v2/hooks/common" + "github.com/bandprotocol/chain/v3/hooks/common" ) // handleMsgTransfer implements emitter handler for msgTransfer. @@ -21,8 +22,8 @@ func (h *Hook) handleMsgTransfer( if events, ok := evMap[channeltypes.EventTypeSendPacket+"."+channeltypes.AttributeKeyDataHex]; ok { packet := newPacket( ctx, - evMap[channeltypes.EventTypeSendPacket+"."+channeltypes.AttributeKeySrcPort][0], - evMap[channeltypes.EventTypeSendPacket+"."+channeltypes.AttributeKeySrcChannel][0], + msg.SourcePort, + msg.SourceChannel, common.Atoui(evMap[channeltypes.EventTypeSendPacket+"."+channeltypes.AttributeKeySequence][0]), evMap[channeltypes.EventTypeSendPacket+"."+channeltypes.AttributeKeyDstPort][0], evMap[channeltypes.EventTypeSendPacket+"."+channeltypes.AttributeKeyDstChannel][0], diff --git a/hooks/emitter/utils.go b/hooks/emitter/utils.go new file mode 100644 index 000000000..3c54c4da4 --- /dev/null +++ b/hooks/emitter/utils.go @@ -0,0 +1,43 @@ +package emitter + +import ( + "math" + "strconv" + + abci "github.com/cometbft/cometbft/abci/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + + oraclekeeper "github.com/bandprotocol/chain/v3/x/oracle/keeper" +) + +func ConvertToGas(owasm uint64) uint64 { + return uint64(math.Ceil(float64(owasm) / float64(oraclekeeper.GasConversionFactor))) +} + +func MustParseValAddress(addr string) sdk.ValAddress { + val, err := sdk.ValAddressFromBech32(addr) + if err != nil { + panic(err) + } + return val +} + +func splitTxEvents(msgSize int, events []abci.Event) ([]abci.Event, [][]abci.Event) { + var txEvents []abci.Event + eventGroups := make([][]abci.Event, msgSize) + for _, event := range events { + n := len(event.Attributes) + attrType := event.Attributes[n-1] + if attrType.Key != "msg_index" { + txEvents = append(txEvents, event) + } else { + idx, err := strconv.ParseInt(attrType.Value, 10, 0) + if err != nil { + panic(err) + } + eventGroups[idx] = append(eventGroups[idx], event) + } + } + return txEvents, eventGroups +} diff --git a/hooks/price/price.go b/hooks/price/price.go index 529d5ea47..056280df9 100644 --- a/hooks/price/price.go +++ b/hooks/price/price.go @@ -4,15 +4,17 @@ import ( "errors" "fmt" + "github.com/syndtr/goleveldb/leveldb" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/syndtr/goleveldb/leveldb" - "github.com/bandprotocol/chain/v2/hooks/common" - "github.com/bandprotocol/chain/v2/x/oracle/keeper" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/hooks/common" + "github.com/bandprotocol/chain/v3/x/oracle/keeper" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // Hook uses levelDB to store the latest price of standard price reference. @@ -55,20 +57,20 @@ func NewHook( } // AfterInitChain specify actions need to do after chain initialization (app.Hook interface). -func (h *Hook) AfterInitChain(ctx sdk.Context, req abci.RequestInitChain, res abci.ResponseInitChain) { +func (h *Hook) AfterInitChain(ctx sdk.Context, req *abci.RequestInitChain, res *abci.ResponseInitChain) { } // AfterBeginBlock specify actions need to do after begin block period (app.Hook interface). -func (h *Hook) AfterBeginBlock(ctx sdk.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) { +func (h *Hook) AfterBeginBlock(ctx sdk.Context, req *abci.RequestFinalizeBlock, events []abci.Event) { } // AfterDeliverTx specify actions need to do after transaction has been processed (app.Hook interface). -func (h *Hook) AfterDeliverTx(ctx sdk.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) { +func (h *Hook) AfterDeliverTx(ctx sdk.Context, tx sdk.Tx, res *abci.ExecTxResult) { } // AfterEndBlock specify actions need to do after end block period (app.Hook interface). -func (h *Hook) AfterEndBlock(ctx sdk.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) { - for _, event := range res.Events { +func (h *Hook) AfterEndBlock(ctx sdk.Context, events []abci.Event) { + for _, event := range events { events := sdk.StringifyEvents([]abci.Event{event}) evMap := common.ParseEvents(events) switch event.Type { diff --git a/hooks/price/types.go b/hooks/price/types.go index 6bac2fe09..cc08c262c 100644 --- a/hooks/price/types.go +++ b/hooks/price/types.go @@ -1,7 +1,7 @@ package price import ( - "github.com/bandprotocol/chain/v2/pkg/obi" + "github.com/bandprotocol/chain/v3/pkg/obi" ) const DefaultMultiplier = uint64(1000000000) diff --git a/hooks/price/types_test.go b/hooks/price/types_test.go index c406744be..dbd9e612c 100644 --- a/hooks/price/types_test.go +++ b/hooks/price/types_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/bandprotocol/chain/v2/hooks/price" + "github.com/bandprotocol/chain/v3/hooks/price" ) func hexToBytes(hexstr string) []byte { diff --git a/hooks/request/db.go b/hooks/request/db.go index 127c3316c..027d84c29 100644 --- a/hooks/request/db.go +++ b/hooks/request/db.go @@ -10,7 +10,7 @@ import ( "gorm.io/gorm" "gorm.io/gorm/clause" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) func initDb(driverName, dataSourceName string) *gorm.DB { diff --git a/hooks/request/model.go b/hooks/request/model.go index 4be46d501..227ff142e 100644 --- a/hooks/request/model.go +++ b/hooks/request/model.go @@ -1,7 +1,7 @@ package request import ( - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // GenerateRequestModel converts proto's QueryRequestResponse to GORM's Request model diff --git a/hooks/request/request.go b/hooks/request/request.go index 7862710ab..0f42f536f 100644 --- a/hooks/request/request.go +++ b/hooks/request/request.go @@ -5,18 +5,20 @@ import ( "errors" "strings" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" _ "github.com/go-sql-driver/mysql" _ "github.com/lib/pq" _ "github.com/mattn/go-sqlite3" "gorm.io/gorm" - "github.com/bandprotocol/chain/v2/hooks/common" - "github.com/bandprotocol/chain/v2/x/oracle/keeper" - "github.com/bandprotocol/chain/v2/x/oracle/types" + abci "github.com/cometbft/cometbft/abci/types" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/bandprotocol/chain/v3/hooks/common" + "github.com/bandprotocol/chain/v3/x/oracle/keeper" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // Hook inherits from Band app hook to save latest request into SQL database. @@ -46,17 +48,17 @@ func NewHook(cdc codec.Codec, oracleKeeper keeper.Keeper, connStr string, numRec } // AfterInitChain specify actions need to do after chain initialization (app.Hook interface). -func (h *Hook) AfterInitChain(ctx sdk.Context, req abci.RequestInitChain, res abci.ResponseInitChain) { +func (h *Hook) AfterInitChain(ctx sdk.Context, req *abci.RequestInitChain, res *abci.ResponseInitChain) { } // AfterBeginBlock specify actions need to do after begin block period (app.Hook interface). -func (h *Hook) AfterBeginBlock(ctx sdk.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) { +func (h *Hook) AfterBeginBlock(_ sdk.Context, _ *abci.RequestFinalizeBlock, _ []abci.Event) { trans := h.db.Begin() h.trans = trans } // AfterDeliverTx specify actions need to do after transaction has been processed (app.Hook interface). -func (h *Hook) AfterDeliverTx(ctx sdk.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) { +func (h *Hook) AfterDeliverTx(ctx sdk.Context, tx sdk.Tx, res *abci.ExecTxResult) { reports := make(map[types.RequestID][]types.Report) for _, event := range res.Events { events := sdk.StringifyEvents([]abci.Event{event}) @@ -94,9 +96,9 @@ func (h *Hook) AfterDeliverTx(ctx sdk.Context, req abci.RequestDeliverTx, res ab } // AfterEndBlock specify actions need to do after end block period (app.Hook interface). -func (h *Hook) AfterEndBlock(ctx sdk.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) { +func (h *Hook) AfterEndBlock(ctx sdk.Context, events []abci.Event) { var requests []types.QueryRequestResponse - for _, event := range res.Events { + for _, event := range events { events := sdk.StringifyEvents([]abci.Event{event}) evMap := common.ParseEvents(events) switch event.Type { diff --git a/hooks/request/types.go b/hooks/request/types.go index 46ed9816c..f35fc6a3a 100644 --- a/hooks/request/types.go +++ b/hooks/request/types.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // RawReport is GORM model of RawReport proto message diff --git a/pkg/bandrng/rng_test.go b/pkg/bandrng/rng_test.go index cacc07c44..e5e6c8aa3 100644 --- a/pkg/bandrng/rng_test.go +++ b/pkg/bandrng/rng_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/bandprotocol/chain/v2/pkg/bandrng" + "github.com/bandprotocol/chain/v3/pkg/bandrng" ) func TestRngRandom(t *testing.T) { diff --git a/pkg/bandrng/sampling_test.go b/pkg/bandrng/sampling_test.go index 29ed064e6..60c9ba2fc 100644 --- a/pkg/bandrng/sampling_test.go +++ b/pkg/bandrng/sampling_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/bandprotocol/chain/v2/pkg/bandrng" + "github.com/bandprotocol/chain/v3/pkg/bandrng" ) func TestChooseOneOne(t *testing.T) { diff --git a/pkg/filecache/filecache_test.go b/pkg/filecache/filecache_test.go index 8b2ba8f79..b47d874d7 100644 --- a/pkg/filecache/filecache_test.go +++ b/pkg/filecache/filecache_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/bandprotocol/chain/v2/pkg/filecache" + "github.com/bandprotocol/chain/v3/pkg/filecache" ) func TestAddFile(t *testing.T) { diff --git a/pkg/gzip/gzip_test.go b/pkg/gzip/gzip_test.go index da721d3ac..98fe4c60a 100644 --- a/pkg/gzip/gzip_test.go +++ b/pkg/gzip/gzip_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/bandprotocol/chain/v2/pkg/gzip" + "github.com/bandprotocol/chain/v3/pkg/gzip" ) func TestUncompress(t *testing.T) { diff --git a/pkg/obi/decode.go b/pkg/obi/decode.go index f0753b1e2..d564b6ee7 100644 --- a/pkg/obi/decode.go +++ b/pkg/obi/decode.go @@ -109,7 +109,7 @@ func MustDecode(data []byte, v ...interface{}) { } } -// DecodeUnsigned16 decodes the input bytes into `uint8` and returns the remaining bytes. +// DecodeUnsigned8 decodes the input bytes into `uint8` and returns the remaining bytes. func DecodeUnsigned8(data []byte) (uint8, []byte, error) { if len(data) < 1 { return 0, nil, errors.New("obi: out of range") diff --git a/pkg/requestcache/cache.go b/pkg/requestcache/cache.go index cb8a7b39c..c083caf0c 100644 --- a/pkg/requestcache/cache.go +++ b/pkg/requestcache/cache.go @@ -8,7 +8,7 @@ import ( "github.com/peterbourgon/diskv" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) type Cache struct { diff --git a/proto/bandchain/v1/node/query.proto b/proto/bandchain/v1/node/query.proto index 6efd55891..3fb67059c 100644 --- a/proto/bandchain/v1/node/query.proto +++ b/proto/bandchain/v1/node/query.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package bandchain.v1.node; -option go_package = "github.com/bandprotocol/chain/v2/client/grpc/node"; +option go_package = "github.com/bandprotocol/chain/v3/client/grpc/node"; import "google/api/annotations.proto"; import "gogoproto/gogo.proto"; @@ -9,29 +9,29 @@ import "gogoproto/gogo.proto"; // Service defines the gRPC querier service. service Service { // ChainID queries the chain ID of this node - rpc ChainID(QueryChainIDRequest) returns (QueryChainIDResponse) { + rpc ChainID(ChainIDRequest) returns (ChainIDResponse) { option (google.api.http).get = "/bandchain/v1/chain_id"; } // EVMValidators queries current list of validator's address and power - rpc EVMValidators(QueryEVMValidatorsRequest) returns (QueryEVMValidatorsResponse) { + rpc EVMValidators(EVMValidatorsRequest) returns (EVMValidatorsResponse) { option (google.api.http).get = "/bandchain/v1/evm-validators"; } } -// QueryChainIDRequest is request type for the Service/ChainID RPC method. -message QueryChainIDRequest {} +// ChainIDRequest is request type for the Service/ChainID RPC method. +message ChainIDRequest {} -// QueryChainIDResponse is response type for the Service/ChainID RPC method. -message QueryChainIDResponse { +// ChainIDResponse is response type for the Service/ChainID RPC method. +message ChainIDResponse { string chain_id = 1 [(gogoproto.customname) = "ChainID"]; } -// QueryEVMValidatorsRequest is request type for the Service/EVMValidators RPC method. -message QueryEVMValidatorsRequest {} +// EVMValidatorsRequest is request type for the Service/EVMValidators RPC method. +message EVMValidatorsRequest {} -// QueryEVMValidatorsResponse is response type for the Service/EVMValidators RPC method. -message QueryEVMValidatorsResponse { +// EVMValidatorsResponse is response type for the Service/EVMValidators RPC method. +message EVMValidatorsResponse { // BlockHeight is the latest block height int64 block_height = 1; // Validators is list of validator's addresss and voting power diff --git a/proto/bandchain/v1/oracle/proof.proto b/proto/bandchain/v1/oracle/proof.proto index 7559af646..55161b3fc 100644 --- a/proto/bandchain/v1/oracle/proof.proto +++ b/proto/bandchain/v1/oracle/proof.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package bandchain.v1.oracle; -option go_package = "github.com/bandprotocol/chain/v2/client/grpc/oracle/proof"; +option go_package = "github.com/bandprotocol/chain/v3/client/grpc/oracle/proof"; import "google/api/annotations.proto"; import "gogoproto/gogo.proto"; @@ -10,72 +10,72 @@ import "oracle/v1/oracle.proto"; // Service defines the gRPC querier service. service Service { // Proof queries the proof for given request ID - rpc Proof(QueryProofRequest) returns (QueryProofResponse) { + rpc Proof(ProofRequest) returns (ProofResponse) { option (google.api.http).get = "/bandchain/v1/oracle/proof/{request_id}"; } // MultiProof queries multiple proofs for given list of request IDs - rpc MultiProof(QueryMultiProofRequest) returns (QueryMultiProofResponse) { + rpc MultiProof(MultiProofRequest) returns (MultiProofResponse) { option (google.api.http).get = "/bandchain/v1/oracle/multi_proof"; } // RequestCountProof queries the count proof - rpc RequestCountProof(QueryRequestCountProofRequest) returns (QueryRequestCountProofResponse) { + rpc RequestCountProof(RequestCountProofRequest) returns (RequestCountProofResponse) { option (google.api.http).get = "/bandchain/v1/oracle/requests_count_proof"; } } -// QueryProofRequest is request type for the Service/Proof RPC method. -message QueryProofRequest { +// ProofRequest is request type for the Service/Proof RPC method. +message ProofRequest { // RequestID is ID of an oracle request uint64 request_id = 1; // height is block height int64 height = 2; } -// QueryChainIDResponse is response type for the Service/Proof RPC method. -message QueryProofResponse { +// ProofResponse is response type for the Service/Proof RPC method. +message ProofResponse { // height is block height int64 height = 1; // result is the proof - SingleProofResponse result = 2 [(gogoproto.nullable) = false]; + SingleProofResult result = 2 [(gogoproto.nullable) = false]; } -// QueryMultiProofRequest is request type for the Service/MultiProof RPC method. -message QueryMultiProofRequest { +// MultiProofRequest is request type for the Service/MultiProof RPC method. +message MultiProofRequest { // request_ids is the list of request IDs repeated uint64 request_ids = 1; } -// QueryMultiProofResponse is response type for the Service/MultiProof RPC method. -message QueryMultiProofResponse { - int64 height = 1; - MultiProofResponse result = 2 [(gogoproto.nullable) = false]; +// MultiProofResponse is response type for the Service/MultiProof RPC method. +message MultiProofResponse { + int64 height = 1; + MultiProofResult result = 2 [(gogoproto.nullable) = false]; } -// QueryRequestCountProofRequest is request type for the Service/RequestCountProof RPC method. -message QueryRequestCountProofRequest {} +// RequestCountProofRequest is request type for the Service/RequestCountProof RPC method. +message RequestCountProofRequest {} -// QueryRequestCountProofResponse is response type for the Service/RequestCountProof RPC method. -message QueryRequestCountProofResponse { - int64 height = 1; - CountProofResponse result = 2 [(gogoproto.nullable) = false]; +// RequestCountProofResponse is response type for the Service/RequestCountProof RPC method. +message RequestCountProofResponse { + int64 height = 1; + CountProofResult result = 2 [(gogoproto.nullable) = false]; } // SingleProofResponse is the data structure for response of single proof -message SingleProofResponse { +message SingleProofResult { SingleProof proof = 1 [(gogoproto.nullable) = false]; bytes evm_proof_bytes = 2 [(gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; } -// MultiProofResponse is the data structure for response of multi proof -message MultiProofResponse { +// MultiProofResult is the data structure for response of multi proof +message MultiProofResult { MultiProof proof = 1 [(gogoproto.nullable) = false]; bytes evm_proof_bytes = 2 [(gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; } -// CountProofResponse is the data structure for response of count proof -message CountProofResponse { +// CountProofResult is the data structure for response of count proof +message CountProofResult { CountProof proof = 1 [(gogoproto.nullable) = false]; bytes evm_proof_bytes = 2 [(gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; } @@ -130,20 +130,20 @@ message BlockRelayProof { // // ____________________[AppHash]____________________ // / \ -// ___________[N19]____________ ____[N20]_____ -// / \ / \ -// _____[N15]_____ ____[N16]______ __[N17]__ [K] -// / \ / \ / \ -// __[N8]_ __[N9]_ _[N10]_ _[N11]_ [N12] [N13] +// ___________[N19]____________ ______[N20]_______ +// / \ / \ +// _____[N15]_____ ____[N16]______ __[N17]__ __[N18]__ +// / \ / \ / \ / \ +// __[N8]_ __[N9]_ _[N10]_ _[N11]_ [N12] [N13] [K] [L] // / \ / \ / \ / \ / \ / \ // [N0] [N1] [N2] [N3] [N4] [N5] [N6] [N7] [G] [H] [I] [J] // / \ / \ / \ / \ / \ / \ / \ / \ // [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [A] [B] [C] [D] [E] [F] // -// [0] - acc (auth) [1] - authz [2] - bank [3] - capability [4] - consensus [5] - crisis -// [6] - dist [7] - evidence [8] - feegrant [9] - globalfee [A] - gov [B] - group -// [C] - ibccore [D] - icahost [E] - mint [F] - oracle [G] - params [H] - slashing -// [I] - staking [J] - transfer [K] - upgrade +// [0] - acc (auth) [1] - authz [2] - bank [3] - capability [4] - consensus [5] - crisis +// [6] - dist [7] - evidence [8] - feegrant [9] - feeibc [A] - globalfee [B] - gov +// [C] - group [D] - ibccore [E] - icahost [F] - mint [G] - oracle [H] - params +// [I] - slashing [J] - staking [K] - transfer [L] - upgrade // // Notice that NOT all leaves of the Merkle tree are needed in order to compute the Merkle // root hash, since we only want to validate the correctness of [F] In fact, only @@ -153,15 +153,12 @@ message MultiStoreProof { (gogoproto.customname) = "OracleIAVLStateHash", (gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes" ]; - bytes mint_store_merkle_hash = 2 [(gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; - bytes ibc_to_icahost_stores_merkle_hash = 3 - [(gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; - bytes feegrant_to_group_stores_merkle_hash = 4 - [(gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; - bytes auth_to_evidence_stores_merkle_hash = 5 + bytes params_store_merkle_hash = 2 [(gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; + bytes slashing_to_staking_stores_merkle_hash = 3 [(gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; - bytes params_to_upgrade_stores_merkle_hash = 6 + bytes transfer_to_upgrade_stores_merkle_hash = 4 [(gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; + bytes auth_to_mint_stores_merkle_hash = 5 [(gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; } // BlockHeaderMerkleParts stores a group of hashes using for computing Tendermint's block diff --git a/proto/buf.gen.pulsar.yml b/proto/buf.gen.pulsar.yml new file mode 100644 index 000000000..223829e47 --- /dev/null +++ b/proto/buf.gen.pulsar.yml @@ -0,0 +1,21 @@ +version: v1 +managed: + enabled: true + go_package_prefix: + default: github.com/bandprotocol/chain/v3/api + except: + - buf.build/googleapis/googleapis + - buf.build/cosmos/gogo-proto + - buf.build/cosmos/cosmos-proto + override: + buf.build/cosmos/cosmos-sdk: cosmossdk.io/api +plugins: + - name: go-pulsar + out: ../api + opt: paths=source_relative + - name: go-grpc + out: ../api + opt: paths=source_relative + - name: go-cosmos-orm + out: ../api + opt: paths=source_relative diff --git a/proto/buf.lock b/proto/buf.lock index 8224dea6f..e575d2103 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -4,20 +4,20 @@ deps: - remote: buf.build owner: cosmos repository: cosmos-proto - commit: 1935555c206d4afb9e94615dfd0fad31 - digest: shake256:c74d91a3ac7ae07d579e90eee33abf9b29664047ac8816500cf22c081fec0d72d62c89ce0bebafc1f6fec7aa5315be72606717740ca95007248425102c365377 + commit: 04467658e59e44bbb22fe568206e1f70 + digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466 - remote: buf.build owner: cosmos repository: cosmos-sdk - commit: 954f7b05f38440fc8250134b15adec47 - digest: shake256:2ab4404fd04a7d1d52df0e2d0f2d477a3d83ffd88d876957bf3fedfd702c8e52833d65b3ce1d89a3c5adf2aab512616b0e4f51d8463f07eda9a8a3317ee3ac54 + commit: 5a6ab7bc14314acaa912d5e53aef1c2f + digest: shake256:02c00c73493720055f9b57553a35b5550023a3c1914123b247956288a78fb913aff70e66552777ae14d759467e119079d484af081264a5dd607a94d9fbc8116b - remote: buf.build owner: cosmos repository: gogo-proto - commit: 5e5b9fdd01804356895f8f79a6f1ddc1 - digest: shake256:0b85da49e2e5f9ebc4806eae058e2f56096ff3b1c59d1fb7c190413dd15f45dd456f0b69ced9059341c80795d2b6c943de15b120a9e0308b499e43e4b5fc2952 + commit: 88ef6483f90f478fb938c37dde52ece3 + digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba - remote: buf.build owner: googleapis repository: googleapis - commit: 75b4300737fb4efca0831636be94e517 - digest: shake256:d865f55b8ceb838c90c28b09894ab43d07f42551108c23760004a6a4e28fe24d3a1f7380a3c9278edb329a338a9cc5db8ad9f394de548e70d534e98504972d67 + commit: e7f8d366f5264595bcc4cd4139af9973 + digest: shake256:e5e5f1c12f82e028ea696faa43b4f9dc6258a6d1226282962a8c8b282e10946281d815884f574bd279ebd9cd7588629beb3db17b892af6c33b56f92f8f67f509 diff --git a/proto/buf.yaml b/proto/buf.yaml index 1c04b141d..a45f413b4 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -2,8 +2,9 @@ version: v1 name: buf.build/bandprotocol/chain deps: - buf.build/cosmos/cosmos-proto - - buf.build/cosmos/cosmos-sdk:v0.47.0 - buf.build/cosmos/gogo-proto + - buf.build/googleapis/googleapis + - buf.build/cosmos/cosmos-sdk:v0.50.0 breaking: use: - FILE diff --git a/proto/globalfee/v1beta1/genesis.proto b/proto/globalfee/v1beta1/genesis.proto index a25a3c774..0e5c87072 100644 --- a/proto/globalfee/v1beta1/genesis.proto +++ b/proto/globalfee/v1beta1/genesis.proto @@ -4,7 +4,7 @@ package globalfee.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/bandprotocol/chain/v2/x/globalfee/types"; +option go_package = "github.com/bandprotocol/chain/v3/x/globalfee/types"; // GenesisState - initial state of module message GenesisState { diff --git a/proto/globalfee/v1beta1/query.proto b/proto/globalfee/v1beta1/query.proto index bedf4df25..ce8b0d3a8 100644 --- a/proto/globalfee/v1beta1/query.proto +++ b/proto/globalfee/v1beta1/query.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "globalfee/v1beta1/genesis.proto"; -option go_package = "github.com/bandprotocol/chain/v2/x/globalfee/types"; +option go_package = "github.com/bandprotocol/chain/v3/x/globalfee/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/globalfee/v1beta1/tx.proto b/proto/globalfee/v1beta1/tx.proto index 23013eee4..96ca5d61a 100644 --- a/proto/globalfee/v1beta1/tx.proto +++ b/proto/globalfee/v1beta1/tx.proto @@ -1,15 +1,16 @@ syntax = "proto3"; package globalfee.v1beta1; -option go_package = "github.com/bandprotocol/chain/v2/x/globalfee/types"; +option go_package = "github.com/bandprotocol/chain/v3/x/globalfee/types"; -import "cosmos/msg/v1/msg.proto"; -import "globalfee/v1beta1/genesis.proto"; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "globalfee/v1beta1/genesis.proto"; // Msg defines the x/globalfee Msg service. service Msg { + option (cosmos.msg.v1.service) = true; // UpdateParams defines a governance operation for updating the x/globalfee module // parameters. // diff --git a/proto/oracle/v1/genesis.proto b/proto/oracle/v1/genesis.proto index 3521a6870..ffc2f697c 100644 --- a/proto/oracle/v1/genesis.proto +++ b/proto/oracle/v1/genesis.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package oracle.v1; -option go_package = "github.com/bandprotocol/chain/v2/x/oracle/types"; +option go_package = "github.com/bandprotocol/chain/v3/x/oracle/types"; import "gogoproto/gogo.proto"; import "oracle/v1/oracle.proto"; diff --git a/proto/oracle/v1/oracle.proto b/proto/oracle/v1/oracle.proto index 19c768034..93d946b51 100644 --- a/proto/oracle/v1/oracle.proto +++ b/proto/oracle/v1/oracle.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package oracle.v1; -option go_package = "github.com/bandprotocol/chain/v2/x/oracle/types"; +option go_package = "github.com/bandprotocol/chain/v3/x/oracle/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/oracle/v1/query.proto b/proto/oracle/v1/query.proto index 1a291430b..3e64cb371 100644 --- a/proto/oracle/v1/query.proto +++ b/proto/oracle/v1/query.proto @@ -1,10 +1,11 @@ syntax = "proto3"; package oracle.v1; -option go_package = "github.com/bandprotocol/chain/v2/x/oracle/types"; +option go_package = "github.com/bandprotocol/chain/v3/x/oracle/types"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; +import "cosmos_proto/cosmos.proto"; import "oracle/v1/oracle.proto"; // Query defines the gRPC querier service. @@ -158,7 +159,7 @@ message QueryRequestResponse { // method. message QueryPendingRequestsRequest { // ValidatorAddress is address of a validator - string validator_address = 1; + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // QueryPendingRequestResponse is response type for the Query/PendingRequests @@ -180,7 +181,7 @@ message QueryParamsResponse { // QueryValidatorRequest is request type for the Query/Validator RPC method. message QueryValidatorRequest { // ValidatorAddress is address of a validator - string validator_address = 1; + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // QueryValidatorResponse is response type for the Query/Validator RPC method. @@ -192,9 +193,9 @@ message QueryValidatorResponse { // QueryIsReporterRequest is request type for the Query/Reporter RPC method. message QueryIsReporterRequest { // ValidatorAddress is a validator address - string validator_address = 1; + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // ReporterAddress is a candidate account - string reporter_address = 2; + string reporter_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // QueryIsReporterResponse is response type for the Query/Reporter RPC method. @@ -206,13 +207,13 @@ message QueryIsReporterResponse { // QueryReportersRequest is request type for the Query/Reporters RPC method. message QueryReportersRequest { // ValidatorAddress is a validator address - string validator_address = 1; + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // QueryReportersResponse is response type for the Query/Reporters RPC method. message QueryReportersResponse { // Reporter is a list of account addresses of reporters - repeated string reporter = 1; + repeated string reporter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // QueryActiveValidatorsRequest is request type for the Query/ActiveValidators @@ -272,7 +273,7 @@ message QueryRequestVerificationRequest { // verification string chain_id = 1; // Validator is a validator address - string validator = 2; + string validator = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // RequestID is oracle request ID uint64 request_id = 3; // ExternalID is an oracle's external ID @@ -296,7 +297,7 @@ message QueryRequestVerificationResponse { // ChainID is the targeted chain ID string chain_id = 1; // Validator is the targeted validator address - string validator = 2; + string validator = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // RequestID is the ID of targeted request uint64 request_id = 3; // ExternalID is the ID of targeted oracle's external data source diff --git a/proto/oracle/v1/tx.proto b/proto/oracle/v1/tx.proto index 82c1b64b7..779dfa61c 100644 --- a/proto/oracle/v1/tx.proto +++ b/proto/oracle/v1/tx.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package oracle.v1; -option go_package = "github.com/bandprotocol/chain/v2/x/oracle/types"; +option go_package = "github.com/bandprotocol/chain/v3/x/oracle/types"; import "gogoproto/gogo.proto"; import "oracle/v1/oracle.proto"; @@ -12,6 +12,8 @@ import "amino/amino.proto"; // Msg defines the oracle Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // RequestData defines a method for submitting a new request. rpc RequestData(MsgRequestData) returns (MsgRequestDataResponse); @@ -84,7 +86,7 @@ message MsgReportData { // identified by external ID repeated RawReport raw_reports = 2 [(gogoproto.nullable) = false]; // Validator is the address of the validator that owns this report. - string validator = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator = 3 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // MsgReportDataResponse is response data for MsgReportData message @@ -221,7 +223,7 @@ message MsgActivate { option (gogoproto.equal) = true; // Validator is the validator address who sign this message and request to be // activated. - string validator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // MsgActivateResponse is response data for MsgActivate message diff --git a/proxy-ssl/nginx.conf b/proxy-ssl/nginx.conf index 1bda62d14..1326202b8 100644 --- a/proxy-ssl/nginx.conf +++ b/proxy-ssl/nginx.conf @@ -10,30 +10,44 @@ http { server { listen 443 ssl; - ssl_certificate /etc/nginx/ssl/cert.pem; + ssl_certificate /etc/nginx/ssl/fullchain.pem; ssl_certificate_key /etc/nginx/ssl/privkey.pem; location ^~/rest/ { + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Headers' '*'; + + return 204; + } + proxy_pass http://query-node:1317/; proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } + + location ^~/grpc-web/ { + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Headers' '*'; - location ^~/rpc/ { - proxy_pass http://query-node:26657/; + return 204; + } + + proxy_pass http://query-node:1317/; proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } - location ^~/grpc-web/ { - proxy_pass http://query-node:9091/; + location ^~/rpc/ { + proxy_pass http://query-node:26657/; proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } - + location ^~/hasura/ { proxy_pass http://graphql-engine:8080/; proxy_set_header Host $host; @@ -42,7 +56,7 @@ http { } location ^~/faucet/ { - proxy_pass http://bandchain_faucet:5005/; + proxy_pass http://bandchain-faucet:5005/; proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; @@ -51,7 +65,7 @@ http { server { listen 9091 ssl http2; - ssl_certificate /etc/nginx/ssl/cert.pem; + ssl_certificate /etc/nginx/ssl/fullchain.pem; ssl_certificate_key /etc/nginx/ssl/privkey.pem; location / { diff --git a/proxy/default.vcl b/proxy/default.vcl index 3849fae27..74612b6e3 100644 --- a/proxy/default.vcl +++ b/proxy/default.vcl @@ -16,7 +16,7 @@ backend hasura { } backend faucet { - .host = "bandchain_faucet"; + .host = "bandchain-faucet"; .port = "5005"; } diff --git a/scripts/generate_genesis.sh b/scripts/generate_genesis.sh index 500dab24f..21207568a 100755 --- a/scripts/generate_genesis.sh +++ b/scripts/generate_genesis.sh @@ -3,7 +3,7 @@ DIR=`dirname "$0"` rm -rf ~/.band # initial new node -bandd init validator --chain-id bandchain +bandd init validator --chain-id bandchain --default-denom uband echo "lock nasty suffer dirt dream fine fall deal curtain plate husband sound tower mom crew crawl guard rack snake before fragile course bacon range" \ | bandd keys add validator --recover --keyring-backend test echo "smile stem oven genius cave resource better lunar nasty moon company ridge brass rather supply used horn three panic put venue analyst leader comic" \ diff --git a/scripts/mockgen.sh b/scripts/mockgen.sh index 381a18e51..1559fc360 100755 --- a/scripts/mockgen.sh +++ b/scripts/mockgen.sh @@ -1,3 +1,4 @@ #!/usr/bin/env bash mockgen_cmd="mockgen" +$mockgen_cmd -source=x/oracle/types/expected_keepers.go -package testutil -destination x/oracle/testutil/expected_keepers_mocks.go diff --git a/scripts/protocgen-pulsar.sh b/scripts/protocgen-pulsar.sh new file mode 100755 index 000000000..54308dd17 --- /dev/null +++ b/scripts/protocgen-pulsar.sh @@ -0,0 +1,8 @@ +# this script is for generating protobuf files for the new google.golang.org/protobuf API +set -eo pipefail + +echo "Cleaning API directory" +(cd api; find ./ -type f \( -iname \*.pulsar.go -o -iname \*.pb.go -o -iname \*.cosmos_orm.go -o -iname \*.pb.gw.go \) -delete; find . -empty -type d -delete; cd ..) + +echo "Generating API module" +(cd proto; buf generate --template buf.gen.pulsar.yml) diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 253c1d038..7d7c8f39c 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -21,5 +21,7 @@ done cd .. # move proto files to the right places -cp -r github.com/bandprotocol/chain/v2/* ./ +cp -r github.com/bandprotocol/chain/v3/* ./ rm -rf github.com + +./scripts/protocgen-pulsar.sh diff --git a/scripts/start_yoda.sh b/scripts/start_yoda.sh index 73eb7a0cb..5dfcc2772 100755 --- a/scripts/start_yoda.sh +++ b/scripts/start_yoda.sh @@ -9,7 +9,7 @@ yoda config chain-id bandchain yoda config validator $(bandd keys show validator -a --bech val --keyring-backend test) # setup execution endpoint -yoda config executor "rest:$EXECUTOR_URL?timeout=10s" +yoda config executor "rest:https://asia-southeast2-band-playground.cloudfunctions.net/test-runtime-executor?timeout=10s" # setup broadcast-timeout to yoda config yoda config broadcast-timeout "5m" @@ -23,7 +23,7 @@ yoda config max-try 5 echo "y" | bandd tx oracle activate --from validator --gas-prices 0.0025uband --keyring-backend test --chain-id bandchain # wait for activation transaction success -sleep 2 +sleep 7 for i in $(eval echo {1..1}) do @@ -35,13 +35,13 @@ done echo "y" | bandd tx bank send validator $(yoda keys list -a) 1000000uband --gas-prices 0.0025uband --keyring-backend test --chain-id bandchain # wait for sending band tokens transaction success -sleep 2 +sleep 10 # add reporter to bandchain echo "y" | bandd tx oracle add-reporters $(yoda keys list -a) --from validator --gas-prices 0.0025uband --keyring-backend test --chain-id bandchain # wait for addding reporter transaction success -sleep 2 +sleep 10 # run yoda yoda run diff --git a/testing/ibctesting/chain.go b/testing/ibctesting/chain.go deleted file mode 100644 index 54c565066..000000000 --- a/testing/ibctesting/chain.go +++ /dev/null @@ -1,613 +0,0 @@ -// TODO: consider importing directly from ibc instead of forking -package ibctesting - -import ( - "bytes" - "fmt" - "testing" - "time" - - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/crypto/tmhash" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmprotoversion "github.com/cometbft/cometbft/proto/tendermint/version" - tmtypes "github.com/cometbft/cometbft/types" - tmversion "github.com/cometbft/cometbft/version" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - stakingtestutil "github.com/cosmos/cosmos-sdk/x/staking/testutil" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" - ibchost "github.com/cosmos/ibc-go/v7/modules/core/24-host" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - "github.com/cosmos/ibc-go/v7/testing/mock" - "github.com/stretchr/testify/require" - - bandapp "github.com/bandprotocol/chain/v2/app" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/x/oracle/types" -) - -var valSize uint64 = 2 - -// TestChain is a testing struct that wraps a TestingApp with the last TM Header, the current ABCI -// header and the validators of the TestChain. It also contains a field called ChainID. This -// is the clientID that *other* chains use to refer to this TestChain. The SenderAccount -// is used for delivering transactions through the application state. -// NOTE: the actual application uses an empty chain-id for ease of testing. -type TestChain struct { - t *testing.T - - Coordinator *Coordinator - App *bandtesting.TestingApp - ChainID string - LastHeader *ibctmtypes.Header // header for last block height committed - CurrentHeader tmproto.Header // header for current block height - // QueryServer types.QueryServer - TxConfig client.TxConfig - Codec codec.BinaryCodec - - Vals *tmtypes.ValidatorSet - Signers []tmtypes.PrivValidator - Treasury sdk.AccAddress - - SenderPrivKey cryptotypes.PrivKey - SenderAccount authtypes.AccountI - - senders map[string]*authtypes.BaseAccount -} - -// NewTestChain initializes a new TestChain instance with a single validator set using a -// generated private key. It also creates a sender account to be used for delivering transactions. -// -// The first block height is committed to state in order to allow for client creations on -// counterparty chains. The TestChain will return with a block height starting at 2. -// -// Time management is handled by the Coordinator in order to ensure synchrony between chains. -// Each update of any chain increments the block header time for all chains by 5 seconds. -func NewTestChain(t *testing.T, coord *Coordinator, chainID string) *TestChain { - signers := make([]tmtypes.PrivValidator, valSize) - validators := make([]*tmtypes.Validator, valSize) - genesisAccount := make([]authtypes.GenesisAccount, valSize) - balances := make([]banktypes.Balance, valSize) - senders := make(map[string]*authtypes.BaseAccount) - - for i := uint64(0); i < valSize; i++ { - // generate validator private/public key - privVal := mock.PV{PrivKey: bandtesting.Validators[i].PrivKey} - tmPub, err := cryptocodec.ToTmPubKeyInterface(bandtesting.Validators[i].PubKey) - require.NoError(t, err) - - // create validator set with two validators - validators[i] = tmtypes.NewValidator(tmPub, 1) - - signers[i] = privVal - - senders[bandtesting.Validators[i].Address.String()] = authtypes.NewBaseAccount( - bandtesting.Validators[i].PubKey.Address().Bytes(), - bandtesting.Validators[i].PubKey, - i, - 0, - ) - genesisAccount[i] = senders[bandtesting.Validators[i].Address.String()] - balances[i] = banktypes.Balance{ - Address: genesisAccount[i].GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(10000000))), - } - } - - valSet := tmtypes.NewValidatorSet(validators) - - app := bandtesting.SetupWithGenesisValSet(t, valSet, genesisAccount, chainID, balances...) - ctx := app.NewContext(false, tmproto.Header{Height: app.LastBlockHeight()}) - vals := app.StakingKeeper.GetAllValidators(ctx) - for _, v := range vals { - err := app.OracleKeeper.Activate(app.DeliverContext, v.GetOperator()) - require.NoError(t, err) - } - - // create current header and call begin block - header := tmproto.Header{ - ChainID: chainID, - Height: 1, - Time: coord.CurrentTime.UTC(), - } - - txConfig := bandapp.MakeEncodingConfig().TxConfig - - // create an account to send transactions from - chain := &TestChain{ - t: t, - Coordinator: coord, - ChainID: chainID, - App: app, - CurrentHeader: header, - // QueryServer: app.GetIBCKeeper(), - TxConfig: txConfig, - Codec: app.AppCodec(), - Vals: valSet, - Signers: signers, - SenderPrivKey: bandtesting.Validators[0].PrivKey, - SenderAccount: genesisAccount[0], - Treasury: bandtesting.Treasury.Address, - senders: senders, - } - - coord.CommitBlock(chain) - - return chain -} - -// GetContext returns the current context for the application. -func (chain *TestChain) GetContext() sdk.Context { - return chain.App.GetBaseApp().NewContext(false, chain.CurrentHeader) -} - -// QueryProof performs an abci query with the given key and returns the proto encoded merkle proof -// for the query and the height at which the proof will succeed on a tendermint verifier. -func (chain *TestChain) QueryProof(key []byte) ([]byte, clienttypes.Height) { - return chain.QueryProofAtHeight(key, chain.App.LastBlockHeight()) -} - -// QueryProof performs an abci query with the given key and returns the proto encoded merkle proof -// for the query and the height at which the proof will succeed on a tendermint verifier. -func (chain *TestChain) QueryProofAtHeight(key []byte, height int64) ([]byte, clienttypes.Height) { - res := chain.App.Query(abci.RequestQuery{ - Path: fmt.Sprintf("store/%s/key", ibcexported.StoreKey), - Height: height - 1, - Data: key, - Prove: true, - }) - - merkleProof, err := commitmenttypes.ConvertProofs(res.ProofOps) - require.NoError(chain.t, err) - - proof, err := chain.App.AppCodec().Marshal(&merkleProof) - require.NoError(chain.t, err) - - revision := clienttypes.ParseChainID(chain.ChainID) - - // proof height + 1 is returned as the proof created corresponds to the height the proof - // was created in the IAVL tree. Tendermint and subsequently the clients that rely on it - // have heights 1 above the IAVL tree. Thus we return proof height + 1 - return proof, clienttypes.NewHeight(revision, uint64(res.Height)+1) -} - -// QueryUpgradeProof performs an abci query with the given key and returns the proto encoded merkle proof -// for the query and the height at which the proof will succeed on a tendermint verifier. -func (chain *TestChain) QueryUpgradeProof(key []byte, height uint64) ([]byte, clienttypes.Height) { - res := chain.App.Query(abci.RequestQuery{ - Path: "store/upgrade/key", - Height: int64(height - 1), - Data: key, - Prove: true, - }) - - merkleProof, err := commitmenttypes.ConvertProofs(res.ProofOps) - require.NoError(chain.t, err) - - proof, err := chain.App.AppCodec().Marshal(&merkleProof) - require.NoError(chain.t, err) - - revision := clienttypes.ParseChainID(chain.ChainID) - - // proof height + 1 is returned as the proof created corresponds to the height the proof - // was created in the IAVL tree. Tendermint and subsequently the clients that rely on it - // have heights 1 above the IAVL tree. Thus we return proof height + 1 - return proof, clienttypes.NewHeight(revision, uint64(res.Height+1)) -} - -// QueryConsensusStateProof performs an abci query for a consensus state -// stored on the given clientID. The proof and consensusHeight are returned. -func (chain *TestChain) QueryConsensusStateProof(clientID string) ([]byte, clienttypes.Height) { - clientState := chain.GetClientState(clientID) - - consensusHeight := clientState.GetLatestHeight().(clienttypes.Height) - consensusKey := ibchost.FullConsensusStateKey(clientID, consensusHeight) - proofConsensus, _ := chain.QueryProof(consensusKey) - - return proofConsensus, consensusHeight -} - -// NextBlock sets the last header to the current header and increments the current header to be -// at the next block height. It does not update the time as that is handled by the Coordinator. -// -// CONTRACT: this function must only be called after app.Commit() occurs -func (chain *TestChain) NextBlock() { - // set the last header to the current header - // use nil trusted fields - chain.LastHeader = chain.CurrentTMClientHeader() - - // increment the current header - chain.CurrentHeader = tmproto.Header{ - ChainID: chain.ChainID, - Height: chain.App.LastBlockHeight() + 1, - AppHash: chain.App.LastCommitID().Hash, - // NOTE: the time is increased by the coordinator to maintain time synchrony amongst - // chains. - Time: chain.CurrentHeader.Time, - ValidatorsHash: chain.Vals.Hash(), - NextValidatorsHash: chain.Vals.Hash(), - } - chain.App.BeginBlock(abci.RequestBeginBlock{Header: chain.CurrentHeader, Hash: chain.CurrentHeader.AppHash}) -} - -// sendMsgs delivers a transaction through the application without returning the result. -func (chain *TestChain) sendMsgs(msgs ...sdk.Msg) error { - _, err := chain.SendMsgs(msgs...) - return err -} - -// SendMsgs delivers a transaction through the application. It updates the senders sequence -// number and updates the TestChain's headers. It returns the result and error if one -// occurred. -func (chain *TestChain) SendMsgs(msgs ...sdk.Msg) (*sdk.Result, error) { - // ensure the chain has the latest time - chain.Coordinator.UpdateTimeForChain(chain) - - _, r, err := bandtesting.SignAndDeliver( - chain.t, - chain.TxConfig, - chain.App.GetBaseApp(), - chain.GetContext().BlockHeader(), - msgs, - chain.ChainID, - []uint64{chain.SenderAccount.GetAccountNumber()}, - []uint64{chain.SenderAccount.GetSequence()}, - chain.SenderPrivKey, - ) - if err != nil { - return nil, err - } - - // SignAndDeliver calls app.Commit() - chain.NextBlock() - - // increment sequence for successful transaction execution - err = chain.SenderAccount.SetSequence(chain.SenderAccount.GetSequence() + 1) - require.NoError(chain.t, err) - - chain.Coordinator.IncrementTime() - - return r, nil -} - -// SendMsgs delivers a transaction through the application. It updates the senders sequence -// number and updates the TestChain's headers. It returns the result and error if one -// occurred. -func (chain *TestChain) SendReport( - rid types.RequestID, - rawReps []types.RawReport, - sender bandtesting.Account, -) (*sdk.Result, error) { - senderAccount := chain.senders[sender.Address.String()] - - // ensure the chain has the latest time - chain.Coordinator.UpdateTimeForChain(chain) - - _, r, err := bandtesting.SignAndDeliver( - chain.t, - chain.TxConfig, - chain.App.GetBaseApp(), - chain.GetContext().BlockHeader(), - []sdk.Msg{types.NewMsgReportData(rid, rawReps, sender.ValAddress)}, - chain.ChainID, - []uint64{senderAccount.GetAccountNumber()}, - []uint64{senderAccount.GetSequence()}, - sender.PrivKey, - ) - if err != nil { - return nil, err - } - - // SignAndDeliver calls app.Commit() - chain.NextBlock() - - // increment sequence for successful transaction execution - err = senderAccount.SetSequence(senderAccount.GetSequence() + 1) - require.NoError(chain.t, err) - - chain.Coordinator.IncrementTime() - - return r, nil -} - -// GetClientState retrieves the client state for the provided clientID. The client is -// expected to exist otherwise testing will fail. -func (chain *TestChain) GetClientState(clientID string) ibcexported.ClientState { - clientState, found := chain.App.GetIBCKeeper().ClientKeeper.GetClientState(chain.GetContext(), clientID) - require.True(chain.t, found) - - return clientState -} - -// GetConsensusState retrieves the consensus state for the provided clientID and height. -// It will return a success boolean depending on if consensus state exists or not. -func (chain *TestChain) GetConsensusState( - clientID string, - height ibcexported.Height, -) (ibcexported.ConsensusState, bool) { - return chain.App.GetIBCKeeper().ClientKeeper.GetClientConsensusState(chain.GetContext(), clientID, height) -} - -// GetValsAtHeight will return the validator set of the chain at a given height. It will return -// a success boolean depending on if the validator set exists or not at that height. -func (chain *TestChain) GetValsAtHeight(height int64) (*tmtypes.ValidatorSet, bool) { - histInfo, ok := chain.App.GetStakingKeeper().GetHistoricalInfo(chain.GetContext(), height) - if !ok { - return nil, false - } - - valSet := stakingtypes.Validators(histInfo.Valset) - - tmValidators, err := stakingtestutil.ToTmValidators(valSet, sdk.DefaultPowerReduction) - if err != nil { - panic(err) - } - return tmtypes.NewValidatorSet(tmValidators), true -} - -// GetAcknowledgement retrieves an acknowledgement for the provided packet. If the -// acknowledgement does not exist then testing will fail. -func (chain *TestChain) GetAcknowledgement(packet ibcexported.PacketI) []byte { - ack, found := chain.App.GetIBCKeeper().ChannelKeeper.GetPacketAcknowledgement( - chain.GetContext(), - packet.GetDestPort(), - packet.GetDestChannel(), - packet.GetSequence(), - ) - require.True(chain.t, found) - - return ack -} - -// GetPrefix returns the prefix for used by a chain in connection creation -func (chain *TestChain) GetPrefix() commitmenttypes.MerklePrefix { - return commitmenttypes.NewMerklePrefix(chain.App.GetIBCKeeper().ConnectionKeeper.GetCommitmentPrefix().Bytes()) -} - -// ConstructUpdateTMClientHeader will construct a valid 07-tendermint Header to update the -// light client on the source chain. -func (chain *TestChain) ConstructUpdateTMClientHeader( - counterparty *TestChain, - clientID string, -) (*ibctmtypes.Header, error) { - return chain.ConstructUpdateTMClientHeaderWithTrustedHeight(counterparty, clientID, clienttypes.ZeroHeight()) -} - -// ConstructUpdateTMClientHeader will construct a valid 07-tendermint Header to update the -// light client on the source chain. -func (chain *TestChain) ConstructUpdateTMClientHeaderWithTrustedHeight( - counterparty *TestChain, - clientID string, - trustedHeight clienttypes.Height, -) (*ibctmtypes.Header, error) { - header := counterparty.LastHeader - // Relayer must query for LatestHeight on client to get TrustedHeight if the trusted height is not set - if trustedHeight.IsZero() { - trustedHeight = chain.GetClientState(clientID).GetLatestHeight().(clienttypes.Height) - } - var ( - tmTrustedVals *tmtypes.ValidatorSet - ok bool - ) - // Once we get TrustedHeight from client, we must query the validators from the counterparty chain - // If the LatestHeight == LastHeader.Height, then TrustedValidators are current validators - // If LatestHeight < LastHeader.Height, we can query the historical validator set from HistoricalInfo - if trustedHeight == counterparty.LastHeader.GetHeight() { - tmTrustedVals = counterparty.Vals - } else { - // NOTE: We need to get validators from counterparty at height: trustedHeight+1 - // since the last trusted validators for a header at height h - // is the NextValidators at h+1 committed to in header h by - // NextValidatorsHash - tmTrustedVals, ok = counterparty.GetValsAtHeight(int64(trustedHeight.RevisionHeight + 1)) - if !ok { - return nil, ibctmtypes.ErrInvalidHeaderHeight.Wrapf("could not retrieve trusted validators at trustedHeight: %d", trustedHeight) - } - } - // inject trusted fields into last header - // for now assume revision number is 0 - header.TrustedHeight = trustedHeight - - trustedVals, err := tmTrustedVals.ToProto() - if err != nil { - return nil, err - } - header.TrustedValidators = trustedVals - - return header, nil -} - -// ExpireClient fast forwards the chain's block time by the provided amount of time which will -// expire any clients with a trusting period less than or equal to this amount of time. -func (chain *TestChain) ExpireClient(amount time.Duration) { - chain.Coordinator.IncrementTimeBy(amount) -} - -// CurrentTMClientHeader creates a TM header using the current header parameters -// on the chain. The trusted fields in the header are set to nil. -func (chain *TestChain) CurrentTMClientHeader() *ibctmtypes.Header { - return chain.CreateTMClientHeader( - chain.ChainID, - chain.CurrentHeader.Height, - clienttypes.Height{}, - chain.CurrentHeader.Time, - chain.Vals, - nil, - chain.Signers, - ) -} - -// CreateTMClientHeader creates a TM header to update the TM client. Args are passed in to allow -// caller flexibility to use params that differ from the chain. -func (chain *TestChain) CreateTMClientHeader( - chainID string, - blockHeight int64, - trustedHeight clienttypes.Height, - timestamp time.Time, - tmValSet, tmTrustedVals *tmtypes.ValidatorSet, - signers []tmtypes.PrivValidator, -) *ibctmtypes.Header { - var ( - valSet *tmproto.ValidatorSet - trustedVals *tmproto.ValidatorSet - ) - require.NotNil(chain.t, tmValSet) - - vsetHash := tmValSet.Hash() - - tmHeader := tmtypes.Header{ - Version: tmprotoversion.Consensus{Block: tmversion.BlockProtocol, App: 2}, - ChainID: chainID, - Height: blockHeight, - Time: timestamp, - LastBlockID: MakeBlockID(make([]byte, tmhash.Size), 10_000, make([]byte, tmhash.Size)), - LastCommitHash: chain.App.LastCommitID().Hash, - DataHash: tmhash.Sum([]byte("data_hash")), - ValidatorsHash: vsetHash, - NextValidatorsHash: vsetHash, - ConsensusHash: tmhash.Sum([]byte("consensus_hash")), - AppHash: chain.CurrentHeader.AppHash, - LastResultsHash: tmhash.Sum([]byte("last_results_hash")), - EvidenceHash: tmhash.Sum([]byte("evidence_hash")), - ProposerAddress: tmValSet.Proposer.Address, //nolint:staticcheck - } - hhash := tmHeader.Hash() - blockID := MakeBlockID(hhash, 3, tmhash.Sum([]byte("part_set"))) - voteSet := tmtypes.NewVoteSet(chainID, blockHeight, 1, tmproto.PrecommitType, tmValSet) - - commit, err := tmtypes.MakeCommit(blockID, blockHeight, 1, voteSet, signers, timestamp) - require.NoError(chain.t, err) - - signedHeader := &tmproto.SignedHeader{ - Header: tmHeader.ToProto(), - Commit: commit.ToProto(), - } - - if tmValSet != nil { //nolint:staticcheck - valSet, err = tmValSet.ToProto() - if err != nil { - panic(err) - } - } - - if tmTrustedVals != nil { - trustedVals, err = tmTrustedVals.ToProto() - if err != nil { - panic(err) - } - } - - // The trusted fields may be nil. They may be filled before relaying messages to a client. - // The relayer is responsible for querying client and injecting appropriate trusted fields. - return &ibctmtypes.Header{ - SignedHeader: signedHeader, - ValidatorSet: valSet, - TrustedHeight: trustedHeight, - TrustedValidators: trustedVals, - } -} - -// MakeBlockID copied unimported test functions from tmtypes to use them here -func MakeBlockID(hash []byte, partSetSize uint32, partSetHash []byte) tmtypes.BlockID { - return tmtypes.BlockID{ - Hash: hash, - PartSetHeader: tmtypes.PartSetHeader{ - Total: partSetSize, - Hash: partSetHash, - }, - } -} - -// CreateSortedSignerArray takes two PrivValidators, and the corresponding Validator structs -// (including voting power). It returns a signer array of PrivValidators that matches the -// sorting of ValidatorSet. -// The sorting is first by .VotingPower (descending), with secondary index of .Address (ascending). -func CreateSortedSignerArray( - altPrivVal, - suitePrivVal tmtypes.PrivValidator, - altVal, - suiteVal *tmtypes.Validator, -) []tmtypes.PrivValidator { - switch { - case altVal.VotingPower > suiteVal.VotingPower: - return []tmtypes.PrivValidator{altPrivVal, suitePrivVal} - case altVal.VotingPower < suiteVal.VotingPower: - return []tmtypes.PrivValidator{suitePrivVal, altPrivVal} - default: - if bytes.Compare(altVal.Address, suiteVal.Address) == -1 { - return []tmtypes.PrivValidator{altPrivVal, suitePrivVal} - } - return []tmtypes.PrivValidator{suitePrivVal, altPrivVal} - } -} - -// CreatePortCapability binds and claims a capability for the given portID if it does not -// already exist. This function will fail testing on any resulting error. -// NOTE: only creation of a capbility for a oracle or mock port is supported -// Other applications must bind to the port in InitGenesis or modify this code. -func (chain *TestChain) CreatePortCapability(scopedKeeper capabilitykeeper.ScopedKeeper, portID string) { - // check if the portId is already binded, if not bind it - _, ok := chain.App.GetScopedIBCKeeper().GetCapability(chain.GetContext(), ibchost.PortPath(portID)) - if !ok { - // create capability using the IBC capability keeper - cap, err := chain.App.GetScopedIBCKeeper().NewCapability(chain.GetContext(), ibchost.PortPath(portID)) - require.NoError(chain.t, err) - - // claim capability using the scopedKeeper - err = scopedKeeper.ClaimCapability(chain.GetContext(), cap, ibchost.PortPath(portID)) - require.NoError(chain.t, err) - } - - chain.App.Commit() - - chain.NextBlock() -} - -// GetPortCapability returns the port capability for the given portID. The capability must -// exist, otherwise testing will fail. -func (chain *TestChain) GetPortCapability(portID string) *capabilitytypes.Capability { - cap, ok := chain.App.GetScopedIBCKeeper().GetCapability(chain.GetContext(), ibchost.PortPath(portID)) - require.True(chain.t, ok) - - return cap -} - -// CreateChannelCapability binds and claims a capability for the given portID and channelID -// if it does not already exist. This function will fail testing on any resulting error. The -// scoped keeper passed in will claim the new capability. -func (chain *TestChain) CreateChannelCapability(scopedKeeper capabilitykeeper.ScopedKeeper, portID, channelID string) { - capName := ibchost.ChannelCapabilityPath(portID, channelID) - // check if the portId is already binded, if not bind it - _, ok := chain.App.GetScopedIBCKeeper().GetCapability(chain.GetContext(), capName) - if !ok { - cap, err := chain.App.GetScopedIBCKeeper().NewCapability(chain.GetContext(), capName) - require.NoError(chain.t, err) - err = scopedKeeper.ClaimCapability(chain.GetContext(), cap, capName) - require.NoError(chain.t, err) - } - - chain.App.Commit() - - chain.NextBlock() -} - -// GetChannelCapability returns the channel capability for the given portID and channelID. -// The capability must exist, otherwise testing will fail. -func (chain *TestChain) GetChannelCapability(portID, channelID string) *capabilitytypes.Capability { - cap, ok := chain.App.GetScopedIBCKeeper(). - GetCapability(chain.GetContext(), ibchost.ChannelCapabilityPath(portID, channelID)) - require.True(chain.t, ok) - - return cap -} diff --git a/testing/ibctesting/config.go b/testing/ibctesting/config.go deleted file mode 100644 index b5bbed8f1..000000000 --- a/testing/ibctesting/config.go +++ /dev/null @@ -1,65 +0,0 @@ -package ibctesting - -import ( - "time" - - connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - "github.com/cosmos/ibc-go/v7/testing/mock" -) - -type ClientConfig interface { - GetClientType() string -} - -type TendermintConfig struct { - TrustLevel ibctmtypes.Fraction - TrustingPeriod time.Duration - UnbondingPeriod time.Duration - MaxClockDrift time.Duration - AllowUpdateAfterExpiry bool - AllowUpdateAfterMisbehaviour bool -} - -func NewTendermintConfig() *TendermintConfig { - return &TendermintConfig{ - TrustLevel: DefaultTrustLevel, - TrustingPeriod: TrustingPeriod, - UnbondingPeriod: UnbondingPeriod, - MaxClockDrift: MaxClockDrift, - AllowUpdateAfterExpiry: false, - AllowUpdateAfterMisbehaviour: false, - } -} - -func (tmcfg *TendermintConfig) GetClientType() string { - return exported.Tendermint -} - -type ConnectionConfig struct { - DelayPeriod uint64 - Version *connectiontypes.Version -} - -func NewConnectionConfig() *ConnectionConfig { - return &ConnectionConfig{ - DelayPeriod: DefaultDelayPeriod, - Version: ConnectionVersion, - } -} - -type ChannelConfig struct { - PortID string - Version string - Order channeltypes.Order -} - -func NewChannelConfig() *ChannelConfig { - return &ChannelConfig{ - PortID: mock.ModuleName, - Version: DefaultChannelVersion, - Order: channeltypes.UNORDERED, - } -} diff --git a/testing/ibctesting/coordinator.go b/testing/ibctesting/coordinator.go deleted file mode 100644 index 704b57853..000000000 --- a/testing/ibctesting/coordinator.go +++ /dev/null @@ -1,246 +0,0 @@ -package ibctesting - -import ( - "fmt" - "strconv" - "testing" - "time" - - abci "github.com/cometbft/cometbft/abci/types" - "github.com/stretchr/testify/require" -) - -const ChainIDPrefix = "testchain" - -var ( - globalStartTime = time.Date(2020, 1, 2, 0, 0, 0, 0, time.UTC) - TimeIncrement = time.Second * 5 -) - -// Coordinator is a testing struct which contains N TestChain's. It handles keeping all chains -// in sync with regards to time. -type Coordinator struct { - t *testing.T - - CurrentTime time.Time - Chains map[string]*TestChain -} - -// NewCoordinator initializes Coordinator with N TestChain's -func NewCoordinator(t *testing.T, n int) *Coordinator { - chains := make(map[string]*TestChain) - coord := &Coordinator{ - t: t, - CurrentTime: globalStartTime, - } - - for i := 0; i < n; i++ { - chainID := GetChainID(i) - chains[chainID] = NewTestChain(t, coord, chainID) - } - coord.Chains = chains - - return coord -} - -// IncrementTime iterates through all the TestChain's and increments their current header time -// by 5 seconds. -// -// CONTRACT: this function must be called after every Commit on any TestChain. -func (coord *Coordinator) IncrementTime() { - coord.IncrementTimeBy(TimeIncrement) -} - -// IncrementTimeBy iterates through all the TestChain's and increments their current header time -// by specified time. -func (coord *Coordinator) IncrementTimeBy(increment time.Duration) { - coord.CurrentTime = coord.CurrentTime.Add(increment).UTC() - coord.UpdateTime() -} - -// UpdateTime updates all clocks for the TestChains to the current global time. -func (coord *Coordinator) UpdateTime() { - for _, chain := range coord.Chains { - coord.UpdateTimeForChain(chain) - } -} - -// UpdateTimeForChain updates the clock for a specific chain. -func (coord *Coordinator) UpdateTimeForChain(chain *TestChain) { - chain.CurrentHeader.Time = coord.CurrentTime.UTC() - chain.App.BeginBlock(abci.RequestBeginBlock{Header: chain.CurrentHeader, Hash: chain.CurrentHeader.AppHash}) -} - -// Setup constructs a TM client, connection, and channel on both chains provided. It will -// fail if any error occurs. The clientID's, TestConnections, and TestChannels are returned -// for both chains. The channels created are connected to the BandChain. -func (coord *Coordinator) Setup(path *Path) { - coord.SetupConnections(path) - - // channels can also be referenced through the returned connections - coord.CreateChannels(path) -} - -// SetupClients is a helper function to create clients on both chains. It assumes the -// caller does not anticipate any errors. -func (coord *Coordinator) SetupClients(path *Path) { - err := path.EndpointA.CreateClient() - require.NoError(coord.t, err) - - err = path.EndpointB.CreateClient() - require.NoError(coord.t, err) -} - -// SetupClientConnections is a helper function to create clients and the appropriate -// connections on both the source and counterparty chain. It assumes the caller does not -// anticipate any errors. -func (coord *Coordinator) SetupConnections(path *Path) { - coord.SetupClients(path) - - coord.CreateConnections(path) -} - -// CreateConnection constructs and executes connection handshake messages in order to create -// OPEN channels on chainA and chainB. The connection information of for chainA and chainB -// are returned within a TestConnection struct. The function expects the connections to be -// successfully opened otherwise testing will fail. -func (coord *Coordinator) CreateConnections(path *Path) { - err := path.EndpointA.ConnOpenInit() - require.NoError(coord.t, err) - - err = path.EndpointB.ConnOpenTry() - require.NoError(coord.t, err) - - err = path.EndpointA.ConnOpenAck() - require.NoError(coord.t, err) - - err = path.EndpointB.ConnOpenConfirm() - require.NoError(coord.t, err) - - // ensure counterparty is up to date - err = path.EndpointA.UpdateClient() - require.NoError(coord.t, err) -} - -// CreateMockChannels constructs and executes channel handshake messages to create OPEN -// channels that use a mock application module that returns nil on all callbacks. This -// function is expects the channels to be successfully opened otherwise testing will -// fail. -func (coord *Coordinator) CreateMockChannels(path *Path) { - path.EndpointA.ChannelConfig.PortID = MockPort - path.EndpointB.ChannelConfig.PortID = MockPort - - coord.CreateChannels(path) -} - -// CreateTransferChannels constructs and executes channel handshake messages to create OPEN -// ibc-oracle channels on chainA and chainB. The function expects the channels to be -// successfully opened otherwise testing will fail. -func (coord *Coordinator) CreateTransferChannels(path *Path) { - path.EndpointA.ChannelConfig.PortID = OraclePort - path.EndpointB.ChannelConfig.PortID = OraclePort - - coord.CreateChannels(path) -} - -// CreateChannel constructs and executes channel handshake messages in order to create -// OPEN channels on chainA and chainB. The function expects the channels to be successfully -// opened otherwise testing will fail. -func (coord *Coordinator) CreateChannels(path *Path) { - err := path.EndpointA.ChanOpenInit() - require.NoError(coord.t, err) - - err = path.EndpointB.ChanOpenTry() - require.NoError(coord.t, err) - - err = path.EndpointA.ChanOpenAck() - require.NoError(coord.t, err) - - err = path.EndpointB.ChanOpenConfirm() - require.NoError(coord.t, err) - - // ensure counterparty is up to date - err = path.EndpointA.UpdateClient() - require.NoError(coord.t, err) -} - -// GetChain returns the TestChain using the given chainID and returns an error if it does -// not exist. -func (coord *Coordinator) GetChain(chainID string) *TestChain { - chain, found := coord.Chains[chainID] - require.True(coord.t, found, fmt.Sprintf("%s chain does not exist", chainID)) - return chain -} - -// GetChainID returns the chainID used for the provided index. -func GetChainID(index int) string { - return ChainIDPrefix + strconv.Itoa(index) -} - -// CommitBlock commits a block on the provided indexes and then increments the global time. -// -// CONTRACT: the passed in list of indexes must not contain duplicates -func (coord *Coordinator) CommitBlock(chains ...*TestChain) { - for _, chain := range chains { - chain.App.Commit() - chain.NextBlock() - } - coord.IncrementTime() -} - -// CommitNBlocks commits n blocks to state and updates the block height by 1 for each commit. -func (coord *Coordinator) CommitNBlocks(chain *TestChain, n uint64) { - for i := uint64(0); i < n; i++ { - chain.App.BeginBlock(abci.RequestBeginBlock{Header: chain.CurrentHeader, Hash: chain.CurrentHeader.AppHash}) - chain.App.Commit() - chain.NextBlock() - coord.IncrementTime() - } -} - -// ConnOpenInitOnBothChains initializes a connection on both endpoints with the state INIT -// using the OpenInit handshake call. -func (coord *Coordinator) ConnOpenInitOnBothChains(path *Path) error { - if err := path.EndpointA.ConnOpenInit(); err != nil { - return err - } - - if err := path.EndpointB.ConnOpenInit(); err != nil { - return err - } - - if err := path.EndpointA.UpdateClient(); err != nil { - return err - } - - if err := path.EndpointB.UpdateClient(); err != nil { - return err - } - - return nil -} - -// ChanOpenInitOnBothChains initializes a channel on the source chain and counterparty chain -// with the state INIT using the OpenInit handshake call. -func (coord *Coordinator) ChanOpenInitOnBothChains(path *Path) error { - // NOTE: only creation of a capability for a oracle or mock port is supported - // Other applications must bind to the port in InitGenesis or modify this code. - - if err := path.EndpointA.ChanOpenInit(); err != nil { - return err - } - - if err := path.EndpointB.ChanOpenInit(); err != nil { - return err - } - - if err := path.EndpointA.UpdateClient(); err != nil { - return err - } - - if err := path.EndpointB.UpdateClient(); err != nil { - return err - } - - return nil -} diff --git a/testing/ibctesting/endpoint.go b/testing/ibctesting/endpoint.go deleted file mode 100644 index 2254a750a..000000000 --- a/testing/ibctesting/endpoint.go +++ /dev/null @@ -1,630 +0,0 @@ -package ibctesting - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - "github.com/stretchr/testify/require" -) - -// Endpoint is a which represents a channel endpoint and its associated -// client and connections. It contains client, connection, and channel -// configuration parameters. Endpoint functions will utilize the parameters -// set in the configuration structs when executing IBC messages. -type Endpoint struct { - Chain *TestChain - Counterparty *Endpoint - ClientID string - ConnectionID string - ChannelID string - - ClientConfig ClientConfig - ConnectionConfig *ConnectionConfig - ChannelConfig *ChannelConfig -} - -// NewEndpoint constructs a new endpoint without the counterparty. -// CONTRACT: the counterparty endpoint must be set by the caller. -func NewEndpoint( - chain *TestChain, clientConfig ClientConfig, - connectionConfig *ConnectionConfig, channelConfig *ChannelConfig, -) *Endpoint { - return &Endpoint{ - Chain: chain, - ClientConfig: clientConfig, - ConnectionConfig: connectionConfig, - ChannelConfig: channelConfig, - } -} - -// NewDefaultEndpoint constructs a new endpoint using default values. -// CONTRACT: the counterparty endpoitn must be set by the caller. -func NewDefaultEndpoint(chain *TestChain) *Endpoint { - return &Endpoint{ - Chain: chain, - ClientConfig: NewTendermintConfig(), - ConnectionConfig: NewConnectionConfig(), - ChannelConfig: NewChannelConfig(), - } -} - -// QueryProof queries proof associated with this endpoint using the latest client state -// height on the counterparty chain. -func (endpoint *Endpoint) QueryProof(key []byte) ([]byte, clienttypes.Height) { - // obtain the counterparty client representing the chain associated with the endpoint - clientState := endpoint.Counterparty.Chain.GetClientState(endpoint.Counterparty.ClientID) - - // query proof on the counterparty using the latest height of the IBC client - return endpoint.QueryProofAtHeight(key, clientState.GetLatestHeight().GetRevisionHeight()) -} - -// QueryProofAtHeight queries proof associated with this endpoint using the proof height -// providied -func (endpoint *Endpoint) QueryProofAtHeight(key []byte, height uint64) ([]byte, clienttypes.Height) { - // query proof on the counterparty using the latest height of the IBC client - return endpoint.Chain.QueryProofAtHeight(key, int64(height)) -} - -// CreateClient creates an IBC client on the endpoint. It will update the -// clientID for the endpoint if the message is successfully executed. -// NOTE: a solo machine client will be created with an empty diversifier. -func (endpoint *Endpoint) CreateClient() (err error) { - // ensure counterparty has committed state - endpoint.Chain.Coordinator.CommitBlock(endpoint.Counterparty.Chain) - - var ( - clientState exported.ClientState - consensusState exported.ConsensusState - ) - - switch endpoint.ClientConfig.GetClientType() { - case exported.Tendermint: - tmConfig, ok := endpoint.ClientConfig.(*TendermintConfig) - require.True(endpoint.Chain.t, ok) - - height := endpoint.Counterparty.Chain.LastHeader.GetHeight().(clienttypes.Height) - clientState = ibctmtypes.NewClientState( - endpoint.Counterparty.Chain.ChainID, - tmConfig.TrustLevel, - tmConfig.TrustingPeriod, - tmConfig.UnbondingPeriod, - tmConfig.MaxClockDrift, - height, - commitmenttypes.GetSDKSpecs(), - UpgradePath, - ) - consensusState = endpoint.Counterparty.Chain.LastHeader.ConsensusState() - case exported.Solomachine: - // TODO - // solo := NewSolomachine(endpoint.Chain.T, endpoint.Chain.Codec, clientID, "", 1) - // clientState = solo.ClientState() - // consensusState = solo.ConsensusState() - - default: - err = fmt.Errorf("client type %s is not supported", endpoint.ClientConfig.GetClientType()) - } - - if err != nil { - return err - } - - msg, err := clienttypes.NewMsgCreateClient( - clientState, consensusState, endpoint.Chain.SenderAccount.GetAddress().String(), - ) - require.NoError(endpoint.Chain.t, err) - - res, err := endpoint.Chain.SendMsgs(msg) - if err != nil { - return err - } - - endpoint.ClientID, err = ParseClientIDFromEvents(res.GetEvents()) - require.NoError(endpoint.Chain.t, err) - - return nil -} - -// UpdateClient updates the IBC client associated with the endpoint. -func (endpoint *Endpoint) UpdateClient() (err error) { - // ensure counterparty has committed state - endpoint.Chain.Coordinator.CommitBlock(endpoint.Counterparty.Chain) - - var header *ibctmtypes.Header - - switch endpoint.ClientConfig.GetClientType() { - case exported.Tendermint: - header, err = endpoint.Chain.ConstructUpdateTMClientHeader(endpoint.Counterparty.Chain, endpoint.ClientID) - - default: - err = fmt.Errorf("client type %s is not supported", endpoint.ClientConfig.GetClientType()) - } - - if err != nil { - return err - } - - msg, err := clienttypes.NewMsgUpdateClient( - endpoint.ClientID, header, - endpoint.Chain.SenderAccount.GetAddress().String(), - ) - require.NoError(endpoint.Chain.t, err) - - return endpoint.Chain.sendMsgs(msg) -} - -// ConnOpenInit will construct and execute a MsgConnectionOpenInit on the associated endpoint. -func (endpoint *Endpoint) ConnOpenInit() error { - msg := connectiontypes.NewMsgConnectionOpenInit( - endpoint.ClientID, - endpoint.Counterparty.ClientID, - endpoint.Counterparty.Chain.GetPrefix(), DefaultOpenInitVersion, endpoint.ConnectionConfig.DelayPeriod, - endpoint.Chain.SenderAccount.GetAddress().String(), - ) - res, err := endpoint.Chain.SendMsgs(msg) - if err != nil { - return err - } - - endpoint.ConnectionID, err = ParseConnectionIDFromEvents(res.GetEvents()) - require.NoError(endpoint.Chain.t, err) - - return nil -} - -// ConnOpenTry will construct and execute a MsgConnectionOpenTry on the associated endpoint. -func (endpoint *Endpoint) ConnOpenTry() error { - err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.t, err) - - counterpartyClient, proofClient, proofConsensus, consensusHeight, proofInit, proofHeight := endpoint.QueryConnectionHandshakeProof() - - msg := connectiontypes.NewMsgConnectionOpenTry( - endpoint.ClientID, // does not support handshake continuation - endpoint.Counterparty.ConnectionID, - endpoint.Counterparty.ClientID, - counterpartyClient, - endpoint.Counterparty.Chain.GetPrefix(), - []*connectiontypes.Version{ConnectionVersion}, - endpoint.ConnectionConfig.DelayPeriod, - proofInit, - proofClient, - proofConsensus, - proofHeight, - consensusHeight, - endpoint.Chain.SenderAccount.GetAddress().String(), - ) - res, err := endpoint.Chain.SendMsgs(msg) - if err != nil { - return err - } - - if endpoint.ConnectionID == "" { - endpoint.ConnectionID, err = ParseConnectionIDFromEvents(res.GetEvents()) - require.NoError(endpoint.Chain.t, err) - } - - return nil -} - -// ConnOpenAck will construct and execute a MsgConnectionOpenAck on the associated endpoint. -func (endpoint *Endpoint) ConnOpenAck() error { - err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.t, err) - - counterpartyClient, proofClient, proofConsensus, consensusHeight, proofTry, proofHeight := endpoint.QueryConnectionHandshakeProof() - - msg := connectiontypes.NewMsgConnectionOpenAck( - endpoint.ConnectionID, - endpoint.Counterparty.ConnectionID, - counterpartyClient, // testing doesn't use flexible selection - proofTry, - proofClient, - proofConsensus, - proofHeight, - consensusHeight, - ConnectionVersion, - endpoint.Chain.SenderAccount.GetAddress().String(), - ) - return endpoint.Chain.sendMsgs(msg) -} - -// ConnOpenConfirm will construct and execute a MsgConnectionOpenConfirm on the associated endpoint. -func (endpoint *Endpoint) ConnOpenConfirm() error { - err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.t, err) - - connectionKey := host.ConnectionKey(endpoint.Counterparty.ConnectionID) - proof, height := endpoint.Counterparty.Chain.QueryProof(connectionKey) - - msg := connectiontypes.NewMsgConnectionOpenConfirm( - endpoint.ConnectionID, - proof, height, - endpoint.Chain.SenderAccount.GetAddress().String(), - ) - return endpoint.Chain.sendMsgs(msg) -} - -// QueryConnectionHandshakeProof returns all the proofs necessary to execute OpenTry or Open Ack of -// the connection handshakes. It returns the counterparty client state, proof of the counterparty -// client state, proof of the counterparty consensus state, the consensus state height, proof of -// the counterparty connection, and the proof height for all the proofs returned. -func (endpoint *Endpoint) QueryConnectionHandshakeProof() ( - clientState exported.ClientState, proofClient, - proofConsensus []byte, consensusHeight clienttypes.Height, - proofConnection []byte, proofHeight clienttypes.Height, -) { - // obtain the client state on the counterparty chain - clientState = endpoint.Counterparty.Chain.GetClientState(endpoint.Counterparty.ClientID) - - // query proof for the client state on the counterparty - clientKey := host.FullClientStateKey(endpoint.Counterparty.ClientID) - proofClient, proofHeight = endpoint.Counterparty.QueryProof(clientKey) - - consensusHeight = clientState.GetLatestHeight().(clienttypes.Height) - - // query proof for the consensus state on the counterparty - consensusKey := host.FullConsensusStateKey(endpoint.Counterparty.ClientID, consensusHeight) - proofConsensus, _ = endpoint.Counterparty.QueryProofAtHeight(consensusKey, proofHeight.GetRevisionHeight()) - - // query proof for the connection on the counterparty - connectionKey := host.ConnectionKey(endpoint.Counterparty.ConnectionID) - proofConnection, _ = endpoint.Counterparty.QueryProofAtHeight(connectionKey, proofHeight.GetRevisionHeight()) - - return -} - -// ChanOpenInit will construct and execute a MsgChannelOpenInit on the associated endpoint. -func (endpoint *Endpoint) ChanOpenInit() error { - msg := channeltypes.NewMsgChannelOpenInit( - endpoint.ChannelConfig.PortID, - endpoint.ChannelConfig.Version, endpoint.ChannelConfig.Order, []string{endpoint.ConnectionID}, - endpoint.Counterparty.ChannelConfig.PortID, - endpoint.Chain.SenderAccount.GetAddress().String(), - ) - res, err := endpoint.Chain.SendMsgs(msg) - if err != nil { - return err - } - - endpoint.ChannelID, err = ParseChannelIDFromEvents(res.GetEvents()) - require.NoError(endpoint.Chain.t, err) - - return nil -} - -// ChanOpenTry will construct and execute a MsgChannelOpenTry on the associated endpoint. -func (endpoint *Endpoint) ChanOpenTry() error { - err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.t, err) - - channelKey := host.ChannelKey(endpoint.Counterparty.ChannelConfig.PortID, endpoint.Counterparty.ChannelID) - proof, height := endpoint.Counterparty.Chain.QueryProof(channelKey) - - msg := channeltypes.NewMsgChannelOpenTry( - endpoint.ChannelConfig.PortID, - endpoint.ChannelConfig.Version, - endpoint.ChannelConfig.Order, - []string{endpoint.ConnectionID}, - endpoint.Counterparty.ChannelConfig.PortID, - endpoint.Counterparty.ChannelID, - endpoint.Counterparty.ChannelConfig.Version, - proof, - height, - endpoint.Chain.SenderAccount.GetAddress().String(), - ) - res, err := endpoint.Chain.SendMsgs(msg) - if err != nil { - return err - } - - if endpoint.ChannelID == "" { - endpoint.ChannelID, err = ParseChannelIDFromEvents(res.GetEvents()) - require.NoError(endpoint.Chain.t, err) - } - - return nil -} - -// ChanOpenAck will construct and execute a MsgChannelOpenAck on the associated endpoint. -func (endpoint *Endpoint) ChanOpenAck() error { - err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.t, err) - - channelKey := host.ChannelKey(endpoint.Counterparty.ChannelConfig.PortID, endpoint.Counterparty.ChannelID) - proof, height := endpoint.Counterparty.Chain.QueryProof(channelKey) - - msg := channeltypes.NewMsgChannelOpenAck( - endpoint.ChannelConfig.PortID, - endpoint.ChannelID, - endpoint.Counterparty.ChannelID, - endpoint.Counterparty.ChannelConfig.Version, // testing doesn't use flexible selection - proof, - height, - endpoint.Chain.SenderAccount.GetAddress().String(), - ) - return endpoint.Chain.sendMsgs(msg) -} - -// ChanOpenConfirm will construct and execute a MsgChannelOpenConfirm on the associated endpoint. -func (endpoint *Endpoint) ChanOpenConfirm() error { - err := endpoint.UpdateClient() - require.NoError(endpoint.Chain.t, err) - - channelKey := host.ChannelKey(endpoint.Counterparty.ChannelConfig.PortID, endpoint.Counterparty.ChannelID) - proof, height := endpoint.Counterparty.Chain.QueryProof(channelKey) - - msg := channeltypes.NewMsgChannelOpenConfirm( - endpoint.ChannelConfig.PortID, endpoint.ChannelID, - proof, height, - endpoint.Chain.SenderAccount.GetAddress().String(), - ) - return endpoint.Chain.sendMsgs(msg) -} - -// ChanCloseInit will construct and execute a MsgChannelCloseInit on the associated endpoint. -// -// NOTE: does not work with ibc-transfer/oracle module -func (endpoint *Endpoint) ChanCloseInit() error { - msg := channeltypes.NewMsgChannelCloseInit( - endpoint.ChannelConfig.PortID, endpoint.ChannelID, - endpoint.Chain.SenderAccount.GetAddress().String(), - ) - return endpoint.Chain.sendMsgs(msg) -} - -// SendPacket sends a packet through the channel keeper using the associated endpoint -// The counterparty client is updated so proofs can be sent to the counterparty chain. -// The packet sequence generated for the packet to be sent is returned. An error -// is returned if one occurs. -func (endpoint *Endpoint) SendPacket( - timeoutHeight clienttypes.Height, - timeoutTimestamp uint64, - data []byte, -) (uint64, error) { - channelCap := endpoint.Chain.GetChannelCapability(endpoint.ChannelConfig.PortID, endpoint.ChannelID) - - // no need to send message, acting as a module - sequence, err := endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.SendPacket( - endpoint.Chain.GetContext(), - channelCap, - endpoint.ChannelConfig.PortID, - endpoint.ChannelID, - timeoutHeight, - timeoutTimestamp, - data, - ) - if err != nil { - return 0, err - } - - // commit changes since no message was sent - endpoint.Chain.Coordinator.CommitBlock(endpoint.Chain) - - err = endpoint.Counterparty.UpdateClient() - if err != nil { - return 0, err - } - - return sequence, nil -} - -// RecvPacket receives a packet on the associated endpoint. -// The counterparty client is updated. -func (endpoint *Endpoint) RecvPacket(packet channeltypes.Packet) error { - _, err := endpoint.RecvPacketWithResult(packet) - if err != nil { - return err - } - - return nil -} - -// RecvPacketWithResult receives a packet on the associated endpoint and the result -// of the transaction is returned. The counterparty client is updated. -func (endpoint *Endpoint) RecvPacketWithResult(packet channeltypes.Packet) (*sdk.Result, error) { - // get proof of packet commitment on source - packetKey := host.PacketCommitmentKey(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) - proof, proofHeight := endpoint.Counterparty.Chain.QueryProof(packetKey) - - recvMsg := channeltypes.NewMsgRecvPacket( - packet, - proof, - proofHeight, - endpoint.Chain.SenderAccount.GetAddress().String(), - ) - - // receive on counterparty and update source client - res, err := endpoint.Chain.SendMsgs(recvMsg) - if err != nil { - return nil, err - } - - if err := endpoint.Counterparty.UpdateClient(); err != nil { - return nil, err - } - - return res, nil -} - -// WriteAcknowledgement writes an acknowledgement on the channel associated with the endpoint. -// The counterparty client is updated. -func (endpoint *Endpoint) WriteAcknowledgement(ack exported.Acknowledgement, packet exported.PacketI) error { - channelCap := endpoint.Chain.GetChannelCapability(packet.GetDestPort(), packet.GetDestChannel()) - - // no need to send message, acting as a handler - err := endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.WriteAcknowledgement( - endpoint.Chain.GetContext(), - channelCap, - packet, - ack, - ) - if err != nil { - return err - } - - // commit changes since no message was sent - endpoint.Chain.Coordinator.CommitBlock(endpoint.Chain) - - return endpoint.Counterparty.UpdateClient() -} - -// AcknowledgePacket sends a MsgAcknowledgement to the channel associated with the endpoint. -func (endpoint *Endpoint) AcknowledgePacket(packet channeltypes.Packet, ack []byte) error { - // get proof of acknowledgement on counterparty - packetKey := host.PacketAcknowledgementKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence()) - proof, proofHeight := endpoint.Counterparty.QueryProof(packetKey) - - ackMsg := channeltypes.NewMsgAcknowledgement( - packet, - ack, - proof, - proofHeight, - endpoint.Chain.SenderAccount.GetAddress().String(), - ) - - return endpoint.Chain.sendMsgs(ackMsg) -} - -// TimeoutPacket sends a MsgTimeout to the channel associated with the endpoint. -func (endpoint *Endpoint) TimeoutPacket(packet channeltypes.Packet) error { - // get proof for timeout based on channel order - var packetKey []byte - - switch endpoint.ChannelConfig.Order { - case channeltypes.ORDERED: - packetKey = host.NextSequenceRecvKey(packet.GetDestPort(), packet.GetDestChannel()) - case channeltypes.UNORDERED: - packetKey = host.PacketReceiptKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence()) - default: - return fmt.Errorf("unsupported order type %s", endpoint.ChannelConfig.Order) - } - - proof, proofHeight := endpoint.Counterparty.QueryProof(packetKey) - nextSeqRecv, found := endpoint.Counterparty.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextSequenceRecv( - endpoint.Counterparty.Chain.GetContext(), - endpoint.ChannelConfig.PortID, - endpoint.ChannelID, - ) - require.True(endpoint.Chain.t, found) - - timeoutMsg := channeltypes.NewMsgTimeout( - packet, nextSeqRecv, - proof, proofHeight, endpoint.Chain.SenderAccount.GetAddress().String(), - ) - - return endpoint.Chain.sendMsgs(timeoutMsg) -} - -// SetChannelClosed sets a channel state to CLOSED. -func (endpoint *Endpoint) SetChannelClosed() error { - channel := endpoint.GetChannel() - - channel.State = channeltypes.CLOSED - endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.SetChannel( - endpoint.Chain.GetContext(), - endpoint.ChannelConfig.PortID, - endpoint.ChannelID, - channel, - ) - - endpoint.Chain.Coordinator.CommitBlock(endpoint.Chain) - - return endpoint.Counterparty.UpdateClient() -} - -// GetClientState retrieves the Client State for this endpoint. The -// client state is expected to exist otherwise testing will fail. -func (endpoint *Endpoint) GetClientState() exported.ClientState { - return endpoint.Chain.GetClientState(endpoint.ClientID) -} - -// SetClientState sets the client state for this endpoint. -func (endpoint *Endpoint) SetClientState(clientState exported.ClientState) { - endpoint.Chain.App.GetIBCKeeper().ClientKeeper.SetClientState( - endpoint.Chain.GetContext(), - endpoint.ClientID, - clientState, - ) -} - -// GetConsensusState retrieves the Consensus State for this endpoint at the provided height. -// The consensus state is expected to exist otherwise testing will fail. -func (endpoint *Endpoint) GetConsensusState(height exported.Height) exported.ConsensusState { - consensusState, found := endpoint.Chain.GetConsensusState(endpoint.ClientID, height) - require.True(endpoint.Chain.t, found) - - return consensusState -} - -// SetConsensusState sets the consensus state for this endpoint. -func (endpoint *Endpoint) SetConsensusState(consensusState exported.ConsensusState, height exported.Height) { - endpoint.Chain.App.GetIBCKeeper().ClientKeeper.SetClientConsensusState( - endpoint.Chain.GetContext(), - endpoint.ClientID, - height, - consensusState, - ) -} - -// GetConnection retrieves an IBC Connection for the endpoint. The -// connection is expected to exist otherwise testing will fail. -func (endpoint *Endpoint) GetConnection() connectiontypes.ConnectionEnd { - connection, found := endpoint.Chain.App.GetIBCKeeper().ConnectionKeeper.GetConnection( - endpoint.Chain.GetContext(), - endpoint.ConnectionID, - ) - require.True(endpoint.Chain.t, found) - - return connection -} - -// SetConnection sets the connection for this endpoint. -func (endpoint *Endpoint) SetConnection(connection connectiontypes.ConnectionEnd) { - endpoint.Chain.App.GetIBCKeeper().ConnectionKeeper.SetConnection( - endpoint.Chain.GetContext(), - endpoint.ConnectionID, - connection, - ) -} - -// GetChannel retrieves an IBC Channel for the endpoint. The channel -// is expected to exist otherwise testing will fail. -func (endpoint *Endpoint) GetChannel() channeltypes.Channel { - channel, found := endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.GetChannel( - endpoint.Chain.GetContext(), - endpoint.ChannelConfig.PortID, - endpoint.ChannelID, - ) - require.True(endpoint.Chain.t, found) - - return channel -} - -// SetChannel sets the channel for this endpoint. -func (endpoint *Endpoint) SetChannel(channel channeltypes.Channel) { - endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.SetChannel( - endpoint.Chain.GetContext(), - endpoint.ChannelConfig.PortID, - endpoint.ChannelID, - channel, - ) -} - -// QueryClientStateProof performs and abci query for a client stat associated -// with this endpoint and returns the ClientState along with the proof. -func (endpoint *Endpoint) QueryClientStateProof() (exported.ClientState, []byte) { - // retrieve client state to provide proof for - clientState := endpoint.GetClientState() - - clientKey := host.FullClientStateKey(endpoint.ClientID) - proofClient, _ := endpoint.QueryProof(clientKey) - - return clientState, proofClient -} diff --git a/testing/ibctesting/events.go b/testing/ibctesting/events.go deleted file mode 100644 index 7d3a54e96..000000000 --- a/testing/ibctesting/events.go +++ /dev/null @@ -1,163 +0,0 @@ -package ibctesting - -import ( - "fmt" - "strconv" - - sdk "github.com/cosmos/cosmos-sdk/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - "github.com/stretchr/testify/suite" -) - -type EventsMap map[string]map[string]string - -// ParseClientIDFromEvents parses events emitted from a MsgCreateClient and returns the -// client identifier. -func ParseClientIDFromEvents(events sdk.Events) (string, error) { - for _, ev := range events { - if ev.Type == clienttypes.EventTypeCreateClient { - for _, attr := range ev.Attributes { - if attr.Key == clienttypes.AttributeKeyClientID { - return attr.Value, nil - } - } - } - } - return "", fmt.Errorf("client identifier event attribute not found") -} - -// ParseConnectionIDFromEvents parses events emitted from a MsgConnectionOpenInit or -// MsgConnectionOpenTry and returns the connection identifier. -func ParseConnectionIDFromEvents(events sdk.Events) (string, error) { - for _, ev := range events { - if ev.Type == connectiontypes.EventTypeConnectionOpenInit || - ev.Type == connectiontypes.EventTypeConnectionOpenTry { - for _, attr := range ev.Attributes { - if attr.Key == connectiontypes.AttributeKeyConnectionID { - return attr.Value, nil - } - } - } - } - return "", fmt.Errorf("connection identifier event attribute not found") -} - -// ParseChannelIDFromEvents parses events emitted from a MsgChannelOpenInit or -// MsgChannelOpenTry and returns the channel identifier. -func ParseChannelIDFromEvents(events sdk.Events) (string, error) { - for _, ev := range events { - if ev.Type == channeltypes.EventTypeChannelOpenInit || ev.Type == channeltypes.EventTypeChannelOpenTry { - for _, attr := range ev.Attributes { - if attr.Key == channeltypes.AttributeKeyChannelID { - return attr.Value, nil - } - } - } - } - return "", fmt.Errorf("channel identifier event attribute not found") -} - -// ParsePacketFromEvents parses events emitted from a MsgRecvPacket and returns the -// acknowledgement. -func ParsePacketFromEvents(events sdk.Events) (channeltypes.Packet, error) { - for _, ev := range events { - if ev.Type == channeltypes.EventTypeSendPacket { - packet := channeltypes.Packet{} - for _, attr := range ev.Attributes { - switch attr.Key { - case channeltypes.AttributeKeyData: //nolint:staticcheck // DEPRECATED - packet.Data = []byte(attr.Value) - - case channeltypes.AttributeKeySequence: - seq, err := strconv.ParseUint(attr.Value, 10, 64) - if err != nil { - return channeltypes.Packet{}, err - } - - packet.Sequence = seq - - case channeltypes.AttributeKeySrcPort: - packet.SourcePort = attr.Value - - case channeltypes.AttributeKeySrcChannel: - packet.SourceChannel = attr.Value - - case channeltypes.AttributeKeyDstPort: - packet.DestinationPort = attr.Value - - case channeltypes.AttributeKeyDstChannel: - packet.DestinationChannel = attr.Value - - case channeltypes.AttributeKeyTimeoutHeight: - height, err := clienttypes.ParseHeight(attr.Value) - if err != nil { - return channeltypes.Packet{}, err - } - - packet.TimeoutHeight = height - - case channeltypes.AttributeKeyTimeoutTimestamp: - timestamp, err := strconv.ParseUint(attr.Value, 10, 64) - if err != nil { - return channeltypes.Packet{}, err - } - - packet.TimeoutTimestamp = timestamp - - default: - continue - } - } - - return packet, nil - } - } - return channeltypes.Packet{}, fmt.Errorf("acknowledgement event attribute not found") -} - -// ParseAckFromEvents parses events emitted from a MsgRecvPacket and returns the -// acknowledgement. -func ParseAckFromEvents(events sdk.Events) ([]byte, error) { - for _, ev := range events { - if ev.Type == channeltypes.EventTypeWriteAck { - for _, attr := range ev.Attributes { - if attr.Key == channeltypes.AttributeKeyAck { //nolint:staticcheck // DEPRECATED - return []byte(attr.Value), nil - } - } - } - } - return nil, fmt.Errorf("acknowledgement event attribute not found") -} - -// AssertEvents asserts that expected events are present in the actual events. -// Expected map needs to be a subset of actual events to pass. -func AssertEvents( - suite *suite.Suite, - expected EventsMap, - actual sdk.Events, -) { - hasEvents := make(map[string]bool) - for eventType := range expected { - hasEvents[eventType] = false - } - - for _, event := range actual { - expEvent, eventFound := expected[event.Type] - if eventFound { - hasEvents[event.Type] = true - suite.Require().Len(event.Attributes, len(expEvent)) - for _, attr := range event.Attributes { - expValue, found := expEvent[attr.Key] - suite.Require().True(found) - suite.Require().Equal(expValue, attr.Value) - } - } - } - - for eventName, hasEvent := range hasEvents { - suite.Require().True(hasEvent, "event: %s was not found in events", eventName) - } -} diff --git a/testing/ibctesting/path.go b/testing/ibctesting/path.go deleted file mode 100644 index 8b39b0fbb..000000000 --- a/testing/ibctesting/path.go +++ /dev/null @@ -1,98 +0,0 @@ -package ibctesting - -import ( - "bytes" - "fmt" - - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" -) - -// Path contains two endpoints representing two chains connected over IBC -type Path struct { - EndpointA *Endpoint - EndpointB *Endpoint -} - -// NewPath constructs an endpoint for each chain using the default values -// for the endpoints. Each endpoint is updated to have a pointer to the -// counterparty endpoint. -func NewPath(chainA, chainB *TestChain) *Path { - endpointA := NewDefaultEndpoint(chainA) - endpointB := NewDefaultEndpoint(chainB) - - endpointA.Counterparty = endpointB - endpointB.Counterparty = endpointA - - return &Path{ - EndpointA: endpointA, - EndpointB: endpointB, - } -} - -// SetChannelOrdered sets the channel order for both endpoints to ORDERED. -func (path *Path) SetChannelOrdered() { - path.EndpointA.ChannelConfig.Order = channeltypes.ORDERED - path.EndpointB.ChannelConfig.Order = channeltypes.ORDERED -} - -// RelayPacket attempts to relay the packet first on EndpointA and then on EndpointB -// if EndpointA does not contain a packet commitment for that packet. An error is returned -// if a relay step fails or the packet commitment does not exist on either endpoint. -func (path *Path) RelayPacket(packet channeltypes.Packet) error { - pc := path.EndpointA.Chain.App.GetIBCKeeper().ChannelKeeper.GetPacketCommitment( - path.EndpointA.Chain.GetContext(), - packet.GetSourcePort(), - packet.GetSourceChannel(), - packet.GetSequence(), - ) - if bytes.Equal(pc, channeltypes.CommitPacket(path.EndpointA.Chain.App.AppCodec(), packet)) { - // packet found, relay from A to B - if err := path.EndpointB.UpdateClient(); err != nil { - return err - } - - res, err := path.EndpointB.RecvPacketWithResult(packet) - if err != nil { - return err - } - - ack, err := ParseAckFromEvents(res.GetEvents()) - if err != nil { - return err - } - - if err := path.EndpointA.AcknowledgePacket(packet, ack); err != nil { - return err - } - return nil - } - - pc = path.EndpointB.Chain.App.GetIBCKeeper().ChannelKeeper.GetPacketCommitment( - path.EndpointB.Chain.GetContext(), - packet.GetSourcePort(), - packet.GetSourceChannel(), - packet.GetSequence(), - ) - if bytes.Equal(pc, channeltypes.CommitPacket(path.EndpointB.Chain.App.AppCodec(), packet)) { - // packet found, relay from B to A - if err := path.EndpointA.UpdateClient(); err != nil { - return err - } - - res, err := path.EndpointA.RecvPacketWithResult(packet) - if err != nil { - return err - } - - ack, err := ParseAckFromEvents(res.GetEvents()) - if err != nil { - return err - } - if err := path.EndpointB.AcknowledgePacket(packet, ack); err != nil { - return err - } - return nil - } - - return fmt.Errorf("packet commitment does not exist on either endpoint for provided packet") -} diff --git a/testing/ibctesting/value.go b/testing/ibctesting/value.go deleted file mode 100644 index e11da44ba..000000000 --- a/testing/ibctesting/value.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -This file contains the variables, constants, and default values -used in the testing package and commonly defined in tests. -*/ -package ibctesting - -import ( - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" - ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - "github.com/cosmos/ibc-go/v7/testing/mock" - - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" -) - -const ( - FirstClientID = "07-tendermint-0" - FirstChannelID = "channel-0" - FirstConnectionID = "connection-0" - - // Default params constants used to create a TM client - TrustingPeriod time.Duration = time.Hour * 24 * 7 * 2 - UnbondingPeriod time.Duration = time.Hour * 24 * 7 * 3 - MaxClockDrift time.Duration = time.Second * 10 - DefaultDelayPeriod uint64 = 0 - - DefaultChannelVersion = oracletypes.Version - InvalidID = "IDisInvalid" - - // Application Ports - OraclePort = oracletypes.ModuleName - MockPort = mock.ModuleName - - // used for testing proposals - Title = "title" - Description = "description" -) - -var ( - DefaultOpenInitVersion *connectiontypes.Version - - // Default params variables used to create a TM client - DefaultTrustLevel ibctmtypes.Fraction = ibctmtypes.DefaultTrustLevel - TestCoin = sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100)) - - UpgradePath = []string{"upgrade", "upgradedIBCState"} - - ConnectionVersion = connectiontypes.ExportedVersionsToProto(connectiontypes.GetCompatibleVersions())[0] - - // MockAcknowledgement = mock.MockAcknowledgement.Acknowledgement() - // MockPacketData = []byte("mock packet data") - // MockFailPacketData = []byte("mock failed packet data") - // MockCanaryCapabilityName = []byte("mock async packet data") - - // prefix = commitmenttypes.NewMerklePrefix([]byte("ibc")) -) diff --git a/testing/test_helpers.go b/testing/test_helpers.go index 602c63876..bb45789f8 100644 --- a/testing/test_helpers.go +++ b/testing/test_helpers.go @@ -4,47 +4,41 @@ import ( "encoding/json" "fmt" "math/rand" - "os" "path/filepath" "sort" "testing" "time" - sdkmath "cosmossdk.io/math" - owasm "github.com/bandprotocol/go-owasm/api" - dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" + + cosmosdb "github.com/cosmos/cosmos-db" + ibctesting "github.com/cosmos/ibc-go/v8/testing" + + "cosmossdk.io/log" + "cosmossdk.io/math" + "cosmossdk.io/store/snapshots" + snapshottypes "cosmossdk.io/store/snapshots/types" + "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/server" - "github.com/cosmos/cosmos-sdk/snapshots" - snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + "github.com/cosmos/cosmos-sdk/testutil" + "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/types/tx/signing" - authsign "github.com/cosmos/cosmos-sdk/x/auth/signing" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - "github.com/stretchr/testify/require" - bandapp "github.com/bandprotocol/chain/v2/app" - "github.com/bandprotocol/chain/v2/pkg/filecache" - "github.com/bandprotocol/chain/v2/testing/testdata" - "github.com/bandprotocol/chain/v2/x/oracle/types" + owasm "github.com/bandprotocol/go-owasm/api" + + band "github.com/bandprotocol/chain/v3/app" + "github.com/bandprotocol/chain/v3/pkg/filecache" + "github.com/bandprotocol/chain/v3/testing/testdata" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) // Account is a data structure to store key of test account. @@ -56,16 +50,17 @@ type Account struct { } var ( - Owner Account - Treasury Account - FeePayer Account - Alice Account - Bob Account - Carol Account - Validators []Account - DataSources []types.DataSource - OracleScripts []types.OracleScript - OwasmVM *owasm.Vm + Owner Account + Treasury Account + FeePayer Account + Alice Account + Bob Account + Carol Account + MissedValidator Account + Validators []Account + DataSources []oracletypes.DataSource + OracleScripts []oracletypes.OracleScript + OwasmVM *owasm.Vm ) var ( @@ -76,7 +71,7 @@ var ( Coins1000000uband = sdk.NewCoins(sdk.NewInt64Coin("uband", 1000000)) Coins99999999uband = sdk.NewCoins(sdk.NewInt64Coin("uband", 99999999)) Coins100000000uband = sdk.NewCoins(sdk.NewInt64Coin("uband", 100000000)) - BadCoins = []sdk.Coin{{Denom: "uband", Amount: sdk.NewInt(-1)}} + BadCoins = []sdk.Coin{{Denom: "uband", Amount: math.NewInt(-1)}} ) const ( @@ -91,53 +86,24 @@ const ( ) // DefaultConsensusParams defines the default Tendermint consensus params used in TestingApp. -var DefaultConsensusParams = &tmproto.ConsensusParams{ - Block: &tmproto.BlockParams{ +var DefaultConsensusParams = &cmtproto.ConsensusParams{ + Block: &cmtproto.BlockParams{ MaxBytes: 200000, MaxGas: -1, }, - Evidence: &tmproto.EvidenceParams{ + Evidence: &cmtproto.EvidenceParams{ MaxAgeNumBlocks: 302400, MaxAgeDuration: 504 * time.Hour, // 3 weeks is the max duration // MaxBytes: 10000, }, - Validator: &tmproto.ValidatorParams{ + Validator: &cmtproto.ValidatorParams{ PubKeyTypes: []string{ - tmtypes.ABCIPubKeyTypeSecp256k1, + cmttypes.ABCIPubKeyTypeSecp256k1, }, }, } -type TestingApp struct { - *bandapp.BandApp -} - -func (app *TestingApp) GetBaseApp() *baseapp.BaseApp { - return app.BaseApp -} - -// GetStakingKeeper implements the TestingApp interface. -func (app *TestingApp) GetStakingKeeper() *stakingkeeper.Keeper { - return app.StakingKeeper -} - -// GetIBCKeeper implements the TestingApp interface. -func (app *TestingApp) GetIBCKeeper() *ibckeeper.Keeper { - return app.IBCKeeper -} - -// GetScopedIBCKeeper implements the TestingApp interface. -func (app *TestingApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { - return app.ScopedIBCKeeper -} - -// GetTxConfig implements the TestingApp interface. -func (app *TestingApp) GetTxConfig() client.TxConfig { - return bandapp.MakeEncodingConfig().TxConfig -} - func init() { - bandapp.SetBech32AddressPrefixesAndBip44CoinTypeAndSeal(sdk.GetConfig()) r := rand.New(rand.NewSource(time.Now().Unix())) Owner = createArbitraryAccount(r) Treasury = createArbitraryAccount(r) @@ -145,6 +111,7 @@ func init() { Alice = createArbitraryAccount(r) Bob = createArbitraryAccount(r) Carol = createArbitraryAccount(r) + MissedValidator = createArbitraryAccount(r) for i := 0; i < 3; i++ { Validators = append(Validators, createArbitraryAccount(r)) } @@ -161,22 +128,32 @@ func init() { OwasmVM = owasmVM } -// CreateTestApp creates a new test environment for unit tests. -func CreateTestApp(t *testing.T, autoActivate bool) (*TestingApp, sdk.Context) { - t.Helper() +// createArbitraryAccount generates a random Account using a provided random number generator. +func createArbitraryAccount(r *rand.Rand) Account { + privkeySeed := make([]byte, 12) + _, _ = r.Read(privkeySeed) + privKey := secp256k1.GenPrivKeyFromSecret(privkeySeed) + return Account{ + PrivKey: privKey, + PubKey: privKey.PubKey(), + Address: sdk.AccAddress(privKey.PubKey().Address()), + ValAddress: sdk.ValAddress(privKey.PubKey().Address()), + } +} - acc := []authtypes.GenesisAccount{ +func GenesisStateWithValSet(app *band.BandApp, dir string) band.GenesisState { + genAccs := []authtypes.GenesisAccount{ &authtypes.BaseAccount{Address: Owner.Address.String()}, &authtypes.BaseAccount{Address: FeePayer.Address.String()}, &authtypes.BaseAccount{Address: Alice.Address.String()}, &authtypes.BaseAccount{Address: Bob.Address.String()}, &authtypes.BaseAccount{Address: Carol.Address.String()}, + &authtypes.BaseAccount{Address: MissedValidator.Address.String()}, &authtypes.BaseAccount{Address: Validators[0].Address.String()}, &authtypes.BaseAccount{Address: Validators[1].Address.String()}, &authtypes.BaseAccount{Address: Validators[2].Address.String()}, } - // Fund seed accounts and validators with 1000000uband and 100000000uband initially. balances := []banktypes.Balance{ { Address: Owner.Address.String(), @@ -186,277 +163,38 @@ func CreateTestApp(t *testing.T, autoActivate bool) (*TestingApp, sdk.Context) { {Address: Alice.Address.String(), Coins: Coins1000000uband}, {Address: Bob.Address.String(), Coins: Coins1000000uband}, {Address: Carol.Address.String(), Coins: Coins1000000uband}, + {Address: MissedValidator.Address.String(), Coins: Coins100000000uband}, {Address: Validators[0].Address.String(), Coins: Coins100000000uband}, {Address: Validators[1].Address.String(), Coins: Coins100000000uband}, {Address: Validators[2].Address.String(), Coins: Coins100000000uband}, } - isCheckTx := false - app := setupWithGenesis(t, Validators, acc, ChainID, balances...) - ctx := app.NewContext(isCheckTx, tmproto.Header{Height: app.LastBlockHeight()}) - if autoActivate { - err := app.OracleKeeper.Activate(ctx, Validators[0].ValAddress) - require.NoError(t, err) - err = app.OracleKeeper.Activate(ctx, Validators[1].ValAddress) - require.NoError(t, err) - err = app.OracleKeeper.Activate(ctx, Validators[2].ValAddress) - require.NoError(t, err) - } - - return &TestingApp{app}, ctx -} - -// setupWithGenesis sets up a BandApp for testing with a specified genesis state. -func setupWithGenesis( - t *testing.T, - valSet []Account, - genAccs []authtypes.GenesisAccount, - chainID string, - balances ...banktypes.Balance, -) *bandapp.BandApp { - t.Helper() - - app, genesisState, dir := setup(t, chainID, true) - genesisState = generateGenesisState(t, app, dir, genesisState, valSet, genAccs, balances...) - - stateBytes, err := json.MarshalIndent(genesisState, "", " ") - if err != nil { - panic(err) - } - - // Initialize the sim blockchain. We are ready for testing! - app.InitChain(abci.RequestInitChain{ - ChainId: chainID, - Validators: []abci.ValidatorUpdate{}, - ConsensusParams: DefaultConsensusParams, - AppStateBytes: stateBytes, - }) - return app -} - -// setup initializes a BandApp instance for simulation testing. -func setup(t *testing.T, chainID string, withGenesis bool) (*bandapp.BandApp, bandapp.GenesisState, string) { - t.Helper() - - // Set HomeFlag to a temp folder for simulation run. - dir, err := os.MkdirTemp("", "bandd") - if err != nil { - panic(err) - } - db, _ := dbm.NewGoLevelDB("db", dir) - - appOptions := make(simtestutil.AppOptionsMap, 0) - appOptions[flags.FlagHome] = dir - appOptions[server.FlagInvCheckPeriod] = 0 - - snapshotDir := filepath.Join(dir, "data", "snapshots") - snapshotDB, err := dbm.NewDB("metadata", dbm.GoLevelDBBackend, snapshotDir) - if err != nil { - panic(err) - } - snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir) - if err != nil { - panic(err) - } - - snapshotOptions := snapshottypes.NewSnapshotOptions( - 1000, - 2, - ) - - app := bandapp.NewBandApp( - log.NewNopLogger(), - db, - nil, - true, - map[int64]bool{}, - appOptions, - 100, - "", "", "", - baseapp.SetSnapshot(snapshotStore, snapshotOptions), - baseapp.SetChainID(chainID), - ) - if withGenesis { - return app, bandapp.NewDefaultGenesisState(), dir - } - - return app, bandapp.GenesisState{}, dir -} - -// SetupWithEmptyStore setup a instance with empty DB. -func SetupWithEmptyStore(t *testing.T, chainID string) *bandapp.BandApp { - t.Helper() - - app, _, _ := setup(t, chainID, false) - return app -} - -// SetupWithGenesisValSet initializes a new TestingApp with a validator set and genesis accounts -// that also act as delegator. For simplicity, each validator is bonded with a delegation -// of one consensus engine unit (10^6) in the default token of the BandChain from first genesis -// account. A Nop logger is set in TestingApp. -func SetupWithGenesisValSet( - t *testing.T, - valSet *tmtypes.ValidatorSet, - genAccs []authtypes.GenesisAccount, - chainID string, - balances ...banktypes.Balance, -) *TestingApp { - t.Helper() - - app, genesisState, dir := setup(t, chainID, true) - - // set genesis accounts - authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) - genesisState[authtypes.ModuleName] = app.AppCodec().MustMarshalJSON(authGenesis) - - validators := make([]stakingtypes.Validator, 0, len(valSet.Validators)) - delegations := make([]stakingtypes.Delegation, 0, len(valSet.Validators)) - - bondAmt := sdk.NewInt(1000000) - - for _, val := range valSet.Validators { - pk, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) - require.NoError(t, err) - pkAny, err := codectypes.NewAnyWithValue(pk) - require.NoError(t, err) - validator := stakingtypes.Validator{ - OperatorAddress: sdk.ValAddress(val.Address).String(), - ConsensusPubkey: pkAny, - Jailed: false, - Status: stakingtypes.Bonded, - Tokens: bondAmt, - DelegatorShares: sdk.OneDec(), - Description: stakingtypes.Description{}, - UnbondingHeight: int64(0), - UnbondingTime: time.Unix(0, 0).UTC(), - Commission: stakingtypes.NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()), - MinSelfDelegation: sdk.ZeroInt(), - } - validators = append(validators, validator) - delegations = append( - delegations, - stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), sdk.OneDec()), - ) - } - - // set validators and delegations - ps := stakingtypes.DefaultParams() - ps.BondDenom = "uband" - stakingGenesis := stakingtypes.NewGenesisState(ps, validators, delegations) - genesisState[stakingtypes.ModuleName] = app.AppCodec().MustMarshalJSON(stakingGenesis) - - totalSupply := sdk.NewCoins() - for _, b := range balances { - // add genesis acc tokens and delegated tokens to total supply - totalSupply = totalSupply.Add(b.Coins.Add(sdk.NewCoin("uband", bondAmt))...) - } - - // add bonded amount to bonded pool module account - balances = append(balances, banktypes.Balance{ - Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(), - Coins: sdk.Coins{sdk.NewCoin("uband", bondAmt.Mul(sdk.NewInt(2)))}, - }) - - // update total supply - bankGenesis := banktypes.NewGenesisState( - banktypes.DefaultGenesisState().Params, - balances, - totalSupply, - []banktypes.Metadata{}, - []banktypes.SendEnabled{}, - ) - genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenesis) - - // Add genesis data sources and oracle scripts - oracleGenesis := types.DefaultGenesisState() - oracleGenesis.DataSources = generateDataSources(dir) - oracleGenesis.OracleScripts = generateOracleScripts(dir) - genesisState[types.ModuleName] = app.AppCodec().MustMarshalJSON(oracleGenesis) - - stateBytes, err := json.MarshalIndent(genesisState, "", " ") - require.NoError(t, err) - - // init chain will set the validator set and initialize the genesis accounts - app.InitChain( - abci.RequestInitChain{ - ChainId: chainID, - Validators: []abci.ValidatorUpdate{}, - ConsensusParams: DefaultConsensusParams, - AppStateBytes: stateBytes, - }, - ) - - // commit genesis changes - app.Commit() - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ - ChainID: chainID, - Height: app.LastBlockHeight() + 1, - AppHash: app.LastCommitID().Hash, - ValidatorsHash: valSet.Hash(), - NextValidatorsHash: valSet.Hash(), - }, Hash: app.LastCommitID().Hash}) - - return &TestingApp{app} -} - -// createArbitraryAccount generates a random Account using a provided random number generator. -func createArbitraryAccount(r *rand.Rand) Account { - privkeySeed := make([]byte, 12) - r.Read(privkeySeed) - privKey := secp256k1.GenPrivKeyFromSecret(privkeySeed) - return Account{ - PrivKey: privKey, - PubKey: privKey.PubKey(), - Address: sdk.AccAddress(privKey.PubKey().Address()), - ValAddress: sdk.ValAddress(privKey.PubKey().Address()), - } -} - -// generateGenesisState initializes the genesis state of a BandApp for testing. -func generateGenesisState( - t *testing.T, - app *bandapp.BandApp, - dir string, - genesisState bandapp.GenesisState, - valSet []Account, - genAccs []authtypes.GenesisAccount, - balances ...banktypes.Balance, -) bandapp.GenesisState { - t.Helper() - + genesisState := band.NewDefaultGenesisState(app.AppCodec()) authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) genesisState[authtypes.ModuleName] = app.AppCodec().MustMarshalJSON(authGenesis) - validators := make([]stakingtypes.Validator, 0, len(valSet)) - signingInfos := make([]slashingtypes.SigningInfo, 0, len(valSet)) - delegations := make([]stakingtypes.Delegation, 0, len(valSet)) - bamt := []sdkmath.Int{Coins100000000uband[0].Amount, Coins1000000uband[0].Amount, Coins99999999uband[0].Amount} - for idx, val := range valSet { - tmpk, err := cryptocodec.ToTmPubKeyInterface(val.PubKey) - if err != nil { - panic(err) - } - pk, err := cryptocodec.FromTmPubKeyInterface(tmpk) - if err != nil { - panic(err) - } - pkAny, err := codectypes.NewAnyWithValue(pk) - if err != nil { - panic(err) - } + validators := make([]stakingtypes.Validator, 0, len(Validators)) + signingInfos := make([]slashingtypes.SigningInfo, 0, len(Validators)) + delegations := make([]stakingtypes.Delegation, 0, len(Validators)) + bamt := []math.Int{Coins100000000uband[0].Amount, Coins1000000uband[0].Amount, Coins99999999uband[0].Amount} + for idx, val := range Validators { + pkAny, _ := codectypes.NewAnyWithValue(val.PubKey) validator := stakingtypes.Validator{ - OperatorAddress: sdk.ValAddress(val.Address).String(), - ConsensusPubkey: pkAny, - Jailed: false, - Status: stakingtypes.Bonded, - Tokens: bamt[idx], - DelegatorShares: sdk.OneDec(), - Description: stakingtypes.Description{}, - UnbondingHeight: int64(0), - UnbondingTime: time.Unix(0, 0).UTC(), - Commission: stakingtypes.NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()), - MinSelfDelegation: sdk.ZeroInt(), + OperatorAddress: val.ValAddress.String(), + ConsensusPubkey: pkAny, + Jailed: false, + Status: stakingtypes.Bonded, + Tokens: bamt[idx], + DelegatorShares: math.LegacyOneDec(), + Description: stakingtypes.Description{}, + UnbondingHeight: int64(0), + UnbondingTime: time.Unix(0, 0).UTC(), + Commission: stakingtypes.NewCommission( + math.LegacyZeroDec(), + math.LegacyZeroDec(), + math.LegacyZeroDec(), + ), + MinSelfDelegation: math.ZeroInt(), } consAddr, err := validator.GetConsAddr() validatorSigningInfo := slashingtypes.NewValidatorSigningInfo(consAddr, 0, 0, time.Unix(0, 0), false, 0) @@ -466,11 +204,18 @@ func generateGenesisState( validators = append(validators, validator) signingInfos = append( signingInfos, - slashingtypes.SigningInfo{Address: consAddr.String(), ValidatorSigningInfo: validatorSigningInfo}, + slashingtypes.SigningInfo{ + Address: sdk.ConsAddress(consAddr).String(), + ValidatorSigningInfo: validatorSigningInfo, + }, ) delegations = append( delegations, - stakingtypes.NewDelegation(genAccs[4+idx].GetAddress(), val.Address.Bytes(), sdk.OneDec()), + stakingtypes.NewDelegation( + genAccs[4+idx].GetAddress().String(), + val.ValAddress.String(), + math.LegacyOneDec(), + ), ) } // set validators and delegations @@ -497,7 +242,7 @@ func generateGenesisState( // add bonded amount to bonded pool module account balances = append(balances, banktypes.Balance{ Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(), - Coins: sdk.Coins{sdk.NewCoin("uband", sdk.NewInt(200999999))}, + Coins: sdk.Coins{sdk.NewCoin("uband", math.NewInt(200999999))}, }) bankGenesis := banktypes.NewGenesisState( @@ -510,140 +255,115 @@ func generateGenesisState( genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenesis) // Add genesis data sources and oracle scripts - oracleGenesis := types.DefaultGenesisState() - oracleGenesis.DataSources = generateDataSources(dir) - oracleGenesis.OracleScripts = generateOracleScripts(dir) - genesisState[types.ModuleName] = app.AppCodec().MustMarshalJSON(oracleGenesis) + oracleGenesis := oracletypes.DefaultGenesisState() + oracleGenesis.DataSources = GenerateDataSources(dir) + oracleGenesis.OracleScripts = GenerateOracleScripts(dir) + genesisState[oracletypes.ModuleName] = app.AppCodec().MustMarshalJSON(oracleGenesis) return genesisState } -// generateDataSources generates a set of data sources for the BandApp. -func generateDataSources(homePath string) []types.DataSource { +// GenerateDataSources generates a set of data sources for the BandApp. +func GenerateDataSources(homePath string) []oracletypes.DataSource { dir := filepath.Join(homePath, "files") fc := filecache.New(dir) - DataSources = []types.DataSource{{}} // 0th index should be ignored + DataSources = []oracletypes.DataSource{{}} // 0th index should be ignored for idx := 0; idx < 5; idx++ { idxStr := fmt.Sprintf("%d", idx+1) hash := fc.AddFile([]byte("code" + idxStr)) - DataSources = append(DataSources, types.NewDataSource( + DataSources = append(DataSources, oracletypes.NewDataSource( Owner.Address, "name"+idxStr, "desc"+idxStr, hash, Coins1000000uband, Treasury.Address, )) } return DataSources[1:] } -// generateOracleScripts generates a set of oracle scripts for the BandApp. -func generateOracleScripts(homePath string) []types.OracleScript { +// GenerateOracleScripts generates a set of oracle scripts for the BandApp. +func GenerateOracleScripts(homePath string) []oracletypes.OracleScript { dir := filepath.Join(homePath, "files") fc := filecache.New(dir) - OracleScripts = []types.OracleScript{{}} // 0th index should be ignored + OracleScripts = []oracletypes.OracleScript{{}} // 0th index should be ignored wasms := [][]byte{ testdata.Wasm1, testdata.Wasm2, testdata.Wasm3, testdata.Wasm4, testdata.Wasm56(10), testdata.Wasm56(10000000), testdata.Wasm78(10), testdata.Wasm78(2000), testdata.Wasm9, } for idx := 0; idx < len(wasms); idx++ { idxStr := fmt.Sprintf("%d", idx+1) hash := fc.AddFile(testdata.Compile(wasms[idx])) - OracleScripts = append(OracleScripts, types.NewOracleScript( + OracleScripts = append(OracleScripts, oracletypes.NewOracleScript( Owner.Address, "name"+idxStr, "desc"+idxStr, hash, "schema"+idxStr, "url"+idxStr, )) } return OracleScripts[1:] } -// GenTx generates a signed mock transaction. -func GenTx( - gen client.TxConfig, - msgs []sdk.Msg, - feeAmt sdk.Coins, - gas uint64, - chainID string, - accNums, accSeqs []uint64, - priv ...cryptotypes.PrivKey, -) (sdk.Tx, error) { - sigs := make([]signing.SignatureV2, len(priv)) - - // create a random length memo - r := rand.New(rand.NewSource(time.Now().UnixNano())) - - memo := simulation.RandStringOfLength(r, simulation.RandIntBetween(r, 0, 100)) - - signMode := gen.SignModeHandler().DefaultMode() - - // 1st round: set SignatureV2 with empty signatures, to set correct - // signer infos. - for i, p := range priv { - sigs[i] = signing.SignatureV2{ - PubKey: p.PubKey(), - Data: &signing.SingleSignatureData{ - SignMode: signMode, - }, - Sequence: accSeqs[i], - } - } +// SetupWithCustomHome initializes a new BandApp with a custom home directory +func SetupWithCustomHome(isCheckTx bool, dir string) *band.BandApp { + return SetupWithCustomHomeAndChainId(isCheckTx, dir, ChainID) +} + +func SetupWithCustomHomeAndChainId(isCheckTx bool, dir, chainID string) *band.BandApp { + db := cosmosdb.NewMemDB() - tx := gen.NewTxBuilder() - err := tx.SetMsgs(msgs...) + snapshotDir := filepath.Join(dir, "data", "snapshots") + snapshotDB, err := cosmosdb.NewDB("metadata", cosmosdb.GoLevelDBBackend, snapshotDir) if err != nil { - return nil, err + panic(err) } - err = tx.SetSignatures(sigs...) + snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir) if err != nil { - return nil, err + panic(err) } - tx.SetMemo(memo) - tx.SetFeeAmount(feeAmt) - tx.SetGasLimit(gas) - - // 2nd round: once all signer infos are set, every signer can sign. - for i, p := range priv { - signerData := authsign.SignerData{ - ChainID: chainID, - AccountNumber: accNums[i], - Sequence: accSeqs[i], - } - signBytes, err := gen.SignModeHandler().GetSignBytes(signMode, signerData, tx.GetTx()) - if err != nil { - panic(err) - } - sig, err := p.Sign(signBytes) + + app := band.NewBandApp( + log.NewNopLogger(), + db, + nil, + true, + map[int64]bool{}, + dir, + sims.EmptyAppOptions{}, + 100, + baseapp.SetChainID(chainID), + baseapp.SetSnapshot(snapshotStore, snapshottypes.SnapshotOptions{KeepRecent: 2}), + ) + if !isCheckTx { + genesisState := GenesisStateWithValSet(app, dir) + defaultGenesisStatebytes, err := json.Marshal(genesisState) if err != nil { panic(err) } - sigs[i].Data.(*signing.SingleSignatureData).Signature = sig - err = tx.SetSignatures(sigs...) + + _, err = app.InitChain( + &abci.RequestInitChain{ + Validators: []abci.ValidatorUpdate{}, + ConsensusParams: DefaultConsensusParams, + AppStateBytes: defaultGenesisStatebytes, + ChainId: chainID, + }, + ) if err != nil { panic(err) } } - return tx.GetTx(), nil + return app } -// SignAndDeliver signs and delivers a transaction. No simulation occurs as the -// ibc testing package causes checkState and deliverState to diverge in block time. -func SignAndDeliver( - t *testing.T, txCfg client.TxConfig, app *baseapp.BaseApp, header tmproto.Header, msgs []sdk.Msg, - chainID string, accNums, accSeqs []uint64, priv ...cryptotypes.PrivKey, -) (sdk.GasInfo, *sdk.Result, error) { - tx, err := GenTx( - txCfg, - msgs, - sdk.Coins{sdk.NewInt64Coin("uband", 2500)}, - DefaultGenTxGas, - chainID, - accNums, - accSeqs, - priv..., - ) - require.NoError(t, err) - - // Simulate a sending a transaction and committing a block - app.BeginBlock(abci.RequestBeginBlock{Header: header, Hash: header.AppHash}) - gInfo, res, err := app.SimDeliver(txCfg.TxEncoder(), tx) - - app.EndBlock(abci.RequestEndBlock{}) - app.Commit() +func CreateTestingAppFn(t testing.TB) func() (ibctesting.TestingApp, map[string]json.RawMessage) { + return func() (ibctesting.TestingApp, map[string]json.RawMessage) { + dir := testutil.GetTempDir(t) + app := band.NewBandApp( + log.NewNopLogger(), + cosmosdb.NewMemDB(), + nil, + true, + map[int64]bool{}, + dir, + sims.EmptyAppOptions{}, + 100, + ) - return gInfo, res, err + g := GenesisStateWithValSet(app, dir) + return app, g + } } diff --git a/testing/testdata/wasm_1_simple.go b/testing/testdata/wasm_1_simple.go index 827329a99..835cc7d5e 100644 --- a/testing/testdata/wasm_1_simple.go +++ b/testing/testdata/wasm_1_simple.go @@ -3,11 +3,11 @@ package testdata // Wasm1 is a simple Owasm script with the following specification: // // PREPARE: -// CALL ask_external_data with EID 1 DID 1 CALLDATA "beeb" -// CALL ask_external_data with EID 2 DID 2 CALLDATA "beeb" -// CALL ask_external_data with EID 3 DID 3 CALLDATA "beeb" +// CALL ask_external_data with EID 1 DID 1 CALLDATA "test" +// CALL ask_external_data with EID 2 DID 2 CALLDATA "test" +// CALL ask_external_data with EID 3 DID 3 CALLDATA "test" // EXECUTE: -// CALL set_return_date with RETDATE "beeb" +// CALL set_return_date with RETDATE "test" var Wasm1 = wat2wasm(` (module (type $t0 (func)) @@ -49,5 +49,5 @@ var Wasm1 = wat2wasm(` call $set_return_data) (table $T0 1 1 funcref) (memory $memory (export "memory") 17) - (data (i32.const 1024) "beeb")) + (data (i32.const 1024) "test")) `) diff --git a/testing/testdata/wasm_2_return_in_prepare.go b/testing/testdata/wasm_2_return_in_prepare.go index 5e1bc0c1d..e2bedeb25 100644 --- a/testing/testdata/wasm_2_return_in_prepare.go +++ b/testing/testdata/wasm_2_return_in_prepare.go @@ -3,7 +3,7 @@ package testdata // Wasm2 is a bad Owasm script with the following specification: // // PREPARE: -// CALL set_return_data with RETDATA "beeb" -- Not allowed during prepare +// CALL set_return_data with RETDATA "test" -- Not allowed during prepare // EXECUTE: // DO NOTHING var Wasm2 []byte = wat2wasm(` @@ -17,5 +17,5 @@ var Wasm2 []byte = wat2wasm(` call $set_return_data) (func $execute (export "execute")) (memory $memory (export "memory") 17) - (data (i32.const 1024) "beeb")) + (data (i32.const 1024) "test")) `) diff --git a/testing/testdata/wasm_3_do_nothing.go b/testing/testdata/wasm_3_do_nothing.go index 43c11b8a8..cece01612 100644 --- a/testing/testdata/wasm_3_do_nothing.go +++ b/testing/testdata/wasm_3_do_nothing.go @@ -17,5 +17,5 @@ var Wasm3 []byte = wat2wasm(` (func $execute (export "execute") (type $t0)) (table $T0 1 1 funcref) (memory $memory (export "memory") 17) - (data (i32.const 1024) "beeb")) + (data (i32.const 1024) "test")) `) diff --git a/testing/testdata/wasm_56_computation.go b/testing/testdata/wasm_56_computation.go index 453903179..c80ef0cf6 100644 --- a/testing/testdata/wasm_56_computation.go +++ b/testing/testdata/wasm_56_computation.go @@ -7,9 +7,9 @@ import ( // An oracle script to test heavy computation. // // PREPARE: -// Loop for `time` times and ask external data with calldata "new beeb". +// Loop for `time` times and ask external data with calldata "new test". // EXECUTE: -// Loop for `time` times and set return data "new beeb". +// Loop for `time` times and set return data "new test". func Wasm56(time int) []byte { return wat2wasm(fmt.Sprintf(`(module (type $t0 (func)) @@ -49,5 +49,5 @@ func Wasm56(time int) []byte { call $set_return_data) (table $T0 1 1 funcref) (memory $memory (export "memory") 17) - (data (i32.const 1024) "new beeb"))`, time, time)) + (data (i32.const 1024) "new test"))`, time, time)) } diff --git a/testing/testdata/wasm_9_set_data_several_times.go b/testing/testdata/wasm_9_set_data_several_times.go index 3212e0541..806730278 100644 --- a/testing/testdata/wasm_9_set_data_several_times.go +++ b/testing/testdata/wasm_9_set_data_several_times.go @@ -19,5 +19,5 @@ var Wasm9 []byte = wat2wasm(` call $set_return_data) (table $T0 1 1 funcref) (memory $memory (export "memory") 17) - (data (i32.const 1024) "beeb")) + (data (i32.const 1024) "test")) `) diff --git a/testing/testdata/wasm_util.go b/testing/testdata/wasm_util.go index ea6a39421..d5ff65eea 100644 --- a/testing/testdata/wasm_util.go +++ b/testing/testdata/wasm_util.go @@ -4,7 +4,7 @@ import ( owasm "github.com/bandprotocol/go-owasm/api" "github.com/bytecodealliance/wasmtime-go/v20" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) func Compile(code []byte) []byte { diff --git a/testing/tx_helpers.go b/testing/tx_helpers.go new file mode 100644 index 000000000..8942b041d --- /dev/null +++ b/testing/tx_helpers.go @@ -0,0 +1,168 @@ +package testing + +// Copy from https://github.com/cosmos/cosmos-sdk/blob/v0.50.9/testutil/sims/tx_helpers.go to add time in block header and block events +import ( + "context" + "math/rand" + "testing" + "time" + + "github.com/stretchr/testify/require" + + types2 "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/proto/tendermint/types" + + "cosmossdk.io/errors" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + authsign "github.com/cosmos/cosmos-sdk/x/auth/signing" +) + +// GenSignedMockTx generates a signed mock transaction. +func GenSignedMockTx( + r *rand.Rand, + txConfig client.TxConfig, + msgs []sdk.Msg, + feeAmt sdk.Coins, + gas uint64, + chainID string, + accNums, accSeqs []uint64, + priv ...cryptotypes.PrivKey, +) (sdk.Tx, error) { + sigs := make([]signing.SignatureV2, len(priv)) + + // create a random length memo + memo := simulation.RandStringOfLength(r, simulation.RandIntBetween(r, 0, 100)) + + signMode, err := authsign.APISignModeToInternal(txConfig.SignModeHandler().DefaultMode()) + if err != nil { + return nil, err + } + + // 1st round: set SignatureV2 with empty signatures, to set correct + // signer infos. + for i, p := range priv { + sigs[i] = signing.SignatureV2{ + PubKey: p.PubKey(), + Data: &signing.SingleSignatureData{ + SignMode: signMode, + }, + Sequence: accSeqs[i], + } + } + + tx := txConfig.NewTxBuilder() + err = tx.SetMsgs(msgs...) + if err != nil { + return nil, err + } + err = tx.SetSignatures(sigs...) + if err != nil { + return nil, err + } + tx.SetMemo(memo) + tx.SetFeeAmount(feeAmt) + tx.SetGasLimit(gas) + + // 2nd round: once all signer infos are set, every signer can sign. + for i, p := range priv { + signerData := authsign.SignerData{ + Address: sdk.AccAddress(p.PubKey().Address()).String(), + ChainID: chainID, + AccountNumber: accNums[i], + Sequence: accSeqs[i], + PubKey: p.PubKey(), + } + + signBytes, err := authsign.GetSignBytesAdapter( + context.Background(), txConfig.SignModeHandler(), signMode, signerData, + tx.GetTx()) + if err != nil { + panic(err) + } + sig, err := p.Sign(signBytes) + if err != nil { + panic(err) + } + sigs[i].Data.(*signing.SingleSignatureData).Signature = sig + } + err = tx.SetSignatures(sigs...) + if err != nil { + panic(err) + } + + return tx.GetTx(), nil +} + +// SignCheckDeliver checks a generated signed transaction and simulates a +// block commitment with the given transaction. A test assertion is made using +// the parameter 'expPass' against the result. A corresponding result is +// returned. +func SignCheckDeliver( + t *testing.T, txCfg client.TxConfig, app *baseapp.BaseApp, header types.Header, msgs []sdk.Msg, + chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey, +) (sdk.GasInfo, *sdk.Result, []types2.Event, error) { + tx, err := GenSignedMockTx( + rand.New(rand.NewSource(time.Now().UnixNano())), + txCfg, + msgs, + sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)}, + DefaultGenTxGas, + chainID, + accNums, + accSeqs, + priv..., + ) + require.NoError(t, err) + txBytes, err := txCfg.TxEncoder()(tx) + require.Nil(t, err) + + // Must simulate now as CheckTx doesn't run Msgs anymore + _, res, err := app.Simulate(txBytes) + + if expSimPass { + require.NoError(t, err) + require.NotNil(t, res) + } else { + require.Error(t, err) + require.Nil(t, res) + } + + bz, err := txCfg.TxEncoder()(tx) + require.NoError(t, err) + + resBlock, err := app.FinalizeBlock(&types2.RequestFinalizeBlock{ + Height: header.Height, + Time: header.Time, + Txs: [][]byte{bz}, + }) + require.NoError(t, err) + + require.Equal(t, 1, len(resBlock.TxResults)) + txResult := resBlock.TxResults[0] + finalizeSuccess := txResult.Code == 0 + if expPass { + require.True(t, finalizeSuccess) + } else { + require.False(t, finalizeSuccess) + } + + _, _ = app.Commit() + + gInfo := sdk.GasInfo{GasWanted: uint64(txResult.GasWanted), GasUsed: uint64(txResult.GasUsed)} + txRes := sdk.Result{Data: txResult.Data, Log: txResult.Log, Events: txResult.Events} + if finalizeSuccess { + err = nil + } else { + err = errors.ABCIError(txResult.Codespace, txResult.Code, txResult.Log) + } + + endblockEvent := resBlock.Events + + return gInfo, &txRes, endblockEvent, err +} diff --git a/testing/util.go b/testing/util.go index e6b928297..7f57d0fcd 100644 --- a/testing/util.go +++ b/testing/util.go @@ -5,12 +5,15 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + + storetypes "cosmossdk.io/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/stretchr/testify/require" - bankkeeper "github.com/bandprotocol/chain/v2/x/bank/keeper" + bankkeeper "github.com/bandprotocol/chain/v3/x/bank/keeper" ) // ParseTime is a helper function to parse from number to time.Time with UTC locale. @@ -19,22 +22,22 @@ func ParseTime(t int64) time.Time { } type GasRecord struct { - Gas sdk.Gas + Gas storetypes.Gas Descriptor string } // GasMeterWrapper wrap gas meter for testing purpose type GasMeterWrapper struct { - sdk.GasMeter + storetypes.GasMeter GasRecords []GasRecord } -func (m *GasMeterWrapper) ConsumeGas(amount sdk.Gas, descriptor string) { +func (m *GasMeterWrapper) ConsumeGas(amount storetypes.Gas, descriptor string) { m.GasRecords = append(m.GasRecords, GasRecord{amount, descriptor}) m.GasMeter.ConsumeGas(amount, descriptor) } -func (m *GasMeterWrapper) CountRecord(amount sdk.Gas, descriptor string) int { +func (m *GasMeterWrapper) CountRecord(amount storetypes.Gas, descriptor string) int { count := 0 for _, r := range m.GasRecords { if r.Gas == amount && r.Descriptor == descriptor { @@ -57,14 +60,14 @@ func (m *GasMeterWrapper) CountDescriptor(descriptor string) int { } // NewGasMeterWrapper to wrap gas meters for testing purposes -func NewGasMeterWrapper(meter sdk.GasMeter) *GasMeterWrapper { +func NewGasMeterWrapper(meter storetypes.GasMeter) *GasMeterWrapper { return &GasMeterWrapper{meter, nil} } func MustGetBalances(ctx sdk.Context, bankKeeper bankkeeper.WrappedBankKeeper, address sdk.AccAddress) sdk.Coins { balancesRes, err := bankKeeper.AllBalances( - sdk.WrapSDKContext(ctx), - banktypes.NewQueryAllBalancesRequest(address, &query.PageRequest{}), + ctx, + banktypes.NewQueryAllBalancesRequest(address, &query.PageRequest{}, false), ) if err != nil { panic(err) @@ -81,12 +84,12 @@ func CheckBalances( expected sdk.Coins, ) { balancesRes, err := bankKeeper.AllBalances( - sdk.WrapSDKContext(ctx), - banktypes.NewQueryAllBalancesRequest(address, &query.PageRequest{}), + ctx, + banktypes.NewQueryAllBalancesRequest(address, &query.PageRequest{}, false), ) require.NoError(t, err) - require.True(t, expected.IsEqual(balancesRes.Balances)) + require.True(t, expected.Equal(balancesRes.Balances)) } // CheckErrorf checks whether diff --git a/x/bank/app_test.go b/x/bank/app_test.go new file mode 100644 index 000000000..b920eea61 --- /dev/null +++ b/x/bank/app_test.go @@ -0,0 +1,226 @@ +package bank_test + +import ( + "testing" + + "github.com/stretchr/testify/suite" + + abci "github.com/cometbft/cometbft/abci/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + band "github.com/bandprotocol/chain/v3/app" + bandtesting "github.com/bandprotocol/chain/v3/testing" +) + +func init() { + band.SetBech32AddressPrefixesAndBip44CoinTypeAndSeal(sdk.GetConfig()) +} + +type AppTestSuite struct { + suite.Suite + + app *band.BandApp +} + +var ( + NoAbsentVotes = abci.CommitInfo{ + Votes: []abci.VoteInfo{ + { + Validator: abci.Validator{Address: bandtesting.Validators[0].PubKey.Address().Bytes(), Power: 100}, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }, + { + Validator: abci.Validator{Address: bandtesting.Validators[1].PubKey.Address().Bytes(), Power: 100}, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }, + { + Validator: abci.Validator{Address: bandtesting.Validators[2].PubKey.Address().Bytes(), Power: 100}, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }, + { + Validator: abci.Validator{Address: bandtesting.MissedValidator.PubKey.Address().Bytes(), Power: 100}, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }, + }, + } + AbsentVotes = abci.CommitInfo{ + Votes: []abci.VoteInfo{ + { + Validator: abci.Validator{Address: bandtesting.Validators[0].PubKey.Address().Bytes(), Power: 100}, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }, + { + Validator: abci.Validator{Address: bandtesting.Validators[1].PubKey.Address().Bytes(), Power: 100}, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }, + { + Validator: abci.Validator{Address: bandtesting.Validators[2].PubKey.Address().Bytes(), Power: 100}, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }, + { + Validator: abci.Validator{Address: bandtesting.MissedValidator.PubKey.Address().Bytes(), Power: 100}, + BlockIdFlag: cmtproto.BlockIDFlagAbsent, + }, + }, + } +) + +func TestAppTestSuite(t *testing.T) { + suite.Run(t, new(AppTestSuite)) +} + +func (s *AppTestSuite) SetupTest() { + dir := testutil.GetTempDir(s.T()) + s.app = bandtesting.SetupWithCustomHome(false, dir) + ctx := s.app.BaseApp.NewUncachedContext(false, cmtproto.Header{}) + + _, err := s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1}) + s.Require().NoError(err) + _, err = s.app.Commit() + s.Require().NoError(err) + + params, err := s.app.SlashingKeeper.GetParams(ctx) + s.Require().NoError(err) + + // Set new sign window + params.SignedBlocksWindow = 2 + params.MinSignedPerWindow = math.LegacyNewDecWithPrec(5, 1) + + // Add Missed validator + res1 := s.app.AccountKeeper.GetAccount(ctx, bandtesting.MissedValidator.Address) + s.Require().NotNil(res1) + + acc1Num := res1.GetAccountNumber() + acc1Seq := res1.GetSequence() + + txConfig := moduletestutil.MakeTestTxConfig() + + err = s.app.SlashingKeeper.SetParams(ctx, params) + s.Require().NoError(err) + + msg, err := stakingtypes.NewMsgCreateValidator( + sdk.ValAddress(bandtesting.MissedValidator.Address).String(), + bandtesting.MissedValidator.PubKey, + sdk.NewInt64Coin("uband", 100000000), + stakingtypes.Description{ + Moniker: "test", + }, + stakingtypes.NewCommissionRates( + math.LegacyOneDec(), + math.LegacyOneDec(), + math.LegacyOneDec(), + ), + math.OneInt(), + ) + s.Require().NoError(err) + + _, res, _, err := bandtesting.SignCheckDeliver( + s.T(), + txConfig, + s.app.BaseApp, + cmtproto.Header{Height: s.app.LastBlockHeight() + 1}, + []sdk.Msg{msg}, + s.app.ChainID(), + []uint64{acc1Num}, + []uint64{acc1Seq}, + true, + true, + bandtesting.MissedValidator.PrivKey, + ) + s.Require().NotNil(res) + s.Require().NoError(err) +} + +func (s *AppTestSuite) checkCommunityPool(expected string) { + ctx := s.app.NewUncachedContext(false, cmtproto.Header{}) + // Check community pool + feePool, err := s.app.DistrKeeper.FeePool.Get(ctx) + s.Require().NoError(err) + + dec, err := math.LegacyNewDecFromStr(expected) + s.Require().NoError(err) + + s.Require().Equal(sdk.NewDecCoins(sdk.NewDecCoinFromDec("uband", dec)), feePool.CommunityPool) +} + +func (s *AppTestSuite) TestNoAbsent() { + // Pass 1 block no absent + _, err := s.app.FinalizeBlock( + &abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, DecidedLastCommit: NoAbsentVotes}, + ) + s.Require().NoError(err) + _, err = s.app.Commit() + s.Require().NoError(err) + + s.checkCommunityPool("4.04") + + // Pass 2 block no absent + _, err = s.app.FinalizeBlock( + &abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, DecidedLastCommit: NoAbsentVotes}, + ) + s.Require().NoError(err) + _, err = s.app.Commit() + s.Require().NoError(err) + + s.checkCommunityPool("4.08") + + // Pass 3 block no absent + _, err = s.app.FinalizeBlock( + &abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, DecidedLastCommit: NoAbsentVotes}, + ) + s.Require().NoError(err) + _, err = s.app.Commit() + s.Require().NoError(err) + + s.checkCommunityPool("4.12") +} + +func (s *AppTestSuite) TestMissedValidatorAbsent() { + // Pass 1 block absent nothing happen + _, err := s.app.FinalizeBlock( + &abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, DecidedLastCommit: AbsentVotes}, + ) + s.Require().NoError(err) + _, err = s.app.Commit() + s.Require().NoError(err) + + s.checkCommunityPool("4.04") + + // Pass 2 block absent missed validator not slash yet due to not pass min height + _, err = s.app.FinalizeBlock( + &abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, DecidedLastCommit: AbsentVotes}, + ) + s.Require().NoError(err) + _, err = s.app.Commit() + s.Require().NoError(err) + + ctx := s.app.NewUncachedContext(false, cmtproto.Header{}) + missVal, err := s.app.StakingKeeper.GetValidator(ctx, bandtesting.MissedValidator.ValAddress) + s.Require().NoError(err) + s.Require().False(missVal.IsJailed()) + + s.checkCommunityPool("4.08") + + // Pass 3 block still miss should be slashed + _, err = s.app.FinalizeBlock( + &abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, DecidedLastCommit: AbsentVotes}, + ) + s.Require().NoError(err) + _, err = s.app.Commit() + s.Require().NoError(err) + + ctx = s.app.NewUncachedContext(false, cmtproto.Header{}) + missVal, err = s.app.StakingKeeper.GetValidator(ctx, bandtesting.MissedValidator.ValAddress) + s.Require().NoError(err) + s.Require().True(missVal.IsJailed()) + + // Community pool should increase 1% of validator power(100 band) == 1 band == 1000000uband + s.checkCommunityPool("1000004.12") +} diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index aa479555a..c2062f906 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -1,16 +1,18 @@ package keeper import ( + "context" "fmt" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/bandprotocol/chain/v2/x/bank/types" + "github.com/bandprotocol/chain/v3/x/bank/types" ) // WrappedBankKeeper encapsulates the underlying bank keeper and overrides @@ -26,12 +28,22 @@ type WrappedBankKeeper struct { distrKeeper types.DistributionKeeper accountKeeper types.AccountKeeper + logger log.Logger } // NewWrappedBankKeeperBurnToCommunityPool creates a new instance of WrappedBankKeeper // with its distrKeeper and accountKeeper members set to nil. -func NewWrappedBankKeeperBurnToCommunityPool(bk bankkeeper.Keeper, acc types.AccountKeeper) WrappedBankKeeper { - return WrappedBankKeeper{bk, nil, acc} +func NewWrappedBankKeeperBurnToCommunityPool( + bk bankkeeper.Keeper, + ak types.AccountKeeper, + logger log.Logger, +) *WrappedBankKeeper { + return &WrappedBankKeeper{ + Keeper: bk, + distrKeeper: nil, + accountKeeper: ak, + logger: logger.With(log.ModuleKey, "x/wrappedbank"), + } } // SetDistrKeeper sets distr module keeper for this WrappedBankKeeper instance. @@ -39,14 +51,9 @@ func (k *WrappedBankKeeper) SetDistrKeeper(dk types.DistributionKeeper) { k.distrKeeper = dk } -// Logger returns a module-specific logger. -func (k WrappedBankKeeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", "x/wrappedbank") -} - // BurnCoins moves the specified amount of coins from the given module name to // the community pool. The total bank of the coins will not change. -func (k WrappedBankKeeper) BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error { +func (k WrappedBankKeeper) BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error { // If distrKeeper is not set OR we want to burn coins in distr itself, we will // just use the original BurnCoins function. @@ -70,17 +77,11 @@ func (k WrappedBankKeeper) BurnCoins(ctx sdk.Context, moduleName string, amt sdk } // Instead of burning coins, we send them to the community pool. - err := k.SendCoinsFromModuleToModule(ctx, moduleName, distrtypes.ModuleName, amt) - if err != nil { + if err := k.distrKeeper.FundCommunityPool(ctx, amt, acc.GetAddress()); err != nil { return err } - feePool := k.distrKeeper.GetFeePool(ctx) - feePool.CommunityPool = feePool.CommunityPool.Add(sdk.NewDecCoinsFromCoins(amt...)...) - k.distrKeeper.SetFeePool(ctx, feePool) - - logger := k.Logger(ctx) - logger.Info(fmt.Sprintf( + k.logger.Info(fmt.Sprintf( "sent %s from %s module account to community pool", amt.String(), moduleName, )) return nil diff --git a/x/bank/module.go b/x/bank/module.go deleted file mode 100644 index 3807326ef..000000000 --- a/x/bank/module.go +++ /dev/null @@ -1,70 +0,0 @@ -package bank - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/x/bank" - "github.com/cosmos/cosmos-sdk/x/bank/exported" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - "github.com/cosmos/cosmos-sdk/x/bank/types" - - "github.com/bandprotocol/chain/v2/x/bank/keeper" -) - -var ( - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModule = AppModule{} - _ module.AppModuleSimulation = AppModule{} -) - -// AppModuleBasic defines the basic application module used by the distribution module. -type AppModuleBasic struct { - bank.AppModuleBasic -} - -// AppModule implements an application module for the bank module. -type AppModule struct { - bank.AppModule - - keeper bankkeeper.Keeper - accountKeeper types.AccountKeeper - - // legacySubspace is used solely for migration of x/params managed parameters - legacySubspace exported.Subspace -} - -// NewAppModule creates a new AppModule object -func NewAppModule( - cdc codec.Codec, - keeper bankkeeper.Keeper, - accountKeeper types.AccountKeeper, - ss exported.Subspace, -) AppModule { - return AppModule{ - AppModule: bank.NewAppModule(cdc, keeper, accountKeeper, ss), - keeper: keeper, - accountKeeper: accountKeeper, - legacySubspace: ss, - } -} - -// RegisterServices registers module services. -func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterMsgServer(cfg.MsgServer(), bankkeeper.NewMsgServerImpl(am.keeper)) - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - - m := bankkeeper.NewMigrator(am.keeper.(keeper.WrappedBankKeeper).Keeper.(bankkeeper.BaseKeeper), am.legacySubspace) - if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { - panic(fmt.Sprintf("failed to migrate x/bank from version 1 to 2: %v", err)) - } - - if err := cfg.RegisterMigration(types.ModuleName, 2, m.Migrate2to3); err != nil { - panic(fmt.Sprintf("failed to migrate x/bank from version 2 to 3: %v", err)) - } - - if err := cfg.RegisterMigration(types.ModuleName, 3, m.Migrate3to4); err != nil { - panic(fmt.Sprintf("failed to migrate x/bank from version 3 to 4: %v", err)) - } -} diff --git a/x/bank/types/expected_keepers.go b/x/bank/types/expected_keepers.go index 1a5b60f70..91bcd7d9a 100644 --- a/x/bank/types/expected_keepers.go +++ b/x/bank/types/expected_keepers.go @@ -1,20 +1,18 @@ package types import ( + "context" + sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" ) // AccountKeeper defines the account contract that must be fulfilled when // creating a x/bank keeper. type AccountKeeper interface { - GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI + GetModuleAccount(ctx context.Context, moduleName string) sdk.ModuleAccountI } -// DistributionKeeper defines the distribution contract that must be fulfilled when -// creating a x/bank keeper. +// DistributionKeeper defines the expected distribution keeper (noalias) type DistributionKeeper interface { - GetFeePool(sdk.Context) disttypes.FeePool - SetFeePool(sdk.Context, disttypes.FeePool) + FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error } diff --git a/x/globalfee/client/cli/query.go b/x/globalfee/client/cli/query.go index bc73f4e3d..e39fed206 100644 --- a/x/globalfee/client/cli/query.go +++ b/x/globalfee/client/cli/query.go @@ -1,11 +1,12 @@ package cli import ( + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - "github.com/bandprotocol/chain/v2/x/globalfee/types" + "github.com/bandprotocol/chain/v3/x/globalfee/types" ) func GetQueryCmd() *cobra.Command { diff --git a/x/globalfee/feechecker/feechecker.go b/x/globalfee/feechecker/feechecker.go index 571c854e6..ac8c9b8a0 100644 --- a/x/globalfee/feechecker/feechecker.go +++ b/x/globalfee/feechecker/feechecker.go @@ -3,14 +3,16 @@ package feechecker import ( "math" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/authz" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - "github.com/bandprotocol/chain/v2/x/globalfee/keeper" - oraclekeeper "github.com/bandprotocol/chain/v2/x/oracle/keeper" - oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/globalfee/keeper" + oraclekeeper "github.com/bandprotocol/chain/v3/x/oracle/keeper" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) type FeeChecker struct { @@ -65,7 +67,7 @@ func (fc FeeChecker) CheckTxFeeWithMinGasPrices( gas := feeTx.GetGas() var allFees sdk.Coins if !allGasPrices.IsZero() { - glDec := sdk.NewDec(int64(gas)) + glDec := sdkmath.LegacyNewDec(int64(gas)) for _, gp := range allGasPrices { if !gp.IsZero() { fee := gp.Amount.Mul(glDec) @@ -82,8 +84,11 @@ func (fc FeeChecker) CheckTxFeeWithMinGasPrices( ) } } - - priority := getTxPriority(feeCoins, int64(gas), fc.GetBondDenom(ctx)) + denom, err := fc.GetBondDenom(ctx) + if err != nil { + return nil, 0, err + } + priority := getTxPriority(feeCoins, int64(gas), denom) return feeCoins, priority, nil } @@ -121,14 +126,14 @@ func (fc FeeChecker) GetGlobalMinGasPrices(ctx sdk.Context) (sdk.DecCoins, error } func (fc FeeChecker) DefaultZeroGlobalFee(ctx sdk.Context) ([]sdk.DecCoin, error) { - bondDenom := fc.GetBondDenom(ctx) - if bondDenom == "" { + bondDenom, err := fc.GetBondDenom(ctx) + if err != nil { return nil, sdkerrors.ErrNotFound.Wrap("empty staking bond denomination") } - return []sdk.DecCoin{sdk.NewDecCoinFromDec(bondDenom, sdk.NewDec(0))}, nil + return []sdk.DecCoin{sdk.NewDecCoinFromDec(bondDenom, sdkmath.LegacyNewDec(0))}, nil } -func (fc FeeChecker) GetBondDenom(ctx sdk.Context) string { +func (fc FeeChecker) GetBondDenom(ctx sdk.Context) (string, error) { return fc.StakingKeeper.BondDenom(ctx) } diff --git a/x/globalfee/feechecker/feechecker_test.go b/x/globalfee/feechecker/feechecker_test.go index 23028d7bb..14d4d16ea 100644 --- a/x/globalfee/feechecker/feechecker_test.go +++ b/x/globalfee/feechecker/feechecker_test.go @@ -4,13 +4,22 @@ import ( "math" "testing" + "github.com/stretchr/testify/suite" + protov2 "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/protoadapt" + + abci "github.com/cometbft/cometbft/abci/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + + sdkmath "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" - "github.com/stretchr/testify/suite" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/x/globalfee/feechecker" - "github.com/bandprotocol/chain/v2/x/oracle/types" + bandtesting "github.com/bandprotocol/chain/v3/testing" + "github.com/bandprotocol/chain/v3/x/globalfee/feechecker" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) var ( @@ -29,6 +38,14 @@ func (st *StubTx) GetMsgs() []sdk.Msg { return st.Msgs } +func (st *StubTx) GetMsgsV2() (ms []protov2.Message, err error) { + for _, msg := range st.Msgs { + ms = append(ms, protoadapt.MessageV2Of(msg)) + } + + return +} + func (st *StubTx) ValidateBasic() error { return nil } @@ -41,7 +58,7 @@ func (st *StubTx) GetFee() sdk.Coins { fees := make(sdk.Coins, len(st.GasPrices)) // Determine the fees by multiplying each gas prices - glDec := sdk.NewDec(int64(st.GetGas())) + glDec := sdkmath.LegacyNewDec(int64(st.GetGas())) for i, gp := range st.GasPrices { fee := gp.Amount.Mul(glDec) fees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt()) @@ -58,13 +75,20 @@ type FeeCheckerTestSuite struct { } func (suite *FeeCheckerTestSuite) SetupTest() { - app, ctx := bandtesting.CreateTestApp(suite.T(), true) + dir := testutil.GetTempDir(suite.T()) + app := bandtesting.SetupWithCustomHome(false, dir) + _, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) + suite.Require().NoError(err) + _, err = app.Commit() + suite.Require().NoError(err) + + ctx := app.BaseApp.NewUncachedContext(false, cmtproto.Header{}) suite.ctx = ctx.WithBlockHeight(999). WithIsCheckTx(true). - WithMinGasPrices(sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDecWithPrec(1, 4)}}) + WithMinGasPrices(sdk.DecCoins{{Denom: "uband", Amount: sdkmath.LegacyNewDecWithPrec(1, 4)}}) - err := app.OracleKeeper.GrantReporter(suite.ctx, bandtesting.Validators[0].ValAddress, bandtesting.Alice.Address) + err = app.OracleKeeper.GrantReporter(suite.ctx, bandtesting.Validators[0].ValAddress, bandtesting.Alice.Address) suite.Require().NoError(err) req := types.NewRequest( @@ -83,7 +107,7 @@ func (suite *FeeCheckerTestSuite) SetupTest() { suite.FeeChecker = feechecker.NewFeeChecker( &app.OracleKeeper, - &app.GlobalfeeKeeper, + &app.GlobalFeeKeeper, app.StakingKeeper, ) } @@ -141,7 +165,10 @@ func (suite *FeeCheckerTestSuite) TestNoAuthzReport() { types.NewMsgReportData(suite.requestID, []types.RawReport{}, bandtesting.Validators[0].ValAddress), } authzMsg := authz.NewMsgExec(bandtesting.Bob.Address, reportMsgs) - stubTx := &StubTx{Msgs: []sdk.Msg{&authzMsg}, GasPrices: sdk.NewDecCoins(sdk.NewDecCoin("uband", sdk.NewInt(1)))} + stubTx := &StubTx{ + Msgs: []sdk.Msg{&authzMsg}, + GasPrices: sdk.NewDecCoins(sdk.NewDecCoin("uband", sdkmath.NewInt(1))), + } // test - check report tx isReportTx := suite.FeeChecker.CheckReportTx(suite.ctx, stubTx) @@ -183,13 +210,13 @@ func (suite *FeeCheckerTestSuite) TestNotReportMsg() { stubTx := &StubTx{ Msgs: []sdk.Msg{requestMsg}, GasPrices: sdk.NewDecCoins( - sdk.NewDecCoinFromDec("uaaaa", sdk.NewDecWithPrec(100, 3)), - sdk.NewDecCoinFromDec("uaaab", sdk.NewDecWithPrec(1, 3)), - sdk.NewDecCoinFromDec("uaaac", sdk.NewDecWithPrec(0, 3)), - sdk.NewDecCoinFromDec("uband", sdk.NewDecWithPrec(3, 3)), - sdk.NewDecCoinFromDec("uccca", sdk.NewDecWithPrec(0, 3)), - sdk.NewDecCoinFromDec("ucccb", sdk.NewDecWithPrec(1, 3)), - sdk.NewDecCoinFromDec("ucccc", sdk.NewDecWithPrec(100, 3)), + sdk.NewDecCoinFromDec("uaaaa", sdkmath.LegacyNewDecWithPrec(100, 3)), + sdk.NewDecCoinFromDec("uaaab", sdkmath.LegacyNewDecWithPrec(1, 3)), + sdk.NewDecCoinFromDec("uaaac", sdkmath.LegacyNewDecWithPrec(0, 3)), + sdk.NewDecCoinFromDec("uband", sdkmath.LegacyNewDecWithPrec(3, 3)), + sdk.NewDecCoinFromDec("uccca", sdkmath.LegacyNewDecWithPrec(0, 3)), + sdk.NewDecCoinFromDec("ucccb", sdkmath.LegacyNewDecWithPrec(1, 3)), + sdk.NewDecCoinFromDec("ucccc", sdkmath.LegacyNewDecWithPrec(100, 3)), ), } @@ -219,7 +246,10 @@ func (suite *FeeCheckerTestSuite) TestReportMsgAndOthersTypeMsgInTheSameAuthzMsg ) msgs := []sdk.Msg{reportMsg, requestMsg} authzMsg := authz.NewMsgExec(bandtesting.Alice.Address, msgs) - stubTx := &StubTx{Msgs: []sdk.Msg{&authzMsg}, GasPrices: sdk.NewDecCoins(sdk.NewDecCoin("uband", sdk.NewInt(1)))} + stubTx := &StubTx{ + Msgs: []sdk.Msg{&authzMsg}, + GasPrices: sdk.NewDecCoins(sdk.NewDecCoin("uband", sdkmath.NewInt(1))), + } // test - check report tx isReportTx := suite.FeeChecker.CheckReportTx(suite.ctx, stubTx) @@ -247,7 +277,7 @@ func (suite *FeeCheckerTestSuite) TestReportMsgAndOthersTypeMsgInTheSameTx() { ) stubTx := &StubTx{ Msgs: []sdk.Msg{reportMsg, requestMsg}, - GasPrices: sdk.NewDecCoins(sdk.NewDecCoin("uband", sdk.NewInt(1))), + GasPrices: sdk.NewDecCoins(sdk.NewDecCoin("uband", sdkmath.NewInt(1))), } // test - check report tx @@ -262,8 +292,9 @@ func (suite *FeeCheckerTestSuite) TestReportMsgAndOthersTypeMsgInTheSameTx() { } func (suite *FeeCheckerTestSuite) TestGetBondDenom() { - denom := suite.FeeChecker.GetBondDenom(suite.ctx) + denom, err := suite.FeeChecker.GetBondDenom(suite.ctx) suite.Require().Equal("uband", denom) + suite.Require().NoError(err) } func (suite *FeeCheckerTestSuite) TestDefaultZeroGlobalFee() { @@ -271,7 +302,7 @@ func (suite *FeeCheckerTestSuite) TestDefaultZeroGlobalFee() { suite.Require().Equal(1, len(coins)) suite.Require().Equal("uband", coins[0].Denom) - suite.Require().Equal(sdk.NewDec(0), coins[0].Amount) + suite.Require().Equal(sdkmath.LegacyNewDec(0), coins[0].Amount) suite.Require().NoError(err) } diff --git a/x/globalfee/feechecker/utils.go b/x/globalfee/feechecker/utils.go index 6ed2ffc2c..edcb3c24e 100644 --- a/x/globalfee/feechecker/utils.go +++ b/x/globalfee/feechecker/utils.go @@ -6,8 +6,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" - oraclekeeper "github.com/bandprotocol/chain/v2/x/oracle/keeper" - "github.com/bandprotocol/chain/v2/x/oracle/types" + oraclekeeper "github.com/bandprotocol/chain/v3/x/oracle/keeper" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // getTxPriority returns priority of the provided fee based on gas prices of uband diff --git a/x/globalfee/feechecker/utils_test.go b/x/globalfee/feechecker/utils_test.go index c7b5ef8a8..64595625c 100644 --- a/x/globalfee/feechecker/utils_test.go +++ b/x/globalfee/feechecker/utils_test.go @@ -3,10 +3,13 @@ package feechecker_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - "github.com/bandprotocol/chain/v2/x/globalfee/feechecker" + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/bandprotocol/chain/v3/x/globalfee/feechecker" ) type utilsTestSuite struct { @@ -18,15 +21,15 @@ func TestUtilsTestSuite(t *testing.T) { } func (s *utilsTestSuite) TestCombinedGasPricesRequirement() { - zeroCoin1 := sdk.NewDecCoin("photon", sdk.ZeroInt()) - zeroCoin2 := sdk.NewDecCoin("stake", sdk.ZeroInt()) - zeroCoin3 := sdk.NewDecCoin("quark", sdk.ZeroInt()) - coin1 := sdk.NewDecCoin("photon", sdk.NewInt(1)) - coin2 := sdk.NewDecCoin("stake", sdk.NewInt(2)) - coin1High := sdk.NewDecCoin("photon", sdk.NewInt(10)) - coin2High := sdk.NewDecCoin("stake", sdk.NewInt(20)) - coinNewDenom1 := sdk.NewDecCoin("Newphoton", sdk.NewInt(1)) - coinNewDenom2 := sdk.NewDecCoin("Newstake", sdk.NewInt(1)) + zeroCoin1 := sdk.NewDecCoin("photon", math.ZeroInt()) + zeroCoin2 := sdk.NewDecCoin("stake", math.ZeroInt()) + zeroCoin3 := sdk.NewDecCoin("quark", math.ZeroInt()) + coin1 := sdk.NewDecCoin("photon", math.NewInt(1)) + coin2 := sdk.NewDecCoin("stake", math.NewInt(2)) + coin1High := sdk.NewDecCoin("photon", math.NewInt(10)) + coin2High := sdk.NewDecCoin("stake", math.NewInt(20)) + coinNewDenom1 := sdk.NewDecCoin("Newphoton", math.NewInt(1)) + coinNewDenom2 := sdk.NewDecCoin("Newstake", math.NewInt(1)) // coins must be valid !!! and sorted!!! coinsEmpty := sdk.DecCoins{} coinsNonEmpty := sdk.DecCoins{coin1, coin2}.Sort() diff --git a/x/globalfee/genesis_test.go b/x/globalfee/genesis_test.go index 78dd07b41..99adc58e8 100644 --- a/x/globalfee/genesis_test.go +++ b/x/globalfee/genesis_test.go @@ -3,9 +3,10 @@ package globalfee import ( "testing" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" ) func TestDefaultGenesis(t *testing.T) { diff --git a/x/globalfee/keeper/genesis.go b/x/globalfee/keeper/genesis.go index f7188ca17..4d4f3efbe 100644 --- a/x/globalfee/keeper/genesis.go +++ b/x/globalfee/keeper/genesis.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/globalfee/types" + "github.com/bandprotocol/chain/v3/x/globalfee/types" ) // InitGenesis new globalfee genesis diff --git a/x/globalfee/keeper/genesis_test.go b/x/globalfee/keeper/genesis_test.go index 57c2cfc8b..617cc074e 100644 --- a/x/globalfee/keeper/genesis_test.go +++ b/x/globalfee/keeper/genesis_test.go @@ -3,18 +3,21 @@ package keeper_test import ( "testing" + "github.com/stretchr/testify/suite" + + "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/stretchr/testify/suite" - "github.com/bandprotocol/chain/v2/x/globalfee" - "github.com/bandprotocol/chain/v2/x/globalfee/keeper" - "github.com/bandprotocol/chain/v2/x/globalfee/types" + "github.com/bandprotocol/chain/v3/x/globalfee" + "github.com/bandprotocol/chain/v3/x/globalfee/keeper" + "github.com/bandprotocol/chain/v3/x/globalfee/types" ) type GenesisTestSuite struct { @@ -31,8 +34,8 @@ func TestGenesisTestSuite(t *testing.T) { } func (s *GenesisTestSuite) SetupTest() { - key := sdk.NewKVStoreKey(types.StoreKey) - testCtx := testutil.DefaultContextWithDB(s.T(), key, sdk.NewTransientStoreKey("transient_test")) + key := storetypes.NewKVStoreKey(types.StoreKey) + testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(globalfee.AppModuleBasic{}) // gomock initializations @@ -51,14 +54,14 @@ func (s *GenesisTestSuite) TestImportExportGenesis() { "single fee": { src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"}]}}`, exp: types.GenesisState{ - Params: types.Params{MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.NewInt(1)))}, + Params: types.Params{MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", math.NewInt(1)))}, }, }, "multiple fee options": { src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"}, {"denom":"BLX", "amount":"0.001"}]}}`, exp: types.GenesisState{ - Params: types.Params{MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.NewInt(1)), - sdk.NewDecCoinFromDec("BLX", sdk.NewDecWithPrec(1, 3)))}, + Params: types.Params{MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", math.NewInt(1)), + sdk.NewDecCoinFromDec("BLX", math.LegacyNewDecWithPrec(1, 3)))}, }, }, "no fee set": { diff --git a/x/globalfee/keeper/grpc_query.go b/x/globalfee/keeper/grpc_query.go index e3306ee21..da6dea6b2 100644 --- a/x/globalfee/keeper/grpc_query.go +++ b/x/globalfee/keeper/grpc_query.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/globalfee/types" + "github.com/bandprotocol/chain/v3/x/globalfee/types" ) var _ types.QueryServer = &Querier{} diff --git a/x/globalfee/keeper/grpc_query_test.go b/x/globalfee/keeper/grpc_query_test.go index 27546f382..96d640494 100644 --- a/x/globalfee/keeper/grpc_query_test.go +++ b/x/globalfee/keeper/grpc_query_test.go @@ -3,16 +3,20 @@ package keeper_test import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/bandprotocol/chain/v2/x/globalfee/keeper" - "github.com/bandprotocol/chain/v2/x/globalfee/types" + "github.com/bandprotocol/chain/v3/x/globalfee/keeper" + "github.com/bandprotocol/chain/v3/x/globalfee/types" ) func TestQueryParams(t *testing.T) { @@ -23,21 +27,21 @@ func TestQueryParams(t *testing.T) { "one coin": { setupStore: func(ctx sdk.Context, k keeper.Keeper) { _ = k.SetParams(ctx, types.Params{ - MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.OneInt())), + MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", math.OneInt())), }) }, - expMin: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.OneInt())), + expMin: sdk.NewDecCoins(sdk.NewDecCoin("ALX", math.OneInt())), }, "multiple coins": { setupStore: func(ctx sdk.Context, k keeper.Keeper) { _ = k.SetParams(ctx, types.Params{ MinimumGasPrices: sdk.NewDecCoins( - sdk.NewDecCoin("ALX", sdk.OneInt()), - sdk.NewDecCoin("BLX", sdk.NewInt(2)), + sdk.NewDecCoin("ALX", math.OneInt()), + sdk.NewDecCoin("BLX", math.NewInt(2)), ), }) }, - expMin: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.OneInt()), sdk.NewDecCoin("BLX", sdk.NewInt(2))), + expMin: sdk.NewDecCoins(sdk.NewDecCoin("ALX", math.OneInt()), sdk.NewDecCoin("BLX", math.NewInt(2))), }, "no min gas price set": { setupStore: func(ctx sdk.Context, k keeper.Keeper) { @@ -52,8 +56,8 @@ func TestQueryParams(t *testing.T) { for name, spec := range specs { t.Run(name, func(t *testing.T) { encCfg := moduletestutil.MakeTestEncodingConfig() - key := sdk.NewKVStoreKey(types.StoreKey) - ctx := testutil.DefaultContextWithDB(t, key, sdk.NewTransientStoreKey("transient_test")).Ctx + key := storetypes.NewKVStoreKey(types.StoreKey) + ctx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")).Ctx k := keeper.NewKeeper( encCfg.Codec, @@ -63,7 +67,7 @@ func TestQueryParams(t *testing.T) { q := keeper.Querier{Keeper: k} spec.setupStore(ctx, k) - gotResp, gotErr := q.Params(sdk.WrapSDKContext(ctx), nil) + gotResp, gotErr := q.Params(ctx, nil) require.NoError(t, gotErr) require.NotNil(t, gotResp) diff --git a/x/globalfee/keeper/keeper.go b/x/globalfee/keeper/keeper.go index f6163c535..ff061df59 100644 --- a/x/globalfee/keeper/keeper.go +++ b/x/globalfee/keeper/keeper.go @@ -1,12 +1,13 @@ package keeper import ( - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/globalfee/types" + "github.com/bandprotocol/chain/v3/x/globalfee/types" ) type Keeper struct { diff --git a/x/globalfee/keeper/keeper_test.go b/x/globalfee/keeper/keeper_test.go index 7b161048a..d656d46b1 100644 --- a/x/globalfee/keeper/keeper_test.go +++ b/x/globalfee/keeper/keeper_test.go @@ -3,16 +3,20 @@ package keeper_test import ( "testing" + "github.com/stretchr/testify/suite" + + "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/stretchr/testify/suite" - "github.com/bandprotocol/chain/v2/x/globalfee" - "github.com/bandprotocol/chain/v2/x/globalfee/keeper" - "github.com/bandprotocol/chain/v2/x/globalfee/types" + "github.com/bandprotocol/chain/v3/x/globalfee" + "github.com/bandprotocol/chain/v3/x/globalfee/keeper" + "github.com/bandprotocol/chain/v3/x/globalfee/types" ) type IntegrationTestSuite struct { @@ -29,8 +33,8 @@ func TestKeeperTestSuite(t *testing.T) { func (s *IntegrationTestSuite) SetupTest() { encCfg := moduletestutil.MakeTestEncodingConfig(globalfee.AppModuleBasic{}) - key := sdk.NewKVStoreKey(types.StoreKey) - testCtx := testutil.DefaultContextWithDB(s.T(), key, sdk.NewTransientStoreKey("transient_test")) + key := storetypes.NewKVStoreKey(types.StoreKey) + testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) s.ctx = testCtx.Ctx s.globalfeeKeeper = keeper.NewKeeper( @@ -58,8 +62,8 @@ func (s *IntegrationTestSuite) TestParams() { name: "set full valid params", input: types.Params{ MinimumGasPrices: sdk.NewDecCoins( - sdk.NewDecCoin("ALX", sdk.NewInt(1)), - sdk.NewDecCoinFromDec("BLX", sdk.NewDecWithPrec(1, 3)), + sdk.NewDecCoin("ALX", math.NewInt(1)), + sdk.NewDecCoinFromDec("BLX", math.LegacyNewDecWithPrec(1, 3)), ), }, expectErr: "", @@ -77,7 +81,7 @@ func (s *IntegrationTestSuite) TestParams() { MinimumGasPrices: []sdk.DecCoin{ { Denom: "1AAAA", - Amount: sdk.NewDecFromInt(sdk.NewInt(1)), + Amount: math.LegacyNewDecFromInt(math.NewInt(1)), }, }, }, @@ -89,7 +93,7 @@ func (s *IntegrationTestSuite) TestParams() { MinimumGasPrices: []sdk.DecCoin{ { Denom: "AAAA", - Amount: sdk.NewDecFromInt(sdk.NewInt(-1)), + Amount: math.LegacyNewDecFromInt(math.NewInt(-1)), }, }, }, @@ -101,11 +105,11 @@ func (s *IntegrationTestSuite) TestParams() { MinimumGasPrices: []sdk.DecCoin{ { Denom: "AAAA", - Amount: sdk.NewDecFromInt(sdk.NewInt(1)), + Amount: math.LegacyNewDecFromInt(math.NewInt(1)), }, { Denom: "AAAA", - Amount: sdk.NewDecFromInt(sdk.NewInt(2)), + Amount: math.LegacyNewDecFromInt(math.NewInt(2)), }, }, }, @@ -117,11 +121,11 @@ func (s *IntegrationTestSuite) TestParams() { MinimumGasPrices: []sdk.DecCoin{ { Denom: "BBBB", - Amount: sdk.NewDecFromInt(sdk.NewInt(1)), + Amount: math.LegacyNewDecFromInt(math.NewInt(1)), }, { Denom: "AAAA", - Amount: sdk.NewDecFromInt(sdk.NewInt(2)), + Amount: math.LegacyNewDecFromInt(math.NewInt(2)), }, }, }, diff --git a/x/globalfee/keeper/msg_server.go b/x/globalfee/keeper/msg_server.go index 1c7b6939d..daa4b456c 100644 --- a/x/globalfee/keeper/msg_server.go +++ b/x/globalfee/keeper/msg_server.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/bandprotocol/chain/v2/x/globalfee/types" + "github.com/bandprotocol/chain/v3/x/globalfee/types" ) type msgServer struct { diff --git a/x/globalfee/keeper/msg_server_test.go b/x/globalfee/keeper/msg_server_test.go index 4042b88e2..50ec34f2f 100644 --- a/x/globalfee/keeper/msg_server_test.go +++ b/x/globalfee/keeper/msg_server_test.go @@ -1,9 +1,11 @@ package keeper_test import ( + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/globalfee/types" + "github.com/bandprotocol/chain/v3/x/globalfee/types" ) func (s *IntegrationTestSuite) TestUpdateParams() { @@ -25,8 +27,8 @@ func (s *IntegrationTestSuite) TestUpdateParams() { Authority: s.globalfeeKeeper.GetAuthority(), Params: types.Params{ MinimumGasPrices: sdk.NewDecCoins( - sdk.NewDecCoin("ALX", sdk.NewInt(1)), - sdk.NewDecCoinFromDec("BLX", sdk.NewDecWithPrec(1, 3)), + sdk.NewDecCoin("ALX", math.NewInt(1)), + sdk.NewDecCoinFromDec("BLX", math.LegacyNewDecWithPrec(1, 3)), ), }, }, @@ -50,7 +52,7 @@ func (s *IntegrationTestSuite) TestUpdateParams() { MinimumGasPrices: []sdk.DecCoin{ { Denom: "1AAAA", - Amount: sdk.NewDecFromInt(sdk.NewInt(1)), + Amount: math.LegacyNewDecFromInt(math.NewInt(1)), }, }, }, @@ -65,7 +67,7 @@ func (s *IntegrationTestSuite) TestUpdateParams() { MinimumGasPrices: []sdk.DecCoin{ { Denom: "AAAA", - Amount: sdk.NewDecFromInt(sdk.NewInt(-1)), + Amount: math.LegacyNewDecFromInt(math.NewInt(-1)), }, }, }, @@ -80,11 +82,11 @@ func (s *IntegrationTestSuite) TestUpdateParams() { MinimumGasPrices: []sdk.DecCoin{ { Denom: "AAAA", - Amount: sdk.NewDecFromInt(sdk.NewInt(1)), + Amount: math.LegacyNewDecFromInt(math.NewInt(1)), }, { Denom: "AAAA", - Amount: sdk.NewDecFromInt(sdk.NewInt(2)), + Amount: math.LegacyNewDecFromInt(math.NewInt(2)), }, }, }, @@ -99,11 +101,11 @@ func (s *IntegrationTestSuite) TestUpdateParams() { MinimumGasPrices: []sdk.DecCoin{ { Denom: "BBBB", - Amount: sdk.NewDecFromInt(sdk.NewInt(1)), + Amount: math.LegacyNewDecFromInt(math.NewInt(1)), }, { Denom: "AAAA", - Amount: sdk.NewDecFromInt(sdk.NewInt(2)), + Amount: math.LegacyNewDecFromInt(math.NewInt(2)), }, }, }, @@ -112,8 +114,8 @@ func (s *IntegrationTestSuite) TestUpdateParams() { }, } - for _, tc := range testCases { - tc := tc + for _, testcase := range testCases { + tc := testcase s.Run(tc.name, func() { _, err := s.msgServer.UpdateParams(s.ctx, tc.request) if tc.expectErr != "" { diff --git a/x/globalfee/module.go b/x/globalfee/module.go index 7ef025ee7..33dd6dadf 100644 --- a/x/globalfee/module.go +++ b/x/globalfee/module.go @@ -3,35 +3,38 @@ package globalfee import ( "context" "encoding/json" + "fmt" + + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" - errorsmod "cosmossdk.io/errors" - abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - "github.com/bandprotocol/chain/v2/x/globalfee/client/cli" - "github.com/bandprotocol/chain/v2/x/globalfee/keeper" - "github.com/bandprotocol/chain/v2/x/globalfee/types" + "github.com/bandprotocol/chain/v3/x/globalfee/client/cli" + "github.com/bandprotocol/chain/v3/x/globalfee/keeper" + "github.com/bandprotocol/chain/v3/x/globalfee/types" ) // ConsensusVersion defines the current x/globalfee module consensus version. const ConsensusVersion = 1 var ( - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleGenesis = AppModule{} - _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + // _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + + _ module.AppModule = AppModule{} ) -// AppModuleBasic defines the basic application module used by the wasm module. +// AppModuleBasic defines the basic application module used by the globalfee module. type AppModuleBasic struct{} -func (a AppModuleBasic) Name() string { +func (AppModuleBasic) Name() string { return types.ModuleName } @@ -41,43 +44,35 @@ func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the module's interface types -func (a AppModuleBasic) RegisterInterfaces(r codectypes.InterfaceRegistry) { +func (AppModuleBasic) RegisterInterfaces(r codectypes.InterfaceRegistry) { types.RegisterInterfaces(r) } -func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { return cdc.MustMarshalJSON(types.DefaultGenesisState()) } -func (a AppModuleBasic) ValidateGenesis( - marshaler codec.JSONCodec, - config client.TxEncodingConfig, - message json.RawMessage, -) error { +// Validation check of the Genesis +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { var data types.GenesisState - err := marshaler.UnmarshalJSON(message, &data) - if err != nil { - return err - } - - if err := data.Params.Validate(); err != nil { - return errorsmod.Wrap(err, "params") + if err := cdc.UnmarshalJSON(bz, &data); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) } - return nil + return data.Validate() } -func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { panic(err) } } -func (a AppModuleBasic) GetTxCmd() *cobra.Command { +func (AppModuleBasic) GetTxCmd() *cobra.Command { return nil } -func (a AppModuleBasic) GetQueryCmd() *cobra.Command { +func (AppModuleBasic) GetQueryCmd() *cobra.Command { return cli.GetQueryCmd() } @@ -95,42 +90,32 @@ func NewAppModule(keeper keeper.Keeper) *AppModule { } } -func (a AppModule) InitGenesis( - ctx sdk.Context, - marshaler codec.JSONCodec, - message json.RawMessage, -) []abci.ValidatorUpdate { - var genesisState types.GenesisState - marshaler.MustUnmarshalJSON(message, &genesisState) +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} - a.keeper.InitGenesis(ctx, &genesisState) - return []abci.ValidatorUpdate{} -} +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} -func (a AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) json.RawMessage { - genState := a.keeper.ExportGenesis(ctx) - return marshaler.MustMarshalJSON(genState) -} - -func (a AppModule) RegisterInvariants(registry sdk.InvariantRegistry) { -} - -func (a AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(a.keeper)) - types.RegisterQueryServer(cfg.QueryServer(), keeper.Querier{Keeper: a.keeper}) +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { + var genesisState types.GenesisState + cdc.MustUnmarshalJSON(data, &genesisState) + am.keeper.InitGenesis(ctx, &genesisState) } -func (a AppModule) BeginBlock(context sdk.Context, block abci.RequestBeginBlock) { +func (am AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) json.RawMessage { + genState := am.keeper.ExportGenesis(ctx) + return marshaler.MustMarshalJSON(genState) } -func (a AppModule) EndBlock(context sdk.Context, block abci.RequestEndBlock) []abci.ValidatorUpdate { - return nil +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), keeper.Querier{Keeper: am.keeper}) } // ConsensusVersion is a sequence number for state-breaking change of the // module. It should be incremented on each consensus-breaking change // introduced by the module. To avoid wrong/empty versions, the initial version // should be set to 1. -func (a AppModule) ConsensusVersion() uint64 { +func (am AppModule) ConsensusVersion() uint64 { return ConsensusVersion } diff --git a/x/globalfee/types/codec.go b/x/globalfee/types/codec.go index d4ed7385d..4b7504d44 100644 --- a/x/globalfee/types/codec.go +++ b/x/globalfee/types/codec.go @@ -8,11 +8,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/msgservice" ) -var ( - amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewAminoCodec(amino) -) - // RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(Params{}, "globalfee/Params", nil) diff --git a/x/globalfee/types/genesis.go b/x/globalfee/types/genesis.go index aa84903f2..f52af7190 100644 --- a/x/globalfee/types/genesis.go +++ b/x/globalfee/types/genesis.go @@ -4,6 +4,7 @@ import ( "encoding/json" errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" ) @@ -19,7 +20,7 @@ func DefaultGenesisState() *GenesisState { return NewGenesisState(DefaultParams()) } -// GetGenesisStateFromAppState returns x/auth GenesisState given raw application +// GetGenesisStateFromAppState returns x/globalfee GenesisState given raw application // genesis state. func GetGenesisStateFromAppState(cdc codec.Codec, appState map[string]json.RawMessage) *GenesisState { var genesisState GenesisState @@ -31,8 +32,10 @@ func GetGenesisStateFromAppState(cdc codec.Codec, appState map[string]json.RawMe return &genesisState } -func ValidateGenesis(data GenesisState) error { - if err := data.Params.Validate(); err != nil { +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (g GenesisState) Validate() error { + if err := g.Params.Validate(); err != nil { return errorsmod.Wrap(err, "globalfee params") } diff --git a/x/globalfee/types/genesis.pb.go b/x/globalfee/types/genesis.pb.go index 31740a587..88d1bf1a2 100644 --- a/x/globalfee/types/genesis.pb.go +++ b/x/globalfee/types/genesis.pb.go @@ -129,28 +129,28 @@ func init() { func init() { proto.RegisterFile("globalfee/v1beta1/genesis.proto", fileDescriptor_d6ae8f447e857249) } var fileDescriptor_d6ae8f447e857249 = []byte{ - // 333 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0x31, 0x4f, 0xc2, 0x40, - 0x14, 0xc7, 0x7b, 0x31, 0x61, 0x28, 0x0e, 0xd8, 0x38, 0x00, 0x21, 0x57, 0xd3, 0x89, 0x44, 0xbd, - 0x0b, 0x75, 0x73, 0x44, 0x13, 0x06, 0x1d, 0x08, 0x6e, 0x3a, 0x90, 0xeb, 0x71, 0x96, 0x8b, 0xbd, - 0xbe, 0x86, 0x3b, 0x88, 0x7c, 0x0b, 0x3f, 0x87, 0x9f, 0xc1, 0x5d, 0x46, 0x46, 0x27, 0x34, 0xb0, - 0x39, 0xfa, 0x09, 0x0c, 0xbd, 0x0a, 0x26, 0x9d, 0xee, 0x92, 0xf7, 0x7b, 0xff, 0xdf, 0xcb, 0x7b, - 0xae, 0x1f, 0x27, 0x10, 0xb1, 0xe4, 0x51, 0x08, 0x3a, 0xeb, 0x44, 0xc2, 0xb0, 0x0e, 0x8d, 0x45, - 0x2a, 0xb4, 0xd4, 0x24, 0x9b, 0x80, 0x01, 0xef, 0x68, 0x07, 0x90, 0x02, 0x68, 0x1e, 0xc7, 0x10, - 0x43, 0x5e, 0xa5, 0xdb, 0x9f, 0x05, 0x9b, 0x98, 0x83, 0x56, 0xa0, 0x69, 0xc4, 0xf4, 0x3e, 0x8b, - 0x83, 0x4c, 0x6d, 0x3d, 0x78, 0x70, 0x0f, 0x7b, 0x36, 0xf9, 0xce, 0x30, 0x23, 0xbc, 0x1b, 0xb7, - 0x92, 0xb1, 0x09, 0x53, 0xba, 0x8e, 0x4e, 0x50, 0xbb, 0x1a, 0x36, 0x48, 0xc9, 0x44, 0xfa, 0x39, - 0xd0, 0xad, 0x2f, 0x56, 0xbe, 0xf3, 0xbd, 0xf2, 0x6b, 0xb6, 0xe1, 0x0c, 0x94, 0x34, 0x42, 0x65, - 0x66, 0x3e, 0x28, 0x22, 0x82, 0x77, 0xe4, 0x56, 0x2c, 0xec, 0xbd, 0x21, 0xd7, 0x53, 0x32, 0x95, - 0x6a, 0xaa, 0x86, 0x31, 0xd3, 0xc3, 0x6c, 0x22, 0xb9, 0xd8, 0x4a, 0x0e, 0xda, 0xd5, 0xb0, 0x45, - 0xec, 0x94, 0x64, 0x3b, 0xe5, 0x4e, 0x73, 0x2d, 0xf8, 0x15, 0xc8, 0xb4, 0x9b, 0x15, 0x9e, 0x56, - 0xb9, 0x7f, 0xef, 0xfc, 0x59, 0xf9, 0x8d, 0x39, 0x53, 0xc9, 0x65, 0x50, 0xa6, 0x82, 0xd7, 0x4f, - 0xff, 0x34, 0x96, 0x66, 0x3c, 0x8d, 0x08, 0x07, 0x45, 0x8b, 0x95, 0xd8, 0xe7, 0x5c, 0x8f, 0x9e, - 0xa8, 0x99, 0x67, 0x42, 0xff, 0x09, 0xf5, 0xa0, 0x56, 0x64, 0xf4, 0x98, 0xee, 0xe7, 0x09, 0xdd, - 0xdb, 0xc5, 0x1a, 0xa3, 0xe5, 0x1a, 0xa3, 0xaf, 0x35, 0x46, 0x2f, 0x1b, 0xec, 0x2c, 0x37, 0xd8, - 0xf9, 0xd8, 0x60, 0xe7, 0x3e, 0xfc, 0x17, 0x1c, 0xb1, 0x74, 0x94, 0xaf, 0x95, 0x43, 0x42, 0xf9, - 0x98, 0xc9, 0x94, 0xce, 0x42, 0xfa, 0x4c, 0xf7, 0xd7, 0xcc, 0x45, 0x51, 0x25, 0x87, 0x2e, 0x7e, - 0x03, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x6e, 0x5e, 0x15, 0xe7, 0x01, 0x00, 0x00, + // 334 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xb1, 0x4e, 0x32, 0x41, + 0x10, 0xc7, 0x6f, 0xf3, 0x25, 0x14, 0xc7, 0x57, 0xe0, 0xc5, 0x02, 0x08, 0xd9, 0x33, 0x57, 0x91, + 0xa8, 0xbb, 0x01, 0x3a, 0x4b, 0x34, 0xa1, 0xd0, 0x82, 0x60, 0xa7, 0x05, 0xd9, 0x5b, 0xd6, 0x63, + 0xe3, 0xed, 0xcd, 0x85, 0x5d, 0x88, 0xbc, 0x85, 0xcf, 0xe1, 0x33, 0xd8, 0x4b, 0x49, 0x69, 0x85, + 0x06, 0x3a, 0x4b, 0x9f, 0xc0, 0xb0, 0x7b, 0x82, 0x09, 0xd5, 0x6e, 0x32, 0xbf, 0xf9, 0xff, 0x26, + 0x33, 0x7e, 0x98, 0xa4, 0x10, 0xb3, 0xf4, 0x41, 0x08, 0x3a, 0x6b, 0xc5, 0xc2, 0xb0, 0x16, 0x4d, + 0x44, 0x26, 0xb4, 0xd4, 0x24, 0x9f, 0x80, 0x81, 0xe0, 0x68, 0x07, 0x90, 0x02, 0xa8, 0x1f, 0x27, + 0x90, 0x80, 0xad, 0xd2, 0xed, 0xcf, 0x81, 0x75, 0xcc, 0x41, 0x2b, 0xd0, 0x34, 0x66, 0x7a, 0x9f, + 0xc5, 0x41, 0x66, 0xae, 0x1e, 0xdd, 0xfb, 0xff, 0x7b, 0x2e, 0xf9, 0xd6, 0x30, 0x23, 0x82, 0x6b, + 0xbf, 0x94, 0xb3, 0x09, 0x53, 0xba, 0x8a, 0x4e, 0x50, 0xb3, 0xdc, 0xae, 0x91, 0x03, 0x13, 0xe9, + 0x5b, 0xa0, 0x5b, 0x5d, 0xac, 0x42, 0xef, 0x6b, 0x15, 0x56, 0x5c, 0xc3, 0x19, 0x28, 0x69, 0x84, + 0xca, 0xcd, 0x7c, 0x50, 0x44, 0x44, 0x6f, 0xc8, 0x2f, 0x39, 0x38, 0x78, 0x45, 0x7e, 0xa0, 0x64, + 0x26, 0xd5, 0x54, 0x0d, 0x13, 0xa6, 0x87, 0xf9, 0x44, 0x72, 0xb1, 0x95, 0xfc, 0x6b, 0x96, 0xdb, + 0x0d, 0xe2, 0xa6, 0x24, 0xdb, 0x29, 0x77, 0x9a, 0x2b, 0xc1, 0x2f, 0x41, 0x66, 0xdd, 0xbc, 0xf0, + 0x34, 0x0e, 0xfb, 0xf7, 0xce, 0xef, 0x55, 0x58, 0x9b, 0x33, 0x95, 0x5e, 0x44, 0x87, 0x54, 0xf4, + 0xf2, 0x11, 0x9e, 0x26, 0xd2, 0x8c, 0xa7, 0x31, 0xe1, 0xa0, 0x68, 0xb1, 0x12, 0xf7, 0x9c, 0xeb, + 0xd1, 0x23, 0x35, 0xf3, 0x5c, 0xe8, 0x5f, 0xa1, 0x1e, 0x54, 0x8a, 0x8c, 0x1e, 0xd3, 0x7d, 0x9b, + 0xd0, 0xbd, 0x59, 0xac, 0x31, 0x5a, 0xae, 0x31, 0xfa, 0x5c, 0x63, 0xf4, 0xbc, 0xc1, 0xde, 0x72, + 0x83, 0xbd, 0xf7, 0x0d, 0xf6, 0xee, 0xda, 0x7f, 0x82, 0x63, 0x96, 0x8d, 0xec, 0x5a, 0x39, 0xa4, + 0x94, 0x8f, 0x99, 0xcc, 0xe8, 0xac, 0x43, 0x9f, 0xe8, 0xfe, 0x9a, 0x56, 0x14, 0x97, 0x2c, 0xd4, + 0xf9, 0x09, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x75, 0xd2, 0x7b, 0xe7, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/globalfee/types/msgs.go b/x/globalfee/types/msgs.go index 5508bbcfc..107505e0f 100644 --- a/x/globalfee/types/msgs.go +++ b/x/globalfee/types/msgs.go @@ -2,6 +2,7 @@ package types import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -11,23 +12,6 @@ const ( var _ sdk.Msg = &MsgUpdateParams{} -// Route returns the route of MsgUpdateParams - "oracle" (sdk.Msg interface). -func (m MsgUpdateParams) Route() string { return RouterKey } - -// Type returns the message type of MsgUpdateParams (sdk.Msg interface). -func (m MsgUpdateParams) Type() string { return TypeMsgUpdateParams } - -// GetSignBytes implements the LegacyMsg interface. -func (m MsgUpdateParams) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) -} - -// GetSigners returns the expected signers for a MsgUpdateParams message. -func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(m.Authority) - return []sdk.AccAddress{addr} -} - // ValidateBasic does a sanity check on the provided data. func (m *MsgUpdateParams) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { diff --git a/x/globalfee/types/params_test.go b/x/globalfee/types/params_test.go index 1df15508a..4e8e97788 100644 --- a/x/globalfee/types/params_test.go +++ b/x/globalfee/types/params_test.go @@ -3,8 +3,11 @@ package types import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestDefaultParams(t *testing.T) { @@ -22,27 +25,27 @@ func TestValidateParams(t *testing.T) { false, }, "DecCoins conversion fails, fail": { - sdk.Coins{sdk.NewCoin("photon", sdk.OneInt())}, + sdk.Coins{sdk.NewCoin("photon", math.OneInt())}, true, }, "coins amounts are zero, fail": { sdk.DecCoins{ - sdk.NewDecCoin("atom", sdk.ZeroInt()), - sdk.NewDecCoin("photon", sdk.ZeroInt()), + sdk.NewDecCoin("atom", math.ZeroInt()), + sdk.NewDecCoin("photon", math.ZeroInt()), }, true, }, "duplicate coins denoms, fail": { sdk.DecCoins{ - sdk.NewDecCoin("photon", sdk.OneInt()), - sdk.NewDecCoin("photon", sdk.OneInt()), + sdk.NewDecCoin("photon", math.OneInt()), + sdk.NewDecCoin("photon", math.OneInt()), }, true, }, "coins are not sorted by denom alphabetically, fail": { sdk.DecCoins{ - sdk.NewDecCoin("photon", sdk.OneInt()), - sdk.NewDecCoin("atom", sdk.OneInt()), + sdk.NewDecCoin("photon", math.OneInt()), + sdk.NewDecCoin("atom", math.OneInt()), }, true, }, diff --git a/x/globalfee/types/query.pb.go b/x/globalfee/types/query.pb.go index e85fbe20a..571db9916 100644 --- a/x/globalfee/types/query.pb.go +++ b/x/globalfee/types/query.pb.go @@ -120,26 +120,26 @@ func init() { func init() { proto.RegisterFile("globalfee/v1beta1/query.proto", fileDescriptor_6d5fd101df5712fa) } var fileDescriptor_6d5fd101df5712fa = []byte{ - // 290 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0xcf, 0xc9, 0x4f, - 0x4a, 0xcc, 0x49, 0x4b, 0x4d, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x2c, - 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0x4b, 0xeb, 0x41, 0xa5, - 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0xb2, 0xfa, 0x20, 0x16, 0x44, 0xa1, 0x94, 0x4c, 0x7a, - 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, 0x7e, 0x62, 0x41, 0xa6, 0x7e, 0x62, 0x5e, 0x5e, 0x7e, 0x49, 0x62, - 0x49, 0x66, 0x7e, 0x5e, 0x31, 0x54, 0x56, 0x1e, 0xd3, 0x96, 0xf4, 0xd4, 0xbc, 0xd4, 0xe2, 0x4c, - 0xa8, 0x02, 0x25, 0x11, 0x2e, 0xa1, 0x40, 0x90, 0xb5, 0x01, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0x41, - 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x4a, 0x7e, 0x5c, 0xc2, 0x28, 0xa2, 0xc5, 0x05, 0xf9, 0x79, - 0xc5, 0xa9, 0x42, 0xe6, 0x5c, 0x6c, 0x05, 0x60, 0x11, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, - 0x49, 0x3d, 0x0c, 0x57, 0xea, 0x41, 0xb4, 0x38, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x10, 0x04, 0x55, - 0x6e, 0xd4, 0xcc, 0xc8, 0xc5, 0x0a, 0x36, 0x50, 0xa8, 0x8a, 0x8b, 0x0d, 0xa2, 0x42, 0x48, 0x15, - 0x8b, 0x66, 0x4c, 0xa7, 0x48, 0xa9, 0x11, 0x52, 0x06, 0x71, 0x9b, 0x92, 0x62, 0xd3, 0xe5, 0x27, - 0x93, 0x99, 0xa4, 0x85, 0x24, 0xf5, 0x31, 0xbd, 0x0c, 0x71, 0x85, 0x93, 0xcf, 0x89, 0x47, 0x72, - 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, - 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x19, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, - 0xe7, 0xe7, 0xea, 0x27, 0x25, 0xe6, 0xa5, 0x80, 0xc3, 0x26, 0x39, 0x3f, 0x47, 0x3f, 0x39, 0x23, - 0x31, 0x33, 0x4f, 0xbf, 0xcc, 0x48, 0xbf, 0x02, 0xc9, 0xd8, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, - 0x36, 0xb0, 0x22, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc8, 0xea, 0x91, 0xf7, 0xc9, 0x01, - 0x00, 0x00, + // 289 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0xb1, 0x4e, 0xc3, 0x30, + 0x10, 0x86, 0x63, 0x04, 0x1d, 0xcc, 0x84, 0xe9, 0x40, 0x03, 0xb8, 0x10, 0x09, 0xc4, 0x14, 0xab, + 0xe9, 0xc0, 0xde, 0x19, 0x21, 0xe8, 0xc8, 0xe6, 0x84, 0xc3, 0x8d, 0x94, 0xfa, 0xd2, 0xd8, 0xa9, + 0x28, 0x23, 0xbc, 0x00, 0x12, 0x2f, 0xd5, 0xb1, 0x12, 0x0b, 0x13, 0x42, 0x09, 0x0f, 0x82, 0x9a, + 0x44, 0x08, 0x14, 0x24, 0x36, 0xeb, 0xfe, 0xef, 0xee, 0x3e, 0x1f, 0x3d, 0x54, 0x09, 0x86, 0x32, + 0xb9, 0x03, 0x10, 0xf3, 0x41, 0x08, 0x56, 0x0e, 0xc4, 0x2c, 0x87, 0x6c, 0xe1, 0xa7, 0x19, 0x5a, + 0x64, 0x3b, 0xdf, 0xb1, 0xdf, 0xc4, 0x6e, 0x57, 0xa1, 0xc2, 0x2a, 0x15, 0xeb, 0x57, 0x0d, 0xba, + 0x07, 0x0a, 0x51, 0x25, 0x20, 0x64, 0x1a, 0x0b, 0xa9, 0x35, 0x5a, 0x69, 0x63, 0xd4, 0xa6, 0x49, + 0xfb, 0xed, 0x2d, 0x0a, 0x34, 0x98, 0xb8, 0x01, 0xbc, 0x2e, 0x65, 0xd7, 0xeb, 0xb5, 0x57, 0x32, + 0x93, 0x53, 0x33, 0x86, 0x59, 0x0e, 0xc6, 0x7a, 0x97, 0x74, 0xf7, 0x57, 0xd5, 0xa4, 0xa8, 0x0d, + 0xb0, 0x73, 0xda, 0x49, 0xab, 0xca, 0x1e, 0x39, 0x22, 0x67, 0xdb, 0x41, 0xcf, 0x6f, 0x59, 0xfa, + 0x75, 0xcb, 0x68, 0x73, 0xf9, 0xde, 0x77, 0xc6, 0x0d, 0x1e, 0x3c, 0x11, 0xba, 0x55, 0x0d, 0x64, + 0x0f, 0xb4, 0x53, 0x13, 0xec, 0xe4, 0x8f, 0xe6, 0xb6, 0x8a, 0x7b, 0xfa, 0x1f, 0x56, 0xbb, 0x79, + 0xc7, 0x8f, 0xaf, 0x9f, 0x2f, 0x1b, 0xfb, 0xac, 0x27, 0xda, 0x5f, 0xae, 0x2d, 0x46, 0x17, 0xcb, + 0x82, 0x93, 0x55, 0xc1, 0xc9, 0x47, 0xc1, 0xc9, 0x73, 0xc9, 0x9d, 0x55, 0xc9, 0x9d, 0xb7, 0x92, + 0x3b, 0x37, 0x81, 0x8a, 0xed, 0x24, 0x0f, 0xfd, 0x08, 0xa7, 0x22, 0x94, 0xfa, 0xb6, 0xba, 0x4d, + 0x84, 0x89, 0x88, 0x26, 0x32, 0xd6, 0x62, 0x3e, 0x14, 0xf7, 0x3f, 0xc6, 0xda, 0x45, 0x0a, 0x26, + 0xec, 0x54, 0xd0, 0xf0, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x89, 0xf1, 0x1d, 0x99, 0xc9, 0x01, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/globalfee/types/tx.pb.go b/x/globalfee/types/tx.pb.go index 20dbfbb77..6b246edc6 100644 --- a/x/globalfee/types/tx.pb.go +++ b/x/globalfee/types/tx.pb.go @@ -137,28 +137,28 @@ func init() { func init() { proto.RegisterFile("globalfee/v1beta1/tx.proto", fileDescriptor_453c6a09831c9f6b) } var fileDescriptor_453c6a09831c9f6b = []byte{ - // 328 bytes of a gzipped FileDescriptorProto + // 334 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0xcf, 0xc9, 0x4f, 0x4a, 0xcc, 0x49, 0x4b, 0x4d, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, - 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0xcb, 0xe9, 0x41, 0xe5, 0xa4, 0xc4, 0x93, - 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xf5, 0x73, 0x8b, 0xd3, 0xf5, 0xcb, 0x0c, 0x41, 0x14, 0x44, 0xad, - 0x94, 0x3c, 0xa6, 0x39, 0xe9, 0xa9, 0x79, 0xa9, 0xc5, 0x99, 0xc5, 0x50, 0x05, 0x22, 0xe9, 0xf9, - 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x15, 0x95, 0x84, 0x98, 0x17, 0x0f, 0x91, 0x80, 0x70, - 0x20, 0x52, 0x4a, 0x93, 0x18, 0xb9, 0xf8, 0x7d, 0x8b, 0xd3, 0x43, 0x0b, 0x52, 0x12, 0x4b, 0x52, - 0x03, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0x85, 0xcc, 0xb8, 0x38, 0x13, 0x4b, 0x4b, 0x32, 0xf2, 0x8b, - 0x32, 0x4b, 0x2a, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x24, 0x2e, 0x6d, 0xd1, 0x15, 0x81, - 0x6a, 0x74, 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e, 0x0e, 0x2e, 0x29, 0xca, 0xcc, 0x4b, 0x0f, 0x42, - 0x28, 0x15, 0x32, 0xe7, 0x62, 0x2b, 0x00, 0x9b, 0x20, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, - 0xa9, 0x87, 0xe1, 0x35, 0x3d, 0x88, 0x15, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0x95, - 0x5b, 0xf1, 0x35, 0x3d, 0xdf, 0xa0, 0x85, 0x30, 0x48, 0x49, 0x92, 0x4b, 0x1c, 0xcd, 0x4d, 0x41, - 0xa9, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x46, 0xa9, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x42, 0x71, - 0x5c, 0x3c, 0x28, 0x4e, 0x56, 0xc2, 0x62, 0x15, 0x9a, 0x11, 0x52, 0x5a, 0x84, 0xd5, 0xc0, 0xac, - 0x71, 0xf2, 0x39, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, - 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xa3, 0xf4, 0xcc, - 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xa4, 0xc4, 0xbc, 0x14, 0x70, 0x30, 0x26, - 0xe7, 0xe7, 0xe8, 0x27, 0x67, 0x24, 0x66, 0xe6, 0xe9, 0x97, 0x19, 0xe9, 0x57, 0xe8, 0x23, 0x62, - 0xa9, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xac, 0xc8, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, - 0x1b, 0x18, 0xb3, 0x37, 0x07, 0x02, 0x00, 0x00, + 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0xcb, 0xe9, 0x41, 0xe5, 0xa4, 0x44, 0xd2, + 0xf3, 0xd3, 0xf3, 0xc1, 0xb2, 0xfa, 0x20, 0x16, 0x44, 0xa1, 0x94, 0x64, 0x72, 0x7e, 0x71, 0x6e, + 0x7e, 0x71, 0x3c, 0x44, 0x02, 0xc2, 0x81, 0x4a, 0x89, 0x43, 0x78, 0xfa, 0xb9, 0xc5, 0xe9, 0xfa, + 0x65, 0x86, 0x20, 0x0a, 0x2a, 0x21, 0x8f, 0x69, 0x71, 0x7a, 0x6a, 0x5e, 0x6a, 0x71, 0x26, 0x54, + 0xa7, 0xd2, 0x24, 0x46, 0x2e, 0x7e, 0xdf, 0xe2, 0xf4, 0xd0, 0x82, 0x94, 0xc4, 0x92, 0xd4, 0x80, + 0xc4, 0xa2, 0xc4, 0xdc, 0x62, 0x21, 0x33, 0x2e, 0xce, 0xc4, 0xd2, 0x92, 0x8c, 0xfc, 0xa2, 0xcc, + 0x92, 0x4a, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x4e, 0x27, 0x89, 0x4b, 0x5b, 0x74, 0x45, 0xa0, 0x56, + 0x3a, 0xa6, 0xa4, 0x14, 0xa5, 0x16, 0x17, 0x07, 0x97, 0x14, 0x65, 0xe6, 0xa5, 0x07, 0x21, 0x94, + 0x0a, 0x99, 0x73, 0xb1, 0x15, 0x80, 0x4d, 0x90, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd4, + 0xc3, 0xf0, 0x9a, 0x1e, 0xc4, 0x0a, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xa0, 0xca, 0xad, + 0xf8, 0x9a, 0x9e, 0x6f, 0xd0, 0x42, 0x18, 0xa4, 0x24, 0xc9, 0x25, 0x8e, 0xe6, 0xa6, 0xa0, 0xd4, + 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0xa3, 0x1c, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x38, 0x2e, + 0x1e, 0x14, 0x27, 0x2b, 0x61, 0xb1, 0x0a, 0xcd, 0x08, 0x29, 0x2d, 0xc2, 0x6a, 0x60, 0xd6, 0x48, + 0xb1, 0x36, 0x3c, 0xdf, 0xa0, 0xc5, 0xe8, 0xe4, 0x73, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, + 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, + 0x72, 0x0c, 0x51, 0x46, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x49, + 0x89, 0x79, 0x29, 0xe0, 0xd0, 0x4c, 0xce, 0xcf, 0xd1, 0x4f, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x2f, + 0x33, 0xd6, 0xaf, 0xd0, 0x47, 0x84, 0x7d, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x58, 0x91, + 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x44, 0x62, 0x75, 0x82, 0x0e, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/oracle/abci.go b/x/oracle/abci.go index dc69c3a16..0ad5294db 100644 --- a/x/oracle/abci.go +++ b/x/oracle/abci.go @@ -1,28 +1,27 @@ package oracle import ( - abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/oracle/keeper" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/keeper" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) -// handleBeginBlock re-calculates and saves the rolling seed value based on block hashes. -func handleBeginBlock(ctx sdk.Context, req abci.RequestBeginBlock, k keeper.Keeper) { +// BeginBlocker re-calculates and saves the rolling seed value based on block hashes. +func BeginBlocker(ctx sdk.Context, k keeper.Keeper) error { // Update rolling seed used for pseudorandom oracle provider selection. - hash := req.GetHash() + hash := ctx.HeaderInfo().Hash // On the first block in the test. it's possible to have empty hash. if len(hash) > 0 { rollingSeed := k.GetRollingSeed(ctx) k.SetRollingSeed(ctx, append(rollingSeed[1:], hash[0])) } // Reward a portion of block rewards (inflation + tx fee) to active oracle validators. - k.AllocateTokens(ctx, req.LastCommitInfo.GetVotes()) + return k.AllocateTokens(ctx, ctx.VoteInfos()) } -// handleEndBlock cleans up the state during end block. See comment in the implementation! -func handleEndBlock(ctx sdk.Context, k keeper.Keeper) { +// EndBlocker cleans up the state during end block. See comment in the implementation! +func EndBlocker(ctx sdk.Context, k keeper.Keeper) error { // Loops through all requests in the resolvable list to resolve all of them! for _, reqID := range k.GetPendingResolveList(ctx) { k.ResolveRequest(ctx, reqID) @@ -34,4 +33,5 @@ func handleEndBlock(ctx sdk.Context, k keeper.Keeper) { k.ProcessExpiredRequests(ctx) // NOTE: We can remove old requests from state to optimize space, using `k.DeleteRequest` // and `k.DeleteReports`. We don't do that now as it is premature optimization at this state. + return nil } diff --git a/x/oracle/abci_test.go b/x/oracle/abci_test.go index 4afecc53b..92a1a78da 100644 --- a/x/oracle/abci_test.go +++ b/x/oracle/abci_test.go @@ -4,16 +4,63 @@ import ( "encoding/hex" "testing" + "github.com/stretchr/testify/suite" + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + + "cosmossdk.io/core/header" + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/stretchr/testify/require" - bandtesting "github.com/bandprotocol/chain/v2/testing" + band "github.com/bandprotocol/chain/v3/app" + bandtesting "github.com/bandprotocol/chain/v3/testing" ) +type ABCITestSuite struct { + suite.Suite + + app *band.BandApp +} + +func TestABCITestSuite(t *testing.T) { + suite.Run(t, new(ABCITestSuite)) +} + +func (s *ABCITestSuite) SetupTest() { + dir := testutil.GetTempDir(s.T()) + s.app = bandtesting.SetupWithCustomHome(false, dir) + + _, err := s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1}) + s.Require().NoError(err) + _, err = s.app.Commit() + s.Require().NoError(err) + + _, err = s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1}) + s.Require().NoError(err) + _, err = s.app.Commit() + s.Require().NoError(err) + + ctx := s.app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + + // Send all coins in the distribution module account. + distModule := s.app.AccountKeeper.GetModuleAccount(ctx, distrtypes.ModuleName) + err = s.app.BankKeeper.SendCoinsFromModuleToAccount( + ctx, + distrtypes.ModuleName, + bandtesting.Treasury.Address, + s.app.BankKeeper.GetAllBalances(ctx, distModule.GetAddress()), + ) + s.Require().NoError(err) + err = s.app.DistrKeeper.FeePool.Set(ctx, distrtypes.InitialFeePool()) + s.Require().NoError(err) +} + func fromHex(hexStr string) []byte { res, err := hex.DecodeString(hexStr) if err != nil { @@ -22,280 +69,406 @@ func fromHex(hexStr string) []byte { return res } -func TestRollingSeedCorrect(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (s *ABCITestSuite) TestRollingSeed() { + k := s.app.OracleKeeper + ctx := s.app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + require := s.Require() // Initially rolling seed should be all zeros. require.Equal( - t, fromHex("0000000000000000000000000000000000000000000000000000000000000000"), k.GetRollingSeed(ctx), ) // Every begin block, the rolling seed should get updated. - app.BeginBlocker(ctx, abci.RequestBeginBlock{ + _, err := s.app.BeginBlocker(ctx.WithHeaderInfo(header.Info{ Hash: fromHex("0100000000000000000000000000000000000000000000000000000000000000"), - }) + })) require.Equal( - t, fromHex("0000000000000000000000000000000000000000000000000000000000000001"), k.GetRollingSeed(ctx), ) - app.BeginBlocker(ctx, abci.RequestBeginBlock{ + require.NoError(err) + + _, err = s.app.BeginBlocker(ctx.WithHeaderInfo(header.Info{ Hash: fromHex("0200000000000000000000000000000000000000000000000000000000000000"), - }) + })) require.Equal( - t, fromHex("0000000000000000000000000000000000000000000000000000000000000102"), k.GetRollingSeed(ctx), ) - app.BeginBlocker(ctx, abci.RequestBeginBlock{ + require.NoError(err) + + _, err = s.app.BeginBlocker(ctx.WithHeaderInfo(header.Info{ Hash: fromHex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), - }) + })) require.Equal( - t, fromHex("00000000000000000000000000000000000000000000000000000000000102ff"), k.GetRollingSeed(ctx), ) + require.NoError(err) } -func TestAllocateTokensCalledOnBeginBlock(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (s *ABCITestSuite) TestAllocateTokensCalledOnBeginBlock() { + k := s.app.OracleKeeper + ctx := s.app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + require := s.Require() votes := []abci.VoteInfo{{ - Validator: abci.Validator{Address: bandtesting.Validators[0].PubKey.Address(), Power: 70}, - SignedLastBlock: true, + Validator: abci.Validator{Address: bandtesting.Validators[0].PubKey.Address(), Power: 70}, + BlockIdFlag: tmproto.BlockIDFlagCommit, }, { - Validator: abci.Validator{Address: bandtesting.Validators[1].PubKey.Address(), Power: 30}, - SignedLastBlock: true, + Validator: abci.Validator{Address: bandtesting.Validators[1].PubKey.Address(), Power: 30}, + BlockIdFlag: tmproto.BlockIDFlagCommit, }} - // Set collected fee to 100uband + 70% oracle reward proportion + disable minting inflation. - // NOTE: we intentionally keep ctx.BlockHeight = 0, so distr's AllocateTokens doesn't get called. - feeCollector := app.AccountKeeper.GetModuleAccount(ctx, authtypes.FeeCollectorName) - err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(sdk.NewInt64Coin("uband", 100))) - require.NoError(t, err) - err = app.BankKeeper.SendCoinsFromModuleToModule( + + // Set collected fee to 10000uband + 70% oracle reward proportion + disable minting inflation. + feeCollector := s.app.AccountKeeper.GetModuleAccount(ctx, authtypes.FeeCollectorName) + err := s.app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(sdk.NewInt64Coin("uband", 10000))) + require.NoError(err) + err = s.app.BankKeeper.SendCoinsFromModuleToModule( ctx, minttypes.ModuleName, authtypes.FeeCollectorName, - sdk.NewCoins(sdk.NewInt64Coin("uband", 100)), + sdk.NewCoins(sdk.NewInt64Coin("uband", 10000)), ) - require.NoError(t, err) + require.NoError(err) + s.app.AccountKeeper.SetAccount(ctx, feeCollector) - distModule := app.AccountKeeper.GetModuleAccount(ctx, distrtypes.ModuleName) + distModule := s.app.AccountKeeper.GetModuleAccount(ctx, distrtypes.ModuleName) - app.AccountKeeper.SetAccount(ctx, feeCollector) - mintParams := app.MintKeeper.GetParams(ctx) - mintParams.InflationMin = sdk.ZeroDec() - mintParams.InflationMax = sdk.ZeroDec() - err = app.MintKeeper.SetParams(ctx, mintParams) - require.NoError(t, err) + mintParams, err := s.app.MintKeeper.Params.Get(ctx) + require.NoError(err) + mintParams.InflationMin = math.LegacyZeroDec() + mintParams.InflationMax = math.LegacyZeroDec() + err = s.app.MintKeeper.Params.Set(ctx, mintParams) + require.NoError(err) params := k.GetParams(ctx) params.OracleRewardPercentage = 70 err = k.SetParams(ctx, params) - require.NoError(t, err) + require.NoError(err) require.Equal( - t, - sdk.NewCoins(sdk.NewInt64Coin("uband", 100)), - app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()), + sdk.NewCoins(sdk.NewInt64Coin("uband", 10000)), + s.app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()), ) // If there are no validators active, Calling begin block should be no-op. - app.BeginBlocker(ctx, abci.RequestBeginBlock{ - Hash: fromHex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), - LastCommitInfo: abci.CommitInfo{Votes: votes}, - }) + _, err = s.app.BeginBlocker( + ctx.WithHeaderInfo(header.Info{Hash: fromHex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")}). + WithVoteInfos(votes). + WithProposer(bandtesting.Validators[0].ValAddress.Bytes()), + ) + require.NoError(err) require.Equal( - t, - sdk.NewCoins(sdk.NewInt64Coin("uband", 100)), - app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()), + sdk.NewCoins(sdk.NewInt64Coin("uband", 10000)), + s.app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()), ) + // 1 validator active, begin block should take 70% of the fee. 2% of that goes to comm pool. err = k.Activate(ctx, bandtesting.Validators[1].ValAddress) - require.NoError(t, err) - app.BeginBlocker(ctx, abci.RequestBeginBlock{ - Hash: fromHex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), - LastCommitInfo: abci.CommitInfo{Votes: votes}, - }) + require.NoError(err) + _, err = s.app.BeginBlocker( + ctx.WithHeaderInfo(header.Info{Hash: fromHex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")}). + WithVoteInfos(votes). + WithProposer(bandtesting.Validators[0].ValAddress.Bytes()), + ) + require.NoError(err) require.Equal( - t, - sdk.NewCoins(sdk.NewInt64Coin("uband", 30)), - app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()), + sdk.NewCoins(sdk.NewInt64Coin("uband", 3000)), + s.app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()), ) require.Equal( - t, - sdk.NewCoins(sdk.NewInt64Coin("uband", 70)), - app.BankKeeper.GetAllBalances(ctx, distModule.GetAddress()), + sdk.NewCoins(sdk.NewInt64Coin("uband", 7000)), + s.app.BankKeeper.GetAllBalances(ctx, distModule.GetAddress()), ) - // 100*70%*2% = 1.4uband + // 10000*70%*2% = 140uband + feePool, err := s.app.DistrKeeper.FeePool.Get(ctx) + require.NoError(err) require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDecWithPrec(14, 1)}}, - app.DistrKeeper.GetFeePool(ctx).CommunityPool, + sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDec(140)}}, + feePool.CommunityPool, ) // 0uband - require.Empty(t, app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[0].ValAddress)) - // 100*70%*98% = 68.6uband + require.Empty(s.app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[0].ValAddress)) + // 10000*70%*98% = 6860uband + valOutReward, err := s.app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[1].ValAddress) + require.NoError(err) require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDecWithPrec(686, 1)}}, - app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[1].ValAddress).Rewards, + sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDec(6860)}}, + valOutReward.Rewards, ) - // 2 validators active now. 70% of the remaining fee pool will be split 3 ways (comm pool + val1 + val2). + + // 2 validators active now. 70% of the remaining fee pool will be split 3 ways (comm pool + val0 + val1). err = k.Activate(ctx, bandtesting.Validators[0].ValAddress) - require.NoError(t, err) + require.NoError(err) - app.BeginBlocker(ctx, abci.RequestBeginBlock{ - Hash: fromHex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), - LastCommitInfo: abci.CommitInfo{Votes: votes}, - }) + _, err = s.app.BeginBlocker( + ctx.WithHeaderInfo(header.Info{Hash: fromHex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")}). + WithVoteInfos(votes). + WithProposer(bandtesting.Validators[0].ValAddress.Bytes()), + ) + require.NoError(err) require.Equal( - t, - sdk.NewCoins(sdk.NewInt64Coin("uband", 9)), - app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()), + sdk.NewCoins(sdk.NewInt64Coin("uband", 900)), + s.app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()), ) require.Equal( - t, - sdk.NewCoins(sdk.NewInt64Coin("uband", 91)), - app.BankKeeper.GetAllBalances(ctx, distModule.GetAddress()), + sdk.NewCoins(sdk.NewInt64Coin("uband", 9100)), + s.app.BankKeeper.GetAllBalances(ctx, distModule.GetAddress()), ) - // 1.4uband + 30*70%*2% = 1.82uband + // 140uband + 3000*70%*2% = 182uband + feePool, err = s.app.DistrKeeper.FeePool.Get(ctx) + require.NoError(err) require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDecWithPrec(182, 2)}}, - app.DistrKeeper.GetFeePool(ctx).CommunityPool, + sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDec(182)}}, + feePool.CommunityPool, ) - // 30*70%*98%*70% = 14.406uband + // 3000*70%*98%*70% = 1440.6uband + valOutReward, err = s.app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[0].ValAddress) + require.NoError(err) require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDecWithPrec(14406, 3)}}, - app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[0].ValAddress).Rewards, + sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDecWithPrec(14406, 1)}}, + valOutReward.Rewards, ) - // 68.6uband + 30*70%*98%*30% = 74.774uband + // 68.6uband + 3000*70%*98%*30% = 7477.4uband + valOutReward, err = s.app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[1].ValAddress) + require.NoError(err) require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDecWithPrec(74774, 3)}}, - app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[1].ValAddress).Rewards, + sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDecWithPrec(74774, 1)}}, + valOutReward.Rewards, ) - // 1 validator becomes in active, and will not get reward this time. + + // 1 validator becomes inactive, and will not get reward this time. k.MissReport(ctx, bandtesting.Validators[1].ValAddress, bandtesting.ParseTime(100)) - app.BeginBlocker(ctx, abci.RequestBeginBlock{ - Hash: fromHex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), - LastCommitInfo: abci.CommitInfo{Votes: votes}, - }) + _, err = s.app.BeginBlocker( + ctx.WithHeaderInfo(header.Info{Hash: fromHex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")}). + WithVoteInfos(votes). + WithProposer(bandtesting.Validators[0].ValAddress.Bytes()), + ) + require.NoError(err) + require.Equal( + sdk.NewCoins(sdk.NewInt64Coin("uband", 270)), + s.app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()), + ) + require.Equal( + sdk.NewCoins(sdk.NewInt64Coin("uband", 9730)), + s.app.BankKeeper.GetAllBalances(ctx, distModule.GetAddress()), + ) + // 182uband + 630*2% = 194.6 but fund community pool function only distribute + // to fee pool in integer amount so it will be 194uband. + feePool, err = s.app.DistrKeeper.FeePool.Get(ctx) + require.NoError(err) + require.Equal( + sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDec(194)}}, + feePool.CommunityPool, + ) + // Since the validator is the only one active, it will get all the remaining fee pool. + // 1440.6uband + 618 = 2058.6uband + valOutReward, err = s.app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[0].ValAddress) + require.NoError(err) + require.Equal( + sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDecWithPrec(20586, 1)}}, + valOutReward.Rewards, + ) + // 7477.4uband + valOutReward, err = s.app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[1].ValAddress) + require.NoError(err) + require.Equal( + sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDecWithPrec(74774, 1)}}, + valOutReward.Rewards, + ) +} + +func (s *ABCITestSuite) TestAllocateTokensToProposer() { + k := s.app.OracleKeeper + ctx := s.app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + require := s.Require() + + votes := []abci.VoteInfo{ + { + Validator: abci.Validator{Address: bandtesting.Validators[0].PubKey.Address(), Power: 1}, + BlockIdFlag: tmproto.BlockIDFlagCommit, + }, + { + Validator: abci.Validator{Address: bandtesting.Validators[1].PubKey.Address(), Power: 1}, + BlockIdFlag: tmproto.BlockIDFlagCommit, + }, + { + Validator: abci.Validator{Address: bandtesting.Validators[2].PubKey.Address(), Power: 1}, + BlockIdFlag: tmproto.BlockIDFlagCommit, + }, + } + + // Set collected fee to 100uband + 70% oracle reward proportion + disable minting inflation. + feeCollector := s.app.AccountKeeper.GetModuleAccount(ctx, authtypes.FeeCollectorName) + err := s.app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(sdk.NewInt64Coin("uband", 102))) + require.NoError(err) + err = s.app.BankKeeper.SendCoinsFromModuleToModule( + ctx, + minttypes.ModuleName, + authtypes.FeeCollectorName, + sdk.NewCoins(sdk.NewInt64Coin("uband", 102)), + ) + require.NoError(err) + s.app.AccountKeeper.SetAccount(ctx, feeCollector) + + distModule := s.app.AccountKeeper.GetModuleAccount(ctx, distrtypes.ModuleName) + + mintParams, err := s.app.MintKeeper.Params.Get(ctx) + require.NoError(err) + mintParams.InflationMin = math.LegacyZeroDec() + mintParams.InflationMax = math.LegacyZeroDec() + err = s.app.MintKeeper.Params.Set(ctx, mintParams) + require.NoError(err) + + params := k.GetParams(ctx) + params.OracleRewardPercentage = 100 + err = k.SetParams(ctx, params) + require.NoError(err) require.Equal( - t, - sdk.NewCoins(sdk.NewInt64Coin("uband", 3)), - app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()), + sdk.NewCoins(sdk.NewInt64Coin("uband", 102)), + s.app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()), + ) + + // 3 validators active now. 70% of the remaining fee pool will be split 4 ways (comm pool + val0 + val1 + val2). + err = k.Activate(ctx, bandtesting.Validators[0].ValAddress) + require.NoError(err) + err = k.Activate(ctx, bandtesting.Validators[1].ValAddress) + require.NoError(err) + err = k.Activate(ctx, bandtesting.Validators[2].ValAddress) + require.NoError(err) + + _, err = s.app.BeginBlocker( + ctx.WithHeaderInfo(header.Info{Hash: fromHex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")}). + WithVoteInfos(votes). + WithProposer(bandtesting.Validators[2].ValAddress.Bytes()), + ) + require.NoError(err) + require.Equal( + sdk.NewCoins(sdk.NewInt64Coin("uband", 0)), + s.app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()), ) require.Equal( - t, - sdk.NewCoins(sdk.NewInt64Coin("uband", 97)), - app.BankKeeper.GetAllBalances(ctx, distModule.GetAddress()), + sdk.NewCoins(sdk.NewInt64Coin("uband", 102)), + s.app.BankKeeper.GetAllBalances(ctx, distModule.GetAddress()), ) - // 1.82uband + 6*2% = 1.82uband + // 102*2% = 2.04uband but fund community pool function only distribute + // to fee pool in integer amount so it will be 2uband. + feePool, err := s.app.DistrKeeper.FeePool.Get(ctx) + require.NoError(err) require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDecWithPrec(194, 2)}}, - app.DistrKeeper.GetFeePool(ctx).CommunityPool, + sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDec(2)}}, + feePool.CommunityPool, ) - // 14.406uband + 6*98% = 20.286uband + // 100/3 = 33.3333333333333333uband + valOutReward, err := s.app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[0].ValAddress) + require.NoError(err) require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDecWithPrec(20286, 3)}}, - app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[0].ValAddress).Rewards, + sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDecWithPrec(333333333333333333, 16)}}, + valOutReward.Rewards, ) - // 74.774uband + // 100/3 = 33.3333333333333333uband + valOutReward, err = s.app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[1].ValAddress) + require.NoError(err) require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDecWithPrec(74774, 3)}}, - app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[1].ValAddress).Rewards, + sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDecWithPrec(333333333333333333, 16)}}, + valOutReward.Rewards, + ) + // 100/3 = 33.3333333333333333uband + // but the proposer get the remaining 0.0000000000000001uband + // so the proposer will get 33.3333333333333334uband + valOutReward, err = s.app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[2].ValAddress) + require.NoError(err) + require.Equal( + sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDecWithPrec(333333333333333334, 16)}}, + valOutReward.Rewards, ) } -func TestAllocateTokensWithDistrAllocateTokens(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (s *ABCITestSuite) TestAllocateTokensWithDistrAllocateTokens() { + k := s.app.OracleKeeper + ctx := s.app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + require := s.Require() ctx = ctx.WithBlockHeight(10) // Set block height to ensure distr's AllocateTokens gets called. votes := []abci.VoteInfo{{ - Validator: abci.Validator{Address: bandtesting.Validators[0].PubKey.Address(), Power: 70}, - SignedLastBlock: true, + Validator: abci.Validator{Address: bandtesting.Validators[0].PubKey.Address(), Power: 70}, + BlockIdFlag: tmproto.BlockIDFlagCommit, }, { - Validator: abci.Validator{Address: bandtesting.Validators[1].PubKey.Address(), Power: 30}, - SignedLastBlock: true, + Validator: abci.Validator{Address: bandtesting.Validators[1].PubKey.Address(), Power: 30}, + BlockIdFlag: tmproto.BlockIDFlagCommit, }} - feeCollector := app.AccountKeeper.GetModuleAccount(ctx, authtypes.FeeCollectorName) - distModule := app.AccountKeeper.GetModuleAccount(ctx, distrtypes.ModuleName) + feeCollector := s.app.AccountKeeper.GetModuleAccount(ctx, authtypes.FeeCollectorName) + distModule := s.app.AccountKeeper.GetModuleAccount(ctx, distrtypes.ModuleName) // Set collected fee to 100uband + 70% oracle reward proportion + disable minting inflation. - err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(sdk.NewInt64Coin("uband", 50))) - require.NoError(t, err) - err = app.BankKeeper.SendCoinsFromModuleToModule( + err := s.app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(sdk.NewInt64Coin("uband", 50))) + require.NoError(err) + err = s.app.BankKeeper.SendCoinsFromModuleToModule( ctx, minttypes.ModuleName, authtypes.FeeCollectorName, sdk.NewCoins(sdk.NewInt64Coin("uband", 50)), ) - require.NoError(t, err) - app.AccountKeeper.SetAccount(ctx, feeCollector) - mintParams := app.MintKeeper.GetParams(ctx) - mintParams.InflationMin = sdk.ZeroDec() - mintParams.InflationMax = sdk.ZeroDec() - err = app.MintKeeper.SetParams(ctx, mintParams) - require.NoError(t, err) + require.NoError(err) + + s.app.AccountKeeper.SetAccount(ctx, feeCollector) + mintParams, err := s.app.MintKeeper.Params.Get(ctx) + require.NoError(err) + mintParams.InflationMin = math.LegacyZeroDec() + mintParams.InflationMax = math.LegacyZeroDec() + err = s.app.MintKeeper.Params.Set(ctx, mintParams) + require.NoError(err) + params := k.GetParams(ctx) params.OracleRewardPercentage = 70 err = k.SetParams(ctx, params) - require.NoError(t, err) - // Set block proposer to Validators[1], who will receive 5% bonus. - app.DistrKeeper.SetPreviousProposerConsAddr(ctx, bandtesting.Validators[1].Address.Bytes()) - require.Equal( - t, - sdk.NewCoins(sdk.NewInt64Coin("uband", 50)), - app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()), - ) + require.NoError(err) + // Only Validators[0] active. After we call begin block: // 35uband = 70% go to oracle pool - // 0.7uband (2%) go to community pool - // 34.3uband go to Validators[0] (active) + // 0.7uband (2%) -> 0uband go to community pool because oracle pool only distribute to fee pool in integer amount + // 35uband go to Validators[0] (active) // 15uband = 30% go to distr pool // 0.3uband (2%) go to community pool - // 2.25uband (15%) go to Validators[1] (proposer) - // 12.45uband split among voters - // 8.715uband (70%) go to Validators[0] - // 3.735uband (30%) go to Validators[1] + // 14.7uband split among voters + // 10.29uband (70%) go to Validators[0] + // 4.41uband (30%) go to Validators[1] // In summary - // Community pool: 0.7 + 0.3 = 1 - // Validators[0]: 34.3 + 8.715 = 43.015 - // Validators[1]: 2.25 + 3.735 = 5.985 + // Community pool: 0.3 = 1 but oracle pool only distribute to fee pool in integer amount + // so it will be 0.3uband. + // Validators[0]: 35 + 10.29 = 45.29 + // Validators[1]: 4.41 err = k.Activate(ctx, bandtesting.Validators[0].ValAddress) - require.NoError(t, err) - app.BeginBlocker(ctx, abci.RequestBeginBlock{ - Hash: fromHex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), - LastCommitInfo: abci.CommitInfo{Votes: votes}, - }) - require.Equal(t, sdk.Coins{}, app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress())) + require.NoError(err) + // begin block with Validators[1] as proposer + _, err = s.app.BeginBlocker( + ctx.WithHeaderInfo(header.Info{Hash: fromHex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")}). + WithVoteInfos(votes). + WithProposer(bandtesting.Validators[1].ValAddress.Bytes()), + ) + require.NoError(err) + require.Equal(sdk.Coins{}, s.app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress())) require.Equal( - t, sdk.NewCoins(sdk.NewInt64Coin("uband", 50)), - app.BankKeeper.GetAllBalances(ctx, distModule.GetAddress()), + s.app.BankKeeper.GetAllBalances(ctx, distModule.GetAddress()), ) + feePool, err := s.app.DistrKeeper.FeePool.Get(ctx) + require.NoError(err) require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDec(1)}}, - app.DistrKeeper.GetFeePool(ctx).CommunityPool, + sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDecWithPrec(3, 1)}}, + feePool.CommunityPool, ) + valOutReward, err := s.app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[0].ValAddress) + require.NoError(err) require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDecWithPrec(44590, 3)}}, - app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[0].ValAddress).Rewards, + sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDecWithPrec(4529, 2)}}, + valOutReward.Rewards, ) + valOutReward, err = s.app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[1].ValAddress) + require.NoError(err) require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDecWithPrec(4410, 3)}}, - app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[1].ValAddress).Rewards, + sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDecWithPrec(441, 2)}}, + valOutReward.Rewards, ) } diff --git a/x/oracle/app_test.go b/x/oracle/app_test.go index cb91f73b7..df40f0399 100644 --- a/x/oracle/app_test.go +++ b/x/oracle/app_test.go @@ -5,60 +5,110 @@ import ( "testing" "time" + "github.com/stretchr/testify/suite" + abci "github.com/cometbft/cometbft/abci/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/x/oracle" - "github.com/bandprotocol/chain/v2/x/oracle/types" + band "github.com/bandprotocol/chain/v3/app" + bandtesting "github.com/bandprotocol/chain/v3/testing" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) -func TestSuccessRequestOracleData(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +type AppTestSuite struct { + suite.Suite + + app *band.BandApp +} + +func TestAppTestSuite(t *testing.T) { + suite.Run(t, new(AppTestSuite)) +} + +func (s *AppTestSuite) SetupTest() { + dir := testutil.GetTempDir(s.T()) + s.app = bandtesting.SetupWithCustomHome(false, dir) + ctx := s.app.BaseApp.NewUncachedContext(false, cmtproto.Header{}) + + // Activate validators + for _, v := range bandtesting.Validators { + err := s.app.OracleKeeper.Activate(ctx, v.ValAddress) + s.Require().NoError(err) + } + + _, err := s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1}) + s.Require().NoError(err) + _, err = s.app.Commit() + s.Require().NoError(err) +} + +func (s *AppTestSuite) TestSuccessRequestOracleData() { + require := s.Require() - ctx = ctx.WithBlockHeight(4).WithBlockTime(time.Unix(1581589790, 0)) - handler := oracle.NewHandler(k) + ctx := s.app.BaseApp.NewUncachedContext(false, cmtproto.Header{}) requestMsg := types.NewMsgRequestData( types.OracleScriptID(1), []byte("calldata"), 3, 2, "app_test", - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(9000000))), + sdk.NewCoins(sdk.NewInt64Coin("uband", 9000000)), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Validators[0].Address, ) - res, err := handler(ctx, requestMsg) - require.NotNil(t, res) - require.NoError(t, err) + + res1 := s.app.AccountKeeper.GetAccount(ctx, bandtesting.Validators[0].Address) + require.NotNil(res1) + + acc1Num := res1.GetAccountNumber() + acc1Seq := res1.GetSequence() + + txConfig := moduletestutil.MakeTestTxConfig() + _, res, _, err := bandtesting.SignCheckDeliver( + s.T(), + txConfig, + s.app.BaseApp, + cmtproto.Header{Height: s.app.LastBlockHeight() + 1, Time: time.Unix(1581589790, 0)}, + []sdk.Msg{requestMsg}, + s.app.ChainID(), + []uint64{acc1Num}, + []uint64{acc1Seq}, + true, + true, + bandtesting.Validators[0].PrivKey, + ) + require.NotNil(res) + require.NoError(err) expectRequest := types.NewRequest( types.OracleScriptID(1), []byte("calldata"), []sdk.ValAddress{ - bandtesting.Validators[2].ValAddress, bandtesting.Validators[0].ValAddress, + bandtesting.Validators[2].ValAddress, bandtesting.Validators[1].ValAddress, }, 2, - 4, + 2, bandtesting.ParseTime(1581589790), "app_test", []types.RawRequest{ - types.NewRawRequest(1, 1, []byte("beeb")), - types.NewRawRequest(2, 2, []byte("beeb")), - types.NewRawRequest(3, 3, []byte("beeb")), + types.NewRawRequest(1, 1, []byte("test")), + types.NewRawRequest(2, 2, []byte("test")), + types.NewRawRequest(3, 3, []byte("test")), }, nil, bandtesting.TestDefaultExecuteGas, ) - app.EndBlocker(ctx, abci.RequestEndBlock{Height: 4}) - request, err := k.GetRequest(ctx, types.RequestID(1)) - require.NoError(t, err) - require.Equal(t, expectRequest, request) + + request, err := s.app.OracleKeeper.GetRequest(ctx, types.RequestID(1)) + require.NoError(err) + require.Equal(expectRequest, request) reportMsg1 := types.NewMsgReportData( types.RequestID(1), []types.RawReport{ @@ -68,21 +118,27 @@ func TestSuccessRequestOracleData(t *testing.T) { }, bandtesting.Validators[0].ValAddress, ) - res, err = handler(ctx, reportMsg1) - require.NotNil(t, res) - require.NoError(t, err) - - ids := k.GetPendingResolveList(ctx) - require.Equal(t, []types.RequestID{}, ids) - _, err = k.GetResult(ctx, types.RequestID(1)) - require.Error(t, err) - - result := app.EndBlocker(ctx, abci.RequestEndBlock{Height: 6}) - expectEvents := []abci.Event{} + _, res, _, err = bandtesting.SignCheckDeliver( + s.T(), + txConfig, + s.app.BaseApp, + cmtproto.Header{Height: s.app.LastBlockHeight() + 1, Time: time.Unix(1581589791, 0)}, + []sdk.Msg{reportMsg1}, + s.app.ChainID(), + []uint64{acc1Num}, + []uint64{acc1Seq + 1}, + true, + true, + bandtesting.Validators[0].PrivKey, + ) + require.NotNil(res) + require.NoError(err) - require.Equal(t, expectEvents, result.GetEvents()) + ids := s.app.OracleKeeper.GetPendingResolveList(ctx) + require.Equal([]types.RequestID{}, ids) + _, err = s.app.OracleKeeper.GetResult(ctx, types.RequestID(1)) + require.Error(err) - ctx = ctx.WithBlockTime(time.Unix(1581589795, 0)) reportMsg2 := types.NewMsgReportData( types.RequestID(1), []types.RawReport{ types.NewRawReport(1, 0, []byte("answer1")), @@ -91,88 +147,153 @@ func TestSuccessRequestOracleData(t *testing.T) { }, bandtesting.Validators[1].ValAddress, ) - res, err = handler(ctx, reportMsg2) - require.NotNil(t, res) - require.NoError(t, err) - ids = k.GetPendingResolveList(ctx) - require.Equal(t, []types.RequestID{1}, ids) - _, err = k.GetResult(ctx, types.RequestID(1)) - require.Error(t, err) + res2 := s.app.AccountKeeper.GetAccount(ctx, bandtesting.Validators[1].Address) + require.NotNil(res2) + + acc2Num := res2.GetAccountNumber() + acc2Seq := res2.GetSequence() + + // res, err = handler(ctx, reportMsg2) + _, res, endBlockEvent, err := bandtesting.SignCheckDeliver( + s.T(), + txConfig, + s.app.BaseApp, + cmtproto.Header{Height: s.app.LastBlockHeight() + 1, Time: time.Unix(1581589795, 0)}, + []sdk.Msg{reportMsg2}, + s.app.ChainID(), + []uint64{acc2Num}, + []uint64{acc2Seq}, + true, + true, + bandtesting.Validators[1].PrivKey, + ) + + require.NotNil(res) + require.NoError(err) - result = app.EndBlocker(ctx, abci.RequestEndBlock{Height: 8}) resPacket := types.NewOracleResponsePacketData( expectRequest.ClientID, types.RequestID(1), 2, expectRequest.RequestTime, 1581589795, - types.RESOLVE_STATUS_SUCCESS, []byte("beeb"), + types.RESOLVE_STATUS_SUCCESS, []byte("test"), ) - expectEvents = []abci.Event{{Type: types.EventTypeResolve, Attributes: []abci.EventAttribute{ - {Key: types.AttributeKeyID, Value: fmt.Sprint(resPacket.RequestID)}, - {Key: types.AttributeKeyResolveStatus, Value: fmt.Sprint(uint32(resPacket.ResolveStatus))}, - {Key: types.AttributeKeyResult, Value: "62656562"}, - {Key: types.AttributeKeyGasUsed, Value: "2485000000"}, - }}} + expRes := types.NewResult( + resPacket.ClientID, + types.OracleScriptID(1), + []byte("calldata"), + 3, + 2, + types.RequestID(1), + 2, + time.Unix(1581589790, 0).Unix(), + time.Unix(1581589795, 0).Unix(), + resPacket.ResolveStatus, + resPacket.Result, + ) + + // Resolve event must contain in block event + expectEvent := abci.Event{Type: types.EventTypeResolve, Attributes: []abci.EventAttribute{ + {Key: types.AttributeKeyID, Value: fmt.Sprint(resPacket.RequestID), Index: true}, + {Key: types.AttributeKeyResolveStatus, Value: fmt.Sprint(uint32(resPacket.ResolveStatus)), Index: true}, + {Key: types.AttributeKeyResult, Value: "74657374", Index: true}, + {Key: types.AttributeKeyGasUsed, Value: "2485000000", Index: true}, + {Key: "mode", Value: "EndBlock", Index: true}, + }} + + require.Contains(endBlockEvent, expectEvent) - require.Equal(t, expectEvents, result.GetEvents()) + ctx2 := s.app.BaseApp.NewContext(true) - ids = k.GetPendingResolveList(ctx) - require.Equal(t, []types.RequestID{}, ids) + // Endblock should have been called and no pending request after endblock + ids = s.app.OracleKeeper.GetPendingResolveList(ctx) + require.Equal([]types.RequestID{}, ids) - req, err := k.GetRequest(ctx, types.RequestID(1)) - require.NotEqual(t, types.Request{}, req) - require.NoError(t, err) + // Request 1 still remain until expired + req, err := s.app.OracleKeeper.GetRequest(ctx, types.RequestID(1)) + require.NotEqual(types.Request{}, req) + require.NoError(err) - ctx = ctx.WithBlockHeight(32).WithBlockTime(ctx.BlockTime().Add(time.Minute)) - app.EndBlocker(ctx, abci.RequestEndBlock{Height: 32}) + // Result 1 should be available + result, err := s.app.OracleKeeper.GetResult(ctx2, types.RequestID(1)) + require.NoError(err) + require.Equal(expRes, result) } -func TestExpiredRequestOracleData(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (s *AppTestSuite) TestExpiredRequestOracleData() { + require := s.Require() - ctx = ctx.WithBlockHeight(4).WithBlockTime(time.Unix(1581589790, 0)) - handler := oracle.NewHandler(k) + // Initialize context and message + ctx := s.app.BaseApp.NewUncachedContext(false, cmtproto.Header{ + Height: 2, + Time: time.Unix(1581589790, 0), + }) requestMsg := types.NewMsgRequestData( types.OracleScriptID(1), []byte("calldata"), 3, 2, "app_test", - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(9000000))), + sdk.NewCoins(sdk.NewInt64Coin("uband", 9000000)), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Validators[0].Address, ) - res, err := handler(ctx, requestMsg) - require.NotNil(t, res) - require.NoError(t, err) + // Signing and delivering the request + res1 := s.app.AccountKeeper.GetAccount(ctx, bandtesting.Validators[0].Address) + require.NotNil(res1) + + acc1Num := res1.GetAccountNumber() + acc1Seq := res1.GetSequence() + + txConfig := moduletestutil.MakeTestTxConfig() + _, res, _, err := bandtesting.SignCheckDeliver( + s.T(), + txConfig, + s.app.BaseApp, + ctx.BlockHeader(), + []sdk.Msg{requestMsg}, + s.app.ChainID(), + []uint64{acc1Num}, + []uint64{acc1Seq}, + true, + true, + bandtesting.Validators[0].PrivKey, + ) + require.NoError(err) + require.NotNil(res) + + // Verify request is as expected expectRequest := types.NewRequest( types.OracleScriptID(1), []byte("calldata"), []sdk.ValAddress{ - bandtesting.Validators[2].ValAddress, bandtesting.Validators[0].ValAddress, + bandtesting.Validators[2].ValAddress, bandtesting.Validators[1].ValAddress, }, 2, - 4, + 2, bandtesting.ParseTime(1581589790), "app_test", []types.RawRequest{ - types.NewRawRequest(1, 1, []byte("beeb")), - types.NewRawRequest(2, 2, []byte("beeb")), - types.NewRawRequest(3, 3, []byte("beeb")), + types.NewRawRequest(1, 1, []byte("test")), + types.NewRawRequest(2, 2, []byte("test")), + types.NewRawRequest(3, 3, []byte("test")), }, nil, bandtesting.TestDefaultExecuteGas, ) - app.EndBlocker(ctx, abci.RequestEndBlock{Height: 4}) - request, err := k.GetRequest(ctx, types.RequestID(1)) - require.NoError(t, err) - require.Equal(t, expectRequest, request) + request, err := s.app.OracleKeeper.GetRequest(ctx, types.RequestID(1)) + require.NoError(err) + require.Equal(expectRequest, request) + + // Set context to later block height and time to trigger expiration ctx = ctx.WithBlockHeight(132).WithBlockTime(ctx.BlockTime().Add(time.Minute)) - result := app.EndBlocker(ctx, abci.RequestEndBlock{Height: 132}) + result, err := s.app.EndBlocker(ctx) + require.NoError(err) + + // Expected events after expiration resPacket := types.NewOracleResponsePacketData( expectRequest.ClientID, types.RequestID(1), 0, expectRequest.RequestTime, ctx.BlockTime().Unix(), types.RESOLVE_STATUS_EXPIRED, []byte{}, @@ -181,36 +302,24 @@ func TestExpiredRequestOracleData(t *testing.T) { Type: types.EventTypeResolve, Attributes: []abci.EventAttribute{ {Key: types.AttributeKeyID, Value: fmt.Sprint(resPacket.RequestID)}, - { - Key: types.AttributeKeyResolveStatus, - Value: fmt.Sprint(uint32(resPacket.ResolveStatus)), - }, + {Key: types.AttributeKeyResolveStatus, Value: fmt.Sprint(uint32(resPacket.ResolveStatus))}, }, }, { Type: types.EventTypeDeactivate, Attributes: []abci.EventAttribute{ - { - Key: types.AttributeKeyValidator, - Value: fmt.Sprint(bandtesting.Validators[2].ValAddress.String()), - }, + {Key: types.AttributeKeyValidator, Value: bandtesting.Validators[0].ValAddress.String()}, }, }, { Type: types.EventTypeDeactivate, Attributes: []abci.EventAttribute{ - { - Key: types.AttributeKeyValidator, - Value: fmt.Sprint(bandtesting.Validators[0].ValAddress.String()), - }, + {Key: types.AttributeKeyValidator, Value: bandtesting.Validators[2].ValAddress.String()}, }, }, { Type: types.EventTypeDeactivate, Attributes: []abci.EventAttribute{ - { - Key: types.AttributeKeyValidator, - Value: fmt.Sprint(bandtesting.Validators[1].ValAddress.String()), - }, + {Key: types.AttributeKeyValidator, Value: bandtesting.Validators[1].ValAddress.String()}, }, }} - require.Equal(t, expectEvents, result.GetEvents()) + require.Equal(expectEvents, result.Events) } diff --git a/x/oracle/autocli.go b/x/oracle/autocli.go new file mode 100644 index 000000000..c053f29d0 --- /dev/null +++ b/x/oracle/autocli.go @@ -0,0 +1,100 @@ +package oracle + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + + oraclev1 "github.com/bandprotocol/chain/v3/api/oracle/v1" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: oraclev1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Counts", + Use: "counts", + Short: "Get number of requests, oracle scripts, and data source scripts currently deployed on Bandchain", + }, + { + RpcMethod: "Data", + Use: "data [data-hash]", + Short: "Get a content of the data source or oracle script for given SHA256 file hash", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "data_hash"}}, + }, + { + RpcMethod: "DataSource", + Use: "data-source [id]", + Short: "Get summary information of a data source", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "data_source_id"}}, + }, + { + RpcMethod: "OracleScript", + Use: "oracle-script [id]", + Short: "Get summary information of an oracle script", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "oracle_script_id"}}, + }, + { + RpcMethod: "Request", + Use: "request [id]", + Short: "Get an oracle request details", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "request_id"}}, + }, + { + RpcMethod: "PendingRequests", + Use: "pending-requests [validator-address]", + Short: "Get list of pending request IDs assigned to given validator", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "validator_address"}}, + }, + { + RpcMethod: "Validator", + Use: "validator [validator-address]", + Short: "Get active status of a validator", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "validator_address"}}, + }, + { + RpcMethod: "IsReporter", + Use: "is-reporter [validator-address] [reporter-address]", + Short: "Check report grant of reporter", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "validator_address"}, + {ProtoField: "reporter_address"}, + }, + }, + { + RpcMethod: "Reporters", + Use: "reporters [validator-address]", + Short: "Get list of reporters owned by given validator", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "validator_address"}}, + }, + { + RpcMethod: "ActiveValidators", + Use: "active-validators", + Short: "Get all active oracle validators", + }, + { + RpcMethod: "Params", + Use: "params", + Short: "Get current parameters of Bandchain's oracle module", + }, + { + RpcMethod: "RequestVerification", + Use: "verify-request [chain-id] [validator-addr] [request-id] [data-source-external-id] [reporter-pubkey] [reporter-signature-hex]", + Short: "Verify validity of pending oracle requests", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "chain_id"}, + {ProtoField: "validator"}, + {ProtoField: "request_id"}, + {ProtoField: "external_id"}, + {ProtoField: "reporter"}, + {ProtoField: "signature"}, + }, + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: oraclev1.Msg_ServiceDesc.ServiceName, + }, + } +} diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go deleted file mode 100644 index 7b853b573..000000000 --- a/x/oracle/client/cli/query.go +++ /dev/null @@ -1,444 +0,0 @@ -package cli - -import ( - "context" - "encoding/hex" - "fmt" - "strconv" - "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/cobra" - - "github.com/bandprotocol/chain/v2/x/oracle/types" -) - -// Flag names and values -const ( - flagAskCount = "ask-count" - flagMinCount = "min-count" -) - -// GetQueryCmd returns the cli query commands for this module. -func GetQueryCmd() *cobra.Command { - oracleCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the oracle module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - oracleCmd.AddCommand( - GetQueryCmdParams(), - GetQueryCmdCounts(), - GetQueryCmdDataSource(), - GetQueryCmdOracleScript(), - GetQueryCmdRequest(), - GetQueryCmdRequestSearch(), - GetQueryCmdValidatorStatus(), - GetQueryCmdReporters(), - GetQueryActiveValidators(), - GetQueryPendingRequests(), - GetQueryRequestVerification(), - GetQueryRequestPrice(), - ) - return oracleCmd -} - -// GetQueryCmdParams implements the query parameters command. -func GetQueryCmdParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "Get current parameters of Bandchain's oracle module", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - r, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(r) - }, - } - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetQueryCmdCounts implements the query counts command. -func GetQueryCmdCounts() *cobra.Command { - cmd := &cobra.Command{ - Use: "counts", - Short: "Get number of requests, oracle scripts, and data source scripts currently deployed on Bandchain", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - r, err := queryClient.Counts(context.Background(), &types.QueryCountsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(r) - }, - } - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetQueryCmdDataSource implements the query data source command. -func GetQueryCmdDataSource() *cobra.Command { - cmd := &cobra.Command{ - Use: "data-source [id]", - Short: "Get summary information of a data source", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - id, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - r, err := queryClient.DataSource(context.Background(), &types.QueryDataSourceRequest{DataSourceId: id}) - if err != nil { - return err - } - - return clientCtx.PrintProto(r) - }, - } - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetQueryCmdOracleScript implements the query oracle script command. -func GetQueryCmdOracleScript() *cobra.Command { - cmd := &cobra.Command{ - Use: "oracle-script [id]", - Short: "Get summary information of an oracle script", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - id, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - r, err := queryClient.OracleScript( - context.Background(), - &types.QueryOracleScriptRequest{OracleScriptId: id}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(r) - }, - } - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetQueryCmdRequest implements the query request command. -func GetQueryCmdRequest() *cobra.Command { - cmd := &cobra.Command{ - Use: "request [id]", - Short: "Get an oracle request details", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - id, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - r, err := queryClient.Request(context.Background(), &types.QueryRequestRequest{RequestId: id}) - if err != nil { - return err - } - - return clientCtx.PrintProto(r) - }, - } - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func GetQueryCmdRequestSearch() *cobra.Command { - cmd := &cobra.Command{ - Use: "request-search [oracle-script-id] [calldata-hex] [ask-count] [min-count]", - Short: "Query latest request based on given properties", - Args: cobra.ExactArgs(4), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - oracleScriptID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return fmt.Errorf("unable to parse oracle script ID: %w", err) - } - calldataHex := args[1] - askCount, err := strconv.ParseUint(args[2], 10, 64) - if err != nil { - return fmt.Errorf("unable to parse ask count: %w", err) - } - minCount, err := strconv.ParseUint(args[3], 10, 64) - if err != nil { - return fmt.Errorf("unable to parse min count: %w", err) - } - - queryClient := types.NewQueryClient(clientCtx) - r, err := queryClient.RequestSearch(context.Background(), &types.QueryRequestSearchRequest{ - OracleScriptId: oracleScriptID, - Calldata: calldataHex, - AskCount: askCount, - MinCount: minCount, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(r) - }, - } - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetQueryCmdValidatorStatus implements the query of validator status. -func GetQueryCmdValidatorStatus() *cobra.Command { - cmd := &cobra.Command{ - Use: "validator [validator-address]", - Short: "Get active status of a validator", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - valAddress, err := sdk.ValAddressFromBech32(args[0]) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - r, err := queryClient.Validator( - context.Background(), - &types.QueryValidatorRequest{ValidatorAddress: valAddress.String()}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(r) - }, - } - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetQueryCmdReporters implements the query reporter list of validator command. -func GetQueryCmdReporters() *cobra.Command { - cmd := &cobra.Command{ - Use: "reporters [validator-address]", - Short: "Get list of reporters owned by given validator", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - r, err := queryClient.Reporters( - context.Background(), - &types.QueryReportersRequest{ValidatorAddress: args[0]}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(r) - }, - } - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetQueryActiveValidators implements the query active validators command. -func GetQueryActiveValidators() *cobra.Command { - cmd := &cobra.Command{ - Use: "active-validators", - Short: "Get number of active validators", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - r, err := queryClient.ActiveValidators(context.Background(), &types.QueryActiveValidatorsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(r) - }, - } - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetQueryPendingRequests implements the query pending requests command. -func GetQueryPendingRequests() *cobra.Command { - cmd := &cobra.Command{ - Use: "pending-requests [validator-address]", - Short: "Get list of pending request IDs assigned to given validator", - Args: cobra.MaximumNArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - valAddress, err := sdk.ValAddressFromBech32(args[0]) - if err != nil { - return fmt.Errorf("unable to parse given validator address: %w", err) - } - - r, err := queryClient.PendingRequests(context.Background(), &types.QueryPendingRequestsRequest{ - ValidatorAddress: valAddress.String(), - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(r) - }, - } - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetQueryRequestVerification implements the query request verification command. -func GetQueryRequestVerification() *cobra.Command { - cmd := &cobra.Command{ - Use: "verify-request [chain-id] [validator-addr] [request-id] [data-source-external-id] [reporter-pubkey] [reporter-signature-hex]", - Short: "Verify validity of pending oracle requests", - Args: cobra.ExactArgs(6), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - requestID, err := strconv.ParseUint(args[2], 10, 64) - if err != nil { - return fmt.Errorf("unable to parse request ID: %w", err) - } - externalID, err := strconv.ParseUint(args[3], 10, 64) - if err != nil { - return fmt.Errorf("unable to parse external ID: %w", err) - } - - signature, err := hex.DecodeString(args[5]) - if err != nil { - return fmt.Errorf("unable to parse signature: %w", err) - } - - r, err := queryClient.RequestVerification(context.Background(), &types.QueryRequestVerificationRequest{ - ChainId: args[0], - Validator: args[1], - RequestId: requestID, - ExternalId: externalID, - Reporter: args[4], - Signature: signature, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(r) - }, - } - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func GetQueryRequestPrice() *cobra.Command { - cmd := &cobra.Command{ - Use: "request-price [symbols-comma-separated]", - Short: "Query the latest price on standard price reference database", - Example: "request-price ETH,BAND,BTC --ask-count 4 --min-count 3", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - symbols := strings.Split(args[0], ",") - - askCount, err := cmd.Flags().GetUint64("ask-count") - if err != nil { - return fmt.Errorf("unable to parse ask count: %w", err) - } - minCount, err := cmd.Flags().GetUint64("min-count") - if err != nil { - return fmt.Errorf("unable to parse min count: %w", err) - } - - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - r, err := queryClient.RequestPrice(context.Background(), &types.QueryRequestPriceRequest{ - Symbols: symbols, - AskCount: askCount, - MinCount: minCount, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(r) - }, - } - flags.AddQueryFlagsToCmd(cmd) - cmd.Flags(). - Uint64(flagAskCount, 0, "The number of validators that have been chosen to respond to the request, if not provided use Band standard dataset standard.") - cmd.Flags(). - Uint64(flagMinCount, 0, "The minimum number of BandChain's validators that need to responds to consider the request successful, iif not provided use Band standard dataset standard") - - return cmd -} diff --git a/x/oracle/client/cli/tx.go b/x/oracle/client/cli/tx.go index 6f1426634..11a81c170 100644 --- a/x/oracle/client/cli/tx.go +++ b/x/oracle/client/cli/tx.go @@ -7,15 +7,16 @@ import ( "strings" "time" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/authz" - "github.com/spf13/cobra" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) const ( @@ -615,10 +616,6 @@ $ %s tx oracle add-reporters band1p40yh3zkmhcv0ecqp3mcazy83sa57rgjp07dun band1m5 return err } msgs[i] = msg - err = msgs[i].ValidateBasic() - if err != nil { - return err - } } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msgs...) }, @@ -662,10 +659,6 @@ $ %s tx oracle remove-reporters band1p40yh3zkmhcv0ecqp3mcazy83sa57rgjp07dun band sdk.MsgTypeURL(&types.MsgReportData{}), ) msgs[i] = &msg - err = msg.ValidateBasic() - if err != nil { - return err - } } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msgs...) }, diff --git a/x/oracle/genesis.go b/x/oracle/genesis.go index f2e3dd8ce..e1019a84f 100644 --- a/x/oracle/genesis.go +++ b/x/oracle/genesis.go @@ -4,10 +4,11 @@ import ( "fmt" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/oracle/keeper" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/keeper" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // InitGenesis performs genesis initialization for the oracle module. diff --git a/x/oracle/handler.go b/x/oracle/handler.go deleted file mode 100644 index 3d0cad080..000000000 --- a/x/oracle/handler.go +++ /dev/null @@ -1,45 +0,0 @@ -package oracle - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/bandprotocol/chain/v2/x/oracle/keeper" - "github.com/bandprotocol/chain/v2/x/oracle/types" -) - -// NewHandler creates the msg handler of this module, as required by Cosmos-SDK standard. -func NewHandler(k keeper.Keeper) sdk.Handler { - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - msgServer := keeper.NewMsgServerImpl(k) - ctx = ctx.WithEventManager(sdk.NewEventManager()) - switch msg := msg.(type) { - case *types.MsgRequestData: - res, err := msgServer.RequestData(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgReportData: - res, err := msgServer.ReportData(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgCreateDataSource: - res, err := msgServer.CreateDataSource(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgEditDataSource: - res, err := msgServer.EditDataSource(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgCreateOracleScript: - res, err := msgServer.CreateOracleScript(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgEditOracleScript: - res, err := msgServer.EditOracleScript(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgActivate: - res, err := msgServer.Activate(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUpdateParams: - res, err := msgServer.UpdateParams(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - default: - return nil, sdkerrors.ErrUnknownRequest.Wrapf("unrecognized %s message type: %T", types.ModuleName, msg) - } - } -} diff --git a/x/oracle/handler_test.go b/x/oracle/handler_test.go deleted file mode 100644 index 5b1199f06..000000000 --- a/x/oracle/handler_test.go +++ /dev/null @@ -1,972 +0,0 @@ -package oracle_test - -import ( - "bytes" - gz "compress/gzip" - "crypto/sha256" - "encoding/hex" - "fmt" - "strings" - "testing" - "time" - - "github.com/bandprotocol/go-owasm/api" - abci "github.com/cometbft/cometbft/abci/types" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/stretchr/testify/require" - - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/testing/testdata" - "github.com/bandprotocol/chain/v2/x/oracle" - "github.com/bandprotocol/chain/v2/x/oracle/types" -) - -func TestCreateDataSourceSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper - - dsCount := k.GetDataSourceCount(ctx) - treasury := bandtesting.Treasury.Address - owner := bandtesting.Owner.Address - name := "data_source_1" - description := "description" - executable := []byte("executable") - executableHash := sha256.Sum256(executable) - filename := hex.EncodeToString(executableHash[:]) - msg := types.NewMsgCreateDataSource( - name, - description, - executable, - bandtesting.EmptyCoins, - treasury, - owner, - bandtesting.Alice.Address, - ) - res, err := oracle.NewHandler(k)(ctx, msg) - require.NoError(t, err) - ds, err := k.GetDataSource(ctx, types.DataSourceID(dsCount+1)) - require.NoError(t, err) - require.Equal( - t, - types.NewDataSource(bandtesting.Owner.Address, name, description, filename, bandtesting.EmptyCoins, treasury), - ds, - ) - event := abci.Event{ - Type: types.EventTypeCreateDataSource, - Attributes: []abci.EventAttribute{ - {Key: types.AttributeKeyID, Value: fmt.Sprintf("%d", dsCount+1)}, - }, - } - require.Equal(t, event, res.Events[0]) -} - -func TestCreateGzippedExecutableDataSourceFail(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper - - treasury := bandtesting.Treasury.Address - owner := bandtesting.Owner.Address - name := "data_source_1" - description := "description" - executable := []byte("executable") - var buf bytes.Buffer - zw := gz.NewWriter(&buf) - _, err := zw.Write(executable) - require.NoError(t, err) - zw.Close() - sender := bandtesting.Alice.Address - msg := types.NewMsgCreateDataSource( - name, - description, - buf.Bytes()[:5], - bandtesting.EmptyCoins, - treasury, - owner, - sender, - ) - res, err := oracle.NewHandler(k)(ctx, msg) - require.ErrorIs(t, err, types.ErrUncompressionFailed) - require.Nil(t, res) -} - -func TestEditDataSourceSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper - - newName := "beeb" - newDescription := "new_description" - newExecutable := []byte("executable2") - newExecutableHash := sha256.Sum256(newExecutable) - newFilename := hex.EncodeToString(newExecutableHash[:]) - msg := types.NewMsgEditDataSource( - 1, - newName, - newDescription, - newExecutable, - bandtesting.Coins1000000uband, - bandtesting.Treasury.Address, - bandtesting.Alice.Address, - bandtesting.Owner.Address, - ) - res, err := oracle.NewHandler(k)(ctx, msg) - require.NoError(t, err) - ds, err := k.GetDataSource(ctx, 1) - require.NoError(t, err) - require.Equal( - t, - types.NewDataSource( - bandtesting.Alice.Address, - newName, - newDescription, - newFilename, - bandtesting.Coins1000000uband, - bandtesting.Treasury.Address, - ), - ds, - ) - event := abci.Event{ - Type: types.EventTypeEditDataSource, - Attributes: []abci.EventAttribute{{Key: types.AttributeKeyID, Value: "1"}}, - } - require.Equal(t, event, res.Events[0]) -} - -func TestEditDataSourceFail(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper - - newName := "beeb" - newDescription := "new_description" - newExecutable := []byte("executable2") - // Bad ID - msg := types.NewMsgEditDataSource( - 42, - newName, - newDescription, - newExecutable, - bandtesting.EmptyCoins, - bandtesting.Treasury.Address, - bandtesting.Owner.Address, - bandtesting.Owner.Address, - ) - res, err := oracle.NewHandler(k)(ctx, msg) - bandtesting.CheckErrorf(t, err, types.ErrDataSourceNotFound, "id: 42") - require.Nil(t, res) - // Not owner - msg = types.NewMsgEditDataSource( - 1, - newName, - newDescription, - newExecutable, - bandtesting.EmptyCoins, - bandtesting.Treasury.Address, - bandtesting.Owner.Address, - bandtesting.Bob.Address, - ) - res, err = oracle.NewHandler(k)(ctx, msg) - require.ErrorIs(t, err, types.ErrEditorNotAuthorized) - require.Nil(t, res) - // Bad Gzip - var buf bytes.Buffer - zw := gz.NewWriter(&buf) - _, err = zw.Write(newExecutable) - require.NoError(t, err) - zw.Close() - msg = types.NewMsgEditDataSource( - 1, - newName, - newDescription, - buf.Bytes()[:5], - bandtesting.EmptyCoins, - bandtesting.Treasury.Address, - bandtesting.Owner.Address, - bandtesting.Owner.Address, - ) - res, err = oracle.NewHandler(k)(ctx, msg) - require.ErrorIs(t, err, types.ErrUncompressionFailed) - require.Nil(t, res) -} - -func TestCreateOracleScriptSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper - - osCount := k.GetOracleScriptCount(ctx) - name := "os_1" - description := "beeb" - code := testdata.WasmExtra1 - schema := "schema" - url := "url" - msg := types.NewMsgCreateOracleScript( - name, - description, - schema, - url, - code, - bandtesting.Owner.Address, - bandtesting.Alice.Address, - ) - res, err := oracle.NewHandler(k)(ctx, msg) - require.NoError(t, err) - os, err := k.GetOracleScript(ctx, types.OracleScriptID(osCount+1)) - require.NoError(t, err) - require.Equal( - t, - types.NewOracleScript( - bandtesting.Owner.Address, - name, - description, - testdata.WasmExtra1FileName, - schema, - url, - ), - os, - ) - - event := abci.Event{ - Type: types.EventTypeCreateOracleScript, - Attributes: []abci.EventAttribute{ - {Key: types.AttributeKeyID, Value: fmt.Sprintf("%d", osCount+1)}, - }, - } - require.Equal(t, event, res.Events[0]) -} - -func TestCreateGzippedOracleScriptSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper - - osCount := k.GetOracleScriptCount(ctx) - name := "os_1" - description := "beeb" - schema := "schema" - url := "url" - var buf bytes.Buffer - zw := gz.NewWriter(&buf) - _, err := zw.Write(testdata.WasmExtra1) - require.NoError(t, err) - zw.Close() - msg := types.NewMsgCreateOracleScript( - name, - description, - schema, - url, - buf.Bytes(), - bandtesting.Owner.Address, - bandtesting.Alice.Address, - ) - res, err := oracle.NewHandler(k)(ctx, msg) - require.NoError(t, err) - os, err := k.GetOracleScript(ctx, types.OracleScriptID(osCount+1)) - require.NoError(t, err) - require.Equal( - t, - types.NewOracleScript( - bandtesting.Owner.Address, - name, - description, - testdata.WasmExtra1FileName, - schema, - url, - ), - os, - ) - - event := abci.Event{ - Type: types.EventTypeCreateOracleScript, - Attributes: []abci.EventAttribute{ - {Key: types.AttributeKeyID, Value: fmt.Sprintf("%d", osCount+1)}, - }, - } - require.Equal(t, event, res.Events[0]) -} - -func TestCreateOracleScriptFail(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper - - name := "os_1" - description := "beeb" - schema := "schema" - url := "url" - // Bad Owasm code - msg := types.NewMsgCreateOracleScript( - name, - description, - schema, - url, - []byte("BAD"), - bandtesting.Owner.Address, - bandtesting.Alice.Address, - ) - res, err := oracle.NewHandler(k)(ctx, msg) - bandtesting.CheckErrorf(t, err, types.ErrOwasmCompilation, "caused by %s", api.ErrValidation) - require.Nil(t, res) - // Bad Gzip - var buf bytes.Buffer - zw := gz.NewWriter(&buf) - _, err = zw.Write(testdata.WasmExtra1) - require.NoError(t, err) - zw.Close() - msg = types.NewMsgCreateOracleScript( - name, - description, - schema, - url, - buf.Bytes()[:5], - bandtesting.Owner.Address, - bandtesting.Alice.Address, - ) - res, err = oracle.NewHandler(k)(ctx, msg) - require.ErrorIs(t, err, types.ErrUncompressionFailed) - require.Nil(t, res) -} - -func TestEditOracleScriptSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper - - newName := "os_2" - newDescription := "beebbeeb" - newCode := testdata.WasmExtra2 - newSchema := "new_schema" - newURL := "new_url" - msg := types.NewMsgEditOracleScript( - 1, - newName, - newDescription, - newSchema, - newURL, - newCode, - bandtesting.Alice.Address, - bandtesting.Owner.Address, - ) - res, err := oracle.NewHandler(k)(ctx, msg) - require.NoError(t, err) - os, err := k.GetOracleScript(ctx, 1) - require.NoError(t, err) - require.Equal( - t, - types.NewOracleScript( - bandtesting.Alice.Address, - newName, - newDescription, - testdata.WasmExtra2FileName, - newSchema, - newURL, - ), - os, - ) - - event := abci.Event{ - Type: types.EventTypeEditOracleScript, - Attributes: []abci.EventAttribute{{Key: types.AttributeKeyID, Value: "1"}}, - } - require.Equal(t, event, res.Events[0]) -} - -func TestEditOracleScriptFail(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper - - newName := "os_2" - newDescription := "beebbeeb" - newCode := testdata.WasmExtra2 - newSchema := "new_schema" - newURL := "new_url" - // Bad ID - msg := types.NewMsgEditOracleScript( - 999, - newName, - newDescription, - newSchema, - newURL, - newCode, - bandtesting.Owner.Address, - bandtesting.Owner.Address, - ) - res, err := oracle.NewHandler(k)(ctx, msg) - bandtesting.CheckErrorf(t, err, types.ErrOracleScriptNotFound, "id: 999") - require.Nil(t, res) - // Not owner - msg = types.NewMsgEditOracleScript( - 1, - newName, - newDescription, - newSchema, - newURL, - newCode, - bandtesting.Owner.Address, - bandtesting.Bob.Address, - ) - res, err = oracle.NewHandler(k)(ctx, msg) - require.EqualError(t, err, "editor not authorized") - require.Nil(t, res) - // Bad Owasm code - msg = types.NewMsgEditOracleScript( - 1, - newName, - newDescription, - newSchema, - newURL, - []byte("BAD_CODE"), - bandtesting.Owner.Address, - bandtesting.Owner.Address, - ) - res, err = oracle.NewHandler(k)(ctx, msg) - bandtesting.CheckErrorf(t, err, types.ErrOwasmCompilation, "caused by %s", api.ErrValidation) - require.Nil(t, res) - // Bad Gzip - var buf bytes.Buffer - zw := gz.NewWriter(&buf) - _, err = zw.Write(testdata.WasmExtra2) - require.NoError(t, err) - zw.Close() - msg = types.NewMsgEditOracleScript( - 1, - newName, - newDescription, - newSchema, - newURL, - buf.Bytes()[:5], - bandtesting.Owner.Address, - bandtesting.Owner.Address, - ) - res, err = oracle.NewHandler(k)(ctx, msg) - require.ErrorIs(t, err, types.ErrUncompressionFailed) - require.Nil(t, res) -} - -func TestRequestDataSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper - - ctx = ctx.WithBlockHeight(124).WithBlockTime(bandtesting.ParseTime(1581589790)) - msg := types.NewMsgRequestData( - 1, - []byte("beeb"), - 2, - 2, - "CID", - bandtesting.Coins100000000uband, - bandtesting.TestDefaultPrepareGas, - bandtesting.TestDefaultExecuteGas, - bandtesting.FeePayer.Address, - ) - res, err := oracle.NewHandler(k)(ctx, msg) - require.NoError(t, err) - require.Equal(t, types.NewRequest( - 1, - []byte("beeb"), - []sdk.ValAddress{bandtesting.Validators[2].ValAddress, bandtesting.Validators[0].ValAddress}, - 2, - 124, - bandtesting.ParseTime(1581589790), - "CID", - []types.RawRequest{ - types.NewRawRequest(1, 1, []byte("beeb")), - types.NewRawRequest(2, 2, []byte("beeb")), - types.NewRawRequest(3, 3, []byte("beeb")), - }, - nil, - bandtesting.TestDefaultExecuteGas, - ), k.MustGetRequest(ctx, 1)) - event := abci.Event{ - Type: authtypes.EventTypeCoinSpent, - Attributes: []abci.EventAttribute{ - {Key: authtypes.AttributeKeySpender, Value: bandtesting.FeePayer.Address.String()}, - {Key: sdk.AttributeKeyAmount, Value: "2000000uband"}, - }, - } - require.Equal(t, event, res.Events[0]) - require.Equal(t, event, res.Events[4]) - require.Equal(t, event, res.Events[8]) - event = abci.Event{ - Type: authtypes.EventTypeCoinReceived, - Attributes: []abci.EventAttribute{ - {Key: authtypes.AttributeKeyReceiver, Value: bandtesting.Treasury.Address.String()}, - {Key: sdk.AttributeKeyAmount, Value: "2000000uband"}, - }, - } - require.Equal(t, event, res.Events[1]) - require.Equal(t, event, res.Events[5]) - require.Equal(t, event, res.Events[9]) - event = abci.Event{ - Type: authtypes.EventTypeTransfer, - Attributes: []abci.EventAttribute{ - {Key: authtypes.AttributeKeyRecipient, Value: bandtesting.Treasury.Address.String()}, - {Key: authtypes.AttributeKeySender, Value: bandtesting.FeePayer.Address.String()}, - {Key: sdk.AttributeKeyAmount, Value: "2000000uband"}, - }, - } - require.Equal(t, event, res.Events[2]) - require.Equal(t, event, res.Events[6]) - require.Equal(t, event, res.Events[10]) - event = abci.Event{ - Type: sdk.EventTypeMessage, - Attributes: []abci.EventAttribute{ - {Key: authtypes.AttributeKeySender, Value: bandtesting.FeePayer.Address.String()}, - }, - } - require.Equal(t, event, res.Events[3]) - require.Equal(t, event, res.Events[7]) - require.Equal(t, event, res.Events[11]) - - event = abci.Event{ - Type: types.EventTypeRequest, - Attributes: []abci.EventAttribute{ - {Key: types.AttributeKeyID, Value: "1"}, - {Key: types.AttributeKeyClientID, Value: "CID"}, - {Key: types.AttributeKeyOracleScriptID, Value: "1"}, - {Key: types.AttributeKeyCalldata, Value: "62656562"}, // "beeb" in hex - {Key: types.AttributeKeyAskCount, Value: "2"}, - {Key: types.AttributeKeyMinCount, Value: "2"}, - {Key: types.AttributeKeyGasUsed, Value: "5294700000"}, - {Key: types.AttributeKeyTotalFees, Value: "6000000uband"}, - {Key: types.AttributeKeyValidator, Value: bandtesting.Validators[2].ValAddress.String()}, - {Key: types.AttributeKeyValidator, Value: bandtesting.Validators[0].ValAddress.String()}, - }, - } - require.Equal(t, event, res.Events[12]) - event = abci.Event{ - Type: types.EventTypeRawRequest, - Attributes: []abci.EventAttribute{ - {Key: types.AttributeKeyDataSourceID, Value: "1"}, - {Key: types.AttributeKeyDataSourceHash, Value: bandtesting.DataSources[1].Filename}, - {Key: types.AttributeKeyExternalID, Value: "1"}, - {Key: types.AttributeKeyCalldata, Value: "beeb"}, - {Key: types.AttributeKeyFee, Value: "1000000uband"}, - }, - } - require.Equal(t, event, res.Events[13]) - event = abci.Event{ - Type: types.EventTypeRawRequest, - Attributes: []abci.EventAttribute{ - {Key: types.AttributeKeyDataSourceID, Value: "2"}, - {Key: types.AttributeKeyDataSourceHash, Value: bandtesting.DataSources[2].Filename}, - {Key: types.AttributeKeyExternalID, Value: "2"}, - {Key: types.AttributeKeyCalldata, Value: "beeb"}, - {Key: types.AttributeKeyFee, Value: "1000000uband"}, - }, - } - require.Equal(t, event, res.Events[14]) - event = abci.Event{ - Type: types.EventTypeRawRequest, - Attributes: []abci.EventAttribute{ - {Key: types.AttributeKeyDataSourceID, Value: "3"}, - {Key: types.AttributeKeyDataSourceHash, Value: bandtesting.DataSources[3].Filename}, - {Key: types.AttributeKeyExternalID, Value: "3"}, - {Key: types.AttributeKeyCalldata, Value: "beeb"}, - {Key: types.AttributeKeyFee, Value: "1000000uband"}, - }, - } - require.Equal(t, event, res.Events[15]) -} - -func TestRequestDataFail(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper - - // No active oracle validators - res, err := oracle.NewHandler( - k, - )( - ctx, - types.NewMsgRequestData( - 1, - []byte("beeb"), - 2, - 2, - "CID", - bandtesting.Coins100000000uband, - bandtesting.TestDefaultPrepareGas, - bandtesting.TestDefaultExecuteGas, - bandtesting.FeePayer.Address, - ), - ) - bandtesting.CheckErrorf(t, err, types.ErrInsufficientValidators, "0 < 2") - require.Nil(t, res) - err = k.Activate(ctx, bandtesting.Validators[0].ValAddress) - require.NoError(t, err) - err = k.Activate(ctx, bandtesting.Validators[1].ValAddress) - require.NoError(t, err) - // Too large calldata - res, err = oracle.NewHandler( - k, - )( - ctx, - types.NewMsgRequestData( - 1, - []byte(strings.Repeat("beeb", 2000)), - 2, - 2, - "CID", - bandtesting.Coins100000000uband, - bandtesting.TestDefaultPrepareGas, - bandtesting.TestDefaultExecuteGas, - bandtesting.FeePayer.Address, - ), - ) - bandtesting.CheckErrorf(t, err, types.ErrTooLargeCalldata, "got: 8000, max: 512") - require.Nil(t, res) - // Too high ask count - res, err = oracle.NewHandler( - k, - )( - ctx, - types.NewMsgRequestData( - 1, - []byte("beeb"), - 3, - 2, - "CID", - bandtesting.Coins100000000uband, - bandtesting.TestDefaultPrepareGas, - bandtesting.TestDefaultExecuteGas, - bandtesting.FeePayer.Address, - ), - ) - bandtesting.CheckErrorf(t, err, types.ErrInsufficientValidators, "2 < 3") - require.Nil(t, res) - // Bad oracle script ID - res, err = oracle.NewHandler( - k, - )( - ctx, - types.NewMsgRequestData( - 999, - []byte("beeb"), - 2, - 2, - "CID", - bandtesting.Coins100000000uband, - bandtesting.TestDefaultPrepareGas, - bandtesting.TestDefaultExecuteGas, - bandtesting.FeePayer.Address, - ), - ) - bandtesting.CheckErrorf(t, err, types.ErrOracleScriptNotFound, "id: 999") - require.Nil(t, res) - // Pay not enough fee - res, err = oracle.NewHandler( - k, - )( - ctx, - types.NewMsgRequestData( - 1, - []byte("beeb"), - 2, - 2, - "CID", - bandtesting.EmptyCoins, - bandtesting.TestDefaultPrepareGas, - bandtesting.TestDefaultExecuteGas, - bandtesting.FeePayer.Address, - ), - ) - bandtesting.CheckErrorf(t, err, types.ErrNotEnoughFee, "require: 2000000uband, max: 0uband") - require.Nil(t, res) -} - -func TestReportSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper - - // Set up a mock request asking 3 validators with min count 2. - k.SetRequest(ctx, 42, types.NewRequest( - 1, - []byte("beeb"), - []sdk.ValAddress{ - bandtesting.Validators[2].ValAddress, - bandtesting.Validators[1].ValAddress, - bandtesting.Validators[0].ValAddress, - }, - 2, - 124, - bandtesting.ParseTime(1581589790), - "CID", - []types.RawRequest{ - types.NewRawRequest(1, 1, []byte("beeb")), - types.NewRawRequest(2, 2, []byte("beeb")), - }, - nil, - 0, - )) - // Common raw reports for everyone. - reports := []types.RawReport{types.NewRawReport(1, 0, []byte("data1")), types.NewRawReport(2, 0, []byte("data2"))} - // Validators[0] reports data. - res, err := oracle.NewHandler(k)(ctx, types.NewMsgReportData(42, reports, bandtesting.Validators[0].ValAddress)) - require.NoError(t, err) - require.Equal(t, []types.RequestID{}, k.GetPendingResolveList(ctx)) - event := abci.Event{ - Type: types.EventTypeReport, - Attributes: []abci.EventAttribute{ - {Key: types.AttributeKeyID, Value: "42"}, - {Key: types.AttributeKeyValidator, Value: bandtesting.Validators[0].ValAddress.String()}, - }, - } - require.Equal(t, event, res.Events[0]) - // Validators[1] reports data. Now the request should move to pending resolve. - res, err = oracle.NewHandler(k)(ctx, types.NewMsgReportData(42, reports, bandtesting.Validators[1].ValAddress)) - require.NoError(t, err) - require.Equal(t, []types.RequestID{42}, k.GetPendingResolveList(ctx)) - event = abci.Event{ - Type: types.EventTypeReport, - Attributes: []abci.EventAttribute{ - {Key: types.AttributeKeyID, Value: "42"}, - {Key: types.AttributeKeyValidator, Value: bandtesting.Validators[1].ValAddress.String()}, - }, - } - require.Equal(t, event, res.Events[0]) - // Even if we resolve the request, Validators[2] should still be able to report. - k.SetPendingResolveList(ctx, []types.RequestID{}) - k.ResolveSuccess(ctx, 42, []byte("RESOLVE_RESULT!"), 1234) - res, err = oracle.NewHandler(k)(ctx, types.NewMsgReportData(42, reports, bandtesting.Validators[2].ValAddress)) - require.NoError(t, err) - event = abci.Event{ - Type: types.EventTypeReport, - Attributes: []abci.EventAttribute{ - {Key: types.AttributeKeyID, Value: "42"}, - {Key: types.AttributeKeyValidator, Value: bandtesting.Validators[2].ValAddress.String()}, - }, - } - require.Equal(t, event, res.Events[0]) - // Check the reports of this request. We should see 3 reports, with report from Validators[2] comes after resolve. - finalReport := k.GetReports(ctx, 42) - require.Contains(t, finalReport, types.NewReport(bandtesting.Validators[0].ValAddress, true, reports)) - require.Contains(t, finalReport, types.NewReport(bandtesting.Validators[1].ValAddress, true, reports)) - require.Contains(t, finalReport, types.NewReport(bandtesting.Validators[2].ValAddress, false, reports)) -} - -func TestReportFail(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper - - // Set up a mock request asking 3 validators with min count 2. - k.SetRequest(ctx, 42, types.NewRequest( - 1, - []byte("beeb"), - []sdk.ValAddress{ - bandtesting.Validators[2].ValAddress, - bandtesting.Validators[1].ValAddress, - bandtesting.Validators[0].ValAddress, - }, - 2, - 124, - bandtesting.ParseTime(1581589790), - "CID", - []types.RawRequest{ - types.NewRawRequest(1, 1, []byte("beeb")), - types.NewRawRequest(2, 2, []byte("beeb")), - }, - nil, - 0, - )) - // Common raw reports for everyone. - reports := []types.RawReport{types.NewRawReport(1, 0, []byte("data1")), types.NewRawReport(2, 0, []byte("data2"))} - // Bad ID - res, err := oracle.NewHandler(k)(ctx, types.NewMsgReportData(999, reports, bandtesting.Validators[0].ValAddress)) - bandtesting.CheckErrorf(t, err, types.ErrRequestNotFound, "id: 999") - require.Nil(t, res) - // Not-asked validator - res, err = oracle.NewHandler(k)(ctx, types.NewMsgReportData(42, reports, bandtesting.Alice.ValAddress)) - bandtesting.CheckErrorf( - t, - err, - types.ErrValidatorNotRequested, - "reqID: 42, val: %s", - bandtesting.Alice.ValAddress.String(), - ) - require.Nil(t, res) - // Too large report data size - res, err = oracle.NewHandler( - k, - )( - ctx, - types.NewMsgReportData( - 42, - []types.RawReport{ - types.NewRawReport(1, 0, []byte("data1")), - types.NewRawReport(2, 0, []byte(strings.Repeat("data2", 2000))), - }, - bandtesting.Validators[0].ValAddress, - ), - ) - bandtesting.CheckErrorf(t, err, types.ErrTooLargeRawReportData, "got: 10000, max: 512") - require.Nil(t, res) - // Not having all raw reports - res, err = oracle.NewHandler( - k, - )( - ctx, - types.NewMsgReportData( - 42, - []types.RawReport{types.NewRawReport(1, 0, []byte("data1"))}, - bandtesting.Validators[0].ValAddress, - ), - ) - require.ErrorIs(t, err, types.ErrInvalidReportSize) - require.Nil(t, res) - // Incorrect external IDs - res, err = oracle.NewHandler( - k, - )( - ctx, - types.NewMsgReportData( - 42, - []types.RawReport{types.NewRawReport(1, 0, []byte("data1")), types.NewRawReport(42, 0, []byte("data2"))}, - bandtesting.Validators[0].ValAddress, - ), - ) - bandtesting.CheckErrorf(t, err, types.ErrRawRequestNotFound, "reqID: 42, extID: 42") - require.Nil(t, res) - // Request already expired - k.SetRequestLastExpired(ctx, 42) - res, err = oracle.NewHandler(k)(ctx, types.NewMsgReportData(42, reports, bandtesting.Validators[0].ValAddress)) - require.ErrorIs(t, err, types.ErrRequestAlreadyExpired) - require.Nil(t, res) -} - -func TestActivateSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper - - ctx = ctx.WithBlockTime(bandtesting.ParseTime(1000000)) - require.Equal(t, - types.NewValidatorStatus(false, time.Time{}), - k.GetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress), - ) - msg := types.NewMsgActivate(bandtesting.Validators[0].ValAddress) - res, err := oracle.NewHandler(k)(ctx, msg) - require.NoError(t, err) - require.Equal(t, - types.NewValidatorStatus(true, bandtesting.ParseTime(1000000)), - k.GetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress), - ) - event := abci.Event{ - Type: types.EventTypeActivate, - Attributes: []abci.EventAttribute{ - {Key: types.AttributeKeyValidator, Value: bandtesting.Validators[0].ValAddress.String()}, - }, - } - require.Equal(t, event, res.Events[0]) -} - -func TestActivateFail(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper - - msg := types.NewMsgActivate(bandtesting.Validators[0].ValAddress) - // Already active. - res, err := oracle.NewHandler(k)(ctx, msg) - require.ErrorIs(t, err, types.ErrValidatorAlreadyActive) - require.Nil(t, res) - // Too soon to activate. - ctx = ctx.WithBlockTime(bandtesting.ParseTime(100000)) - k.MissReport(ctx, bandtesting.Validators[0].ValAddress, bandtesting.ParseTime(99999)) - ctx = ctx.WithBlockTime(bandtesting.ParseTime(100001)) - res, err = oracle.NewHandler(k)(ctx, msg) - require.ErrorIs(t, err, types.ErrTooSoonToActivate) - require.Nil(t, res) - // OK - ctx = ctx.WithBlockTime(bandtesting.ParseTime(200000)) - _, err = oracle.NewHandler(k)(ctx, msg) - require.NoError(t, err) -} - -func TestUpdateParamsSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper - - expectedParams := types.Params{ - MaxRawRequestCount: 1, - MaxAskCount: 10, - MaxCalldataSize: 256, - MaxReportDataSize: 512, - ExpirationBlockCount: 30, - BaseOwasmGas: 50000, - PerValidatorRequestGas: 3000, - SamplingTryCount: 3, - OracleRewardPercentage: 50, - InactivePenaltyDuration: 1000, - IBCRequestEnabled: true, - } - msg := types.NewMsgUpdateParams(k.GetAuthority(), expectedParams) - res, err := oracle.NewHandler(k)(ctx, msg) - require.NoError(t, err) - require.Equal(t, expectedParams, k.GetParams(ctx)) - event := abci.Event{ - Type: types.EventTypeUpdateParams, - Attributes: []abci.EventAttribute{ - {Key: types.AttributeKeyParams, Value: expectedParams.String()}, - }, - } - require.Equal(t, event, res.Events[0]) - - expectedParams = types.Params{ - MaxRawRequestCount: 2, - MaxAskCount: 20, - MaxCalldataSize: 512, - MaxReportDataSize: 256, - ExpirationBlockCount: 40, - BaseOwasmGas: 0, - PerValidatorRequestGas: 0, - SamplingTryCount: 5, - OracleRewardPercentage: 0, - InactivePenaltyDuration: 0, - IBCRequestEnabled: false, - } - msg = types.NewMsgUpdateParams(k.GetAuthority(), expectedParams) - res, err = oracle.NewHandler(k)(ctx, msg) - require.NoError(t, err) - require.Equal(t, expectedParams, k.GetParams(ctx)) - event = abci.Event{ - Type: types.EventTypeUpdateParams, - Attributes: []abci.EventAttribute{ - {Key: types.AttributeKeyParams, Value: expectedParams.String()}, - }, - } - require.Equal(t, event, res.Events[0]) -} - -func TestUpdateParamsFail(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper - - expectedParams := types.Params{ - MaxRawRequestCount: 1, - MaxAskCount: 10, - MaxCalldataSize: 256, - MaxReportDataSize: 512, - ExpirationBlockCount: 30, - BaseOwasmGas: 50000, - PerValidatorRequestGas: 3000, - SamplingTryCount: 3, - OracleRewardPercentage: 50, - InactivePenaltyDuration: 1000, - IBCRequestEnabled: true, - } - msg := types.NewMsgUpdateParams("foo", expectedParams) - res, err := oracle.NewHandler(k)(ctx, msg) - require.ErrorContains(t, err, "invalid authority") - require.Nil(t, res) - - expectedParams = types.Params{ - MaxRawRequestCount: 0, - MaxAskCount: 10, - MaxCalldataSize: 256, - MaxReportDataSize: 512, - ExpirationBlockCount: 30, - BaseOwasmGas: 50000, - PerValidatorRequestGas: 3000, - SamplingTryCount: 3, - OracleRewardPercentage: 50, - InactivePenaltyDuration: 1000, - IBCRequestEnabled: true, - } - msg = types.NewMsgUpdateParams(k.GetAuthority(), expectedParams) - res, err = oracle.NewHandler(k)(ctx, msg) - require.ErrorContains(t, err, "max raw request count must be positive") - require.Nil(t, res) -} diff --git a/x/oracle/ibc_module.go b/x/oracle/ibc_module.go index 647e50208..ca7dbf72c 100644 --- a/x/oracle/ibc_module.go +++ b/x/oracle/ibc_module.go @@ -5,16 +5,17 @@ import ( "math" "strings" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - - "github.com/bandprotocol/chain/v2/x/oracle/keeper" - "github.com/bandprotocol/chain/v2/x/oracle/types" + + "github.com/bandprotocol/chain/v3/x/oracle/keeper" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // IBCModule implements the ICS26 interface for oracle given the oracle keeper. diff --git a/x/oracle/ibc_test.go b/x/oracle/ibc_test.go index eaba2dbef..5adf07007 100644 --- a/x/oracle/ibc_test.go +++ b/x/oracle/ibc_test.go @@ -1,24 +1,34 @@ -// TODO: write this test file by importing testing directly from ibc package oracle_test import ( "strings" "testing" + "time" + + "github.com/stretchr/testify/suite" + + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v8/testing" + + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - "github.com/stretchr/testify/suite" - "github.com/bandprotocol/chain/v2/pkg/obi" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/testing/ibctesting" - "github.com/bandprotocol/chain/v2/testing/testdata" - "github.com/bandprotocol/chain/v2/x/oracle/types" + band "github.com/bandprotocol/chain/v3/app" + "github.com/bandprotocol/chain/v3/pkg/obi" + bandtesting "github.com/bandprotocol/chain/v3/testing" + "github.com/bandprotocol/chain/v3/testing/testdata" + oracletypes "github.com/bandprotocol/chain/v3/x/oracle/types" ) -type OracleTestSuite struct { +func init() { + band.SetBech32AddressPrefixesAndBip44CoinTypeAndSeal(sdk.GetConfig()) + sdk.DefaultBondDenom = "uband" +} + +type IBCTestSuite struct { suite.Suite coordinator *ibctesting.Coordinator @@ -28,24 +38,53 @@ type OracleTestSuite struct { chainB *ibctesting.TestChain path *ibctesting.Path + + // shortcut to chainB (bandchain) + bandApp *band.BandApp } -func (suite *OracleTestSuite) SetupTest() { - suite.coordinator = ibctesting.NewCoordinator(suite.T(), 3) - suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0)) - suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(1)) +func (suite *IBCTestSuite) SetupTest() { + ibctesting.DefaultTestingAppInit = bandtesting.CreateTestingAppFn(suite.T()) + + suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) + suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(1)) + suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(2)) suite.path = ibctesting.NewPath(suite.chainA, suite.chainB) - suite.path.EndpointA.ChannelConfig.PortID = ibctesting.OraclePort - suite.path.EndpointB.ChannelConfig.PortID = ibctesting.OraclePort + suite.path.EndpointA.ChannelConfig.PortID = oracletypes.ModuleName + suite.path.EndpointA.ChannelConfig.Version = oracletypes.Version + suite.path.EndpointB.ChannelConfig.PortID = oracletypes.ModuleName + suite.path.EndpointB.ChannelConfig.Version = oracletypes.Version + + suite.bandApp = suite.chainB.App.(*band.BandApp) suite.coordinator.Setup(suite.path) + + // Activate oracle validator on chain B (bandchain) + for _, v := range suite.chainB.Vals.Validators { + err := suite.bandApp.OracleKeeper.Activate( + suite.chainB.GetContext(), + sdk.ValAddress(v.Address), + ) + suite.Require().NoError(err) + } + + suite.coordinator.CommitBlock(suite.chainB) +} + +func (suite *IBCTestSuite) sendReport(requestID oracletypes.RequestID, report oracletypes.Report, needToResolve bool) { + suite.bandApp.OracleKeeper.SetReport(suite.chainB.GetContext(), requestID, report) + if needToResolve { + suite.bandApp.OracleKeeper.AddPendingRequest(suite.chainB.GetContext(), requestID) + } + + suite.coordinator.CommitBlock(suite.chainB) } -func (suite *OracleTestSuite) sendOracleRequestPacket( +func (suite *IBCTestSuite) sendOracleRequestPacket( path *ibctesting.Path, seq uint64, - oracleRequestPacket types.OracleRequestPacketData, + oracleRequestPacket oracletypes.OracleRequestPacketData, timeoutHeight clienttypes.Height, ) channeltypes.Packet { packet := channeltypes.NewPacket( @@ -63,29 +102,35 @@ func (suite *OracleTestSuite) sendOracleRequestPacket( return packet } -func (suite *OracleTestSuite) checkChainBTreasuryBalances(expect sdk.Coins) { - treasuryBalances := suite.chainB.App.BankKeeper.GetAllBalances(suite.chainB.GetContext(), suite.chainB.Treasury) +func (suite *IBCTestSuite) checkChainBTreasuryBalances(expect sdk.Coins) { + treasuryBalances := suite.bandApp.BankKeeper.GetAllBalances( + suite.chainB.GetContext(), + bandtesting.Treasury.Address, + ) suite.Require().Equal(expect, treasuryBalances) } -func (suite *OracleTestSuite) checkChainBSenderBalances(expect sdk.Coins) { - b := suite.chainB.App.BankKeeper.GetAllBalances(suite.chainB.GetContext(), suite.chainB.SenderAccount.GetAddress()) +func (suite *IBCTestSuite) checkChainBSenderBalances(expect sdk.Coins) { + b := suite.bandApp.BankKeeper.GetAllBalances( + suite.chainB.GetContext(), + suite.chainB.SenderAccount.GetAddress(), + ) suite.Require().Equal(expect, b) } // constructs a send from chainA to chainB on the established channel/connection // and sends the same coin back from chainB to chainA. -func (suite *OracleTestSuite) TestHandleIBCRequestSuccess() { +func (suite *IBCTestSuite) TestHandleIBCRequestSuccess() { path := suite.path // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(10, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 1, - []byte("beeb"), - 2, + []byte("test"), + 4, 2, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(6000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(12000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) @@ -94,33 +139,39 @@ func (suite *OracleTestSuite) TestHandleIBCRequestSuccess() { err := path.RelayPacket(packet) suite.Require().NoError(err) // relay committed - suite.checkChainBTreasuryBalances(sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(6000000)))) - suite.checkChainBSenderBalances(sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3970000)))) + // Treasury get fees from relayer + suite.checkChainBTreasuryBalances(sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(12000000)))) - raws1 := []types.RawReport{ - types.NewRawReport(1, 0, []byte("data1")), - types.NewRawReport(2, 0, []byte("data2")), - types.NewRawReport(3, 0, []byte("data3")), + raws1 := []oracletypes.RawReport{ + oracletypes.NewRawReport(1, 0, []byte("data1")), + oracletypes.NewRawReport(2, 0, []byte("data2")), + oracletypes.NewRawReport(3, 0, []byte("data3")), } - _, err = suite.chainB.SendReport(1, raws1, bandtesting.Validators[0]) - suite.Require().NoError(err) + suite.sendReport( + oracletypes.RequestID(1), + oracletypes.NewReport(sdk.ValAddress(suite.chainB.Vals.Validators[0].Address), true, raws1), + false, + ) - raws2 := []types.RawReport{ - types.NewRawReport(1, 0, []byte("data1")), - types.NewRawReport(2, 0, []byte("data2")), - types.NewRawReport(3, 0, []byte("data3")), + raws2 := []oracletypes.RawReport{ + oracletypes.NewRawReport(1, 0, []byte("data1")), + oracletypes.NewRawReport(2, 0, []byte("data2")), + oracletypes.NewRawReport(3, 0, []byte("data3")), } - _, err = suite.chainB.SendReport(1, raws2, bandtesting.Validators[1]) - suite.Require().NoError(err) + suite.sendReport( + oracletypes.RequestID(1), + oracletypes.NewReport(sdk.ValAddress(suite.chainB.Vals.Validators[2].Address), true, raws2), + true, + ) - oracleResponsePacket := types.NewOracleResponsePacketData( + oracleResponsePacket := oracletypes.NewOracleResponsePacketData( path.EndpointA.ClientID, 1, 2, - 1577923380, - 1577923405, - types.RESOLVE_STATUS_SUCCESS, - []byte("beeb"), + 1577923360, + 1577923385, + oracletypes.RESOLVE_STATUS_SUCCESS, + []byte("test"), ) responsePacket := channeltypes.NewPacket( oracleResponsePacket.GetBytes(), @@ -130,10 +181,10 @@ func (suite *OracleTestSuite) TestHandleIBCRequestSuccess() { path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, clienttypes.ZeroHeight(), - 1577924005000000000, + uint64(time.Unix(1577923385, 0).Add(10*time.Minute).UnixNano()), ) expectCommitment := channeltypes.CommitPacket(suite.chainB.Codec, responsePacket) - commitment := suite.chainB.App.IBCKeeper.ChannelKeeper.GetPacketCommitment( + commitment := suite.bandApp.GetIBCKeeper().ChannelKeeper.GetPacketCommitment( suite.chainB.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, @@ -142,87 +193,87 @@ func (suite *OracleTestSuite) TestHandleIBCRequestSuccess() { suite.Equal(expectCommitment, commitment) } -func (suite *OracleTestSuite) TestIBCPrepareValidateBasicFail() { +func (suite *IBCTestSuite) TestIBCPrepareValidateBasicFail() { path := suite.path clientID := path.EndpointA.ClientID - coins := sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(6000000))) + coins := sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(6000000))) - oracleRequestPackets := []types.OracleRequestPacketData{ - types.NewOracleRequestPacketData( + oracleRequestPackets := []oracletypes.OracleRequestPacketData{ + oracletypes.NewOracleRequestPacketData( clientID, 1, - []byte(strings.Repeat("beeb", 130)), + []byte(strings.Repeat("test", 130)), 1, 1, coins, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ), - types.NewOracleRequestPacketData( + oracletypes.NewOracleRequestPacketData( clientID, 1, - []byte("beeb"), + []byte("test"), 1, 0, coins, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ), - types.NewOracleRequestPacketData( + oracletypes.NewOracleRequestPacketData( clientID, 1, - []byte("beeb"), + []byte("test"), 1, 2, coins, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ), - types.NewOracleRequestPacketData( + oracletypes.NewOracleRequestPacketData( strings.Repeat(clientID, 9), 1, - []byte("beeb"), + []byte("test"), 1, 1, coins, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ), - types.NewOracleRequestPacketData( + oracletypes.NewOracleRequestPacketData( clientID, 1, - []byte("beeb"), + []byte("test"), 1, 1, coins, 0, bandtesting.TestDefaultExecuteGas, ), - types.NewOracleRequestPacketData( + oracletypes.NewOracleRequestPacketData( clientID, 1, - []byte("beeb"), + []byte("test"), 1, 1, coins, bandtesting.TestDefaultPrepareGas, 0, ), - types.NewOracleRequestPacketData( + oracletypes.NewOracleRequestPacketData( clientID, 1, - []byte("beeb"), + []byte("test"), 1, 1, coins, - types.MaximumOwasmGas, - types.MaximumOwasmGas, + oracletypes.MaximumOwasmGas, + oracletypes.MaximumOwasmGas, ), - types.NewOracleRequestPacketData( + oracletypes.NewOracleRequestPacketData( clientID, 1, - []byte("beeb"), + []byte("test"), 1, 1, bandtesting.BadCoins, @@ -231,7 +282,7 @@ func (suite *OracleTestSuite) TestIBCPrepareValidateBasicFail() { ), } - timeoutHeight := clienttypes.NewHeight(0, 110) + timeoutHeight := clienttypes.NewHeight(1, 110) for i, requestPacket := range oracleRequestPackets { packet := suite.sendOracleRequestPacket(path, uint64(i)+1, requestPacket, timeoutHeight) @@ -240,60 +291,66 @@ func (suite *OracleTestSuite) TestIBCPrepareValidateBasicFail() { } } -func (suite *OracleTestSuite) TestIBCPrepareRequestNotEnoughFund() { +func (suite *IBCTestSuite) TestIBCPrepareRequestNotEnoughFund() { path := suite.path // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(1, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 1, - []byte("beeb"), + []byte("test"), 1, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(3000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) // Use Carol as a relayer carol := bandtesting.Carol - carolExpectedBalance := sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(2492500))) + carolExpectedBalance := sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(2500000))) _, err := suite.chainB.SendMsgs(banktypes.NewMsgSend( suite.chainB.SenderAccount.GetAddress(), carol.Address, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(2500000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(2500000))), )) suite.Require().NoError(err) suite.chainB.SenderPrivKey = carol.PrivKey - suite.chainB.SenderAccount = suite.chainB.App.AccountKeeper.GetAccount(suite.chainB.GetContext(), carol.Address) + suite.chainB.SenderAccount = suite.bandApp.AccountKeeper.GetAccount( + suite.chainB.GetContext(), + carol.Address, + ) packet := suite.sendOracleRequestPacket(path, 1, oracleRequestPacket, timeoutHeight) err = path.RelayPacket(packet) suite.Require().NoError(err) // relay committed - carolBalance := suite.chainB.App.BankKeeper.GetAllBalances(suite.chainB.GetContext(), carol.Address) + carolBalance := suite.bandApp.BankKeeper.GetAllBalances( + suite.chainB.GetContext(), + carol.Address, + ) suite.Require().Equal(carolExpectedBalance, carolBalance) } -func (suite *OracleTestSuite) TestIBCPrepareRequestNotEnoughFeeLimit() { +func (suite *IBCTestSuite) TestIBCPrepareRequestNotEnoughFeeLimit() { path := suite.path - expectedBalance := suite.chainB.App.BankKeeper.GetAllBalances( + expectedBalance := suite.bandApp.BankKeeper.GetAllBalances( suite.chainB.GetContext(), suite.chainB.SenderAccount.GetAddress(), - ).Sub(sdk.NewCoin("uband", sdk.NewInt(7500))) + ) // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(1, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 1, - []byte("beeb"), + []byte("test"), 1, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(2000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(2000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) @@ -305,18 +362,18 @@ func (suite *OracleTestSuite) TestIBCPrepareRequestNotEnoughFeeLimit() { suite.checkChainBSenderBalances(expectedBalance) } -func (suite *OracleTestSuite) TestIBCPrepareRequestInvalidCalldataSize() { +func (suite *IBCTestSuite) TestIBCPrepareRequestInvalidCalldataSize() { path := suite.path // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(1, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 1, - []byte(strings.Repeat("beeb", 2000)), + []byte(strings.Repeat("test", 2000)), 1, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(3000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) @@ -326,17 +383,17 @@ func (suite *OracleTestSuite) TestIBCPrepareRequestInvalidCalldataSize() { suite.Require().NoError(err) // relay committed } -func (suite *OracleTestSuite) TestIBCPrepareRequestNotEnoughPrepareGas() { +func (suite *IBCTestSuite) TestIBCPrepareRequestNotEnoughPrepareGas() { path := suite.path // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(1, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 1, - []byte("beeb"), + []byte("test"), 1, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(3000000))), 1, bandtesting.TestDefaultExecuteGas, ) @@ -346,18 +403,18 @@ func (suite *OracleTestSuite) TestIBCPrepareRequestNotEnoughPrepareGas() { suite.Require().NoError(err) // relay committed } -func (suite *OracleTestSuite) TestIBCPrepareRequestInvalidAskCountFail() { +func (suite *IBCTestSuite) TestIBCPrepareRequestInvalidAskCountFail() { path := suite.path // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(1, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 1, - []byte("beeb"), + []byte("test"), 17, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(3000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) @@ -366,13 +423,13 @@ func (suite *OracleTestSuite) TestIBCPrepareRequestInvalidAskCountFail() { err := path.RelayPacket(packet) suite.Require().NoError(err) // relay committed - oracleRequestPacket = types.NewOracleRequestPacketData( + oracleRequestPacket = oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 1, - []byte("beeb"), + []byte("test"), 3, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(3000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) @@ -382,24 +439,24 @@ func (suite *OracleTestSuite) TestIBCPrepareRequestInvalidAskCountFail() { suite.Require().NoError(err) // relay committed } -func (suite *OracleTestSuite) TestIBCPrepareRequestBaseOwasmFeePanic() { +func (suite *IBCTestSuite) TestIBCPrepareRequestBaseOwasmFeePanic() { path := suite.path - params := suite.chainB.App.OracleKeeper.GetParams(suite.chainB.GetContext()) + params := suite.bandApp.OracleKeeper.GetParams(suite.chainB.GetContext()) params.BaseOwasmGas = 100000000 params.PerValidatorRequestGas = 0 - err := suite.chainB.App.OracleKeeper.SetParams(suite.chainB.GetContext(), params) + err := suite.bandApp.OracleKeeper.SetParams(suite.chainB.GetContext(), params) suite.Require().NoError(err) // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(1, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 1, - []byte("beeb"), + []byte("test"), 1, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(3000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) @@ -410,23 +467,23 @@ func (suite *OracleTestSuite) TestIBCPrepareRequestBaseOwasmFeePanic() { suite.Require().Contains(err.Error(), "BASE_OWASM_FEE; gasWanted: 1000000") } -func (suite *OracleTestSuite) TestIBCPrepareRequestPerValidatorRequestFeePanic() { +func (suite *IBCTestSuite) TestIBCPrepareRequestPerValidatorRequestFeePanic() { path := suite.path - params := suite.chainB.App.OracleKeeper.GetParams(suite.chainB.GetContext()) + params := suite.bandApp.OracleKeeper.GetParams(suite.chainB.GetContext()) params.PerValidatorRequestGas = 100000000 - err := suite.chainB.App.OracleKeeper.SetParams(suite.chainB.GetContext(), params) + err := suite.bandApp.OracleKeeper.SetParams(suite.chainB.GetContext(), params) suite.Require().NoError(err) // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(1, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 1, - []byte("beeb"), + []byte("test"), 1, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(3000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) @@ -437,18 +494,18 @@ func (suite *OracleTestSuite) TestIBCPrepareRequestPerValidatorRequestFeePanic() suite.Require().Contains(err.Error(), "PER_VALIDATOR_REQUEST_FEE; gasWanted: 1000000") } -func (suite *OracleTestSuite) TestIBCPrepareRequestOracleScriptNotFound() { +func (suite *IBCTestSuite) TestIBCPrepareRequestOracleScriptNotFound() { path := suite.path // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(1, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 100, - []byte("beeb"), + []byte("test"), 1, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(3000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) @@ -458,18 +515,18 @@ func (suite *OracleTestSuite) TestIBCPrepareRequestOracleScriptNotFound() { suite.Require().NoError(err) // relay committed } -func (suite *OracleTestSuite) TestIBCPrepareRequestBadWasmExecutionFail() { +func (suite *IBCTestSuite) TestIBCPrepareRequestBadWasmExecutionFail() { path := suite.path // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(1, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 2, - []byte("beeb"), + []byte("test"), 1, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(3000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) @@ -479,18 +536,18 @@ func (suite *OracleTestSuite) TestIBCPrepareRequestBadWasmExecutionFail() { suite.Require().NoError(err) // relay committed } -func (suite *OracleTestSuite) TestIBCPrepareRequestWithEmptyRawRequest() { +func (suite *IBCTestSuite) TestIBCPrepareRequestWithEmptyRawRequest() { path := suite.path // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(1, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 3, - []byte("beeb"), + []byte("test"), 1, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(3000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) @@ -500,18 +557,18 @@ func (suite *OracleTestSuite) TestIBCPrepareRequestWithEmptyRawRequest() { suite.Require().NoError(err) // relay committed } -func (suite *OracleTestSuite) TestIBCPrepareRequestUnknownDataSource() { +func (suite *IBCTestSuite) TestIBCPrepareRequestUnknownDataSource() { path := suite.path // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(1, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 4, - []byte("beeb"), + []byte("test"), 1, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(3000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) @@ -521,26 +578,26 @@ func (suite *OracleTestSuite) TestIBCPrepareRequestUnknownDataSource() { suite.Require().NoError(err) // relay committed } -func (suite *OracleTestSuite) TestIBCPrepareRequestInvalidDataSourceCount() { +func (suite *IBCTestSuite) TestIBCPrepareRequestInvalidDataSourceCount() { path := suite.path - params := suite.chainB.App.OracleKeeper.GetParams(suite.chainB.GetContext()) + params := suite.bandApp.OracleKeeper.GetParams(suite.chainB.GetContext()) params.MaxRawRequestCount = 3 - err := suite.chainB.App.OracleKeeper.SetParams(suite.chainB.GetContext(), params) + err := suite.bandApp.OracleKeeper.SetParams(suite.chainB.GetContext(), params) suite.Require().NoError(err) // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(1, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 4, obi.MustEncode(testdata.Wasm4Input{ IDs: []int64{1, 2, 3, 4}, - Calldata: "beeb", + Calldata: "test", }), 1, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(4000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(4000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) @@ -550,18 +607,18 @@ func (suite *OracleTestSuite) TestIBCPrepareRequestInvalidDataSourceCount() { suite.Require().NoError(err) // relay committed } -func (suite *OracleTestSuite) TestIBCPrepareRequestTooMuchWasmGas() { +func (suite *IBCTestSuite) TestIBCPrepareRequestTooMuchWasmGas() { path := suite.path // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(1, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 6, - []byte("beeb"), + []byte("test"), 1, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(3000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) @@ -571,17 +628,17 @@ func (suite *OracleTestSuite) TestIBCPrepareRequestTooMuchWasmGas() { suite.Require().NoError(err) // relay committed } -func (suite *OracleTestSuite) TestIBCPrepareRequestTooLargeCalldata() { +func (suite *IBCTestSuite) TestIBCPrepareRequestTooLargeCalldata() { path := suite.path // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(1, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 8, - []byte("beeb"), + []byte("test"), 1, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(3000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) @@ -591,51 +648,58 @@ func (suite *OracleTestSuite) TestIBCPrepareRequestTooLargeCalldata() { suite.Require().NoError(err) // relay committed } -func (suite *OracleTestSuite) TestIBCResolveRequestOutOfGas() { +func (suite *IBCTestSuite) TestIBCResolveRequestOutOfGas() { path := suite.path // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(1, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 1, - []byte("beeb"), + []byte("test"), 2, 1, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(6000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(6000000))), bandtesting.TestDefaultPrepareGas, 1, ) + expectedSenderBalance := suite.bandApp.BankKeeper.GetAllBalances( + suite.chainB.GetContext(), + suite.chainB.SenderAccount.GetAddress(), + ).Sub(sdk.NewCoin("uband", math.NewInt(6000000))) packet := suite.sendOracleRequestPacket(path, 1, oracleRequestPacket, timeoutHeight) err := path.RelayPacket(packet) suite.Require().NoError(err) // relay committed - suite.checkChainBTreasuryBalances(sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(6000000)))) - suite.checkChainBSenderBalances(sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3970000)))) + suite.checkChainBTreasuryBalances(sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(6000000)))) + suite.checkChainBSenderBalances(expectedSenderBalance) - raws := []types.RawReport{ - types.NewRawReport(1, 0, []byte("data1")), - types.NewRawReport(2, 0, []byte("data2")), - types.NewRawReport(3, 0, []byte("data3")), + raws := []oracletypes.RawReport{ + oracletypes.NewRawReport(1, 0, []byte("data1")), + oracletypes.NewRawReport(2, 0, []byte("data2")), + oracletypes.NewRawReport(3, 0, []byte("data3")), } - _, err = suite.chainB.SendReport(1, raws, bandtesting.Validators[0]) - suite.Require().NoError(err) + suite.sendReport( + oracletypes.RequestID(1), + oracletypes.NewReport(sdk.ValAddress(suite.chainB.Vals.Validators[0].Address), true, raws), + true, + ) - commitment := suite.chainB.App.IBCKeeper.ChannelKeeper.GetPacketCommitment( + commitment := suite.bandApp.IBCKeeper.ChannelKeeper.GetPacketCommitment( suite.chainB.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, 1, ) - oracleResponsePacket := types.NewOracleResponsePacketData( + oracleResponsePacket := oracletypes.NewOracleResponsePacketData( path.EndpointA.ClientID, 1, 1, + 1577923360, 1577923380, - 1577923400, - types.RESOLVE_STATUS_FAILURE, + oracletypes.RESOLVE_STATUS_FAILURE, []byte{}, ) responsePacket := channeltypes.NewPacket( @@ -646,58 +710,74 @@ func (suite *OracleTestSuite) TestIBCResolveRequestOutOfGas() { path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, clienttypes.ZeroHeight(), - 1577924000000000000, + uint64(time.Unix(1577923380, 0).Add(10*time.Minute).UnixNano()), ) expectCommitment := channeltypes.CommitPacket(suite.chainB.Codec, responsePacket) suite.Equal(expectCommitment, commitment) } -func (suite *OracleTestSuite) TestIBCResolveReadNilExternalData() { +func (suite *IBCTestSuite) TestIBCResolveReadNilExternalData() { path := suite.path // send request from A to B - timeoutHeight := clienttypes.NewHeight(0, 110) - oracleRequestPacket := types.NewOracleRequestPacketData( + timeoutHeight := clienttypes.NewHeight(10, 110) + oracleRequestPacket := oracletypes.NewOracleRequestPacketData( path.EndpointA.ClientID, 4, - obi.MustEncode(testdata.Wasm4Input{IDs: []int64{1, 2}, Calldata: string("beeb")}), + obi.MustEncode(testdata.Wasm4Input{IDs: []int64{1, 2}, Calldata: string("test")}), 2, 2, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(4000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(4000000))), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, ) + expectedSenderBalance := suite.bandApp.BankKeeper.GetAllBalances( + suite.chainB.GetContext(), + suite.chainB.SenderAccount.GetAddress(), + ).Sub(sdk.NewCoin("uband", math.NewInt(4000000))) packet := suite.sendOracleRequestPacket(path, 1, oracleRequestPacket, timeoutHeight) err := path.RelayPacket(packet) suite.Require().NoError(err) // relay committed - suite.checkChainBTreasuryBalances(sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(4000000)))) - suite.checkChainBSenderBalances(sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(5970000)))) + suite.checkChainBTreasuryBalances(sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(4000000)))) + suite.checkChainBSenderBalances(expectedSenderBalance) - raws1 := []types.RawReport{types.NewRawReport(0, 0, nil), types.NewRawReport(1, 0, []byte("beebd2v1"))} - _, err = suite.chainB.SendReport(1, raws1, bandtesting.Validators[0]) - suite.Require().NoError(err) + raws1 := []oracletypes.RawReport{ + oracletypes.NewRawReport(0, 0, nil), + oracletypes.NewRawReport(1, 0, []byte("testd2v1")), + } + suite.sendReport( + oracletypes.RequestID(1), + oracletypes.NewReport(sdk.ValAddress(suite.chainB.Vals.Validators[0].Address), true, raws1), + false, + ) - raws2 := []types.RawReport{types.NewRawReport(0, 0, []byte("beebd1v2")), types.NewRawReport(1, 0, nil)} - _, err = suite.chainB.SendReport(1, raws2, bandtesting.Validators[1]) - suite.Require().NoError(err) + raws2 := []oracletypes.RawReport{ + oracletypes.NewRawReport(0, 0, []byte("testd1v2")), + oracletypes.NewRawReport(1, 0, nil), + } + suite.sendReport( + oracletypes.RequestID(1), + oracletypes.NewReport(sdk.ValAddress(suite.chainB.Vals.Validators[2].Address), true, raws2), + true, + ) - commitment := suite.chainB.App.IBCKeeper.ChannelKeeper.GetPacketCommitment( + commitment := suite.bandApp.GetIBCKeeper().ChannelKeeper.GetPacketCommitment( suite.chainB.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, 1, ) - oracleResponsePacket := types.NewOracleResponsePacketData( + oracleResponsePacket := oracletypes.NewOracleResponsePacketData( path.EndpointA.ClientID, 1, 2, - 1577923380, - 1577923405, - types.RESOLVE_STATUS_SUCCESS, - obi.MustEncode(testdata.Wasm4Output{Ret: "beebd1v2beebd2v1"}), + 1577923360, + 1577923385, + oracletypes.RESOLVE_STATUS_SUCCESS, + obi.MustEncode(testdata.Wasm4Output{Ret: "testd1v2testd2v1"}), ) responsePacket := channeltypes.NewPacket( oracleResponsePacket.GetBytes(), @@ -707,51 +787,55 @@ func (suite *OracleTestSuite) TestIBCResolveReadNilExternalData() { path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, clienttypes.ZeroHeight(), - 1577924005000000000, + uint64(time.Unix(1577923385, 0).Add(10*time.Minute).UnixNano()), ) - expectCommitment := channeltypes.CommitPacket(suite.chainB.Codec, responsePacket) + expectCommitment := channeltypes.CommitPacket(suite.bandApp.AppCodec(), responsePacket) suite.Equal(expectCommitment, commitment) } -func (suite *OracleTestSuite) TestIBCResolveRequestNoReturnData() { +func (suite *IBCTestSuite) TestIBCResolveRequestNoReturnData() { path := suite.path - suite.chainB.App.OracleKeeper.SetRequest(suite.chainB.GetContext(), 1, types.NewRequest( + suite.bandApp.OracleKeeper.SetRequest(suite.chainB.GetContext(), 1, oracletypes.NewRequest( // 3rd Wasm - do nothing 3, - []byte("beeb"), - []sdk.ValAddress{bandtesting.Validators[0].ValAddress, bandtesting.Validators[1].ValAddress}, + []byte("test"), + []sdk.ValAddress{ + sdk.ValAddress(suite.chainB.Vals.Validators[0].Address), + sdk.ValAddress(suite.chainB.Vals.Validators[1].Address), + }, 1, - suite.chainB.GetContext(). - BlockHeight()- - 1, + suite.chainB.GetContext().BlockHeight()-1, bandtesting.ParseTime(1577923380), path.EndpointA.ClientID, - []types.RawRequest{ - types.NewRawRequest(1, 1, []byte("beeb")), + []oracletypes.RawRequest{ + oracletypes.NewRawRequest(1, 1, []byte("test")), }, - &types.IBCChannel{PortId: path.EndpointB.ChannelConfig.PortID, ChannelId: path.EndpointB.ChannelID}, + &oracletypes.IBCChannel{PortId: path.EndpointB.ChannelConfig.PortID, ChannelId: path.EndpointB.ChannelID}, 0, )) - raws := []types.RawReport{types.NewRawReport(1, 0, []byte("beeb"))} - _, err := suite.chainB.SendReport(1, raws, bandtesting.Validators[0]) - suite.Require().NoError(err) + raws := []oracletypes.RawReport{oracletypes.NewRawReport(1, 0, []byte("test"))} + suite.sendReport( + oracletypes.RequestID(1), + oracletypes.NewReport(sdk.ValAddress(suite.chainB.Vals.Validators[0].Address), true, raws), + true, + ) - commitment := suite.chainB.App.IBCKeeper.ChannelKeeper.GetPacketCommitment( + commitment := suite.bandApp.IBCKeeper.ChannelKeeper.GetPacketCommitment( suite.chainB.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, 1, ) - oracleResponsePacket := types.NewOracleResponsePacketData( + oracleResponsePacket := oracletypes.NewOracleResponsePacketData( path.EndpointA.ClientID, 1, 1, 1577923380, - 1577923355, - types.RESOLVE_STATUS_FAILURE, + 1577923335, + oracletypes.RESOLVE_STATUS_FAILURE, []byte{}, ) responsePacket := channeltypes.NewPacket( @@ -762,51 +846,55 @@ func (suite *OracleTestSuite) TestIBCResolveRequestNoReturnData() { path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, clienttypes.ZeroHeight(), - 1577923955000000000, + uint64(time.Unix(1577923335, 0).Add(10*time.Minute).UnixNano()), ) expectCommitment := channeltypes.CommitPacket(suite.chainB.Codec, responsePacket) suite.Equal(expectCommitment, commitment) } -func (suite *OracleTestSuite) TestIBCResolveRequestWasmFailure() { +func (suite *IBCTestSuite) TestIBCResolveRequestWasmFailure() { path := suite.path - suite.chainB.App.OracleKeeper.SetRequest(suite.chainB.GetContext(), 1, types.NewRequest( + suite.bandApp.OracleKeeper.SetRequest(suite.chainB.GetContext(), 1, oracletypes.NewRequest( // 6th Wasm - out-of-gas 6, - []byte("beeb"), - []sdk.ValAddress{bandtesting.Validators[0].ValAddress, bandtesting.Validators[1].ValAddress}, + []byte("test"), + []sdk.ValAddress{ + sdk.ValAddress(suite.chainB.Vals.Validators[0].Address), + sdk.ValAddress(suite.chainB.Vals.Validators[1].Address), + }, 1, - suite.chainB.GetContext(). - BlockHeight()- - 1, + suite.chainB.GetContext().BlockHeight()-1, bandtesting.ParseTime(1577923380), path.EndpointA.ClientID, - []types.RawRequest{ - types.NewRawRequest(1, 1, []byte("beeb")), + []oracletypes.RawRequest{ + oracletypes.NewRawRequest(1, 1, []byte("test")), }, - &types.IBCChannel{PortId: path.EndpointB.ChannelConfig.PortID, ChannelId: path.EndpointB.ChannelID}, + &oracletypes.IBCChannel{PortId: path.EndpointB.ChannelConfig.PortID, ChannelId: path.EndpointB.ChannelID}, bandtesting.TestDefaultExecuteGas, )) - raws := []types.RawReport{types.NewRawReport(1, 0, []byte("beeb"))} - _, err := suite.chainB.SendReport(1, raws, bandtesting.Validators[0]) - suite.Require().NoError(err) + raws := []oracletypes.RawReport{oracletypes.NewRawReport(1, 0, []byte("test"))} + suite.sendReport( + oracletypes.RequestID(1), + oracletypes.NewReport(sdk.ValAddress(suite.chainB.Vals.Validators[0].Address), true, raws), + true, + ) - commitment := suite.chainB.App.IBCKeeper.ChannelKeeper.GetPacketCommitment( + commitment := suite.bandApp.IBCKeeper.ChannelKeeper.GetPacketCommitment( suite.chainB.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, 1, ) - oracleResponsePacket := types.NewOracleResponsePacketData( + oracleResponsePacket := oracletypes.NewOracleResponsePacketData( path.EndpointA.ClientID, 1, 1, 1577923380, - 1577923355, - types.RESOLVE_STATUS_FAILURE, + 1577923335, + oracletypes.RESOLVE_STATUS_FAILURE, []byte{}, ) responsePacket := channeltypes.NewPacket( @@ -817,51 +905,55 @@ func (suite *OracleTestSuite) TestIBCResolveRequestWasmFailure() { path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, clienttypes.ZeroHeight(), - 1577923955000000000, + uint64(time.Unix(1577923335, 0).Add(10*time.Minute).UnixNano()), ) expectCommitment := channeltypes.CommitPacket(suite.chainB.Codec, responsePacket) suite.Equal(expectCommitment, commitment) } -func (suite *OracleTestSuite) TestIBCResolveRequestCallReturnDataSeveralTimes() { +func (suite *IBCTestSuite) TestIBCResolveRequestCallReturnDataSeveralTimes() { path := suite.path - suite.chainB.App.OracleKeeper.SetRequest(suite.chainB.GetContext(), 1, types.NewRequest( + suite.bandApp.OracleKeeper.SetRequest(suite.chainB.GetContext(), 1, oracletypes.NewRequest( // 9th Wasm - set return data several times 9, - []byte("beeb"), - []sdk.ValAddress{bandtesting.Validators[0].ValAddress, bandtesting.Validators[1].ValAddress}, + []byte("test"), + []sdk.ValAddress{ + sdk.ValAddress(suite.chainB.Vals.Validators[0].Address), + sdk.ValAddress(suite.chainB.Vals.Validators[1].Address), + }, 1, - suite.chainB.GetContext(). - BlockHeight()- - 1, - bandtesting.ParseTime(1577923380), + suite.chainB.GetContext().BlockHeight()-1, + bandtesting.ParseTime(1577923360), path.EndpointA.ClientID, - []types.RawRequest{ - types.NewRawRequest(1, 1, []byte("beeb")), + []oracletypes.RawRequest{ + oracletypes.NewRawRequest(1, 1, []byte("test")), }, - &types.IBCChannel{PortId: path.EndpointB.ChannelConfig.PortID, ChannelId: path.EndpointB.ChannelID}, + &oracletypes.IBCChannel{PortId: path.EndpointB.ChannelConfig.PortID, ChannelId: path.EndpointB.ChannelID}, bandtesting.TestDefaultExecuteGas, )) - raws := []types.RawReport{types.NewRawReport(1, 0, []byte("beeb"))} - _, err := suite.chainB.SendReport(1, raws, bandtesting.Validators[0]) - suite.Require().NoError(err) + raws := []oracletypes.RawReport{oracletypes.NewRawReport(1, 0, []byte("test"))} + suite.sendReport( + oracletypes.RequestID(1), + oracletypes.NewReport(sdk.ValAddress(suite.chainB.Vals.Validators[0].Address), true, raws), + true, + ) - commitment := suite.chainB.App.IBCKeeper.ChannelKeeper.GetPacketCommitment( + commitment := suite.bandApp.IBCKeeper.ChannelKeeper.GetPacketCommitment( suite.chainB.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, 1, ) - oracleResponsePacket := types.NewOracleResponsePacketData( + oracleResponsePacket := oracletypes.NewOracleResponsePacketData( path.EndpointA.ClientID, 1, 1, - 1577923380, - 1577923355, - types.RESOLVE_STATUS_FAILURE, + 1577923360, + 1577923335, + oracletypes.RESOLVE_STATUS_FAILURE, []byte{}, ) responsePacket := channeltypes.NewPacket( @@ -872,12 +964,12 @@ func (suite *OracleTestSuite) TestIBCResolveRequestCallReturnDataSeveralTimes() path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, clienttypes.ZeroHeight(), - 1577923955000000000, + uint64(time.Unix(1577923335, 0).Add(10*time.Minute).UnixNano()), ) expectCommitment := channeltypes.CommitPacket(suite.chainB.Codec, responsePacket) suite.Equal(expectCommitment, commitment) } -func TestOracleTestSuite(t *testing.T) { - suite.Run(t, new(OracleTestSuite)) +func TestIBCTestSuite(t *testing.T) { + suite.Run(t, new(IBCTestSuite)) } diff --git a/x/oracle/keeper/common_test.go b/x/oracle/keeper/common_test.go index 997d10b34..be30750c6 100644 --- a/x/oracle/keeper/common_test.go +++ b/x/oracle/keeper/common_test.go @@ -1,21 +1,137 @@ package keeper_test import ( + "fmt" + + "github.com/cometbft/cometbft/crypto/secp256k1" + + "cosmossdk.io/math" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + "github.com/bandprotocol/chain/v3/pkg/filecache" + bandtesting "github.com/bandprotocol/chain/v3/testing" + "github.com/bandprotocol/chain/v3/testing/testdata" + "github.com/bandprotocol/chain/v3/x/oracle/keeper" + "github.com/bandprotocol/chain/v3/x/oracle/types" +) + +const ( + chainID = "BANDCHAIN" + basicName = "BASIC_NAME" + basicDesc = "BASIC_DESCRIPTION" + basicSchema = "BASIC_SCHEMA" + basicSourceCodeURL = "BASIC_SOURCE_CODE_URL" + basicFilename = "BASIC_FILENAME" + basicClientID = "BASIC_CLIENT_ID" ) var ( - BasicName = "BASIC_NAME" - BasicDesc = "BASIC_DESCRIPTION" - BasicSchema = "BASIC_SCHEMA" - BasicSourceCodeURL = "BASIC_SOURCE_CODE_URL" - BasicFilename = "BASIC_FILENAME" - BasicCalldata = []byte("BASIC_CALLDATA") - BasicClientID = "BASIC_CLIENT_ID" - BasicReport = []byte("BASIC_REPORT") - BasicResult = []byte("BASIC_RESULT") - CoinsZero = sdk.NewCoins() - Coins10uband = sdk.NewCoins(sdk.NewInt64Coin("uband", 10)) - Coins20uband = sdk.NewCoins(sdk.NewInt64Coin("uband", 20)) - Coins1000000uband = sdk.NewCoins(sdk.NewInt64Coin("uband", 1000000)) + owner = sdk.AccAddress([]byte("owner_______________")) + treasury = sdk.AccAddress([]byte("treasury____________")) + alice = sdk.AccAddress([]byte("alice_______________")) + bob = sdk.AccAddress([]byte("bob_________________")) + + PKS = simtestutil.CreateTestPubKeys(3) + + valConsPk0 = PKS[0] + valConsPk1 = PKS[1] + valConsPk2 = PKS[2] + + validators = []ValidatorWithValAddress{ + createValidator(PKS[0], math.NewInt(100)), + createValidator(PKS[1], math.NewInt(70)), + createValidator(PKS[2], math.NewInt(30)), + } + + reporterPrivKey = secp256k1.GenPrivKey() + reporterPubKey = reporterPrivKey.PubKey() + reporterAddr = sdk.AccAddress(reporterPubKey.Address()) + + basicCalldata = []byte("BASIC_CALLDATA") + basicReport = []byte("BASIC_REPORT") + basicResult = []byte("BASIC_RESULT") + testDefaultPrepareGas uint64 = 40000 + testDefaultExecuteGas uint64 = 300000 + + emptyCoins = sdk.Coins(nil) + coinsZero = sdk.NewCoins() + coins10uband = sdk.NewCoins(sdk.NewInt64Coin("uband", 10)) + coins20uband = sdk.NewCoins(sdk.NewInt64Coin("uband", 20)) + coins1000000uband = sdk.NewCoins(sdk.NewInt64Coin("uband", 1000000)) + coins100000000uband = sdk.NewCoins(sdk.NewInt64Coin("uband", 100000000)) ) + +type ValidatorWithValAddress struct { + Validator stakingtypes.Validator + Address sdk.ValAddress +} + +func createValidator(pk cryptotypes.PubKey, stake math.Int) ValidatorWithValAddress { + valConsAddr := sdk.GetConsAddress(pk) + val, _ := stakingtypes.NewValidator( + sdk.ValAddress(valConsAddr).String(), + pk, + stakingtypes.Description{Moniker: "TestValidator"}, + ) + val.Tokens = stake + val.DelegatorShares = math.LegacyNewDecFromInt(val.Tokens) + return ValidatorWithValAddress{Validator: val, Address: sdk.ValAddress(valConsAddr)} +} + +func addSimpleDataSourceAndOracleScript(ctx sdk.Context, k keeper.Keeper, dir string) { + // Add data source + for i := 1; i <= 3; i++ { + idxStr := fmt.Sprintf("%d", i) + k.SetDataSource( + ctx, + types.DataSourceID(i), + types.NewDataSource( + owner, + "name"+idxStr, + "desc"+idxStr, + "filename"+idxStr, + coins1000000uband, + treasury, + ), + ) + } + fc := filecache.New(dir) + // Add wasm_1_simple + fileName1 := fc.AddFile(testdata.Compile(testdata.Wasm1)) + k.SetOracleScript( + ctx, + types.OracleScriptID(1), + types.NewOracleScript(owner, "test os", "testing oracle script", fileName1, "schema", "url"), + ) + + // Add wasm_4_complex + fileName4 := fc.AddFile(testdata.Compile(testdata.Wasm4)) + k.SetOracleScript( + ctx, + types.OracleScriptID(4), + types.NewOracleScript(owner, "test os4", "testing oracle script complex", fileName4, "schema", "url"), + ) +} + +func defaultRequest() types.Request { + return types.NewRequest( + 1, + basicCalldata, + []sdk.ValAddress{validators[0].Address, validators[1].Address}, + 2, + 1, + bandtesting.ParseTime(0), + basicClientID, + []types.RawRequest{ + types.NewRawRequest(1, 1, []byte("testdata")), + types.NewRawRequest(2, 2, []byte("testdata")), + types.NewRawRequest(3, 3, []byte("testdata")), + }, + nil, + 0, + ) +} diff --git a/x/oracle/keeper/data_source.go b/x/oracle/keeper/data_source.go index 374d29fb0..90cc8a15a 100644 --- a/x/oracle/keeper/data_source.go +++ b/x/oracle/keeper/data_source.go @@ -3,9 +3,11 @@ package keeper import ( "bytes" + storetypes "cosmossdk.io/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // HasDataSource checks if the data source of this ID exists in the storage. @@ -61,7 +63,7 @@ func (k Keeper) MustEditDataSource(ctx sdk.Context, id types.DataSourceID, new t // GetAllDataSources returns the list of all data sources in the store, or nil if there is none. func (k Keeper) GetAllDataSources(ctx sdk.Context) (dataSources []types.DataSource) { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.DataSourceStoreKeyPrefix) + iterator := storetypes.KVStorePrefixIterator(store, types.DataSourceStoreKeyPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { var dataSource types.DataSource diff --git a/x/oracle/keeper/data_source_test.go b/x/oracle/keeper/data_source_test.go index 3bc912ae2..ba0b51dc8 100644 --- a/x/oracle/keeper/data_source_test.go +++ b/x/oracle/keeper/data_source_test.go @@ -1,211 +1,225 @@ package keeper_test import ( - "testing" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/x/oracle/types" + bandtesting "github.com/bandprotocol/chain/v3/testing" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) -func TestHasDataSource(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestHasDataSource() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // We should not have a data source ID 42 without setting it. - require.False(t, k.HasDataSource(ctx, 42)) + require.False(k.HasDataSource(ctx, 42)) // After we set it, we should be able to find it. k.SetDataSource(ctx, 42, types.NewDataSource( - bandtesting.Owner.Address, - BasicName, - BasicDesc, - BasicFilename, - bandtesting.EmptyCoins, - bandtesting.Treasury.Address, + owner, + basicName, + basicDesc, + basicFilename, + coinsZero, + types.KeyExpirationBlockCount, )) - require.True(t, k.HasDataSource(ctx, 42)) + require.True(k.HasDataSource(ctx, 42)) } -func TestSetterGetterDataSource(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestSetterGetterDataSource() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // Getting a non-existent data source should return error. _, err := k.GetDataSource(ctx, 42) - require.ErrorIs(t, err, types.ErrDataSourceNotFound) - require.Panics(t, func() { _ = k.MustGetDataSource(ctx, 42) }) + require.ErrorIs(err, types.ErrDataSourceNotFound) + require.Panics(func() { _ = k.MustGetDataSource(ctx, 42) }) // Creates some basic data sources. dataSource1 := types.NewDataSource( - bandtesting.Alice.Address, + alice, "NAME1", "DESCRIPTION1", "filename1", - bandtesting.EmptyCoins, - bandtesting.Treasury.Address, + emptyCoins, + treasury, ) dataSource2 := types.NewDataSource( - bandtesting.Bob.Address, + bob, "NAME2", "DESCRIPTION2", "filename2", - bandtesting.EmptyCoins, - bandtesting.Treasury.Address, + emptyCoins, + treasury, ) // Sets id 42 with data soure 1 and id 42 with data source 2. k.SetDataSource(ctx, 42, dataSource1) k.SetDataSource(ctx, 43, dataSource2) // Checks that Get and MustGet perform correctly. dataSource1Res, err := k.GetDataSource(ctx, 42) - require.Nil(t, err) - require.Equal(t, dataSource1, dataSource1Res) - require.Equal(t, dataSource1, k.MustGetDataSource(ctx, 42)) + require.Nil(err) + require.Equal(dataSource1, dataSource1Res) + require.Equal(dataSource1, k.MustGetDataSource(ctx, 42)) + dataSource2Res, err := k.GetDataSource(ctx, 43) - require.Nil(t, err) - require.Equal(t, dataSource2, dataSource2Res) - require.Equal(t, dataSource2, k.MustGetDataSource(ctx, 43)) + require.Nil(err) + require.Equal(dataSource2, dataSource2Res) + require.Equal(dataSource2, k.MustGetDataSource(ctx, 43)) // Replaces id 42 with another data source. + k.SetDataSource(ctx, 42, dataSource2) - require.NotEqual(t, dataSource1, k.MustGetDataSource(ctx, 42)) - require.Equal(t, dataSource2, k.MustGetDataSource(ctx, 42)) + require.NotEqual(dataSource1, k.MustGetDataSource(ctx, 42)) + require.Equal(dataSource2, k.MustGetDataSource(ctx, 42)) } -func TestAddDataSourceEditDataSourceBasic(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestAddDataSourceEditDataSourceBasic() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // Creates some basic data sources. dataSource1 := types.NewDataSource( - bandtesting.Alice.Address, + alice, "NAME1", "DESCRIPTION1", "FILENAME1", - bandtesting.EmptyCoins, - bandtesting.Treasury.Address, + emptyCoins, + treasury, ) dataSource2 := types.NewDataSource( - bandtesting.Bob.Address, + bob, "NAME2", "DESCRIPTION2", "FILENAME2", - bandtesting.EmptyCoins, - bandtesting.Treasury.Address, + emptyCoins, + treasury, ) // Adds a new data source to the store. We should be able to retrieve it back. id := k.AddDataSource(ctx, dataSource1) - require.Equal(t, dataSource1, k.MustGetDataSource(ctx, id)) - require.NotEqual(t, dataSource2, k.MustGetDataSource(ctx, id)) + require.Equal(dataSource1, k.MustGetDataSource(ctx, id)) + require.NotEqual(dataSource2, k.MustGetDataSource(ctx, id)) owner, err := sdk.AccAddressFromBech32(dataSource2.Owner) - require.NoError(t, err) + require.NoError(err) treasury, err := sdk.AccAddressFromBech32(dataSource2.Treasury) - require.NoError(t, err) + require.NoError(err) // Edits the data source. We should get the updated data source. k.MustEditDataSource(ctx, id, types.NewDataSource( - owner, dataSource2.Name, dataSource2.Description, dataSource2.Filename, bandtesting.EmptyCoins, treasury, + owner, dataSource2.Name, dataSource2.Description, dataSource2.Filename, emptyCoins, treasury, )) - require.NotEqual(t, dataSource1, k.MustGetDataSource(ctx, id)) - require.Equal(t, dataSource2, k.MustGetDataSource(ctx, id)) + require.NotEqual(dataSource1, k.MustGetDataSource(ctx, id)) + require.Equal(dataSource2, k.MustGetDataSource(ctx, id)) } -func TestEditDataSourceDoNotModify(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestEditDataSourceDoNotModify() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // Creates some basic data sources. dataSource1 := types.NewDataSource( - bandtesting.Alice.Address, + alice, "NAME1", "DESCRIPTION1", "FILENAME1", - bandtesting.EmptyCoins, - bandtesting.Treasury.Address, + emptyCoins, + treasury, ) dataSource2 := types.NewDataSource( - bandtesting.Bob.Address, + bob, types.DoNotModify, types.DoNotModify, "FILENAME2", - bandtesting.EmptyCoins, - bandtesting.Treasury.Address, + emptyCoins, + treasury, ) // Adds a new data source to the store. We should be able to retrieve it back. id := k.AddDataSource(ctx, dataSource1) - require.Equal(t, dataSource1, k.MustGetDataSource(ctx, id)) - require.NotEqual(t, dataSource2, k.MustGetDataSource(ctx, id)) + require.Equal(dataSource1, k.MustGetDataSource(ctx, id)) + require.NotEqual(dataSource2, k.MustGetDataSource(ctx, id)) // Edits the data source. We should get the updated data source. k.MustEditDataSource(ctx, id, dataSource2) dataSourceRes := k.MustGetDataSource(ctx, id) - require.NotEqual(t, dataSourceRes, dataSource1) - require.NotEqual(t, dataSourceRes, dataSource2) - require.Equal(t, dataSourceRes.Owner, dataSource2.Owner) - require.Equal(t, dataSourceRes.Name, dataSource1.Name) - require.Equal(t, dataSourceRes.Description, dataSource1.Description) - require.Equal(t, dataSourceRes.Filename, dataSource2.Filename) - require.Equal(t, dataSourceRes.Fee, dataSource2.Fee) - require.Equal(t, dataSourceRes.Treasury, dataSource2.Treasury) + require.NotEqual(dataSourceRes, dataSource1) + require.NotEqual(dataSourceRes, dataSource2) + require.Equal(dataSourceRes.Owner, dataSource2.Owner) + require.Equal(dataSourceRes.Name, dataSource1.Name) + require.Equal(dataSourceRes.Description, dataSource1.Description) + require.Equal(dataSourceRes.Filename, dataSource2.Filename) + require.Equal(dataSourceRes.Fee, dataSource2.Fee) + require.Equal(dataSourceRes.Treasury, dataSource2.Treasury) } -func TestAddDataSourceDataSourceMustReturnCorrectID(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestAddDataSourceDataSourceMustReturnCorrectID() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() - // Initially we expect the data source count to be what we have on genesis state. - genesisCount := uint64(len(bandtesting.DataSources)) - 1 - require.Equal(t, genesisCount, k.GetDataSourceCount(ctx)) + genesisCount := k.GetDataSourceCount(ctx) // Every new data source we add should return a new ID. id1 := k.AddDataSource( ctx, types.NewDataSource( - bandtesting.Owner.Address, - BasicName, - BasicDesc, - BasicFilename, - bandtesting.EmptyCoins, - bandtesting.Treasury.Address, + owner, + basicName, + basicDesc, + basicFilename, + emptyCoins, + treasury, ), ) - require.Equal(t, types.DataSourceID(genesisCount+1), id1) + require.Equal(types.DataSourceID(genesisCount+1), id1) // Adds another data source so now ID should increase by 2. id2 := k.AddDataSource( ctx, types.NewDataSource( - bandtesting.Owner.Address, - BasicName, - BasicDesc, - BasicFilename, - bandtesting.EmptyCoins, - bandtesting.Treasury.Address, + owner, + basicName, + basicDesc, + basicFilename, + emptyCoins, + treasury, ), ) - require.Equal(t, types.DataSourceID(genesisCount+2), id2) + require.Equal(types.DataSourceID(genesisCount+2), id2) // Finally we expect the data source to increase as well. - require.Equal(t, genesisCount+2, k.GetDataSourceCount(ctx)) + require.Equal(genesisCount+2, k.GetDataSourceCount(ctx)) } -func TestEditDataSourceNonExistentDataSource(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper - - require.Panics(t, func() { k.MustEditDataSource(ctx, 9999, bandtesting.DataSources[1]) }) +func (suite *KeeperTestSuite) TestEditDataSourceNonExistentDataSource() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + + require.Panics(func() { + k.MustEditDataSource(ctx, 9999, types.NewDataSource( + owner, + basicName, + basicDesc, + basicFilename, + emptyCoins, + treasury, + )) + }) } -func TestGetAllDataSources(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestGetAllDataSources() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + + dataSources := bandtesting.GenerateDataSources(suite.homeDir) - // We should be able to get all genesis data sources. - require.Equal(t, bandtesting.DataSources[1:], k.GetAllDataSources(ctx)) + require.Equal(dataSources, k.GetAllDataSources(ctx)) } -func TestAddExecutableFile(t *testing.T) { - app, _ := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestAddExecutableFile() { + k := suite.oracleKeeper + require := suite.Require() // Adding do-not-modify should simply return do-not-modify. - require.Equal(t, types.DoNotModify, k.AddExecutableFile(types.DoNotModifyBytes)) + require.Equal(types.DoNotModify, k.AddExecutableFile(types.DoNotModifyBytes)) // After we add an executable file, we should be able to retrieve it back. filename := k.AddExecutableFile([]byte("UNIQUE_EXEC_FOR_TestAddExecutableFile")) - require.Equal(t, []byte("UNIQUE_EXEC_FOR_TestAddExecutableFile"), k.GetFile(filename)) + require.Equal([]byte("UNIQUE_EXEC_FOR_TestAddExecutableFile"), k.GetFile(filename)) } diff --git a/x/oracle/keeper/fee_collector.go b/x/oracle/keeper/fee_collector.go index 638c96d15..e015c2b96 100644 --- a/x/oracle/keeper/fee_collector.go +++ b/x/oracle/keeper/fee_collector.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // FeeCollector define fee collector diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index 0a70a1e53..e09c840ec 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -6,15 +6,17 @@ import ( "errors" "fmt" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "github.com/cometbft/cometbft/crypto/secp256k1" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "github.com/bandprotocol/chain/v2/hooks/common" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/hooks/common" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper @@ -202,9 +204,7 @@ func (k Querier) Validator( return nil, err } status := k.GetValidatorStatus(ctx, val) - if err != nil { - return nil, err - } + return &types.QueryValidatorResponse{Status: &status}, nil } @@ -225,7 +225,7 @@ func (k Querier) IsReporter( return &types.QueryIsReporterResponse{IsReporter: k.Keeper.IsReporter(ctx, val, rep)}, nil } -// Reporters queries 100 gratees of a given validator address and filter for reporter. +// Reporters queries 100 grantees of a given validator address and filter for reporter. func (k Querier) Reporters( c context.Context, req *types.QueryReportersRequest, @@ -268,16 +268,23 @@ func (k Querier) ActiveValidators( } ctx := sdk.UnwrapSDKContext(c) result := types.QueryActiveValidatorsResponse{} - k.stakingKeeper.IterateBondedValidatorsByPower(ctx, + err := k.stakingKeeper.IterateBondedValidatorsByPower(ctx, func(idx int64, val stakingtypes.ValidatorI) (stop bool) { - if k.GetValidatorStatus(ctx, val.GetOperator()).IsActive { + operator, err := sdk.ValAddressFromBech32(val.GetOperator()) + if err != nil { + return false + } + if k.GetValidatorStatus(ctx, operator).IsActive { result.Validators = append(result.Validators, &types.ActiveValidator{ - Address: val.GetOperator().String(), + Address: val.GetOperator(), Power: val.GetTokens().Uint64(), }) } return false }) + if err != nil { + return nil, err + } return &result, nil } diff --git a/x/oracle/keeper/grpc_query_test.go b/x/oracle/keeper/grpc_query_test.go index 2815b6f9c..9e904a405 100644 --- a/x/oracle/keeper/grpc_query_test.go +++ b/x/oracle/keeper/grpc_query_test.go @@ -1,304 +1,278 @@ package keeper_test import ( + "context" "encoding/hex" - "testing" "time" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/authz" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/x/oracle/keeper" - "github.com/bandprotocol/chain/v2/x/oracle/types" + bandtesting "github.com/bandprotocol/chain/v3/testing" + "github.com/bandprotocol/chain/v3/x/oracle/keeper" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) -type RequestVerificationTestSuite struct { - suite.Suite +// ----------------------------------------- +// --- Test for QueryRequestVerification --- +// ----------------------------------------- - assert *require.Assertions - querier keeper.Querier - request types.Request - - reporterPrivKey cryptotypes.PrivKey - reporterAddr sdk.AccAddress - granteeAddr sdk.AccAddress - - ctx sdk.Context -} - -func (suite *RequestVerificationTestSuite) SetupTest() { - suite.assert = require.New(suite.T()) - app, ctx := bandtesting.CreateTestApp(suite.T(), true) - k := app.OracleKeeper - - suite.querier = keeper.Querier{ - Keeper: k, - } - suite.ctx = ctx - - suite.request = types.NewRequest( - 1, - BasicCalldata, - []sdk.ValAddress{bandtesting.Validators[0].ValAddress}, - 1, - 1, - bandtesting.ParseTime(0), - "", - []types.RawRequest{ - types.NewRawRequest(1, 1, []byte("testdata")), - types.NewRawRequest(2, 2, []byte("testdata")), - types.NewRawRequest(3, 3, []byte("testdata")), - }, - nil, - 0, - ) - suite.reporterPrivKey = secp256k1.GenPrivKey() - suite.reporterAddr = sdk.AccAddress(suite.reporterPrivKey.PubKey().Address()) - suite.granteeAddr = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) - - k.SetRequest(ctx, types.RequestID(1), suite.request) +func (suite *KeeperTestSuite) TestRequestVerificationValid() { + ctx := suite.ctx + querier := suite.queryClient + require := suite.Require() + k := suite.oracleKeeper + k.SetRequest(ctx, types.RequestID(1), defaultRequest()) k.SetRequestCount(ctx, 1) - err := k.GrantReporter(ctx, bandtesting.Validators[0].ValAddress, suite.reporterAddr) - suite.assert.NoError(err) - expiration := ctx.BlockTime().Add(10 * time.Minute) - err = app.AuthzKeeper.SaveGrant(ctx, suite.granteeAddr, sdk.AccAddress(bandtesting.Validators[0].ValAddress), - authz.NewGenericAuthorization("some url"), &expiration, - ) - suite.assert.NoError(err) -} - -func (suite *RequestVerificationTestSuite) TestSuccess() { req := &types.QueryRequestVerificationRequest{ ChainId: suite.ctx.ChainID(), - Validator: bandtesting.Validators[0].ValAddress.String(), + Validator: validators[0].Address.String(), RequestId: 1, ExternalId: 1, DataSourceId: 1, - Reporter: hex.EncodeToString(suite.reporterPrivKey.PubKey().Bytes()), + Reporter: hex.EncodeToString(reporterPubKey.Bytes()), } requestVerification := types.NewRequestVerification( req.ChainId, - bandtesting.Validators[0].ValAddress, + validators[0].Address, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId), types.DataSourceID(req.DataSourceId), ) - signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) - suite.assert.NoError(err) + signature, err := reporterPrivKey.Sign(requestVerification.GetSignBytes()) + require.NoError(err) req.Signature = signature - res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.RequestVerification(context.Background(), req) expectedResult := &types.QueryRequestVerificationResponse{ - ChainId: suite.ctx.ChainID(), - Validator: bandtesting.Validators[0].ValAddress.String(), + ChainId: ctx.ChainID(), + Validator: validators[0].Address.String(), RequestId: 1, ExternalId: 1, DataSourceId: 1, IsDelay: false, } - suite.assert.NoError(err, "RequestVerification should success") - suite.assert.Equal(expectedResult, res, "Expected result should be matched") + require.NoError(err, "RequestVerification should success") + require.Equal(expectedResult, res, "Expected result should be matched") } -func (suite *RequestVerificationTestSuite) TestFailedRequestIDNotExist() { +func (suite *KeeperTestSuite) TestRequestVerificationFailedRequestIDNotExist() { + querier := suite.queryClient + require := suite.Require() + req := &types.QueryRequestVerificationRequest{ ChainId: suite.ctx.ChainID(), - Validator: bandtesting.Validators[0].ValAddress.String(), + Validator: validators[0].Address.String(), RequestId: 2, ExternalId: 1, DataSourceId: 1, - Reporter: hex.EncodeToString(suite.reporterPrivKey.PubKey().Bytes()), + Reporter: hex.EncodeToString(reporterPrivKey.PubKey().Bytes()), } requestVerification := types.NewRequestVerification( req.ChainId, - bandtesting.Validators[0].ValAddress, + validators[0].Address, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId), types.DataSourceID(req.DataSourceId), ) - signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) - suite.assert.NoError(err) + signature, err := reporterPrivKey.Sign(requestVerification.GetSignBytes()) + require.NoError(err) req.Signature = signature - res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.RequestVerification(context.Background(), req) - suite.assert.Contains(err.Error(), "unable to get request from chain", "RequestVerification should failed") - suite.assert.Nil(res, "response should be nil") + require.Contains(err.Error(), "unable to get request from chain", "RequestVerification should failed") + require.Nil(res, "response should be nil") } -func (suite *RequestVerificationTestSuite) TestRequestInDelayRange() { +func (suite *KeeperTestSuite) TestRequestVerificationInDelayRange() { + ctx := suite.ctx + querier := suite.queryClient + require := suite.Require() + req := &types.QueryRequestVerificationRequest{ ChainId: suite.ctx.ChainID(), - Validator: bandtesting.Validators[0].ValAddress.String(), - RequestId: 6, + Validator: validators[0].Address.String(), + RequestId: 5, ExternalId: 1, DataSourceId: 1, - Reporter: hex.EncodeToString(suite.reporterPrivKey.PubKey().Bytes()), + Reporter: hex.EncodeToString(reporterPrivKey.PubKey().Bytes()), MaxDelay: 5, } requestVerification := types.NewRequestVerification( req.ChainId, - bandtesting.Validators[0].ValAddress, + validators[0].Address, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId), types.DataSourceID(req.DataSourceId), ) - signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) - suite.assert.NoError(err) + signature, err := reporterPrivKey.Sign(requestVerification.GetSignBytes()) + require.NoError(err) req.Signature = signature - res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.RequestVerification(context.Background(), req) expectedResult := &types.QueryRequestVerificationResponse{ - ChainId: suite.ctx.ChainID(), - Validator: bandtesting.Validators[0].ValAddress.String(), - RequestId: 6, + ChainId: ctx.ChainID(), + Validator: validators[0].Address.String(), + RequestId: 5, ExternalId: 1, DataSourceId: 1, IsDelay: true, } - suite.assert.NoError(err, "RequestVerification should success") - suite.assert.Equal(expectedResult, res, "Expected result should be matched") + require.NoError(err, "RequestVerification should success") + require.Equal(expectedResult, res, "Expected result should be matched") } -func (suite *RequestVerificationTestSuite) TestFailedExceedDelayRange() { +func (suite *KeeperTestSuite) TestRequestVerificationFailedExceedDelayRange() { + ctx := suite.ctx + querier := suite.queryClient + require := suite.Require() + req := &types.QueryRequestVerificationRequest{ - ChainId: suite.ctx.ChainID(), - Validator: bandtesting.Validators[0].ValAddress.String(), - RequestId: 7, + ChainId: ctx.ChainID(), + Validator: validators[0].Address.String(), + RequestId: 6, ExternalId: 1, DataSourceId: 1, - Reporter: hex.EncodeToString(suite.reporterPrivKey.PubKey().Bytes()), + Reporter: hex.EncodeToString(reporterPrivKey.PubKey().Bytes()), MaxDelay: 5, } requestVerification := types.NewRequestVerification( req.ChainId, - bandtesting.Validators[0].ValAddress, + validators[0].Address, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId), types.DataSourceID(req.DataSourceId), ) - signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) - suite.assert.NoError(err) + signature, err := reporterPrivKey.Sign(requestVerification.GetSignBytes()) + require.NoError(err) req.Signature = signature - res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.RequestVerification(context.Background(), req) - suite.assert.Contains(err.Error(), "unable to get request from chain", "RequestVerification should failed") - suite.assert.Nil(res, "response should be nil") + require.Contains(err.Error(), "unable to get request from chain", "RequestVerification should failed") + require.Nil(res, "response should be nil") } -func (suite *RequestVerificationTestSuite) TestFailedDataSourceIDNotMatch() { +func (suite *KeeperTestSuite) TestRequestVerificationFailedDataSourceIDNotMatch() { + ctx := suite.ctx + querier := suite.queryClient + require := suite.Require() + k := suite.oracleKeeper + k.SetRequest(ctx, types.RequestID(1), defaultRequest()) + k.SetRequestCount(ctx, 1) + req := &types.QueryRequestVerificationRequest{ - ChainId: suite.ctx.ChainID(), - Validator: bandtesting.Validators[0].ValAddress.String(), + ChainId: ctx.ChainID(), + Validator: validators[0].Address.String(), RequestId: 1, ExternalId: 1, DataSourceId: 2, - Reporter: hex.EncodeToString(suite.reporterPrivKey.PubKey().Bytes()), + Reporter: hex.EncodeToString(reporterPrivKey.PubKey().Bytes()), } requestVerification := types.NewRequestVerification( req.ChainId, - bandtesting.Validators[0].ValAddress, + validators[0].Address, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId), types.DataSourceID(req.DataSourceId), ) - signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) - suite.assert.NoError(err) + signature, err := reporterPrivKey.Sign(requestVerification.GetSignBytes()) + require.NoError(err) req.Signature = signature - res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.RequestVerification(context.Background(), req) - suite.assert.Contains( + require.Contains( err.Error(), "is not match with data source id provided in request", "RequestVerification should failed", ) - suite.assert.Nil(res, "response should be nil") + require.Nil(res, "response should be nil") } -func (suite *RequestVerificationTestSuite) TestFailedEmptyRequest() { - res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), nil) - - suite.assert.Contains(err.Error(), "empty request", "RequestVerification should failed") - suite.assert.Nil(res, "response should be nil") -} +func (suite *KeeperTestSuite) TestRequestVerificationFailedChainIDNotMatch() { + querier := suite.queryClient + require := suite.Require() -func (suite *RequestVerificationTestSuite) TestFailedChainIDNotMatch() { req := &types.QueryRequestVerificationRequest{ ChainId: "other-chain-id", - Validator: bandtesting.Validators[0].ValAddress.String(), + Validator: validators[0].Address.String(), RequestId: 1, ExternalId: 1, DataSourceId: 1, - Reporter: hex.EncodeToString(suite.reporterPrivKey.PubKey().Bytes()), + Reporter: hex.EncodeToString(reporterPrivKey.PubKey().Bytes()), } requestVerification := types.NewRequestVerification( req.ChainId, - bandtesting.Validators[0].ValAddress, + validators[0].Address, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId), types.DataSourceID(req.DataSourceId), ) - signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) - suite.assert.NoError(err) + signature, err := reporterPrivKey.Sign(requestVerification.GetSignBytes()) + require.NoError(err) req.Signature = signature - res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.RequestVerification(context.Background(), req) - suite.assert.Contains( + require.Contains( err.Error(), "provided chain ID does not match the validator's chain ID", "RequestVerification should failed", ) - suite.assert.Nil(res, "response should be nil") + require.Nil(res, "response should be nil") } -func (suite *RequestVerificationTestSuite) TestFailedInvalidValidatorAddr() { +func (suite *KeeperTestSuite) TestRequestVerificationFailedInvalidValidatorAddr() { + ctx := suite.ctx + querier := suite.queryClient + require := suite.Require() + req := &types.QueryRequestVerificationRequest{ - ChainId: suite.ctx.ChainID(), + ChainId: ctx.ChainID(), Validator: "someRandomString", RequestId: 1, ExternalId: 1, DataSourceId: 1, - Reporter: hex.EncodeToString(suite.reporterPrivKey.PubKey().Bytes()), + Reporter: hex.EncodeToString(reporterPrivKey.PubKey().Bytes()), } requestVerification := types.NewRequestVerification( req.ChainId, - bandtesting.Validators[0].ValAddress, + validators[0].Address, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId), types.DataSourceID(req.DataSourceId), ) - signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) - suite.assert.NoError(err) + signature, err := reporterPrivKey.Sign(requestVerification.GetSignBytes()) + require.NoError(err) req.Signature = signature - res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.RequestVerification(context.Background(), req) - suite.assert.Contains(err.Error(), "unable to parse validator address", "RequestVerification should failed") - suite.assert.Nil(res, "response should be nil") + require.Contains(err.Error(), "unable to parse validator address", "RequestVerification should failed") + require.Nil(res, "response should be nil") } -func (suite *RequestVerificationTestSuite) TestFailedInvalidReporterPubKey() { +func (suite *KeeperTestSuite) TestRequestVerificationFailedInvalidReporterPubKey() { + ctx := suite.ctx + querier := suite.queryClient + require := suite.Require() + req := &types.QueryRequestVerificationRequest{ - ChainId: suite.ctx.ChainID(), - Validator: bandtesting.Validators[0].ValAddress.String(), + ChainId: ctx.ChainID(), + Validator: validators[0].Address.String(), RequestId: 1, ExternalId: 1, DataSourceId: 1, @@ -307,288 +281,327 @@ func (suite *RequestVerificationTestSuite) TestFailedInvalidReporterPubKey() { requestVerification := types.NewRequestVerification( req.ChainId, - bandtesting.Validators[0].ValAddress, + validators[0].Address, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId), types.DataSourceID(req.DataSourceId), ) - signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) - suite.assert.NoError(err) + signature, err := reporterPrivKey.Sign(requestVerification.GetSignBytes()) + require.NoError(err) req.Signature = signature - res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.RequestVerification(context.Background(), req) - suite.assert.Contains(err.Error(), "unable to get reporter's public key", "RequestVerification should failed") - suite.assert.Nil(res, "response should be nil") + require.Contains(err.Error(), "unable to get reporter's public key", "RequestVerification should failed") + require.Nil(res, "response should be nil") } -func (suite *RequestVerificationTestSuite) TestFailedEmptySignature() { +func (suite *KeeperTestSuite) TestRequestVerificationFailedEmptySignature() { + ctx := suite.ctx + querier := suite.queryClient + require := suite.Require() + req := &types.QueryRequestVerificationRequest{ - ChainId: suite.ctx.ChainID(), - Validator: bandtesting.Validators[0].ValAddress.String(), + ChainId: ctx.ChainID(), + Validator: validators[0].Address.String(), RequestId: 1, ExternalId: 1, - Reporter: hex.EncodeToString(suite.reporterPrivKey.PubKey().Bytes()), + Reporter: hex.EncodeToString(reporterPrivKey.PubKey().Bytes()), } - res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.RequestVerification(context.Background(), req) - suite.assert.Contains(err.Error(), "invalid reporter's signature", "RequestVerification should failed") - suite.assert.Nil(res, "response should be nil") + require.Contains(err.Error(), "invalid reporter's signature", "RequestVerification should failed") + require.Nil(res, "response should be nil") } -func (suite *RequestVerificationTestSuite) TestFailedReporterUnauthorized() { - err := suite.querier.Keeper.RevokeReporter(suite.ctx, bandtesting.Validators[0].ValAddress, suite.reporterAddr) - suite.assert.NoError(err) +func (suite *KeeperTestSuite) TestRequestVerificationFailedReporterUnauthorized() { + ctx := suite.ctx + querier := suite.queryClient + require := suite.Require() req := &types.QueryRequestVerificationRequest{ - ChainId: suite.ctx.ChainID(), - Validator: bandtesting.Validators[0].ValAddress.String(), + ChainId: ctx.ChainID(), + Validator: validators[1].Address.String(), RequestId: 1, ExternalId: 1, DataSourceId: 1, - Reporter: hex.EncodeToString(suite.reporterPrivKey.PubKey().Bytes()), + Reporter: hex.EncodeToString(reporterPrivKey.PubKey().Bytes()), } requestVerification := types.NewRequestVerification( req.ChainId, - bandtesting.Validators[0].ValAddress, + validators[1].Address, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId), types.DataSourceID(req.DataSourceId), ) - signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) - suite.assert.NoError(err) + signature, err := reporterPrivKey.Sign(requestVerification.GetSignBytes()) + require.NoError(err) req.Signature = signature - res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.RequestVerification(context.Background(), req) - suite.assert.Contains(err.Error(), "is not an authorized reporter of", "RequestVerification should failed") - suite.assert.Nil(res, "response should be nil") + require.Contains(err.Error(), "is not an authorized reporter of", "RequestVerification should failed") + require.Nil(res, "response should be nil") } -func (suite *RequestVerificationTestSuite) TestFailedUnselectedValidator() { - suite.request.RequestedValidators = []string{bandtesting.Validators[1].ValAddress.String()} - suite.querier.Keeper.SetRequest(suite.ctx, types.RequestID(1), suite.request) +func (suite *KeeperTestSuite) TestRequestVerificationFailedUnselectedValidator() { + ctx := suite.ctx + querier := suite.queryClient + require := suite.Require() + k := suite.oracleKeeper + + request := defaultRequest() + request.RequestedValidators = []string{validators[1].Address.String()} + + k.SetRequest(ctx, types.RequestID(1), request) + k.SetRequestCount(ctx, 1) req := &types.QueryRequestVerificationRequest{ - ChainId: suite.ctx.ChainID(), - Validator: bandtesting.Validators[0].ValAddress.String(), + ChainId: ctx.ChainID(), + Validator: validators[0].Address.String(), RequestId: 1, ExternalId: 1, DataSourceId: 1, - Reporter: hex.EncodeToString(suite.reporterPrivKey.PubKey().Bytes()), + Reporter: hex.EncodeToString(reporterPrivKey.PubKey().Bytes()), } requestVerification := types.NewRequestVerification( req.ChainId, - bandtesting.Validators[0].ValAddress, + validators[0].Address, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId), types.DataSourceID(req.DataSourceId), ) - signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) - suite.assert.NoError(err) + signature, err := reporterPrivKey.Sign(requestVerification.GetSignBytes()) + require.NoError(err) req.Signature = signature - res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.RequestVerification(context.Background(), req) - suite.assert.Contains(err.Error(), "is not assigned for request ID", "RequestVerification should failed") - suite.assert.Nil(res, "response should be nil") + require.Contains(err.Error(), "is not assigned for request ID", "RequestVerification should failed") + require.Nil(res, "response should be nil") } -func (suite *RequestVerificationTestSuite) TestFailedNoDataSourceFound() { - suite.request.RawRequests = []types.RawRequest{} - suite.querier.Keeper.SetRequest(suite.ctx, types.RequestID(1), suite.request) +func (suite *KeeperTestSuite) TestRequestVerificationFailedNoDataSourceFound() { + ctx := suite.ctx + querier := suite.queryClient + require := suite.Require() + k := suite.oracleKeeper + + request := defaultRequest() + request.RawRequests = []types.RawRequest{} + k.SetRequest(ctx, types.RequestID(1), request) req := &types.QueryRequestVerificationRequest{ - ChainId: suite.ctx.ChainID(), - Validator: bandtesting.Validators[0].ValAddress.String(), + ChainId: ctx.ChainID(), + Validator: validators[0].Address.String(), RequestId: 1, ExternalId: 1, DataSourceId: 1, - Reporter: hex.EncodeToString(suite.reporterPrivKey.PubKey().Bytes()), + Reporter: hex.EncodeToString(reporterPrivKey.PubKey().Bytes()), } requestVerification := types.NewRequestVerification( req.ChainId, - bandtesting.Validators[0].ValAddress, + validators[0].Address, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId), types.DataSourceID(req.DataSourceId), ) - signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) - suite.assert.NoError(err) + signature, err := reporterPrivKey.Sign(requestVerification.GetSignBytes()) + require.NoError(err) req.Signature = signature - res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.RequestVerification(context.Background(), req) - suite.assert.Contains(err.Error(), "no data source required by the request", "RequestVerification should failed") - suite.assert.Nil(res, "response should be nil") + require.Contains(err.Error(), "no data source required by the request", "RequestVerification should failed") + require.Nil(res, "response should be nil") } -func (suite *RequestVerificationTestSuite) TestFailedValidatorAlreadyReported() { - err := suite.querier.Keeper.AddReport( - suite.ctx, +func (suite *KeeperTestSuite) TestRequestVerificationFailedValidatorAlreadyReported() { + ctx := suite.ctx + querier := suite.queryClient + require := suite.Require() + k := suite.oracleKeeper + k.SetRequest(ctx, types.RequestID(1), defaultRequest()) + k.SetRequestCount(ctx, 1) + + err := k.AddReport( + ctx, types.RequestID(1), - bandtesting.Validators[0].ValAddress, true, []types.RawReport{ + validators[0].Address, true, []types.RawReport{ types.NewRawReport(1, 0, []byte("testdata")), types.NewRawReport(2, 0, []byte("testdata")), types.NewRawReport(3, 0, []byte("testdata")), }, ) - suite.assert.NoError(err) + require.NoError(err) req := &types.QueryRequestVerificationRequest{ - ChainId: suite.ctx.ChainID(), - Validator: bandtesting.Validators[0].ValAddress.String(), + ChainId: ctx.ChainID(), + Validator: validators[0].Address.String(), RequestId: 1, ExternalId: 1, DataSourceId: 1, - Reporter: hex.EncodeToString(suite.reporterPrivKey.PubKey().Bytes()), + Reporter: hex.EncodeToString(reporterPrivKey.PubKey().Bytes()), } requestVerification := types.NewRequestVerification( req.ChainId, - bandtesting.Validators[0].ValAddress, + validators[0].Address, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId), types.DataSourceID(req.DataSourceId), ) - signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) - suite.assert.NoError(err) + signature, err := reporterPrivKey.Sign(requestVerification.GetSignBytes()) + require.NoError(err) req.Signature = signature - res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.RequestVerification(context.Background(), req) - suite.assert.Contains(err.Error(), "already submitted data report", "RequestVerification should failed") - suite.assert.Nil(res, "response should be nil") + require.Contains(err.Error(), "already submitted data report", "RequestVerification should failed") + require.Nil(res, "response should be nil") } -func (suite *RequestVerificationTestSuite) TestFailedRequestAlreadyExpired() { +func (suite *KeeperTestSuite) TestRequestVerificationFailedRequestAlreadyExpired() { + ctx := suite.ctx + require := suite.Require() + k := suite.oracleKeeper + k.SetRequest(ctx, types.RequestID(1), defaultRequest()) + k.SetRequestCount(ctx, 1) + + ctx = ctx.WithBlockHeight(1000) + encCfg := moduletestutil.MakeTestEncodingConfig() + queryHelper := baseapp.NewQueryServerTestHelper(ctx, encCfg.InterfaceRegistry) + types.RegisterQueryServer(queryHelper, keeper.Querier{ + Keeper: suite.oracleKeeper, + }) + querier := types.NewQueryClient(queryHelper) + req := &types.QueryRequestVerificationRequest{ - ChainId: suite.ctx.ChainID(), - Validator: bandtesting.Validators[0].ValAddress.String(), + ChainId: ctx.ChainID(), + Validator: validators[0].Address.String(), RequestId: 1, ExternalId: 1, DataSourceId: 1, - Reporter: hex.EncodeToString(suite.reporterPrivKey.PubKey().Bytes()), + Reporter: hex.EncodeToString(reporterPrivKey.PubKey().Bytes()), } - suite.ctx = suite.ctx.WithBlockHeight(1000) - requestVerification := types.NewRequestVerification( req.ChainId, - bandtesting.Validators[0].ValAddress, + validators[0].Address, types.RequestID(req.RequestId), types.ExternalID(req.ExternalId), types.DataSourceID(req.DataSourceId), ) - signature, err := suite.reporterPrivKey.Sign(requestVerification.GetSignBytes()) - suite.assert.NoError(err) + signature, err := reporterPrivKey.Sign(requestVerification.GetSignBytes()) + require.NoError(err) req.Signature = signature - res, err := suite.querier.RequestVerification(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.RequestVerification(ctx, req) - suite.assert.Contains(err.Error(), "Request with ID 1 is already expired", "RequestVerification should failed") - suite.assert.Nil(res, "response should be nil") + require.Contains(err.Error(), "Request with ID 1 is already expired", "RequestVerification should failed") + require.Nil(res, "response should be nil") } -func (suite *RequestVerificationTestSuite) TestGetReporters() { +// ------------------------------ +// --- Test for QueryReporters -- +// ------------------------------ + +func (suite *KeeperTestSuite) TestGetReporters() { + querier := suite.queryClient + require := suite.Require() + req := &types.QueryReportersRequest{ - ValidatorAddress: bandtesting.Validators[0].ValAddress.String(), + ValidatorAddress: validators[0].Address.String(), } - res, err := suite.querier.Reporters(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.Reporters(context.Background(), req) expectedResult := &types.QueryReportersResponse{ - Reporter: []string{suite.reporterAddr.String()}, + Reporter: []string{reporterAddr.String()}, } - suite.assert.NoError(err, "Reporters should success") - suite.assert.Equal(expectedResult, res, "Expected result should be matched") + require.NoError(err, "Reporters should success") + require.Equal(expectedResult, res, "Expected result should be matched") } -func (suite *RequestVerificationTestSuite) TestGetExpiredReporters() { - suite.ctx = suite.ctx.WithBlockTime(suite.ctx.BlockTime().Add(10 * time.Minute)) +func (suite *KeeperTestSuite) TestGetExpiredReporters() { + ctx := suite.ctx + require := suite.Require() + + ctx = ctx.WithBlockTime(ctx.BlockTime().Add(10 * time.Minute)) + encCfg := moduletestutil.MakeTestEncodingConfig() + queryHelper := baseapp.NewQueryServerTestHelper(ctx, encCfg.InterfaceRegistry) + types.RegisterQueryServer(queryHelper, keeper.Querier{ + Keeper: suite.oracleKeeper, + }) + querier := types.NewQueryClient(queryHelper) + req := &types.QueryReportersRequest{ - ValidatorAddress: bandtesting.Validators[0].ValAddress.String(), + ValidatorAddress: validators[0].Address.String(), } - res, err := suite.querier.Reporters(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.Reporters(ctx, req) expectedResult := &types.QueryReportersResponse{ - Reporter: []string{}, + Reporter: []string(nil), } - suite.assert.NoError(err, "Reporters should success") - suite.assert.Equal(expectedResult, res, "Expected result should be matched") + require.NoError(err, "Reporters should success") + require.Equal(expectedResult, res, "Expected result should be matched") } -func (suite *RequestVerificationTestSuite) TestIsReporter() { +// ------------------------------- +// --- Test for QueryIsReporter -- +// ------------------------------- + +func (suite *KeeperTestSuite) TestIsReporter() { + querier := suite.queryClient + require := suite.Require() + req := &types.QueryIsReporterRequest{ - ValidatorAddress: bandtesting.Validators[0].ValAddress.String(), - ReporterAddress: suite.reporterAddr.String(), + ValidatorAddress: validators[0].Address.String(), + ReporterAddress: reporterAddr.String(), } - res, err := suite.querier.IsReporter(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.IsReporter(context.Background(), req) expectedResult := &types.QueryIsReporterResponse{ IsReporter: true, } - suite.assert.NoError(err, "IsReporter should success") - suite.assert.Equal(expectedResult, res, "Expected result should be matched") + require.NoError(err, "IsReporter should success") + require.Equal(expectedResult, res, "Expected result should be matched") } -func (suite *RequestVerificationTestSuite) TestIsNotReporter() { +func (suite *KeeperTestSuite) TestIsNotReporter() { + querier := suite.queryClient + require := suite.Require() + req := &types.QueryIsReporterRequest{ - ValidatorAddress: bandtesting.Validators[0].ValAddress.String(), - ReporterAddress: suite.granteeAddr.String(), + ValidatorAddress: validators[1].Address.String(), + ReporterAddress: reporterAddr.String(), } - res, err := suite.querier.IsReporter(sdk.WrapSDKContext(suite.ctx), req) + res, err := querier.IsReporter(context.Background(), req) expectedResult := &types.QueryIsReporterResponse{ IsReporter: false, } - suite.assert.NoError(err, "IsReporter should success") - suite.assert.Equal(expectedResult, res, "Expected result should be matched") -} - -func (suite *RequestVerificationTestSuite) TestRevokeReporters() { - err := suite.querier.Keeper.RevokeReporter(suite.ctx, bandtesting.Validators[0].ValAddress, suite.reporterAddr) - suite.assert.NoError(err) - req := &types.QueryReportersRequest{ - ValidatorAddress: bandtesting.Validators[0].ValAddress.String(), - } - res, err := suite.querier.Reporters(sdk.WrapSDKContext(suite.ctx), req) - - expectedResult := &types.QueryReportersResponse{ - Reporter: []string{}, - } - suite.assert.NoError(err, "Reporters should success") - suite.assert.Equal(expectedResult, res, "Expected result should be matched") + require.NoError(err, "IsReporter should success") + require.Equal(expectedResult, res, "Expected result should be matched") } -type PendingRequestsTestSuite struct { - suite.Suite +// ------------------------------------ +// --- Test for QueryPendingRequests -- +// ------------------------------------ - assert *require.Assertions - querier keeper.Querier +func (suite *KeeperTestSuite) TestPendingRequestsSuccess() { + ctx := suite.ctx + querier := suite.queryClient + require := suite.Require() + k := suite.oracleKeeper - ctx sdk.Context -} - -func (suite *PendingRequestsTestSuite) SetupTest() { - suite.assert = require.New(suite.T()) - app, ctx := bandtesting.CreateTestApp(suite.T(), true) - k := app.OracleKeeper - - suite.querier = keeper.Querier{ - Keeper: k, - } - suite.ctx = ctx -} - -func (suite *PendingRequestsTestSuite) TestSuccess() { assignedButPendingReq := types.NewRequest( 1, - BasicCalldata, - []sdk.ValAddress{bandtesting.Validators[0].ValAddress}, + basicCalldata, + []sdk.ValAddress{validators[0].Address}, 1, 1, bandtesting.ParseTime(0), @@ -603,8 +616,8 @@ func (suite *PendingRequestsTestSuite) TestSuccess() { ) notBeAssignedReq := types.NewRequest( 1, - BasicCalldata, - []sdk.ValAddress{bandtesting.Validators[1].ValAddress}, + basicCalldata, + []sdk.ValAddress{validators[1].Address}, 1, 1, bandtesting.ParseTime(0), @@ -619,10 +632,10 @@ func (suite *PendingRequestsTestSuite) TestSuccess() { ) alreadyReportAllReq := types.NewRequest( 1, - BasicCalldata, + basicCalldata, []sdk.ValAddress{ - bandtesting.Validators[0].ValAddress, - bandtesting.Validators[1].ValAddress, + validators[0].Address, + validators[1].Address, }, 1, 1, @@ -638,10 +651,10 @@ func (suite *PendingRequestsTestSuite) TestSuccess() { ) assignedButReportedReq := types.NewRequest( 1, - BasicCalldata, + basicCalldata, []sdk.ValAddress{ - bandtesting.Validators[0].ValAddress, - bandtesting.Validators[1].ValAddress, + validators[0].Address, + validators[1].Address, }, 1, 1, @@ -656,52 +669,44 @@ func (suite *PendingRequestsTestSuite) TestSuccess() { 0, ) - suite.querier.Keeper.SetRequest(suite.ctx, types.RequestID(3), assignedButPendingReq) - suite.querier.Keeper.SetRequest(suite.ctx, types.RequestID(4), notBeAssignedReq) - suite.querier.Keeper.SetRequest(suite.ctx, types.RequestID(5), alreadyReportAllReq) - suite.querier.Keeper.SetRequest(suite.ctx, types.RequestID(6), assignedButReportedReq) - suite.querier.Keeper.SetRequestCount(suite.ctx, 4) - suite.querier.Keeper.SetRequestLastExpired(suite.ctx, 2) - suite.querier.Keeper.SetReport( - suite.ctx, + k.SetRequest(ctx, types.RequestID(3), assignedButPendingReq) + k.SetRequest(ctx, types.RequestID(4), notBeAssignedReq) + k.SetRequest(ctx, types.RequestID(5), alreadyReportAllReq) + k.SetRequest(ctx, types.RequestID(6), assignedButReportedReq) + k.SetRequestCount(ctx, 4) + k.SetRequestLastExpired(ctx, 2) + k.SetReport( + ctx, 5, - types.NewReport(bandtesting.Validators[0].ValAddress, true, []types.RawReport{ + types.NewReport(validators[0].Address, true, []types.RawReport{ types.NewRawReport(1, 0, []byte("testdata")), types.NewRawReport(2, 0, []byte("testdata")), types.NewRawReport(3, 0, []byte("testdata")), }), ) - suite.querier.Keeper.SetReport( - suite.ctx, + k.SetReport( + ctx, 5, - types.NewReport(bandtesting.Validators[1].ValAddress, true, []types.RawReport{ + types.NewReport(validators[1].Address, true, []types.RawReport{ types.NewRawReport(1, 0, []byte("testdata")), types.NewRawReport(2, 0, []byte("testdata")), types.NewRawReport(3, 0, []byte("testdata")), }), ) - suite.querier.Keeper.SetReport( - suite.ctx, + k.SetReport( + ctx, 6, - types.NewReport(bandtesting.Validators[0].ValAddress, true, []types.RawReport{ + types.NewReport(validators[0].Address, true, []types.RawReport{ types.NewRawReport(1, 0, []byte("testdata")), types.NewRawReport(2, 0, []byte("testdata")), types.NewRawReport(3, 0, []byte("testdata")), }), ) - r, err := suite.querier.PendingRequests(sdk.WrapSDKContext(suite.ctx), &types.QueryPendingRequestsRequest{ - ValidatorAddress: sdk.ValAddress(bandtesting.Validators[0].Address).String(), + r, err := querier.PendingRequests(context.Background(), &types.QueryPendingRequestsRequest{ + ValidatorAddress: sdk.ValAddress(sdk.AccAddress(validators[0].Address)).String(), }) - suite.assert.Equal(&types.QueryPendingRequestsResponse{RequestIDs: []uint64{3}}, r) - suite.assert.NoError(err) -} - -func TestRequestVerification(t *testing.T) { - suite.Run(t, new(RequestVerificationTestSuite)) -} - -func TestPendingRequests(t *testing.T) { - suite.Run(t, new(PendingRequestsTestSuite)) + require.Equal(&types.QueryPendingRequestsResponse{RequestIDs: []uint64{3}}, r) + require.NoError(err) } diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index de7486e08..de605f612 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -5,18 +5,22 @@ import ( "fmt" "time" - owasm "github.com/bandprotocol/go-owasm/api" - "github.com/cometbft/cometbft/libs/log" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" + + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - "github.com/bandprotocol/chain/v2/pkg/filecache" - "github.com/bandprotocol/chain/v2/x/oracle/types" + owasm "github.com/bandprotocol/go-owasm/api" + + "github.com/bandprotocol/chain/v3/pkg/filecache" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) const ( @@ -35,7 +39,7 @@ type Keeper struct { stakingKeeper types.StakingKeeper distrKeeper types.DistrKeeper authzKeeper types.AuthzKeeper - channelKeeper types.ChannelKeeper + ics4Wrapper porttypes.ICS4Wrapper portKeeper types.PortKeeper scopedKeeper capabilitykeeper.ScopedKeeper @@ -55,7 +59,7 @@ func NewKeeper( stakingKeeper types.StakingKeeper, distrKeeper types.DistrKeeper, authzKeeper types.AuthzKeeper, - channelKeeper types.ChannelKeeper, + ics4Wrapper porttypes.ICS4Wrapper, portKeeper types.PortKeeper, scopeKeeper capabilitykeeper.ScopedKeeper, owasmVM *owasm.Vm, @@ -72,7 +76,7 @@ func NewKeeper( stakingKeeper: stakingKeeper, distrKeeper: distrKeeper, authzKeeper: authzKeeper, - channelKeeper: channelKeeper, + ics4Wrapper: ics4Wrapper, portKeeper: portKeeper, scopedKeeper: scopeKeeper, authority: authority, diff --git a/x/oracle/keeper/keeper_test.go b/x/oracle/keeper/keeper_test.go index 4f619c8d5..e5a23de25 100644 --- a/x/oracle/keeper/keeper_test.go +++ b/x/oracle/keeper/keeper_test.go @@ -1,89 +1,246 @@ package keeper_test import ( + "path/filepath" "testing" + "time" - "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/x/oracle/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttime "github.com/cometbft/cometbft/types/time" + + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/baseapp" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/authz" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + owasm "github.com/bandprotocol/go-owasm/api" + + bandtesting "github.com/bandprotocol/chain/v3/testing" + "github.com/bandprotocol/chain/v3/x/oracle/keeper" + oracletestutil "github.com/bandprotocol/chain/v3/x/oracle/testutil" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) -func TestGetSetRequestCount(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +type KeeperTestSuite struct { + suite.Suite + + ctx sdk.Context + oracleKeeper keeper.Keeper + authKeeper *oracletestutil.MockAccountKeeper + bankKeeper *oracletestutil.MockBankKeeper + stakingKeeper *oracletestutil.MockStakingKeeper + distrKeeper *oracletestutil.MockDistrKeeper + authzKeeper *oracletestutil.MockAuthzKeeper + + queryClient types.QueryClient + msgServer types.MsgServer + + homeDir string + fileDir string + + encCfg moduletestutil.TestEncodingConfig +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} + +func (suite *KeeperTestSuite) SetupTest() { + key := storetypes.NewKVStoreKey(types.StoreKey) + testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test")) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: cmttime.Now()}) + encCfg := moduletestutil.MakeTestEncodingConfig() + + // gomock initializations + ctrl := gomock.NewController(suite.T()) + suite.authKeeper = oracletestutil.NewMockAccountKeeper(ctrl) + suite.bankKeeper = oracletestutil.NewMockBankKeeper(ctrl) + suite.stakingKeeper = oracletestutil.NewMockStakingKeeper(ctrl) + suite.distrKeeper = oracletestutil.NewMockDistrKeeper(ctrl) + suite.authzKeeper = oracletestutil.NewMockAuthzKeeper(ctrl) + + suite.homeDir = testutil.GetTempDir(suite.T()) + suite.fileDir = filepath.Join(suite.homeDir, "files") + + owasmVM, err := owasm.NewVm(100) + suite.Require().NoError(err) + + suite.ctx = ctx + suite.oracleKeeper = keeper.NewKeeper( + encCfg.Codec, + key, + suite.fileDir, + authtypes.FeeCollectorName, + suite.authKeeper, + suite.bankKeeper, + suite.stakingKeeper, + suite.distrKeeper, + suite.authzKeeper, + nil, + nil, + capabilitykeeper.ScopedKeeper{}, + owasmVM, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + suite.oracleKeeper.SetRequestCount(ctx, 0) + suite.oracleKeeper.SetDataSourceCount(ctx, 0) + suite.oracleKeeper.SetOracleScriptCount(ctx, 0) + suite.oracleKeeper.SetRequestLastExpired(ctx, 0) + + err = suite.oracleKeeper.SetParams(ctx, types.DefaultParams()) + suite.Require().NoError(err) + + queryHelper := baseapp.NewQueryServerTestHelper(ctx, encCfg.InterfaceRegistry) + types.RegisterQueryServer(queryHelper, keeper.Querier{ + Keeper: suite.oracleKeeper, + }) + suite.queryClient = types.NewQueryClient(queryHelper) + + suite.authzKeeper.EXPECT(). + GetAuthorization(gomock.Any(), reporterAddr, sdk.AccAddress(validators[0].Address), sdk.MsgTypeURL(&types.MsgReportData{})). + Return(authz.NewGenericAuthorization(sdk.MsgTypeURL(&types.MsgReportData{})), nil). + AnyTimes() + suite.authzKeeper.EXPECT(). + GetAuthorization(gomock.Any(), reporterAddr, sdk.AccAddress(validators[1].Address), sdk.MsgTypeURL(&types.MsgReportData{})). + Return(nil, nil). + AnyTimes() + + authorization, err := codectypes.NewAnyWithValue( + authz.NewGenericAuthorization(sdk.MsgTypeURL(&types.MsgReportData{})), + ) + suite.Require().NoError(err) + expiration := ctx.BlockTime().Add(time.Minute) + suite.authzKeeper.EXPECT(). + GranterGrants(gomock.Any(), &authz.QueryGranterGrantsRequest{ + Granter: sdk.AccAddress(validators[0].Address).String(), + }). + Return(&authz.QueryGranterGrantsResponse{ + Grants: []*authz.GrantAuthorization{ + { + Granter: sdk.AccAddress(validators[0].Address).String(), + Grantee: reporterAddr.String(), + Authorization: authorization, + Expiration: &expiration, + }, + }, + }, nil). + AnyTimes() + + dataSources := bandtesting.GenerateDataSources(suite.homeDir) + for _, dataSource := range dataSources { + suite.oracleKeeper.AddDataSource(suite.ctx, dataSource) + } + + oracleScripts := bandtesting.GenerateOracleScripts(suite.homeDir) + for _, script := range oracleScripts { + suite.oracleKeeper.AddOracleScript(suite.ctx, script) + } +} + +func (suite *KeeperTestSuite) activeAllValidators() { + ctx := suite.ctx + k := suite.oracleKeeper + + for _, v := range validators { + err := k.Activate(ctx, v.Address) + suite.Require().NoError(err) + } +} +func (suite *KeeperTestSuite) TestGetSetRequestCount() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // Initially request count must be 0. - require.Equal(t, uint64(0), k.GetRequestCount(ctx)) + require.Equal(uint64(0), k.GetRequestCount(ctx)) // After we set the count manually, it should be reflected. - k.SetRequestCount(ctx, 42) - require.Equal(t, uint64(42), k.GetRequestCount(ctx)) + k.SetRequestCount(suite.ctx, 42) + require.Equal(uint64(42), k.GetRequestCount(ctx)) } -func TestGetDataSourceCount(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestGetDataSourceCount() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() k.SetDataSourceCount(ctx, 42) - require.Equal(t, uint64(42), k.GetDataSourceCount(ctx)) + require.Equal(uint64(42), k.GetDataSourceCount(ctx)) } -func TestGetSetOracleScriptCount(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestGetSetOracleScriptCount() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() k.SetOracleScriptCount(ctx, 42) - require.Equal(t, uint64(42), k.GetOracleScriptCount(ctx)) + require.Equal(uint64(42), k.GetOracleScriptCount(ctx)) } -func TestGetSetRollingSeed(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestGetSetRollingSeed() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() k.SetRollingSeed(ctx, []byte("HELLO_WORLD")) - require.Equal(t, []byte("HELLO_WORLD"), k.GetRollingSeed(ctx)) + require.Equal([]byte("HELLO_WORLD"), k.GetRollingSeed(ctx)) } -func TestGetNextRequestID(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestGetNextRequestID() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // First request id must be 1. - require.Equal(t, types.RequestID(1), k.GetNextRequestID(ctx)) + require.Equal(types.RequestID(1), k.GetNextRequestID(ctx)) // After we add new requests, the request count must increase accordingly. - require.Equal(t, uint64(1), k.GetRequestCount(ctx)) - require.Equal(t, types.RequestID(2), k.GetNextRequestID(ctx)) - require.Equal(t, types.RequestID(3), k.GetNextRequestID(ctx)) - require.Equal(t, types.RequestID(4), k.GetNextRequestID(ctx)) - require.Equal(t, uint64(4), k.GetRequestCount(ctx)) + require.Equal(uint64(1), k.GetRequestCount(ctx)) + require.Equal(types.RequestID(2), k.GetNextRequestID(ctx)) + require.Equal(types.RequestID(3), k.GetNextRequestID(ctx)) + require.Equal(types.RequestID(4), k.GetNextRequestID(ctx)) + require.Equal(uint64(4), k.GetRequestCount(ctx)) } -func TestGetNextDataSourceID(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestGetNextDataSourceID() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() initialID := k.GetDataSourceCount(ctx) - require.Equal(t, types.DataSourceID(initialID+1), k.GetNextDataSourceID(ctx)) - require.Equal(t, types.DataSourceID(initialID+2), k.GetNextDataSourceID(ctx)) - require.Equal(t, types.DataSourceID(initialID+3), k.GetNextDataSourceID(ctx)) + require.Equal(types.DataSourceID(initialID+1), k.GetNextDataSourceID(ctx)) + require.Equal(types.DataSourceID(initialID+2), k.GetNextDataSourceID(ctx)) + require.Equal(types.DataSourceID(initialID+3), k.GetNextDataSourceID(ctx)) } -func TestGetNextOracleScriptID(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestGetNextOracleScriptID() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() initialID := k.GetOracleScriptCount(ctx) - require.Equal(t, types.OracleScriptID(initialID+1), k.GetNextOracleScriptID(ctx)) - require.Equal(t, types.OracleScriptID(initialID+2), k.GetNextOracleScriptID(ctx)) - require.Equal(t, types.OracleScriptID(initialID+3), k.GetNextOracleScriptID(ctx)) + require.Equal(types.OracleScriptID(initialID+1), k.GetNextOracleScriptID(ctx)) + require.Equal(types.OracleScriptID(initialID+2), k.GetNextOracleScriptID(ctx)) + require.Equal(types.OracleScriptID(initialID+3), k.GetNextOracleScriptID(ctx)) } -func TestGetSetRequestLastExpiredID(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestGetSetRequestLastExpiredID() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // Initially last expired request must be 0. - require.Equal(t, types.RequestID(0), k.GetRequestLastExpired(ctx)) + require.Equal(types.RequestID(0), k.GetRequestLastExpired(ctx)) k.SetRequestLastExpired(ctx, 20) - require.Equal(t, types.RequestID(20), k.GetRequestLastExpired(ctx)) + require.Equal(types.RequestID(20), k.GetRequestLastExpired(ctx)) } diff --git a/x/oracle/keeper/migrator.go b/x/oracle/keeper/migrator.go index d04022e1a..1f49abec9 100644 --- a/x/oracle/keeper/migrator.go +++ b/x/oracle/keeper/migrator.go @@ -3,8 +3,8 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/oracle/exported" - v2 "github.com/bandprotocol/chain/v2/x/oracle/migrations/v2" + "github.com/bandprotocol/chain/v3/x/oracle/exported" + v2 "github.com/bandprotocol/chain/v3/x/oracle/migrations/v2" ) // Migrator is a struct for handling in-place state migrations. diff --git a/x/oracle/keeper/modify.go b/x/oracle/keeper/modify.go index 812df9183..b52670606 100644 --- a/x/oracle/keeper/modify.go +++ b/x/oracle/keeper/modify.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // modify returns new value if it is not `DoNotModify`. Returns old value otherwise diff --git a/x/oracle/keeper/msg_server.go b/x/oracle/keeper/msg_server.go index 24a3f3a2f..e9d2545d8 100644 --- a/x/oracle/keeper/msg_server.go +++ b/x/oracle/keeper/msg_server.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/bandprotocol/chain/v2/pkg/gzip" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/pkg/gzip" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) type msgServer struct { @@ -96,7 +96,7 @@ func (k msgServer) CreateDataSource( var err error msg.Executable, err = gzip.Uncompress(msg.Executable, types.MaxExecutableSize) if err != nil { - return nil, types.ErrUncompressionFailed.Wrapf(err.Error()) + return nil, types.ErrUncompressionFailed.Wrap(err.Error()) } } @@ -157,7 +157,7 @@ func (k msgServer) EditDataSource( if gzip.IsGzipped(msg.Executable) { msg.Executable, err = gzip.Uncompress(msg.Executable, types.MaxExecutableSize) if err != nil { - return nil, types.ErrUncompressionFailed.Wrapf(err.Error()) + return nil, types.ErrUncompressionFailed.Wrap(err.Error()) } } @@ -190,7 +190,7 @@ func (k msgServer) CreateOracleScript( var err error msg.Code, err = gzip.Uncompress(msg.Code, types.MaxWasmCodeSize) if err != nil { - return nil, types.ErrUncompressionFailed.Wrapf(err.Error()) + return nil, types.ErrUncompressionFailed.Wrap(err.Error()) } } @@ -246,7 +246,7 @@ func (k msgServer) EditOracleScript( if gzip.IsGzipped(msg.Code) { msg.Code, err = gzip.Uncompress(msg.Code, types.MaxWasmCodeSize) if err != nil { - return nil, types.ErrUncompressionFailed.Wrapf(err.Error()) + return nil, types.ErrUncompressionFailed.Wrap(err.Error()) } } diff --git a/x/oracle/keeper/oracle_script.go b/x/oracle/keeper/oracle_script.go index b9269397f..c7980b6de 100644 --- a/x/oracle/keeper/oracle_script.go +++ b/x/oracle/keeper/oracle_script.go @@ -3,9 +3,11 @@ package keeper import ( "bytes" + storetypes "cosmossdk.io/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // HasOracleScript checks if the oracle script of this ID exists in the storage. @@ -61,7 +63,7 @@ func (k Keeper) MustEditOracleScript(ctx sdk.Context, id types.OracleScriptID, n // GetAllOracleScripts returns the list of all oracle scripts in the store, or nil if there is none. func (k Keeper) GetAllOracleScripts(ctx sdk.Context) (oracleScripts []types.OracleScript) { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.OracleScriptStoreKeyPrefix) + iterator := storetypes.KVStorePrefixIterator(store, types.OracleScriptStoreKeyPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { var oracleScript types.OracleScript diff --git a/x/oracle/keeper/oracle_script_test.go b/x/oracle/keeper/oracle_script_test.go index 96e809101..a818058eb 100644 --- a/x/oracle/keeper/oracle_script_test.go +++ b/x/oracle/keeper/oracle_script_test.go @@ -1,97 +1,98 @@ package keeper_test import ( - "testing" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/testing/testdata" - "github.com/bandprotocol/chain/v2/x/oracle/types" + bandtesting "github.com/bandprotocol/chain/v3/testing" + "github.com/bandprotocol/chain/v3/testing/testdata" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) -func TestHasOracleScript(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestHasOracleScript() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // We should not have a oracle script ID 42 without setting it. - require.False(t, k.HasOracleScript(ctx, 42)) + require.False(k.HasOracleScript(ctx, 42)) // After we set it, we should be able to find it. k.SetOracleScript(ctx, 42, types.NewOracleScript( - bandtesting.Owner.Address, BasicName, BasicDesc, BasicFilename, BasicSchema, BasicSourceCodeURL, + bandtesting.Owner.Address, basicName, basicDesc, basicFilename, basicSchema, basicSourceCodeURL, )) - require.True(t, k.HasOracleScript(ctx, 42)) + require.True(k.HasOracleScript(ctx, 42)) } -func TestSetterGetterOracleScript(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestSetterGetterOracleScript() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // Getting a non-existent oracle script should return error. _, err := k.GetOracleScript(ctx, 42) - require.ErrorIs(t, err, types.ErrOracleScriptNotFound) - require.Panics(t, func() { _ = k.MustGetOracleScript(ctx, 42) }) + require.ErrorIs(err, types.ErrOracleScriptNotFound) + require.Panics(func() { _ = k.MustGetOracleScript(ctx, 42) }) // Creates some basic oracle scripts. oracleScript1 := types.NewOracleScript( - bandtesting.Alice.Address, "NAME1", "DESCRIPTION1", "FILENAME1", BasicSchema, BasicSourceCodeURL, + bandtesting.Alice.Address, "NAME1", "DESCRIPTION1", "FILENAME1", basicSchema, basicSourceCodeURL, ) oracleScript2 := types.NewOracleScript( - bandtesting.Bob.Address, "NAME2", "DESCRIPTION2", "FILENAME2", BasicSchema, BasicSourceCodeURL, + bandtesting.Bob.Address, "NAME2", "DESCRIPTION2", "FILENAME2", basicSchema, basicSourceCodeURL, ) // Sets id 42 with oracle script 1 and id 42 with oracle script 2. k.SetOracleScript(ctx, 42, oracleScript1) k.SetOracleScript(ctx, 43, oracleScript2) // Checks that Get and MustGet perform correctly. oracleScript1Res, err := k.GetOracleScript(ctx, 42) - require.Nil(t, err) - require.Equal(t, oracleScript1, oracleScript1Res) - require.Equal(t, oracleScript1, k.MustGetOracleScript(ctx, 42)) + require.Nil(err) + require.Equal(oracleScript1, oracleScript1Res) + require.Equal(oracleScript1, k.MustGetOracleScript(ctx, 42)) oracleScript2Res, err := k.GetOracleScript(ctx, 43) - require.Nil(t, err) - require.Equal(t, oracleScript2, oracleScript2Res) - require.Equal(t, oracleScript2, k.MustGetOracleScript(ctx, 43)) + require.Nil(err) + require.Equal(oracleScript2, oracleScript2Res) + require.Equal(oracleScript2, k.MustGetOracleScript(ctx, 43)) // Replaces id 42 with another oracle script. k.SetOracleScript(ctx, 42, oracleScript2) - require.NotEqual(t, oracleScript1, k.MustGetOracleScript(ctx, 42)) - require.Equal(t, oracleScript2, k.MustGetOracleScript(ctx, 42)) + require.NotEqual(oracleScript1, k.MustGetOracleScript(ctx, 42)) + require.Equal(oracleScript2, k.MustGetOracleScript(ctx, 42)) } -func TestAddEditOracleScriptBasic(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestAddEditOracleScriptBasic() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // Creates some basic oracle scripts. oracleScript1 := types.NewOracleScript( - bandtesting.Alice.Address, "NAME1", "DESCRIPTION1", "FILENAME1", BasicSchema, BasicSourceCodeURL, + bandtesting.Alice.Address, "NAME1", "DESCRIPTION1", "FILENAME1", basicSchema, basicSourceCodeURL, ) oracleScript2 := types.NewOracleScript( - bandtesting.Bob.Address, "NAME2", "DESCRIPTION2", "FILENAME2", BasicSchema, BasicSourceCodeURL, + bandtesting.Bob.Address, "NAME2", "DESCRIPTION2", "FILENAME2", basicSchema, basicSourceCodeURL, ) // Adds a new oracle script to the store. We should be able to retrieve it back. id := k.AddOracleScript(ctx, oracleScript1) - require.Equal(t, oracleScript1, k.MustGetOracleScript(ctx, id)) - require.NotEqual(t, oracleScript2, k.MustGetOracleScript(ctx, id)) + require.Equal(oracleScript1, k.MustGetOracleScript(ctx, id)) + require.NotEqual(oracleScript2, k.MustGetOracleScript(ctx, id)) // Edits the oracle script. We should get the updated oracle script. owner, err := sdk.AccAddressFromBech32(oracleScript2.Owner) - require.NoError(t, err) - require.NotPanics(t, func() { + require.NoError(err) + require.NotPanics(func() { k.MustEditOracleScript(ctx, id, types.NewOracleScript( owner, oracleScript2.Name, oracleScript2.Description, oracleScript2.Filename, oracleScript2.Schema, oracleScript2.SourceCodeURL, )) }) - require.NotEqual(t, oracleScript1, k.MustGetOracleScript(ctx, id)) - require.Equal(t, oracleScript2, k.MustGetOracleScript(ctx, id)) + require.NotEqual(oracleScript1, k.MustGetOracleScript(ctx, id)) + require.Equal(oracleScript2, k.MustGetOracleScript(ctx, id)) } -func TestAddEditOracleScriptDoNotModify(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestAddEditOracleScriptDoNotModify() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // Creates some basic oracle scripts. oracleScript1 := types.NewOracleScript( - bandtesting.Alice.Address, "NAME1", "DESCRIPTION1", "FILENAME1", BasicSchema, BasicSourceCodeURL, + bandtesting.Alice.Address, "NAME1", "DESCRIPTION1", "FILENAME1", basicSchema, basicSourceCodeURL, ) oracleScript2 := types.NewOracleScript( bandtesting.Bob.Address, types.DoNotModify, types.DoNotModify, "FILENAME2", @@ -99,79 +100,85 @@ func TestAddEditOracleScriptDoNotModify(t *testing.T) { ) // Adds a new oracle script to the store. We should be able to retrieve it back. id := k.AddOracleScript(ctx, oracleScript1) - require.Equal(t, oracleScript1, k.MustGetOracleScript(ctx, id)) - require.NotEqual(t, oracleScript2, k.MustGetOracleScript(ctx, id)) + require.Equal(oracleScript1, k.MustGetOracleScript(ctx, id)) + require.NotEqual(oracleScript2, k.MustGetOracleScript(ctx, id)) // Edits the oracle script. We should get the updated oracle script. - require.NotPanics(t, func() { k.MustEditOracleScript(ctx, id, oracleScript2) }) + require.NotPanics(func() { k.MustEditOracleScript(ctx, id, oracleScript2) }) oracleScriptRes := k.MustGetOracleScript(ctx, id) - require.NotEqual(t, oracleScriptRes, oracleScript1) - require.NotEqual(t, oracleScriptRes, oracleScript2) - require.Equal(t, oracleScriptRes.Owner, oracleScript2.Owner) - require.Equal(t, oracleScriptRes.Name, oracleScript1.Name) - require.Equal(t, oracleScriptRes.Description, oracleScript1.Description) - require.Equal(t, oracleScriptRes.Filename, oracleScript2.Filename) - require.Equal(t, oracleScriptRes.Schema, oracleScript1.Schema) - require.Equal(t, oracleScriptRes.SourceCodeURL, oracleScript1.SourceCodeURL) + require.NotEqual(oracleScriptRes, oracleScript1) + require.NotEqual(oracleScriptRes, oracleScript2) + require.Equal(oracleScriptRes.Owner, oracleScript2.Owner) + require.Equal(oracleScriptRes.Name, oracleScript1.Name) + require.Equal(oracleScriptRes.Description, oracleScript1.Description) + require.Equal(oracleScriptRes.Filename, oracleScript2.Filename) + require.Equal(oracleScriptRes.Schema, oracleScript1.Schema) + require.Equal(oracleScriptRes.SourceCodeURL, oracleScript1.SourceCodeURL) } -func TestAddOracleScriptMustReturnCorrectID(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestAddOracleScriptMustReturnCorrectID() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() - // Initially we expect the oracle script count to be what we have on genesis state. - genesisCount := uint64(len(bandtesting.OracleScripts)) - 1 - require.Equal(t, genesisCount, k.GetOracleScriptCount(ctx)) + genesisCount := k.GetOracleScriptCount(ctx) // Every new oracle script we add should return a new ID. id1 := k.AddOracleScript(ctx, types.NewOracleScript( - bandtesting.Owner.Address, BasicName, BasicDesc, BasicFilename, BasicSchema, BasicSourceCodeURL, + bandtesting.Owner.Address, basicName, basicDesc, basicFilename, basicSchema, basicSourceCodeURL, )) - require.Equal(t, types.OracleScriptID(genesisCount+1), id1) + require.Equal(types.OracleScriptID(genesisCount+1), id1) // Adds another oracle script so now ID should increase by 2. id2 := k.AddOracleScript(ctx, types.NewOracleScript( - bandtesting.Owner.Address, BasicName, BasicDesc, BasicFilename, BasicSchema, BasicSourceCodeURL, + bandtesting.Owner.Address, basicName, basicDesc, basicFilename, basicSchema, basicSourceCodeURL, )) - require.Equal(t, types.OracleScriptID(genesisCount+2), id2) + require.Equal(types.OracleScriptID(genesisCount+2), id2) // Finally we expect the oracle script to increase as well. - require.Equal(t, genesisCount+2, k.GetOracleScriptCount(ctx)) + require.Equal(genesisCount+2, k.GetOracleScriptCount(ctx)) } -func TestEditNonExistentOracleScript(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestEditNonExistentOracleScript() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // Editing a non-existent oracle script should return error. - require.Panics(t, func() { + require.Panics(func() { k.MustEditOracleScript(ctx, 42, types.NewOracleScript( - bandtesting.Owner.Address, BasicName, BasicDesc, BasicFilename, BasicSchema, BasicSourceCodeURL, + bandtesting.Owner.Address, basicName, basicDesc, basicFilename, basicSchema, basicSourceCodeURL, )) }) } -func TestGetAllOracleScripts(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestGetAllOracleScripts() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + + oracleScripts := bandtesting.GenerateOracleScripts(suite.homeDir) // We should be able to get all genesis oracle scripts. - require.Equal(t, bandtesting.OracleScripts[1:], k.GetAllOracleScripts(ctx)) + require.Equal( + oracleScripts, + k.GetAllOracleScripts(ctx), + ) } -func TestAddOracleScriptFile(t *testing.T) { - app, _ := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestAddOracleScriptFile() { + k := suite.oracleKeeper + require := suite.Require() // Code should be perfectly compilable. compiledCode, err := bandtesting.OwasmVM.Compile(testdata.WasmExtra1, types.MaxCompiledWasmCodeSize) - require.NoError(t, err) + require.NoError(err) // We start by adding the Owasm content to the storage. filename, err := k.AddOracleScriptFile(testdata.WasmExtra1) - require.NoError(t, err) + require.NoError(err) // If we get by file name, we should get the compiled content back. - require.Equal(t, compiledCode, k.GetFile(filename)) + require.Equal(compiledCode, k.GetFile(filename)) // If we try to add do-not-modify, we should just get do-not-modify back. filename, err = k.AddOracleScriptFile(types.DoNotModifyBytes) - require.NoError(t, err) - require.Equal(t, types.DoNotModify, filename) + require.NoError(err) + require.Equal(types.DoNotModify, filename) // We should not be able to add a non-wasm file. _, err = k.AddOracleScriptFile([]byte("code")) - require.ErrorIs(t, err, types.ErrOwasmCompilation) + require.ErrorIs(err, types.ErrOwasmCompilation) } diff --git a/x/oracle/keeper/owasm.go b/x/oracle/keeper/owasm.go index 45ec02708..360131ac0 100644 --- a/x/oracle/keeper/owasm.go +++ b/x/oracle/keeper/owasm.go @@ -3,24 +3,21 @@ package keeper import ( "encoding/hex" "fmt" - "math" + + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/bandprotocol/chain/v2/pkg/bandrng" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/pkg/bandrng" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // 1 cosmos gas is equal to 20000000 owasm gas -const gasConversionFactor = 20_000_000 +const GasConversionFactor = 20_000_000 func ConvertToOwasmGas(cosmos uint64) uint64 { - return cosmos * gasConversionFactor -} - -func ConvertToGas(owasm uint64) uint64 { - return uint64(math.Ceil(float64(owasm) / float64(gasConversionFactor))) + return cosmos * GasConversionFactor } // GetSpanSize return maximum value between MaxReportDataSize and MaxCallDataSize @@ -37,20 +34,27 @@ func (k Keeper) GetSpanSize(ctx sdk.Context) uint64 { func (k Keeper) GetRandomValidators(ctx sdk.Context, size int, id uint64) ([]sdk.ValAddress, error) { valOperators := []sdk.ValAddress{} valPowers := []uint64{} - k.stakingKeeper.IterateBondedValidatorsByPower(ctx, + err := k.stakingKeeper.IterateBondedValidatorsByPower(ctx, func(idx int64, val stakingtypes.ValidatorI) (stop bool) { - if k.GetValidatorStatus(ctx, val.GetOperator()).IsActive { - valOperators = append(valOperators, val.GetOperator()) + operator, err := sdk.ValAddressFromBech32(val.GetOperator()) + if err != nil { + return false + } + if k.GetValidatorStatus(ctx, operator).IsActive { + valOperators = append(valOperators, operator) valPowers = append(valPowers, val.GetTokens().Uint64()) } return false }) + if err != nil { + return nil, err + } if len(valOperators) < size { return nil, types.ErrInsufficientValidators.Wrapf("%d < %d", len(valOperators), size) } rng, err := bandrng.NewRng(k.GetRollingSeed(ctx), sdk.Uint64ToBigEndian(id), []byte(ctx.ChainID())) if err != nil { - return nil, types.ErrBadDrbgInitialization.Wrapf(err.Error()) + return nil, types.ErrBadDrbgInitialization.Wrap(err.Error()) } tryCount := int(k.GetParams(ctx).SamplingTryCount) chosenValIndexes := bandrng.ChooseSomeMaxWeight(rng, valPowers, size, tryCount) @@ -121,7 +125,7 @@ func (k Keeper) PrepareRequest( code := k.GetFile(script.Filename) output, err := k.owasmVM.Prepare(code, ConvertToOwasmGas(r.GetPrepareGas()), env) if err != nil { - return 0, types.ErrBadWasmExecution.Wrapf(err.Error()) + return 0, types.ErrBadWasmExecution.Wrap(err.Error()) } // Preparation complete! It's time to collect raw request ids. @@ -216,7 +220,7 @@ func (k Keeper) CollectFee( fee := sdk.NewCoins() for _, c := range ds.Fee { - c.Amount = c.Amount.Mul(sdk.NewInt(int64(askCount))) + c.Amount = c.Amount.Mul(math.NewInt(int64(askCount))) fee = fee.Add(c) } diff --git a/x/oracle/keeper/owasm_test.go b/x/oracle/keeper/owasm_test.go index eda5060c4..9f1254933 100644 --- a/x/oracle/keeper/owasm_test.go +++ b/x/oracle/keeper/owasm_test.go @@ -1,384 +1,362 @@ package keeper_test import ( - "encoding/hex" "strings" - "testing" - "time" + + "go.uber.org/mock/gomock" + + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - authtypes "github.com/cosmos/cosmos-sdk/x/bank/types" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/stretchr/testify/require" - - "github.com/bandprotocol/chain/v2/pkg/obi" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/testing/testdata" - "github.com/bandprotocol/chain/v2/x/oracle/keeper" - "github.com/bandprotocol/chain/v2/x/oracle/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + "github.com/bandprotocol/chain/v3/pkg/obi" + bandtesting "github.com/bandprotocol/chain/v3/testing" + "github.com/bandprotocol/chain/v3/testing/testdata" + "github.com/bandprotocol/chain/v3/x/oracle/keeper" + oracletestutil "github.com/bandprotocol/chain/v3/x/oracle/testutil" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) -func TestGetRandomValidatorsSuccessActivateAll(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) mockIterateBondedValidatorsByPower() { + suite.stakingKeeper.EXPECT(). + IterateBondedValidatorsByPower(gomock.Any(), gomock.Any()). + DoAndReturn(func(ctx sdk.Context, fn func(index int64, validator stakingtypes.ValidatorI) bool) { + vals := []stakingtypes.Validator{ + { + OperatorAddress: validators[0].Address.String(), + Tokens: math.NewInt(100000000), + }, + { + OperatorAddress: validators[1].Address.String(), + Tokens: math.NewInt(1000000), + }, + { + OperatorAddress: validators[2].Address.String(), + Tokens: math.NewInt(99999999), + }, + } + + for i, val := range vals { + stop := fn(int64(i), val) + if stop { + break + } + } + }).Return(nil).AnyTimes() +} + +func (suite *KeeperTestSuite) TestGetRandomValidatorsSuccessActivateAll() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + suite.activeAllValidators() + suite.mockIterateBondedValidatorsByPower() // Getting 3 validators using ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) vals, err := k.GetRandomValidators(ctx, 3, 1) - require.NoError(t, err) + require.NoError(err) require.Equal( - t, []sdk.ValAddress{ - bandtesting.Validators[2].ValAddress, - bandtesting.Validators[0].ValAddress, - bandtesting.Validators[1].ValAddress, + validators[2].Address, + validators[0].Address, + validators[1].Address, }, vals, ) // Getting 3 validators using ROLLING_SEED_A k.SetRollingSeed(ctx, []byte("ROLLING_SEED_A_WITH_LONG_ENOUGH_ENTROPY")) vals, err = k.GetRandomValidators(ctx, 3, 1) - require.NoError(t, err) + require.NoError(err) require.Equal( - t, []sdk.ValAddress{ - bandtesting.Validators[0].ValAddress, - bandtesting.Validators[2].ValAddress, - bandtesting.Validators[1].ValAddress, + validators[0].Address, + validators[2].Address, + validators[1].Address, }, vals, ) // Getting 3 validators using ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY again should return the same result as the first one. k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) vals, err = k.GetRandomValidators(ctx, 3, 1) - require.NoError(t, err) + require.NoError(err) require.Equal( - t, []sdk.ValAddress{ - bandtesting.Validators[2].ValAddress, - bandtesting.Validators[0].ValAddress, - bandtesting.Validators[1].ValAddress, + validators[2].Address, + validators[0].Address, + validators[1].Address, }, vals, ) // Getting 3 validators using ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY but for a different request ID. k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) vals, err = k.GetRandomValidators(ctx, 3, 42) - require.NoError(t, err) + require.NoError(err) require.Equal( - t, []sdk.ValAddress{ - bandtesting.Validators[0].ValAddress, - bandtesting.Validators[2].ValAddress, - bandtesting.Validators[1].ValAddress, + validators[0].Address, + validators[2].Address, + validators[1].Address, }, vals, ) } -func TestGetRandomValidatorsTooBigSize(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestGetRandomValidatorsTooBigSize() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + suite.activeAllValidators() + suite.mockIterateBondedValidatorsByPower() + + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) _, err := k.GetRandomValidators(ctx, 1, 1) - require.NoError(t, err) + require.NoError(err) _, err = k.GetRandomValidators(ctx, 2, 1) - require.NoError(t, err) + require.NoError(err) _, err = k.GetRandomValidators(ctx, 3, 1) - require.NoError(t, err) + require.NoError(err) _, err = k.GetRandomValidators(ctx, 4, 1) - require.ErrorIs(t, err, types.ErrInsufficientValidators) + require.ErrorIs(err, types.ErrInsufficientValidators) _, err = k.GetRandomValidators(ctx, 9999, 1) - require.ErrorIs(t, err, types.ErrInsufficientValidators) + require.ErrorIs(err, types.ErrInsufficientValidators) } -func TestGetRandomValidatorsWithActivate(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestGetRandomValidatorsNotEnoughEntropy() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + suite.activeAllValidators() + suite.mockIterateBondedValidatorsByPower() - k.SetRollingSeed(ctx, []byte("ROLLING_SEED_WITH_LONG_ENOUGH_ENTROPY")) - // If no validators are active, you must not be able to get random validators - _, err := k.GetRandomValidators(ctx, 1, 1) - require.ErrorIs(t, err, types.ErrInsufficientValidators) - // If we activate 2 validators, we should be able to get at most 2 from the function. - err = k.Activate(ctx, bandtesting.Validators[0].ValAddress) - require.NoError(t, err) - err = k.Activate(ctx, bandtesting.Validators[1].ValAddress) - require.NoError(t, err) - vals, err := k.GetRandomValidators(ctx, 1, 1) - require.NoError(t, err) - require.Equal(t, []sdk.ValAddress{bandtesting.Validators[0].ValAddress}, vals) - vals, err = k.GetRandomValidators(ctx, 2, 1) - require.NoError(t, err) - require.Equal( - t, - []sdk.ValAddress{bandtesting.Validators[0].ValAddress, bandtesting.Validators[1].ValAddress}, - vals, - ) - _, err = k.GetRandomValidators(ctx, 3, 1) - require.ErrorIs(t, err, types.ErrInsufficientValidators) - // After we deactivate 1 validator due to missing a report, we can only get at most 1 validator. - k.MissReport(ctx, bandtesting.Validators[0].ValAddress, time.Now()) - vals, err = k.GetRandomValidators(ctx, 1, 1) - require.NoError(t, err) - require.Equal(t, []sdk.ValAddress{bandtesting.Validators[1].ValAddress}, vals) - _, err = k.GetRandomValidators(ctx, 2, 1) - require.ErrorIs(t, err, types.ErrInsufficientValidators) + k.SetRollingSeed(ctx, []byte("")) + + _, err := k.GetRandomValidators(ctx, 3, 1) + require.ErrorIs(err, types.ErrBadDrbgInitialization) } -func TestPrepareRequestSuccessBasic(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestPrepareRequestSuccessBasic() { + suite.activeAllValidators() + suite.mockIterateBondedValidatorsByPower() + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() - ctx = ctx.WithBlockTime(bandtesting.ParseTime(1581589790)).WithBlockHeight(42) + addSimpleDataSourceAndOracleScript(ctx, k, suite.fileDir) + ctx = ctx.WithBlockTime(bandtesting.ParseTime(1581589790)).WithBlockHeight(42) wrappedGasMeter := bandtesting.NewGasMeterWrapper(ctx.GasMeter()) ctx = ctx.WithGasMeter(wrappedGasMeter) - balancesRes, err := app.BankKeeper.AllBalances( - sdk.WrapSDKContext(ctx), - authtypes.NewQueryAllBalancesRequest(bandtesting.FeePayer.Address, &query.PageRequest{}), + // OracleScript#1: Prepare asks for DS#1,2,3 with ExtID#1,2,3 and calldata "test" + msg := types.NewMsgRequestData( + 1, + basicCalldata, + 1, + 1, + basicClientID, + coins100000000uband, + testDefaultPrepareGas, + testDefaultExecuteGas, + alice, ) - require.NoError(t, err) - feePayerBalances := balancesRes.Balances + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_A_WITH_LONG_ENOUGH_ENTROPY")) + // Define expected mock keeper + suite.bankKeeper.EXPECT().SendCoins(gomock.Any(), alice, treasury, coins1000000uband) + suite.bankKeeper.EXPECT().SendCoins(gomock.Any(), alice, treasury, coins1000000uband) + suite.bankKeeper.EXPECT().SendCoins(gomock.Any(), alice, treasury, coins1000000uband) + + id, err := k.PrepareRequest(ctx, msg, alice, nil) + require.NoError(err) + require.Equal(types.RequestID(1), id) + + require.Equal(types.NewRequest( + 1, basicCalldata, []sdk.ValAddress{validators[0].Address}, 1, + 42, bandtesting.ParseTime(1581589790), basicClientID, []types.RawRequest{ + types.NewRawRequest(1, 1, []byte("test")), + types.NewRawRequest(2, 2, []byte("test")), + types.NewRawRequest(3, 3, []byte("test")), + }, nil, testDefaultExecuteGas, + ), k.MustGetRequest(ctx, 1)) + + // assert gas consumption + params := k.GetParams(ctx) + require.Equal(2, wrappedGasMeter.CountRecord(params.BaseOwasmGas, "BASE_OWASM_FEE")) + require.Equal(1, wrappedGasMeter.CountRecord(testDefaultPrepareGas, "OWASM_PREPARE_FEE")) + require.Equal(1, wrappedGasMeter.CountRecord(testDefaultExecuteGas, "OWASM_EXECUTE_FEE")) +} + +func (suite *KeeperTestSuite) TestPrepareRequestInvalidCalldataSize() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + suite.activeAllValidators() - // OracleScript#1: Prepare asks for DS#1,2,3 with ExtID#1,2,3 and calldata "beeb" m := types.NewMsgRequestData( 1, - BasicCalldata, + []byte(strings.Repeat("x", 2000)), 1, 1, - BasicClientID, + basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, - bandtesting.FeePayer.Address, + bandtesting.Alice.Address, ) - id, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.Equal(t, types.RequestID(1), id) - require.NoError(t, err) - require.Equal(t, types.NewRequest( - 1, BasicCalldata, []sdk.ValAddress{bandtesting.Validators[0].ValAddress}, 1, - 42, bandtesting.ParseTime(1581589790), BasicClientID, []types.RawRequest{ - types.NewRawRequest(1, 1, []byte("beeb")), - types.NewRawRequest(2, 2, []byte("beeb")), - types.NewRawRequest(3, 3, []byte("beeb")), - }, nil, bandtesting.TestDefaultExecuteGas, - ), k.MustGetRequest(ctx, 1)) - require.Equal(t, sdk.Events{ - sdk.NewEvent( - authtypes.EventTypeCoinSpent, - sdk.NewAttribute(authtypes.AttributeKeySpender, bandtesting.FeePayer.Address.String()), - sdk.NewAttribute(sdk.AttributeKeyAmount, bandtesting.Coins1000000uband.String()), - ), sdk.NewEvent( - authtypes.EventTypeCoinReceived, - sdk.NewAttribute(authtypes.AttributeKeyReceiver, bandtesting.Treasury.Address.String()), - sdk.NewAttribute(sdk.AttributeKeyAmount, bandtesting.Coins1000000uband.String()), - ), sdk.NewEvent( - authtypes.EventTypeTransfer, - sdk.NewAttribute(authtypes.AttributeKeyRecipient, bandtesting.Treasury.Address.String()), - sdk.NewAttribute(authtypes.AttributeKeySender, bandtesting.FeePayer.Address.String()), - sdk.NewAttribute(sdk.AttributeKeyAmount, bandtesting.Coins1000000uband.String()), - ), sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeySender, bandtesting.FeePayer.Address.String()), - ), sdk.NewEvent( - authtypes.EventTypeCoinSpent, - sdk.NewAttribute(authtypes.AttributeKeySpender, bandtesting.FeePayer.Address.String()), - sdk.NewAttribute(sdk.AttributeKeyAmount, bandtesting.Coins1000000uband.String()), - ), sdk.NewEvent( - authtypes.EventTypeCoinReceived, - sdk.NewAttribute(authtypes.AttributeKeyReceiver, bandtesting.Treasury.Address.String()), - sdk.NewAttribute(sdk.AttributeKeyAmount, bandtesting.Coins1000000uband.String()), - ), sdk.NewEvent( - authtypes.EventTypeTransfer, - sdk.NewAttribute(authtypes.AttributeKeyRecipient, bandtesting.Treasury.Address.String()), - sdk.NewAttribute(authtypes.AttributeKeySender, bandtesting.FeePayer.Address.String()), - sdk.NewAttribute(sdk.AttributeKeyAmount, bandtesting.Coins1000000uband.String()), - ), sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeySender, bandtesting.FeePayer.Address.String()), - ), sdk.NewEvent( - authtypes.EventTypeCoinSpent, - sdk.NewAttribute(authtypes.AttributeKeySpender, bandtesting.FeePayer.Address.String()), - sdk.NewAttribute(sdk.AttributeKeyAmount, bandtesting.Coins1000000uband.String()), - ), sdk.NewEvent( - authtypes.EventTypeCoinReceived, - sdk.NewAttribute(authtypes.AttributeKeyReceiver, bandtesting.Treasury.Address.String()), - sdk.NewAttribute(sdk.AttributeKeyAmount, bandtesting.Coins1000000uband.String()), - ), sdk.NewEvent( - authtypes.EventTypeTransfer, - sdk.NewAttribute(authtypes.AttributeKeyRecipient, bandtesting.Treasury.Address.String()), - sdk.NewAttribute(authtypes.AttributeKeySender, bandtesting.FeePayer.Address.String()), - sdk.NewAttribute(sdk.AttributeKeyAmount, bandtesting.Coins1000000uband.String()), - ), sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeySender, bandtesting.FeePayer.Address.String()), - ), sdk.NewEvent( - types.EventTypeRequest, - sdk.NewAttribute(types.AttributeKeyID, "1"), - sdk.NewAttribute(types.AttributeKeyClientID, BasicClientID), - sdk.NewAttribute(types.AttributeKeyOracleScriptID, "1"), - sdk.NewAttribute(types.AttributeKeyCalldata, hex.EncodeToString(BasicCalldata)), - sdk.NewAttribute(types.AttributeKeyAskCount, "1"), - sdk.NewAttribute(types.AttributeKeyMinCount, "1"), - sdk.NewAttribute(types.AttributeKeyGasUsed, "5294700000"), - sdk.NewAttribute(types.AttributeKeyTotalFees, "3000000uband"), - sdk.NewAttribute(types.AttributeKeyValidator, bandtesting.Validators[0].ValAddress.String()), - ), sdk.NewEvent( - types.EventTypeRawRequest, - sdk.NewAttribute(types.AttributeKeyDataSourceID, "1"), - sdk.NewAttribute(types.AttributeKeyDataSourceHash, bandtesting.DataSources[1].Filename), - sdk.NewAttribute(types.AttributeKeyExternalID, "1"), - sdk.NewAttribute(types.AttributeKeyCalldata, "beeb"), - sdk.NewAttribute(types.AttributeKeyFee, "1000000uband"), - ), sdk.NewEvent( - types.EventTypeRawRequest, - sdk.NewAttribute(types.AttributeKeyDataSourceID, "2"), - sdk.NewAttribute(types.AttributeKeyDataSourceHash, bandtesting.DataSources[2].Filename), - sdk.NewAttribute(types.AttributeKeyExternalID, "2"), - sdk.NewAttribute(types.AttributeKeyCalldata, "beeb"), - sdk.NewAttribute(types.AttributeKeyFee, "1000000uband"), - ), sdk.NewEvent( - types.EventTypeRawRequest, - sdk.NewAttribute(types.AttributeKeyDataSourceID, "3"), - sdk.NewAttribute(types.AttributeKeyDataSourceHash, bandtesting.DataSources[3].Filename), - sdk.NewAttribute(types.AttributeKeyExternalID, "3"), - sdk.NewAttribute(types.AttributeKeyCalldata, "beeb"), - sdk.NewAttribute(types.AttributeKeyFee, "1000000uband"), - ), - }, ctx.EventManager().Events()) + _, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) + require.EqualError(err, "got: 2000, max: 512: too large calldata") +} - // assert gas consumption - params := k.GetParams(ctx) - require.Equal(t, 2, wrappedGasMeter.CountRecord(params.BaseOwasmGas, "BASE_OWASM_FEE")) - require.Equal(t, 1, wrappedGasMeter.CountRecord(bandtesting.TestDefaultPrepareGas, "OWASM_PREPARE_FEE")) - require.Equal(t, 1, wrappedGasMeter.CountRecord(bandtesting.TestDefaultExecuteGas, "OWASM_EXECUTE_FEE")) - - paid := sdk.NewCoins(sdk.NewInt64Coin("uband", 3000000)) - feePayerBalances = feePayerBalances.Sub(paid...) - bandtesting.CheckBalances(t, ctx, app.BankKeeper, bandtesting.FeePayer.Address, feePayerBalances) - bandtesting.CheckBalances(t, ctx, app.BankKeeper, bandtesting.Treasury.Address, paid) +func (suite *KeeperTestSuite) TestPrepareRequestOracleScriptNotFound() { + suite.activeAllValidators() + suite.mockIterateBondedValidatorsByPower() + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) + + m := types.NewMsgRequestData( + 999, + basicCalldata, + 1, + 1, + basicClientID, + bandtesting.Coins100000000uband, + bandtesting.TestDefaultPrepareGas, + bandtesting.TestDefaultExecuteGas, + bandtesting.Alice.Address, + ) + _, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) + require.EqualError(err, "id: 999: oracle script not found") } -func TestPrepareRequestNotEnoughMaxFee(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestPrepareRequestNotEnoughMaxFee() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) + + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.FeePayer.Address, bandtesting.Treasury.Address, bandtesting.Coins1000000uband). + Return(nil).AnyTimes() ctx = ctx.WithBlockTime(bandtesting.ParseTime(1581589790)).WithBlockHeight(42) - // OracleScript#1: Prepare asks for DS#1,2,3 with ExtID#1,2,3 and calldata "beeb" + // OracleScript#1: Prepare asks for DS#1,2,3 with ExtID#1,2,3 and calldata "test" m := types.NewMsgRequestData( 1, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, bandtesting.EmptyCoins, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.FeePayer.Address, ) _, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.EqualError(t, err, "require: 1000000uband, max: 0uband: not enough fee") + require.EqualError(err, "require: 1000000uband, max: 0uband: not enough fee") m = types.NewMsgRequestData( 1, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, sdk.NewCoins(sdk.NewInt64Coin("uband", 1000000)), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.FeePayer.Address, ) _, err = k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.EqualError(t, err, "require: 2000000uband, max: 1000000uband: not enough fee") + require.EqualError(err, "require: 2000000uband, max: 1000000uband: not enough fee") m = types.NewMsgRequestData( 1, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, sdk.NewCoins(sdk.NewInt64Coin("uband", 2000000)), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.FeePayer.Address, ) _, err = k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.EqualError(t, err, "require: 3000000uband, max: 2000000uband: not enough fee") + require.EqualError(err, "require: 3000000uband, max: 2000000uband: not enough fee") m = types.NewMsgRequestData( 1, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, sdk.NewCoins(sdk.NewInt64Coin("uband", 2999999)), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.FeePayer.Address, ) _, err = k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.EqualError(t, err, "require: 3000000uband, max: 2999999uband: not enough fee") + require.EqualError(err, "require: 3000000uband, max: 2999999uband: not enough fee") m = types.NewMsgRequestData( 1, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, sdk.NewCoins(sdk.NewInt64Coin("uband", 3000000)), bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.FeePayer.Address, ) id, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.NoError(t, err) - require.Equal(t, types.RequestID(1), id) + require.NoError(err) + require.Equal(types.RequestID(1), id) } -func TestPrepareRequestNotEnoughFund(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestPrepareRequestNotEnoughFund() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) + + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.Alice.Address, bandtesting.Treasury.Address, bandtesting.Coins1000000uband). + Return(errorsmod.Wrapf( + sdkerrors.ErrInsufficientFunds, + "spendable balance %s is smaller than %s", + "0uband", "1000000uband", + )) ctx = ctx.WithBlockTime(bandtesting.ParseTime(1581589790)).WithBlockHeight(42) - // OracleScript#1: Prepare asks for DS#1,2,3 with ExtID#1,2,3 and calldata "beeb" + // OracleScript#1: Prepare asks for DS#1,2,3 with ExtID#1,2,3 and calldata "test" m := types.NewMsgRequestData( 1, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address, ) _, err := k.PrepareRequest(ctx, m, bandtesting.Alice.Address, nil) - require.EqualError(t, err, "spendable balance is smaller than 1000000uband: insufficient funds") + require.EqualError(err, "spendable balance 0uband is smaller than 1000000uband: insufficient funds") } -func TestPrepareRequestInvalidCalldataSize(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper - - m := types.NewMsgRequestData( - 1, - []byte(strings.Repeat("x", 2000)), - 1, - 1, - BasicClientID, - bandtesting.Coins100000000uband, - bandtesting.TestDefaultPrepareGas, - bandtesting.TestDefaultExecuteGas, - bandtesting.Alice.Address, - ) - _, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.EqualError(t, err, "got: 2000, max: 512: too large calldata") -} - -func TestPrepareRequestNotEnoughPrepareGas(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestPrepareRequestNotEnoughPrepareGas() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) ctx = ctx.WithBlockTime(bandtesting.ParseTime(1581589790)).WithBlockHeight(42) @@ -387,550 +365,518 @@ func TestPrepareRequestNotEnoughPrepareGas(t *testing.T) { m := types.NewMsgRequestData( 1, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, bandtesting.EmptyCoins, 1, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address, ) _, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.ErrorIs(t, err, types.ErrBadWasmExecution) - require.Contains(t, err.Error(), "out-of-gas") + require.ErrorIs(err, types.ErrBadWasmExecution) + require.Contains(err.Error(), "out-of-gas") params := k.GetParams(ctx) - require.Equal(t, 1, wrappedGasMeter.CountRecord(params.BaseOwasmGas, "BASE_OWASM_FEE")) - require.Equal(t, 0, wrappedGasMeter.CountRecord(100, "OWASM_PREPARE_FEE")) - require.Equal(t, 0, wrappedGasMeter.CountDescriptor("OWASM_EXECUTE_FEE")) + require.Equal(1, wrappedGasMeter.CountRecord(params.BaseOwasmGas, "BASE_OWASM_FEE")) + require.Equal(0, wrappedGasMeter.CountRecord(100, "OWASM_PREPARE_FEE")) + require.Equal(0, wrappedGasMeter.CountDescriptor("OWASM_EXECUTE_FEE")) } -func TestPrepareRequestInvalidAskCountFail(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestPrepareRequestInvalidAskCountFail() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) + + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.FeePayer.Address, bandtesting.Treasury.Address, bandtesting.Coins1000000uband). + Return(nil).AnyTimes() params := k.GetParams(ctx) params.MaxAskCount = 5 err := k.SetParams(ctx, params) - require.NoError(t, err) + require.NoError(err) wrappedGasMeter := bandtesting.NewGasMeterWrapper(ctx.GasMeter()) ctx = ctx.WithGasMeter(wrappedGasMeter) m := types.NewMsgRequestData( 1, - BasicCalldata, + basicCalldata, 10, 1, - BasicClientID, + basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address, ) _, err = k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.ErrorIs(t, err, types.ErrInvalidAskCount) + require.ErrorIs(err, types.ErrInvalidAskCount) - require.Equal(t, 0, wrappedGasMeter.CountDescriptor("BASE_OWASM_FEE")) - require.Equal(t, 0, wrappedGasMeter.CountDescriptor("OWASM_PREPARE_FEE")) - require.Equal(t, 0, wrappedGasMeter.CountDescriptor("OWASM_EXECUTE_FEE")) + require.Equal(0, wrappedGasMeter.CountDescriptor("BASE_OWASM_FEE")) + require.Equal(0, wrappedGasMeter.CountDescriptor("OWASM_PREPARE_FEE")) + require.Equal(0, wrappedGasMeter.CountDescriptor("OWASM_EXECUTE_FEE")) m = types.NewMsgRequestData( 1, - BasicCalldata, + basicCalldata, 4, 1, - BasicClientID, + basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address, ) _, err = k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.ErrorIs(t, err, types.ErrInsufficientValidators) + require.ErrorIs(err, types.ErrInsufficientValidators) - require.Equal(t, 0, wrappedGasMeter.CountDescriptor("BASE_OWASM_FEE")) - require.Equal(t, 0, wrappedGasMeter.CountDescriptor("OWASM_PREPARE_FEE")) - require.Equal(t, 0, wrappedGasMeter.CountDescriptor("OWASM_EXECUTE_FEE")) + require.Equal(0, wrappedGasMeter.CountDescriptor("BASE_OWASM_FEE")) + require.Equal(0, wrappedGasMeter.CountDescriptor("OWASM_PREPARE_FEE")) + require.Equal(0, wrappedGasMeter.CountDescriptor("OWASM_EXECUTE_FEE")) m = types.NewMsgRequestData( 1, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address, ) id, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.Equal(t, types.RequestID(1), id) - require.NoError(t, err) - require.Equal(t, 2, wrappedGasMeter.CountDescriptor("BASE_OWASM_FEE")) - require.Equal(t, 1, wrappedGasMeter.CountDescriptor("OWASM_PREPARE_FEE")) - require.Equal(t, 1, wrappedGasMeter.CountDescriptor("OWASM_EXECUTE_FEE")) + require.Equal(types.RequestID(1), id) + require.NoError(err) + require.Equal(2, wrappedGasMeter.CountDescriptor("BASE_OWASM_FEE")) + require.Equal(1, wrappedGasMeter.CountDescriptor("OWASM_PREPARE_FEE")) + require.Equal(1, wrappedGasMeter.CountDescriptor("OWASM_EXECUTE_FEE")) } -func TestPrepareRequestBaseOwasmFeePanic(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestPrepareRequestBaseOwasmFeePanic() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) + + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.FeePayer.Address, bandtesting.Treasury.Address, bandtesting.Coins1000000uband). + Return(nil).AnyTimes() params := k.GetParams(ctx) params.BaseOwasmGas = 100000 params.PerValidatorRequestGas = 0 err := k.SetParams(ctx, params) - require.NoError(t, err) + require.NoError(err) m := types.NewMsgRequestData( 1, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address, ) - ctx = ctx.WithGasMeter(sdk.NewGasMeter(90000)) + ctx = ctx.WithGasMeter(storetypes.NewGasMeter(90000)) require.PanicsWithValue( - t, - sdk.ErrorOutOfGas{Descriptor: "BASE_OWASM_FEE"}, + storetypes.ErrorOutOfGas{Descriptor: "BASE_OWASM_FEE"}, func() { _, _ = k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) }, ) - ctx = ctx.WithGasMeter(sdk.NewGasMeter(1000000)) + ctx = ctx.WithGasMeter(storetypes.NewGasMeter(1000000)) id, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.Equal(t, types.RequestID(1), id) - require.NoError(t, err) + require.Equal(types.RequestID(1), id) + require.NoError(err) } -func TestPrepareRequestPerValidatorRequestFeePanic(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestPrepareRequestPerValidatorRequestFeePanic() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) + + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.FeePayer.Address, bandtesting.Treasury.Address, bandtesting.Coins1000000uband). + Return(nil).AnyTimes() params := k.GetParams(ctx) params.BaseOwasmGas = 100000 params.PerValidatorRequestGas = 50000 err := k.SetParams(ctx, params) - require.NoError(t, err) + require.NoError(err) m := types.NewMsgRequestData( 1, - BasicCalldata, + basicCalldata, 2, 1, - BasicClientID, + basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address, ) - ctx = ctx.WithGasMeter(sdk.NewGasMeter(90000)) + ctx = ctx.WithGasMeter(storetypes.NewGasMeter(90000)) require.PanicsWithValue( - t, - sdk.ErrorOutOfGas{Descriptor: "PER_VALIDATOR_REQUEST_FEE"}, + storetypes.ErrorOutOfGas{Descriptor: "PER_VALIDATOR_REQUEST_FEE"}, func() { _, _ = k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) }, ) m = types.NewMsgRequestData( 1, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address, ) - ctx = ctx.WithGasMeter(sdk.NewGasMeter(1000000)) + ctx = ctx.WithGasMeter(storetypes.NewGasMeter(1000000)) id, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.Equal(t, types.RequestID(1), id) - require.NoError(t, err) + require.Equal(types.RequestID(1), id) + require.NoError(err) } -func TestPrepareRequestEmptyCalldata(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestPrepareRequestEmptyCalldata() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) + // Send nil while oracle script expects calldata m := types.NewMsgRequestData( 4, nil, 1, 1, - BasicClientID, - bandtesting.Coins100000000uband, - bandtesting.TestDefaultPrepareGas, - bandtesting.TestDefaultExecuteGas, - bandtesting.Alice.Address, - ) - _, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.EqualError(t, err, "runtime error while executing the Wasm script: bad wasm execution") -} - -func TestPrepareRequestOracleScriptNotFound(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper - - m := types.NewMsgRequestData( - 999, - BasicCalldata, - 1, - 1, - BasicClientID, + basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address, ) _, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.EqualError(t, err, "id: 999: oracle script not found") + require.EqualError(err, "runtime error while executing the Wasm script: bad wasm execution") } -func TestPrepareRequestBadWasmExecutionFail(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestPrepareRequestBadWasmExecutionFail() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) m := types.NewMsgRequestData( 2, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address, ) _, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.EqualError(t, err, "OEI action to invoke is not available: bad wasm execution") + require.EqualError(err, "OEI action to invoke is not available: bad wasm execution") } -func TestPrepareRequestWithEmptyRawRequest(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestPrepareRequestWithEmptyRawRequest() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) m := types.NewMsgRequestData( 3, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address, ) _, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.EqualError(t, err, "empty raw requests") + require.EqualError(err, "empty raw requests") } -func TestPrepareRequestUnknownDataSource(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestPrepareRequestUnknownDataSource() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) + + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.FeePayer.Address, bandtesting.Treasury.Address, bandtesting.Coins1000000uband). + Return(nil).AnyTimes() m := types.NewMsgRequestData(4, obi.MustEncode(testdata.Wasm4Input{ IDs: []int64{1, 2, 99}, - Calldata: "beeb", - }), 1, 1, BasicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address) + Calldata: "test", + }), 1, 1, basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address) _, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.EqualError(t, err, "id: 99: data source not found") + require.EqualError(err, "id: 99: data source not found") } -func TestPrepareRequestInvalidDataSourceCount(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestPrepareRequestInvalidDataSourceCount() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) + + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.FeePayer.Address, bandtesting.Treasury.Address, bandtesting.Coins1000000uband). + Return(nil).AnyTimes() params := k.GetParams(ctx) params.MaxRawRequestCount = 3 err := k.SetParams(ctx, params) - require.NoError(t, err) + require.NoError(err) m := types.NewMsgRequestData(4, obi.MustEncode(testdata.Wasm4Input{ IDs: []int64{1, 2, 3, 4}, - Calldata: "beeb", - }), 1, 1, BasicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address) + Calldata: "test", + }), 1, 1, basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address) _, err = k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.ErrorIs(t, err, types.ErrBadWasmExecution) + require.ErrorIs(err, types.ErrBadWasmExecution) m = types.NewMsgRequestData(4, obi.MustEncode(testdata.Wasm4Input{ IDs: []int64{1, 2, 3}, - Calldata: "beeb", - }), 1, 1, BasicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address) + Calldata: "test", + }), 1, 1, basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address) id, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.Equal(t, types.RequestID(1), id) - require.NoError(t, err) + require.Equal(types.RequestID(1), id) + require.NoError(err) } -func TestPrepareRequestTooMuchWasmGas(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestPrepareRequestTooMuchWasmGas() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) + + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.FeePayer.Address, bandtesting.Treasury.Address, bandtesting.Coins1000000uband). + Return(nil).AnyTimes() m := types.NewMsgRequestData( 5, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address, ) id, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.Equal(t, types.RequestID(1), id) - require.NoError(t, err) + require.Equal(types.RequestID(1), id) + require.NoError(err) m = types.NewMsgRequestData( 6, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address, ) _, err = k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.EqualError(t, err, "out-of-gas while executing the wasm script: bad wasm execution") + require.EqualError(err, "out-of-gas while executing the wasm script: bad wasm execution") } -func TestPrepareRequestTooLargeCalldata(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestPrepareRequestTooLargeCalldata() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) + + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.FeePayer.Address, bandtesting.Treasury.Address, bandtesting.Coins1000000uband). + Return(nil).AnyTimes() m := types.NewMsgRequestData( 7, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address, ) id, err := k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.Equal(t, types.RequestID(1), id) - require.NoError(t, err) + require.Equal(types.RequestID(1), id) + require.NoError(err) m = types.NewMsgRequestData( 8, - BasicCalldata, + basicCalldata, 1, 1, - BasicClientID, + basicClientID, bandtesting.Coins100000000uband, bandtesting.TestDefaultPrepareGas, bandtesting.TestDefaultExecuteGas, bandtesting.Alice.Address, ) _, err = k.PrepareRequest(ctx, m, bandtesting.FeePayer.Address, nil) - require.EqualError(t, err, "span to write is too small: bad wasm execution") + require.EqualError(err, "span to write is too small: bad wasm execution") } -func TestResolveRequestSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper - - ctx = ctx.WithBlockTime(bandtesting.ParseTime(1581589890)) - k.SetRequest(ctx, 42, types.NewRequest( - // 1st Wasm - return "beeb" - 1, - BasicCalldata, - []sdk.ValAddress{bandtesting.Validators[0].ValAddress, bandtesting.Validators[1].ValAddress}, - 1, - 42, - bandtesting.ParseTime(1581589790), - BasicClientID, - []types.RawRequest{ - types.NewRawRequest(1, 1, []byte("beeb")), - }, - nil, - bandtesting.TestDefaultExecuteGas, - )) - k.SetReport(ctx, 42, types.NewReport( - bandtesting.Validators[0].ValAddress, true, []types.RawReport{ - types.NewRawReport(1, 0, []byte("beeb")), - }, - )) - k.ResolveRequest(ctx, 42) - expectResult := types.NewResult( - BasicClientID, 1, BasicCalldata, 2, 1, - 42, 1, bandtesting.ParseTime(1581589790).Unix(), - bandtesting.ParseTime(1581589890).Unix(), types.RESOLVE_STATUS_SUCCESS, []byte("beeb"), - ) - require.Equal(t, expectResult, k.MustGetResult(ctx, 42)) - require.Equal(t, sdk.Events{sdk.NewEvent( - types.EventTypeResolve, - sdk.NewAttribute(types.AttributeKeyID, "42"), - sdk.NewAttribute(types.AttributeKeyResolveStatus, "1"), - sdk.NewAttribute(types.AttributeKeyResult, "62656562"), // hex of "beeb" - sdk.NewAttribute(types.AttributeKeyGasUsed, "2485000000"), - )}, ctx.EventManager().Events()) -} - -func TestResolveRequestSuccessComplex(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper - - ctx = ctx.WithBlockTime(bandtesting.ParseTime(1581589890)) - k.SetRequest(ctx, 42, types.NewRequest( - // 4th Wasm. Append all reports from all validators. - 4, obi.MustEncode(testdata.Wasm4Input{ - IDs: []int64{1, 2}, - Calldata: string(BasicCalldata), - }), []sdk.ValAddress{bandtesting.Validators[0].ValAddress, bandtesting.Validators[1].ValAddress}, 1, - 42, bandtesting.ParseTime(1581589790), BasicClientID, []types.RawRequest{ - types.NewRawRequest(0, 1, BasicCalldata), - types.NewRawRequest(1, 2, BasicCalldata), - }, nil, bandtesting.TestDefaultExecuteGas, - )) - k.SetReport(ctx, 42, types.NewReport( - bandtesting.Validators[0].ValAddress, true, []types.RawReport{ - types.NewRawReport(0, 0, []byte("beebd1v1")), - types.NewRawReport(1, 0, []byte("beebd2v1")), - }, - )) - k.SetReport(ctx, 42, types.NewReport( - bandtesting.Validators[1].ValAddress, true, []types.RawReport{ - types.NewRawReport(0, 0, []byte("beebd1v2")), - types.NewRawReport(1, 0, []byte("beebd2v2")), - }, - )) - k.ResolveRequest(ctx, 42) - result := types.NewResult( - BasicClientID, 4, obi.MustEncode(testdata.Wasm4Input{ - IDs: []int64{1, 2}, - Calldata: string(BasicCalldata), - }), 2, 1, - 42, 2, bandtesting.ParseTime(1581589790).Unix(), - bandtesting.ParseTime(1581589890).Unix(), types.RESOLVE_STATUS_SUCCESS, - obi.MustEncode(testdata.Wasm4Output{Ret: "beebd1v1beebd1v2beebd2v1beebd2v2"}), - ) - require.Equal(t, result, k.MustGetResult(ctx, 42)) - require.Equal(t, sdk.Events{sdk.NewEvent( - types.EventTypeResolve, - sdk.NewAttribute(types.AttributeKeyID, "42"), - sdk.NewAttribute(types.AttributeKeyResolveStatus, "1"), - sdk.NewAttribute( - types.AttributeKeyResult, - "000000206265656264317631626565626431763262656562643276316265656264327632", - ), - sdk.NewAttribute(types.AttributeKeyGasUsed, "32492250000"), - )}, ctx.EventManager().Events()) -} - -func TestResolveRequestOutOfGas(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestResolveRequestOutOfGas() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) ctx = ctx.WithBlockTime(bandtesting.ParseTime(1581589890)) k.SetRequest(ctx, 42, types.NewRequest( - // 1st Wasm - return "beeb" + // 1st Wasm - return "test" 1, - BasicCalldata, + basicCalldata, []sdk.ValAddress{bandtesting.Validators[0].ValAddress, bandtesting.Validators[1].ValAddress}, 1, 42, bandtesting.ParseTime(1581589790), - BasicClientID, + basicClientID, []types.RawRequest{ - types.NewRawRequest(1, 1, []byte("beeb")), + types.NewRawRequest(1, 1, []byte("test")), }, nil, 0, )) k.SetReport(ctx, 42, types.NewReport( bandtesting.Validators[0].ValAddress, true, []types.RawReport{ - types.NewRawReport(1, 0, []byte("beeb")), + types.NewRawReport(1, 0, []byte("test")), }, )) k.ResolveRequest(ctx, 42) result := types.NewResult( - BasicClientID, 1, BasicCalldata, 2, 1, + basicClientID, 1, basicCalldata, 2, 1, 42, 1, bandtesting.ParseTime(1581589790).Unix(), bandtesting.ParseTime(1581589890).Unix(), types.RESOLVE_STATUS_FAILURE, nil, ) - require.Equal(t, result, k.MustGetResult(ctx, 42)) + require.Equal(result, k.MustGetResult(ctx, 42)) } -func TestResolveReadNilExternalData(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestResolveReadNilExternalData() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) ctx = ctx.WithBlockTime(bandtesting.ParseTime(1581589890)) k.SetRequest(ctx, 42, types.NewRequest( // 4th Wasm. Append all reports from all validators. 4, obi.MustEncode(testdata.Wasm4Input{ IDs: []int64{1, 2}, - Calldata: string(BasicCalldata), + Calldata: string(basicCalldata), }), []sdk.ValAddress{bandtesting.Validators[0].ValAddress, bandtesting.Validators[1].ValAddress}, 1, - 42, bandtesting.ParseTime(1581589790), BasicClientID, []types.RawRequest{ - types.NewRawRequest(0, 1, BasicCalldata), - types.NewRawRequest(1, 2, BasicCalldata), + 42, bandtesting.ParseTime(1581589790), basicClientID, []types.RawRequest{ + types.NewRawRequest(0, 1, basicCalldata), + types.NewRawRequest(1, 2, basicCalldata), }, nil, bandtesting.TestDefaultExecuteGas, )) k.SetReport(ctx, 42, types.NewReport( bandtesting.Validators[0].ValAddress, true, []types.RawReport{ types.NewRawReport(0, 0, nil), - types.NewRawReport(1, 0, []byte("beebd2v1")), + types.NewRawReport(1, 0, []byte("testd2v1")), }, )) k.SetReport(ctx, 42, types.NewReport( bandtesting.Validators[1].ValAddress, true, []types.RawReport{ - types.NewRawReport(0, 0, []byte("beebd1v2")), + types.NewRawReport(0, 0, []byte("testd1v2")), types.NewRawReport(1, 0, nil), }, )) k.ResolveRequest(ctx, 42) result := types.NewResult( - BasicClientID, 4, obi.MustEncode(testdata.Wasm4Input{ + basicClientID, 4, obi.MustEncode(testdata.Wasm4Input{ IDs: []int64{1, 2}, - Calldata: string(BasicCalldata), + Calldata: string(basicCalldata), }), 2, 1, 42, 2, bandtesting.ParseTime(1581589790).Unix(), bandtesting.ParseTime(1581589890).Unix(), types.RESOLVE_STATUS_SUCCESS, - obi.MustEncode(testdata.Wasm4Output{Ret: "beebd1v2beebd2v1"}), + obi.MustEncode(testdata.Wasm4Output{Ret: "testd1v2testd2v1"}), ) - require.Equal(t, result, k.MustGetResult(ctx, 42)) - require.Equal(t, sdk.Events{sdk.NewEvent( + require.Equal(result, k.MustGetResult(ctx, 42)) + require.Equal(sdk.Events{sdk.NewEvent( types.EventTypeResolve, sdk.NewAttribute(types.AttributeKeyID, "42"), sdk.NewAttribute(types.AttributeKeyResolveStatus, "1"), - sdk.NewAttribute(types.AttributeKeyResult, "0000001062656562643176326265656264327631"), + sdk.NewAttribute(types.AttributeKeyResult, "0000001074657374643176327465737464327631"), sdk.NewAttribute(types.AttributeKeyGasUsed, "31168050000"), )}, ctx.EventManager().Events()) } -func TestResolveRequestNoReturnData(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestResolveRequestNoReturnData() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) ctx = ctx.WithBlockTime(bandtesting.ParseTime(1581589890)) k.SetRequest(ctx, 42, types.NewRequest( // 3rd Wasm - do nothing 3, - BasicCalldata, + basicCalldata, []sdk.ValAddress{bandtesting.Validators[0].ValAddress, bandtesting.Validators[1].ValAddress}, 1, 42, bandtesting.ParseTime(1581589790), - BasicClientID, + basicClientID, []types.RawRequest{ - types.NewRawRequest(1, 1, []byte("beeb")), + types.NewRawRequest(1, 1, []byte("test")), }, nil, 1, )) k.SetReport(ctx, 42, types.NewReport( bandtesting.Validators[0].ValAddress, true, []types.RawReport{ - types.NewRawReport(1, 0, []byte("beeb")), + types.NewRawReport(1, 0, []byte("test")), }, )) k.ResolveRequest(ctx, 42) result := types.NewResult( - BasicClientID, 3, BasicCalldata, 2, 1, 42, 1, bandtesting.ParseTime(1581589790).Unix(), + basicClientID, 3, basicCalldata, 2, 1, 42, 1, bandtesting.ParseTime(1581589790).Unix(), bandtesting.ParseTime(1581589890).Unix(), types.RESOLVE_STATUS_FAILURE, nil, ) - require.Equal(t, result, k.MustGetResult(ctx, 42)) - require.Equal(t, sdk.Events{sdk.NewEvent( + require.Equal(result, k.MustGetResult(ctx, 42)) + require.Equal(sdk.Events{sdk.NewEvent( types.EventTypeResolve, sdk.NewAttribute(types.AttributeKeyID, "42"), sdk.NewAttribute(types.AttributeKeyResolveStatus, "2"), @@ -938,38 +884,42 @@ func TestResolveRequestNoReturnData(t *testing.T) { )}, ctx.EventManager().Events()) } -func TestResolveRequestWasmFailure(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestResolveRequestWasmFailure() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) ctx = ctx.WithBlockTime(bandtesting.ParseTime(1581589890)) k.SetRequest(ctx, 42, types.NewRequest( // 6th Wasm - out-of-gas 6, - BasicCalldata, + basicCalldata, []sdk.ValAddress{bandtesting.Validators[0].ValAddress, bandtesting.Validators[1].ValAddress}, 1, 42, bandtesting.ParseTime(1581589790), - BasicClientID, + basicClientID, []types.RawRequest{ - types.NewRawRequest(1, 1, []byte("beeb")), + types.NewRawRequest(1, 1, []byte("test")), }, nil, 0, )) k.SetReport(ctx, 42, types.NewReport( bandtesting.Validators[0].ValAddress, true, []types.RawReport{ - types.NewRawReport(1, 0, []byte("beeb")), + types.NewRawReport(1, 0, []byte("test")), }, )) k.ResolveRequest(ctx, 42) result := types.NewResult( - BasicClientID, 6, BasicCalldata, 2, 1, 42, 1, bandtesting.ParseTime(1581589790).Unix(), + basicClientID, 6, basicCalldata, 2, 1, 42, 1, bandtesting.ParseTime(1581589790).Unix(), bandtesting.ParseTime(1581589890).Unix(), types.RESOLVE_STATUS_FAILURE, nil, ) - require.Equal(t, result, k.MustGetResult(ctx, 42)) - require.Equal(t, sdk.Events{sdk.NewEvent( + require.Equal(result, k.MustGetResult(ctx, 42)) + require.Equal(sdk.Events{sdk.NewEvent( types.EventTypeResolve, sdk.NewAttribute(types.AttributeKeyID, "42"), sdk.NewAttribute(types.AttributeKeyResolveStatus, "2"), @@ -977,22 +927,26 @@ func TestResolveRequestWasmFailure(t *testing.T) { )}, ctx.EventManager().Events()) } -func TestResolveRequestCallReturnDataSeveralTimes(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestResolveRequestCallReturnDataSeveralTimes() { + require := suite.Require() + suite.mockIterateBondedValidatorsByPower() + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + k.SetRollingSeed(ctx, []byte("ROLLING_SEED_1_WITH_LONG_ENOUGH_ENTROPY")) ctx = ctx.WithBlockTime(bandtesting.ParseTime(1581589890)) k.SetRequest(ctx, 42, types.NewRequest( // 9th Wasm - set return data several times 9, - BasicCalldata, + basicCalldata, []sdk.ValAddress{bandtesting.Validators[0].ValAddress, bandtesting.Validators[1].ValAddress}, 1, 42, bandtesting.ParseTime(1581589790), - BasicClientID, + basicClientID, []types.RawRequest{ - types.NewRawRequest(1, 1, []byte("beeb")), + types.NewRawRequest(1, 1, []byte("test")), }, nil, bandtesting.TestDefaultExecuteGas, @@ -1000,12 +954,12 @@ func TestResolveRequestCallReturnDataSeveralTimes(t *testing.T) { k.ResolveRequest(ctx, 42) result := types.NewResult( - BasicClientID, 9, BasicCalldata, 2, 1, 42, 0, bandtesting.ParseTime(1581589790).Unix(), + basicClientID, 9, basicCalldata, 2, 1, 42, 0, bandtesting.ParseTime(1581589790).Unix(), bandtesting.ParseTime(1581589890).Unix(), types.RESOLVE_STATUS_FAILURE, nil, ) - require.Equal(t, result, k.MustGetResult(ctx, 42)) + require.Equal(result, k.MustGetResult(ctx, 42)) - require.Equal(t, sdk.Events{sdk.NewEvent( + require.Equal(sdk.Events{sdk.NewEvent( types.EventTypeResolve, sdk.NewAttribute(types.AttributeKeyID, "42"), sdk.NewAttribute(types.AttributeKeyResolveStatus, "2"), @@ -1013,6 +967,87 @@ func TestResolveRequestCallReturnDataSeveralTimes(t *testing.T) { )}, ctx.EventManager().Events()) } +func (suite *KeeperTestSuite) TestResolveRequestSuccess() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + + addSimpleDataSourceAndOracleScript(ctx, k, suite.fileDir) + + ctx = ctx.WithBlockTime(bandtesting.ParseTime(1581589890)) + k.SetRequest(ctx, 42, types.NewRequest( + // 1st Wasm - return "test" + 1, + basicCalldata, + []sdk.ValAddress{validators[0].Address, validators[1].Address}, + 1, + 42, + bandtesting.ParseTime(1581589790), + basicClientID, + []types.RawRequest{ + types.NewRawRequest(1, 1, []byte("test")), + }, + nil, + testDefaultExecuteGas, + )) + k.SetReport(ctx, 42, types.NewReport( + validators[0].Address, true, []types.RawReport{ + types.NewRawReport(1, 0, []byte("test")), + }, + )) + k.ResolveRequest(ctx, 42) + expectResult := types.NewResult( + basicClientID, 1, basicCalldata, 2, 1, + 42, 1, bandtesting.ParseTime(1581589790).Unix(), + bandtesting.ParseTime(1581589890).Unix(), types.RESOLVE_STATUS_SUCCESS, []byte("test"), + ) + require.Equal(expectResult, k.MustGetResult(ctx, 42)) +} + +func (suite *KeeperTestSuite) TestResolveRequestSuccessComplex() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + + addSimpleDataSourceAndOracleScript(ctx, k, suite.fileDir) + + ctx = ctx.WithBlockTime(bandtesting.ParseTime(1581589890)) + k.SetRequest(ctx, 42, types.NewRequest( + // 4th Wasm. Append all reports from all validators. + 4, obi.MustEncode(testdata.Wasm4Input{ + IDs: []int64{1, 2}, + Calldata: string(basicCalldata), + }), []sdk.ValAddress{validators[0].Address, validators[1].Address}, 1, + 42, bandtesting.ParseTime(1581589790), basicClientID, []types.RawRequest{ + types.NewRawRequest(0, 1, basicCalldata), + types.NewRawRequest(1, 2, basicCalldata), + }, nil, testDefaultExecuteGas, + )) + k.SetReport(ctx, 42, types.NewReport( + validators[0].Address, true, []types.RawReport{ + types.NewRawReport(0, 0, []byte("testd1v1")), + types.NewRawReport(1, 0, []byte("testd2v1")), + }, + )) + k.SetReport(ctx, 42, types.NewReport( + validators[1].Address, true, []types.RawReport{ + types.NewRawReport(0, 0, []byte("testd1v2")), + types.NewRawReport(1, 0, []byte("testd2v2")), + }, + )) + k.ResolveRequest(ctx, 42) + result := types.NewResult( + basicClientID, 4, obi.MustEncode(testdata.Wasm4Input{ + IDs: []int64{1, 2}, + Calldata: string(basicCalldata), + }), 2, 1, + 42, 2, bandtesting.ParseTime(1581589790).Unix(), + bandtesting.ParseTime(1581589890).Unix(), types.RESOLVE_STATUS_SUCCESS, + obi.MustEncode(testdata.Wasm4Output{Ret: "testd1v1testd1v2testd2v1testd2v2"}), + ) + require.Equal(result, k.MustGetResult(ctx, 42)) +} + func rawRequestsFromFees(ctx sdk.Context, k keeper.Keeper, fees []sdk.Coins) []types.RawRequest { var rawRequests []types.RawRequest for _, f := range fees { @@ -1033,9 +1068,10 @@ func rawRequestsFromFees(ctx sdk.Context, k keeper.Keeper, fees []sdk.Coins) []t return rawRequests } -func TestCollectFeeEmptyFee(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestCollectFeeEmptyFee() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() raws := rawRequestsFromFees(ctx, k, []sdk.Coins{ bandtesting.EmptyCoins, @@ -1046,267 +1082,169 @@ func TestCollectFeeEmptyFee(t *testing.T) { }) coins, err := k.CollectFee(ctx, bandtesting.Alice.Address, bandtesting.EmptyCoins, 1, raws) - require.NoError(t, err) - require.Empty(t, coins) + require.NoError(err) + require.Empty(coins) coins, err = k.CollectFee(ctx, bandtesting.Alice.Address, bandtesting.Coins100000000uband, 1, raws) - require.NoError(t, err) - require.Empty(t, coins) + require.NoError(err) + require.Empty(coins) coins, err = k.CollectFee(ctx, bandtesting.Alice.Address, bandtesting.EmptyCoins, 2, raws) - require.NoError(t, err) - require.Empty(t, coins) + require.NoError(err) + require.Empty(coins) coins, err = k.CollectFee(ctx, bandtesting.Alice.Address, bandtesting.Coins100000000uband, 2, raws) - require.NoError(t, err) - require.Empty(t, coins) + require.NoError(err) + require.Empty(coins) } -func TestCollectFeeBasicSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestCollectFeeBasicSuccess() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + + oracletestutil.ChainGoMockCalls( + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.FeePayer.Address, bandtesting.Treasury.Address, bandtesting.Coins1000000uband). + Return(nil), + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.FeePayer.Address, bandtesting.Treasury.Address, sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(2000000)))). + Return(nil), + ) raws := rawRequestsFromFees(ctx, k, []sdk.Coins{ bandtesting.EmptyCoins, bandtesting.Coins1000000uband, bandtesting.EmptyCoins, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(2000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(2000000))), bandtesting.EmptyCoins, }) - balancesRes, err := app.BankKeeper.AllBalances( - sdk.WrapSDKContext(ctx), - authtypes.NewQueryAllBalancesRequest(bandtesting.FeePayer.Address, &query.PageRequest{}), - ) - require.NoError(t, err) - feePayerBalances := balancesRes.Balances - feePayerBalances[0].Amount = feePayerBalances[0].Amount.Sub(sdk.NewInt(3000000)) - coins, err := k.CollectFee(ctx, bandtesting.FeePayer.Address, bandtesting.Coins100000000uband, 1, raws) - require.NoError(t, err) - require.Equal(t, sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), coins) - - bandtesting.CheckBalances(t, ctx, app.BankKeeper, bandtesting.FeePayer.Address, feePayerBalances) - bandtesting.CheckBalances( - t, - ctx, - app.BankKeeper, - bandtesting.Treasury.Address, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), - ) + require.NoError(err) + require.Equal(sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(3000000))), coins) } -func TestCollectFeeBasicSuccessWithOtherAskCount(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestCollectFeeBasicSuccessWithOtherAskCount() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + + oracletestutil.ChainGoMockCalls( + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.FeePayer.Address, bandtesting.Treasury.Address, sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(4000000)))). + Return(nil), + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.FeePayer.Address, bandtesting.Treasury.Address, sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(8000000)))). + Return(nil), + ) raws := rawRequestsFromFees(ctx, k, []sdk.Coins{ bandtesting.EmptyCoins, bandtesting.Coins1000000uband, bandtesting.EmptyCoins, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(2000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(2000000))), bandtesting.EmptyCoins, }) - balancesRes, err := app.BankKeeper.AllBalances( - sdk.WrapSDKContext(ctx), - authtypes.NewQueryAllBalancesRequest(bandtesting.FeePayer.Address, &query.PageRequest{}), - ) - require.NoError(t, err) - feePayerBalances := balancesRes.Balances - feePayerBalances[0].Amount = feePayerBalances[0].Amount.Sub(sdk.NewInt(12000000)) - coins, err := k.CollectFee(ctx, bandtesting.FeePayer.Address, bandtesting.Coins100000000uband, 4, raws) - require.NoError(t, err) - require.Equal(t, sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(12000000))), coins) - - bandtesting.CheckBalances(t, ctx, app.BankKeeper, bandtesting.FeePayer.Address, feePayerBalances) - bandtesting.CheckBalances( - t, - ctx, - app.BankKeeper, - bandtesting.Treasury.Address, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(12000000))), - ) + require.NoError(err) + require.Equal(sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(12000000))), coins) } -func TestCollectFeeWithMixedAndFeeNotEnough(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestCollectFeeWithMixedAndFeeNotEnough() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.FeePayer.Address, bandtesting.Treasury.Address, bandtesting.Coins1000000uband). + Return(nil) raws := rawRequestsFromFees(ctx, k, []sdk.Coins{ bandtesting.EmptyCoins, bandtesting.Coins1000000uband, bandtesting.EmptyCoins, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(2000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(2000000))), bandtesting.EmptyCoins, }) coins, err := k.CollectFee(ctx, bandtesting.FeePayer.Address, bandtesting.EmptyCoins, 1, raws) - require.ErrorIs(t, err, types.ErrNotEnoughFee) - require.Nil(t, coins) + require.ErrorIs(err, types.ErrNotEnoughFee) + require.Nil(coins) coins, err = k.CollectFee(ctx, bandtesting.FeePayer.Address, bandtesting.Coins1000000uband, 1, raws) - require.ErrorIs(t, err, types.ErrNotEnoughFee) - require.Nil(t, coins) + require.ErrorIs(err, types.ErrNotEnoughFee) + require.Nil(coins) } -func TestCollectFeeWithEnoughFeeButInsufficientBalance(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestCollectFeeWithEnoughFeeButInsufficientBalance() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + + oracletestutil.ChainGoMockCalls( + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.Alice.Address, bandtesting.Treasury.Address, bandtesting.Coins1000000uband). + Return(nil), + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.Alice.Address, bandtesting.Treasury.Address, sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(2000000)))). + Return(errorsmod.Wrapf( + sdkerrors.ErrInsufficientFunds, + "spendable balance %s is smaller than %s", + "0uband", "2000000uband", + )), + ) raws := rawRequestsFromFees(ctx, k, []sdk.Coins{ bandtesting.EmptyCoins, bandtesting.Coins1000000uband, bandtesting.EmptyCoins, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(2000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(2000000))), bandtesting.EmptyCoins, }) coins, err := k.CollectFee(ctx, bandtesting.Alice.Address, bandtesting.Coins100000000uband, 1, raws) - require.Nil(t, coins) + require.Nil(coins) // MAX is 100m but have only 1m in account // First ds collect 1m so there no balance enough for next ds but it doesn't touch limit - require.EqualError(t, err, "spendable balance is smaller than 2000000uband: insufficient funds") + require.EqualError(err, "spendable balance 0uband is smaller than 2000000uband: insufficient funds") } -func TestCollectFeeWithWithManyUnitSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestCollectFeeWithWithManyUnitSuccess() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + + oracletestutil.ChainGoMockCalls( + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.FeePayer.Address, bandtesting.Treasury.Address, bandtesting.Coins1000000uband). + Return(nil), + suite.bankKeeper.EXPECT(). + SendCoins(gomock.Any(), bandtesting.FeePayer.Address, bandtesting.Treasury.Address, sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(2000000)), sdk.NewCoin("uabc", math.NewInt(1000000)))). + Return(nil), + ) raws := rawRequestsFromFees(ctx, k, []sdk.Coins{ bandtesting.EmptyCoins, bandtesting.Coins1000000uband, bandtesting.EmptyCoins, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(2000000)), sdk.NewCoin("uabc", sdk.NewInt(1000000))), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(2000000)), sdk.NewCoin("uabc", math.NewInt(1000000))), bandtesting.EmptyCoins, }) - err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uabc", sdk.NewInt(2000000)))) - require.NoError(t, err) - - // Carol have not enough uband but have enough uabc - err = app.BankKeeper.SendCoinsFromModuleToAccount( - ctx, - minttypes.ModuleName, - bandtesting.FeePayer.Address, - sdk.NewCoins(sdk.NewCoin("uabc", sdk.NewInt(2000000))), - ) - require.NoError(t, err) - coins, err := k.CollectFee( ctx, bandtesting.FeePayer.Address, - bandtesting.MustGetBalances(ctx, app.BankKeeper, bandtesting.FeePayer.Address), + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(1000000000)), sdk.NewCoin("uabc", math.NewInt(1000000))), 1, raws, ) - require.NoError(t, err) + require.NoError(err) // Coins sum is correct require.True( - t, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000)), sdk.NewCoin("uabc", sdk.NewInt(1000000))). - IsEqual(coins), - ) - - // FeePayer balance - // start: 100band, 0abc - // top-up: 100band, 2abc - // collect 3 band and 1 abc => 97band, 1abc - bandtesting.CheckBalances( - t, - ctx, - app.BankKeeper, - bandtesting.FeePayer.Address, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(97000000)), sdk.NewCoin("uabc", sdk.NewInt(1000000))), - ) - - // Treasury balance - // start: 0band, 0abc - // collect 3 band and 1 abc => 3band, 1abc - bandtesting.CheckBalances( - t, - ctx, - app.BankKeeper, - bandtesting.Treasury.Address, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000)), sdk.NewCoin("uabc", sdk.NewInt(1000000))), - ) -} - -func TestCollectFeeWithWithManyUnitFail(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper - - raws := rawRequestsFromFees(ctx, k, []sdk.Coins{ - bandtesting.EmptyCoins, - bandtesting.Coins1000000uband, - bandtesting.EmptyCoins, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(2000000)), sdk.NewCoin("uabc", sdk.NewInt(1000000))), - bandtesting.EmptyCoins, - }) - - err := app.BankKeeper.MintCoins( - ctx, - minttypes.ModuleName, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(10000000)), sdk.NewCoin("uabc", sdk.NewInt(2000000))), - ) - require.NoError(t, err) - - // Alice have no enough uband and don't have uabc so don't top up - // Bob have enough uband and have some but not enough uabc so add some - err = app.BankKeeper.SendCoinsFromModuleToAccount( - ctx, - minttypes.ModuleName, - bandtesting.Bob.Address, - sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(3000000))), - ) - require.NoError(t, err) - - err = app.BankKeeper.SendCoinsFromModuleToAccount( - ctx, - minttypes.ModuleName, - bandtesting.Bob.Address, - sdk.NewCoins(sdk.NewCoin("uabc", sdk.NewInt(1))), - ) - require.NoError(t, err) - - // Carol have not enough uband but have enough uabc - err = app.BankKeeper.SendCoinsFromModuleToAccount( - ctx, - minttypes.ModuleName, - bandtesting.Carol.Address, - sdk.NewCoins(sdk.NewCoin("uabc", sdk.NewInt(1000000))), - ) - require.NoError(t, err) - - // Alice - _, err = k.CollectFee( - ctx, - bandtesting.Alice.Address, - bandtesting.MustGetBalances(ctx, app.BankKeeper, bandtesting.Alice.Address), - 1, - raws, - ) - require.EqualError(t, err, "require: 1000000uabc, max: 0uabc: not enough fee") - - // Bob - _, err = k.CollectFee( - ctx, - bandtesting.Bob.Address, - bandtesting.MustGetBalances(ctx, app.BankKeeper, bandtesting.Bob.Address), - 1, - raws, - ) - require.EqualError(t, err, "require: 1000000uabc, max: 1uabc: not enough fee") - - // Carol - _, err = k.CollectFee( - ctx, - bandtesting.Carol.Address, - bandtesting.MustGetBalances(ctx, app.BankKeeper, bandtesting.Carol.Address), - 1, - raws, + sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(3000000)), sdk.NewCoin("uabc", math.NewInt(1000000))). + Equal(coins), ) - require.EqualError(t, err, "require: 3000000uband, max: 1000000uband: not enough fee") } diff --git a/x/oracle/keeper/params.go b/x/oracle/keeper/params.go index 0a2308086..81e96564d 100644 --- a/x/oracle/keeper/params.go +++ b/x/oracle/keeper/params.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // SetParams sets the x/oracle module parameters. diff --git a/x/oracle/keeper/params_test.go b/x/oracle/keeper/params_test.go index 6c5889e45..be7ea6a06 100644 --- a/x/oracle/keeper/params_test.go +++ b/x/oracle/keeper/params_test.go @@ -2,17 +2,14 @@ package keeper_test import ( "fmt" - "testing" - "github.com/stretchr/testify/require" - - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) -func TestGetSetParams(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestGetSetParams() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() expectedParams := types.Params{ MaxRawRequestCount: 1, @@ -28,8 +25,8 @@ func TestGetSetParams(t *testing.T) { IBCRequestEnabled: true, } err := k.SetParams(ctx, expectedParams) - require.NoError(t, err) - require.Equal(t, expectedParams, k.GetParams(ctx)) + require.NoError(err) + require.Equal(expectedParams, k.GetParams(ctx)) expectedParams = types.Params{ MaxRawRequestCount: 2, @@ -45,8 +42,8 @@ func TestGetSetParams(t *testing.T) { IBCRequestEnabled: false, } err = k.SetParams(ctx, expectedParams) - require.NoError(t, err) - require.Equal(t, expectedParams, k.GetParams(ctx)) + require.NoError(err) + require.Equal(expectedParams, k.GetParams(ctx)) expectedParams = types.Params{ MaxRawRequestCount: 2, @@ -62,8 +59,8 @@ func TestGetSetParams(t *testing.T) { IBCRequestEnabled: false, } err = k.SetParams(ctx, expectedParams) - require.NoError(t, err) - require.Equal(t, expectedParams, k.GetParams(ctx)) + require.NoError(err) + require.Equal(expectedParams, k.GetParams(ctx)) expectedParams = types.Params{ MaxRawRequestCount: 0, @@ -79,5 +76,5 @@ func TestGetSetParams(t *testing.T) { IBCRequestEnabled: false, } err = k.SetParams(ctx, expectedParams) - require.EqualError(t, fmt.Errorf("max raw request count must be positive: 0"), err.Error()) + require.EqualError(fmt.Errorf("max raw request count must be positive: 0"), err.Error()) } diff --git a/x/oracle/keeper/relay.go b/x/oracle/keeper/relay.go index 837e68264..6db460ccb 100644 --- a/x/oracle/keeper/relay.go +++ b/x/oracle/keeper/relay.go @@ -1,10 +1,11 @@ package keeper import ( + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + sdk "github.com/cosmos/cosmos-sdk/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // OnRecvPacket processes a cross chain oracle request. Data source fees diff --git a/x/oracle/keeper/report.go b/x/oracle/keeper/report.go index 1a25861dd..40c45b43c 100644 --- a/x/oracle/keeper/report.go +++ b/x/oracle/keeper/report.go @@ -1,10 +1,14 @@ package keeper import ( + dbm "github.com/cosmos/cosmos-db" + errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // HasReport checks if the report of this ID triple exists in the storage. @@ -86,8 +90,8 @@ func (k Keeper) CheckValidReport( } // GetReportIterator returns the iterator for all reports of the given request ID. -func (k Keeper) GetReportIterator(ctx sdk.Context, rid types.RequestID) sdk.Iterator { - return sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.ReportStoreKey(rid)) +func (k Keeper) GetReportIterator(ctx sdk.Context, rid types.RequestID) dbm.Iterator { + return storetypes.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.ReportStoreKey(rid)) } // GetReportCount returns the number of reports for the given request ID. diff --git a/x/oracle/keeper/report_test.go b/x/oracle/keeper/report_test.go index a682e0ecd..1735fbf2f 100644 --- a/x/oracle/keeper/report_test.go +++ b/x/oracle/keeper/report_test.go @@ -1,110 +1,102 @@ package keeper_test import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/x/oracle/types" + bandtesting "github.com/bandprotocol/chain/v3/testing" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) -func defaultRequest() types.Request { - return types.NewRequest( - 1, BasicCalldata, - []sdk.ValAddress{bandtesting.Validators[0].ValAddress, bandtesting.Validators[1].ValAddress}, - 2, 0, bandtesting.ParseTime(0), - BasicClientID, []types.RawRequest{ - types.NewRawRequest(42, 1, BasicCalldata), - types.NewRawRequest(43, 2, BasicCalldata), - }, nil, 0, - ) -} - -func TestHasReport(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestHasReport() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // We should not have a report to request ID 42 from Alice without setting it. - require.False(t, k.HasReport(ctx, 42, bandtesting.Alice.ValAddress)) + require.False(k.HasReport(ctx, 42, bandtesting.Alice.ValAddress)) // After we set it, we should be able to find it. k.SetReport(ctx, 42, types.NewReport(bandtesting.Alice.ValAddress, true, nil)) - require.True(t, k.HasReport(ctx, 42, bandtesting.Alice.ValAddress)) + require.True(k.HasReport(ctx, 42, bandtesting.Alice.ValAddress)) } -func TestGetReportSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestAddReportSuccess() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() + + k.SetRequest(ctx, 1, defaultRequest()) + err := k.AddReport(ctx, 1, + validators[0].Address, true, []types.RawReport{ + types.NewRawReport(1, 0, []byte("data1/1")), + types.NewRawReport(2, 1, []byte("data2/1")), + types.NewRawReport(3, 0, []byte("data3/1")), + }, + ) + require.NoError(err) + require.Equal([]types.Report{ + types.NewReport(validators[0].Address, true, []types.RawReport{ + types.NewRawReport(1, 0, []byte("data1/1")), + types.NewRawReport(2, 1, []byte("data2/1")), + types.NewRawReport(3, 0, []byte("data3/1")), + }), + }, k.GetReports(ctx, 1)) +} + +func (suite *KeeperTestSuite) TestGetReportSuccess() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() k.SetRequest(ctx, 1, defaultRequest()) expectedReport := types.NewReport( - bandtesting.Validators[0].ValAddress, true, []types.RawReport{ - types.NewRawReport(42, 0, []byte("data1/1")), - types.NewRawReport(43, 1, []byte("data2/1")), + validators[0].Address, true, []types.RawReport{ + types.NewRawReport(1, 0, []byte("data1/1")), + types.NewRawReport(2, 1, []byte("data2/1")), + types.NewRawReport(3, 0, []byte("data3/1")), }, ) err := k.AddReport( ctx, 1, - bandtesting.Validators[0].ValAddress, true, []types.RawReport{ - types.NewRawReport(42, 0, []byte("data1/1")), - types.NewRawReport(43, 1, []byte("data2/1")), + validators[0].Address, true, []types.RawReport{ + types.NewRawReport(1, 0, []byte("data1/1")), + types.NewRawReport(2, 1, []byte("data2/1")), + types.NewRawReport(3, 0, []byte("data3/1")), }, ) - require.NoError(t, err) + require.NoError(err) - report, err := k.GetReport(ctx, 1, bandtesting.Validators[0].ValAddress) - require.NoError(t, err) - require.Equal(t, expectedReport, report) + report, err := k.GetReport(ctx, 1, validators[0].Address) + require.NoError(err) + require.Equal(expectedReport, report) } -func TestGetReportNotFound(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper - k.SetRequest(ctx, 1, defaultRequest()) +func (suite *KeeperTestSuite) TestGetReportNotFound() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() - report, err := k.GetReport(ctx, 1, bandtesting.Validators[0].ValAddress) - require.Empty(t, report) - require.ErrorIs(t, err, types.ErrReportNotFound) + report, err := k.GetReport(ctx, 1, validators[0].Address) + require.Empty(report) + require.ErrorIs(err, types.ErrReportNotFound) } -func TestAddReportSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper - - k.SetRequest(ctx, 1, defaultRequest()) - err := k.AddReport(ctx, 1, - bandtesting.Validators[0].ValAddress, true, []types.RawReport{ - types.NewRawReport(42, 0, []byte("data1/1")), - types.NewRawReport(43, 1, []byte("data2/1")), - }, - ) - require.NoError(t, err) - require.Equal(t, []types.Report{ - types.NewReport(bandtesting.Validators[0].ValAddress, true, []types.RawReport{ - types.NewRawReport(42, 0, []byte("data1/1")), - types.NewRawReport(43, 1, []byte("data2/1")), - }), - }, k.GetReports(ctx, 1)) -} - -func TestReportOnNonExistingRequest(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestReportOnNonExistingRequest() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() err := k.AddReport(ctx, 1, - bandtesting.Validators[0].ValAddress, true, []types.RawReport{ + validators[0].Address, true, []types.RawReport{ types.NewRawReport(42, 0, []byte("data1/1")), types.NewRawReport(43, 1, []byte("data2/1")), }, ) - require.ErrorIs(t, err, types.ErrRequestNotFound) + require.ErrorIs(err, types.ErrRequestNotFound) } -func TestReportByNotRequestedValidator(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestReportByNotRequestedValidator() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() k.SetRequest(ctx, 1, defaultRequest()) err := k.AddReport(ctx, 1, @@ -113,60 +105,67 @@ func TestReportByNotRequestedValidator(t *testing.T) { types.NewRawReport(43, 1, []byte("data2/1")), }, ) - require.ErrorIs(t, err, types.ErrValidatorNotRequested) + require.ErrorIs(err, types.ErrValidatorNotRequested) } -func TestDuplicateReport(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestDuplicateReport() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() k.SetRequest(ctx, 1, defaultRequest()) err := k.AddReport(ctx, 1, - bandtesting.Validators[0].ValAddress, true, []types.RawReport{ - types.NewRawReport(42, 0, []byte("data1/1")), - types.NewRawReport(43, 1, []byte("data2/1")), + validators[0].Address, true, []types.RawReport{ + types.NewRawReport(1, 0, []byte("data1/1")), + types.NewRawReport(2, 1, []byte("data2/1")), + types.NewRawReport(3, 0, []byte("data3/1")), }, ) - require.NoError(t, err) + require.NoError(err) err = k.AddReport(ctx, 1, - bandtesting.Validators[0].ValAddress, true, []types.RawReport{ - types.NewRawReport(42, 0, []byte("data1/1")), - types.NewRawReport(43, 1, []byte("data2/1")), + validators[0].Address, true, []types.RawReport{ + types.NewRawReport(1, 0, []byte("data1/1")), + types.NewRawReport(2, 1, []byte("data2/1")), + types.NewRawReport(3, 0, []byte("data3/1")), }, ) - require.ErrorIs(t, err, types.ErrValidatorAlreadyReported) + require.ErrorIs(err, types.ErrValidatorAlreadyReported) } -func TestReportInvalidDataSourceCount(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestReportInvalidDataSourceCount() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() k.SetRequest(ctx, 1, defaultRequest()) err := k.AddReport(ctx, 1, - bandtesting.Validators[0].ValAddress, true, []types.RawReport{ + validators[0].Address, true, []types.RawReport{ types.NewRawReport(42, 0, []byte("data1/1")), }, ) - require.ErrorIs(t, err, types.ErrInvalidReportSize) + require.ErrorIs(err, types.ErrInvalidReportSize) } -func TestReportInvalidExternalIDs(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestReportInvalidExternalIDs() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() k.SetRequest(ctx, 1, defaultRequest()) err := k.AddReport(ctx, 1, - bandtesting.Validators[0].ValAddress, true, []types.RawReport{ - types.NewRawReport(42, 0, []byte("data1/1")), - types.NewRawReport(44, 1, []byte("data2/1")), // BAD EXTERNAL ID! + validators[0].Address, true, []types.RawReport{ + types.NewRawReport(1, 0, []byte("data1/1")), + types.NewRawReport(44, 1, []byte("data2/1")), // Bad External ID + types.NewRawReport(3, 0, []byte("data3/1")), }, ) - require.ErrorIs(t, err, types.ErrRawRequestNotFound) + require.ErrorIs(err, types.ErrRawRequestNotFound) } -func TestGetReportCount(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestGetReportCount() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // We start by setting some arbitrary reports. k.SetReport(ctx, types.RequestID(1), types.NewReport(bandtesting.Alice.ValAddress, true, []types.RawReport{})) @@ -175,13 +174,14 @@ func TestGetReportCount(t *testing.T) { k.SetReport(ctx, types.RequestID(2), types.NewReport(bandtesting.Bob.ValAddress, true, []types.RawReport{})) k.SetReport(ctx, types.RequestID(2), types.NewReport(bandtesting.Carol.ValAddress, true, []types.RawReport{})) // GetReportCount should return the correct values. - require.Equal(t, uint64(2), k.GetReportCount(ctx, types.RequestID(1))) - require.Equal(t, uint64(3), k.GetReportCount(ctx, types.RequestID(2))) + require.Equal(uint64(2), k.GetReportCount(ctx, types.RequestID(1))) + require.Equal(uint64(3), k.GetReportCount(ctx, types.RequestID(2))) } -func TestDeleteReports(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestDeleteReports() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // We start by setting some arbitrary reports. k.SetReport(ctx, types.RequestID(1), types.NewReport(bandtesting.Alice.ValAddress, true, []types.RawReport{})) @@ -190,16 +190,16 @@ func TestDeleteReports(t *testing.T) { k.SetReport(ctx, types.RequestID(2), types.NewReport(bandtesting.Bob.ValAddress, true, []types.RawReport{})) k.SetReport(ctx, types.RequestID(2), types.NewReport(bandtesting.Carol.ValAddress, true, []types.RawReport{})) // All reports should exist on the state. - require.True(t, k.HasReport(ctx, types.RequestID(1), bandtesting.Alice.ValAddress)) - require.True(t, k.HasReport(ctx, types.RequestID(1), bandtesting.Bob.ValAddress)) - require.True(t, k.HasReport(ctx, types.RequestID(2), bandtesting.Alice.ValAddress)) - require.True(t, k.HasReport(ctx, types.RequestID(2), bandtesting.Bob.ValAddress)) - require.True(t, k.HasReport(ctx, types.RequestID(2), bandtesting.Carol.ValAddress)) + require.True(k.HasReport(ctx, types.RequestID(1), bandtesting.Alice.ValAddress)) + require.True(k.HasReport(ctx, types.RequestID(1), bandtesting.Bob.ValAddress)) + require.True(k.HasReport(ctx, types.RequestID(2), bandtesting.Alice.ValAddress)) + require.True(k.HasReport(ctx, types.RequestID(2), bandtesting.Bob.ValAddress)) + require.True(k.HasReport(ctx, types.RequestID(2), bandtesting.Carol.ValAddress)) // After we delete reports related to request#1, they must disappear. k.DeleteReports(ctx, types.RequestID(1)) - require.False(t, k.HasReport(ctx, types.RequestID(1), bandtesting.Alice.ValAddress)) - require.False(t, k.HasReport(ctx, types.RequestID(1), bandtesting.Bob.ValAddress)) - require.True(t, k.HasReport(ctx, types.RequestID(2), bandtesting.Alice.ValAddress)) - require.True(t, k.HasReport(ctx, types.RequestID(2), bandtesting.Bob.ValAddress)) - require.True(t, k.HasReport(ctx, types.RequestID(2), bandtesting.Carol.ValAddress)) + require.False(k.HasReport(ctx, types.RequestID(1), bandtesting.Alice.ValAddress)) + require.False(k.HasReport(ctx, types.RequestID(1), bandtesting.Bob.ValAddress)) + require.True(k.HasReport(ctx, types.RequestID(2), bandtesting.Alice.ValAddress)) + require.True(k.HasReport(ctx, types.RequestID(2), bandtesting.Bob.ValAddress)) + require.True(k.HasReport(ctx, types.RequestID(2), bandtesting.Carol.ValAddress)) } diff --git a/x/oracle/keeper/request.go b/x/oracle/keeper/request.go index f293289c0..25f7a50d3 100644 --- a/x/oracle/keeper/request.go +++ b/x/oracle/keeper/request.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // HasRequest checks if the request of this ID exists in the storage. diff --git a/x/oracle/keeper/request_test.go b/x/oracle/keeper/request_test.go index 65642bd76..753235f06 100644 --- a/x/oracle/keeper/request_test.go +++ b/x/oracle/keeper/request_test.go @@ -1,18 +1,14 @@ package keeper_test import ( - "testing" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/x/oracle/keeper" - "github.com/bandprotocol/chain/v2/x/oracle/types" + bandtesting "github.com/bandprotocol/chain/v3/testing" + "github.com/bandprotocol/chain/v3/x/oracle/keeper" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) -func testRequest( - t *testing.T, +func (suite *KeeperTestSuite) testRequest( k keeper.Keeper, ctx sdk.Context, rid types.RequestID, @@ -20,242 +16,260 @@ func testRequest( reportCount uint64, hasRequest bool, ) { + require := suite.Require() if resolveStatus == types.RESOLVE_STATUS_OPEN { - require.False(t, k.HasResult(ctx, rid)) + require.False(k.HasResult(ctx, rid)) } else { r, err := k.GetResult(ctx, rid) - require.NoError(t, err) - require.NotNil(t, r) - require.Equal(t, resolveStatus, r.ResolveStatus) + require.NoError(err) + require.NotNil(r) + require.Equal(resolveStatus, r.ResolveStatus) } - require.Equal(t, reportCount, k.GetReportCount(ctx, rid)) - require.Equal(t, hasRequest, k.HasRequest(ctx, rid)) + require.Equal(reportCount, k.GetReportCount(ctx, rid)) + require.Equal(hasRequest, k.HasRequest(ctx, rid)) } -func TestHasRequest(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestHasRequest() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // We should not have a request ID 42 without setting it. - require.False(t, k.HasRequest(ctx, 42)) + require.False(k.HasRequest(ctx, 42)) // After we set it, we should be able to find it. - k.SetRequest(ctx, 42, types.NewRequest(1, BasicCalldata, nil, 1, 1, bandtesting.ParseTime(0), "", nil, nil, 0)) - require.True(t, k.HasRequest(ctx, 42)) + k.SetRequest(ctx, 42, types.NewRequest(1, basicCalldata, nil, 1, 1, bandtesting.ParseTime(0), "", nil, nil, 0)) + require.True(k.HasRequest(ctx, 42)) } -func TestDeleteRequest(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestDeleteRequest() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // After we set it, we should be able to find it. - k.SetRequest(ctx, 42, types.NewRequest(1, BasicCalldata, nil, 1, 1, bandtesting.ParseTime(0), "", nil, nil, 0)) - require.True(t, k.HasRequest(ctx, 42)) + k.SetRequest(ctx, 42, types.NewRequest(1, basicCalldata, nil, 1, 1, bandtesting.ParseTime(0), "", nil, nil, 0)) + require.True(k.HasRequest(ctx, 42)) // After we delete it, we should not find it anymore. k.DeleteRequest(ctx, 42) - require.False(t, k.HasRequest(ctx, 42)) + require.False(k.HasRequest(ctx, 42)) _, err := k.GetRequest(ctx, 42) - require.ErrorIs(t, err, types.ErrRequestNotFound) - require.Panics(t, func() { _ = k.MustGetRequest(ctx, 42) }) + require.ErrorIs(err, types.ErrRequestNotFound) + require.Panics(func() { _ = k.MustGetRequest(ctx, 42) }) } -func TestSetterGetterRequest(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestSetterGetterRequest() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // Getting a non-existent request should return error. _, err := k.GetRequest(ctx, 42) - require.ErrorIs(t, err, types.ErrRequestNotFound) - require.Panics(t, func() { _ = k.MustGetRequest(ctx, 42) }) + require.ErrorIs(err, types.ErrRequestNotFound) + require.Panics(func() { _ = k.MustGetRequest(ctx, 42) }) // Creates some basic requests. - req1 := types.NewRequest(1, BasicCalldata, nil, 1, 1, bandtesting.ParseTime(0), "", nil, nil, 0) - req2 := types.NewRequest(2, BasicCalldata, nil, 1, 1, bandtesting.ParseTime(0), "", nil, nil, 0) + req1 := types.NewRequest(1, basicCalldata, nil, 1, 1, bandtesting.ParseTime(0), "", nil, nil, 0) + req2 := types.NewRequest(2, basicCalldata, nil, 1, 1, bandtesting.ParseTime(0), "", nil, nil, 0) // Sets id 42 with request 1 and id 42 with request 2. k.SetRequest(ctx, 42, req1) k.SetRequest(ctx, 43, req2) // Checks that Get and MustGet perform correctly. req1Res, err := k.GetRequest(ctx, 42) - require.Nil(t, err) - require.Equal(t, req1, req1Res) - require.Equal(t, req1, k.MustGetRequest(ctx, 42)) + require.Nil(err) + require.Equal(req1, req1Res) + require.Equal(req1, k.MustGetRequest(ctx, 42)) req2Res, err := k.GetRequest(ctx, 43) - require.Nil(t, err) - require.Equal(t, req2, req2Res) - require.Equal(t, req2, k.MustGetRequest(ctx, 43)) + require.Nil(err) + require.Equal(req2, req2Res) + require.Equal(req2, k.MustGetRequest(ctx, 43)) // Replaces id 42 with another request. k.SetRequest(ctx, 42, req2) - require.NotEqual(t, req1, k.MustGetRequest(ctx, 42)) - require.Equal(t, req2, k.MustGetRequest(ctx, 42)) + require.NotEqual(req1, k.MustGetRequest(ctx, 42)) + require.Equal(req2, k.MustGetRequest(ctx, 42)) } -func TestSetterGettterPendingResolveList(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestSetterGettterPendingResolveList() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // Initially, we should get an empty list of pending resolves. - require.Equal(t, k.GetPendingResolveList(ctx), []types.RequestID{}) + require.Equal(k.GetPendingResolveList(ctx), []types.RequestID{}) // After we set something, we should get that thing back. k.SetPendingResolveList(ctx, []types.RequestID{5, 6, 7, 8}) - require.Equal(t, k.GetPendingResolveList(ctx), []types.RequestID{5, 6, 7, 8}) + require.Equal(k.GetPendingResolveList(ctx), []types.RequestID{5, 6, 7, 8}) // Let's also try setting it back to empty list. k.SetPendingResolveList(ctx, []types.RequestID{}) - require.Equal(t, k.GetPendingResolveList(ctx), []types.RequestID{}) + require.Equal(k.GetPendingResolveList(ctx), []types.RequestID{}) // Nil should also works. k.SetPendingResolveList(ctx, nil) - require.Equal(t, k.GetPendingResolveList(ctx), []types.RequestID{}) + require.Equal(k.GetPendingResolveList(ctx), []types.RequestID{}) } -func TestAddDataSourceBasic(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestAddDataSourceBasic() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // We start by setting an oracle request available at ID 42. k.SetOracleScript(ctx, 42, types.NewOracleScript( - bandtesting.Owner.Address, BasicName, BasicDesc, BasicFilename, BasicSchema, BasicSourceCodeURL, + owner, basicName, basicDesc, basicFilename, basicSchema, basicSourceCodeURL, )) // Adding the first request should return ID 1. id := k.AddRequest( ctx, - types.NewRequest(42, BasicCalldata, []sdk.ValAddress{}, 1, 1, bandtesting.ParseTime(0), "", nil, nil, 0), + types.NewRequest(42, basicCalldata, []sdk.ValAddress{}, 1, 1, bandtesting.ParseTime(0), "", nil, nil, 0), ) - require.Equal(t, id, types.RequestID(1)) + require.Equal(id, types.RequestID(1)) // Adding another request should return ID 2. id = k.AddRequest( ctx, - types.NewRequest(42, BasicCalldata, []sdk.ValAddress{}, 1, 1, bandtesting.ParseTime(0), "", nil, nil, 0), + types.NewRequest(42, basicCalldata, []sdk.ValAddress{}, 1, 1, bandtesting.ParseTime(0), "", nil, nil, 0), ) - require.Equal(t, id, types.RequestID(2)) + require.Equal(id, types.RequestID(2)) } -func TestAddPendingResolveList(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestAddPendingResolveList() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // Initially, we should get an empty list of pending resolves. - require.Equal(t, k.GetPendingResolveList(ctx), []types.RequestID{}) + require.Equal(k.GetPendingResolveList(ctx), []types.RequestID{}) // Everytime we append a new request ID, it should show up. k.AddPendingRequest(ctx, 42) - require.Equal(t, k.GetPendingResolveList(ctx), []types.RequestID{42}) + require.Equal(k.GetPendingResolveList(ctx), []types.RequestID{42}) k.AddPendingRequest(ctx, 43) - require.Equal(t, k.GetPendingResolveList(ctx), []types.RequestID{42, 43}) + require.Equal(k.GetPendingResolveList(ctx), []types.RequestID{42, 43}) } -func TestProcessExpiredRequests(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestProcessExpiredRequests() { + suite.activeAllValidators() + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() params := k.GetParams(ctx) params.ExpirationBlockCount = 3 err := k.SetParams(ctx, params) - require.NoError(t, err) + require.NoError(err) - // Set some initial requests. All requests are asked to validators 1 & 2. + // Set some initial requests. All requests are asked to validators 0 & 1. + // All request time is set to 1 second after the validators are activated. req1 := defaultRequest() req1.RequestHeight = 5 + req1.RequestTime = ctx.BlockHeader().Time.Unix() + 1 req2 := defaultRequest() req2.RequestHeight = 6 + req2.RequestTime = ctx.BlockHeader().Time.Unix() + 1 req3 := defaultRequest() req3.RequestHeight = 6 + req3.RequestTime = ctx.BlockHeader().Time.Unix() + 1 req4 := defaultRequest() req4.RequestHeight = 10 + req4.RequestTime = ctx.BlockHeader().Time.Unix() + 1 k.AddRequest(ctx, req1) k.AddRequest(ctx, req2) k.AddRequest(ctx, req3) k.AddRequest(ctx, req4) - // Initially all validators are active. - require.True(t, k.GetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress).IsActive) - require.True(t, k.GetValidatorStatus(ctx, bandtesting.Validators[1].ValAddress).IsActive) + // Initially validator 0 & 1 are active. + require.True(k.GetValidatorStatus(ctx, validators[0].Address).IsActive) + require.True(k.GetValidatorStatus(ctx, validators[1].Address).IsActive) // Validator 1 reports all requests. Validator 2 misses request#3. - rawReports := []types.RawReport{types.NewRawReport(42, 0, BasicReport), types.NewRawReport(43, 0, BasicReport)} - err = k.AddReport(ctx, 1, bandtesting.Validators[0].ValAddress, false, rawReports) - require.NoError(t, err) - err = k.AddReport(ctx, 2, bandtesting.Validators[0].ValAddress, true, rawReports) - require.NoError(t, err) - err = k.AddReport(ctx, 3, bandtesting.Validators[0].ValAddress, false, rawReports) - require.NoError(t, err) - err = k.AddReport(ctx, 4, bandtesting.Validators[0].ValAddress, true, rawReports) - require.NoError(t, err) - err = k.AddReport(ctx, 1, bandtesting.Validators[1].ValAddress, true, rawReports) - require.NoError(t, err) - err = k.AddReport(ctx, 2, bandtesting.Validators[1].ValAddress, true, rawReports) - require.NoError(t, err) - err = k.AddReport(ctx, 4, bandtesting.Validators[1].ValAddress, true, rawReports) - require.NoError(t, err) + rawReports := []types.RawReport{ + types.NewRawReport(1, 0, []byte("data1/1")), + types.NewRawReport(2, 1, []byte("data2/1")), + types.NewRawReport(3, 0, []byte("data3/1")), + } + err = k.AddReport(ctx, 1, validators[0].Address, false, rawReports) + require.NoError(err) + err = k.AddReport(ctx, 2, validators[0].Address, true, rawReports) + require.NoError(err) + err = k.AddReport(ctx, 3, validators[0].Address, false, rawReports) + require.NoError(err) + err = k.AddReport(ctx, 4, validators[0].Address, true, rawReports) + require.NoError(err) + err = k.AddReport(ctx, 1, validators[1].Address, true, rawReports) + require.NoError(err) + err = k.AddReport(ctx, 2, validators[1].Address, true, rawReports) + require.NoError(err) + err = k.AddReport(ctx, 4, validators[1].Address, true, rawReports) + require.NoError(err) // Request 1, 2 and 4 gets resolved. Request 3 does not. - k.ResolveSuccess(ctx, 1, BasicResult, 1234) + k.ResolveSuccess(ctx, 1, basicResult, 1234) k.ResolveFailure(ctx, 2, "ARBITRARY_REASON") - k.ResolveSuccess(ctx, 4, BasicResult, 1234) + k.ResolveSuccess(ctx, 4, basicResult, 1234) // Initially, last expired request ID should be 0. - require.Equal(t, types.RequestID(0), k.GetRequestLastExpired(ctx)) + require.Equal(types.RequestID(0), k.GetRequestLastExpired(ctx)) // At block 7, nothing should happen. ctx = ctx.WithBlockHeight(7).WithBlockTime(bandtesting.ParseTime(7000)).WithEventManager(sdk.NewEventManager()) k.ProcessExpiredRequests(ctx) - require.Equal(t, sdk.Events{}, ctx.EventManager().Events()) - require.Equal(t, types.RequestID(0), k.GetRequestLastExpired(ctx)) - require.True(t, k.GetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress).IsActive) - require.True(t, k.GetValidatorStatus(ctx, bandtesting.Validators[1].ValAddress).IsActive) - testRequest(t, k, ctx, types.RequestID(1), types.RESOLVE_STATUS_SUCCESS, 2, true) - testRequest(t, k, ctx, types.RequestID(2), types.RESOLVE_STATUS_FAILURE, 2, true) - testRequest(t, k, ctx, types.RequestID(3), types.RESOLVE_STATUS_OPEN, 1, true) - testRequest(t, k, ctx, types.RequestID(4), types.RESOLVE_STATUS_SUCCESS, 2, true) + require.Equal(sdk.Events{}, ctx.EventManager().Events()) + require.Equal(types.RequestID(0), k.GetRequestLastExpired(ctx)) + require.True(k.GetValidatorStatus(ctx, validators[0].Address).IsActive) + require.True(k.GetValidatorStatus(ctx, validators[1].Address).IsActive) + suite.testRequest(k, ctx, types.RequestID(1), types.RESOLVE_STATUS_SUCCESS, 2, true) + suite.testRequest(k, ctx, types.RequestID(2), types.RESOLVE_STATUS_FAILURE, 2, true) + suite.testRequest(k, ctx, types.RequestID(3), types.RESOLVE_STATUS_OPEN, 1, true) + suite.testRequest(k, ctx, types.RequestID(4), types.RESOLVE_STATUS_SUCCESS, 2, true) // At block 8, now last request ID should move to 1. No events should be emitted. ctx = ctx.WithBlockHeight(8).WithBlockTime(bandtesting.ParseTime(8000)).WithEventManager(sdk.NewEventManager()) k.ProcessExpiredRequests(ctx) - require.Equal(t, sdk.Events{}, ctx.EventManager().Events()) - require.Equal(t, types.RequestID(1), k.GetRequestLastExpired(ctx)) - require.True(t, k.GetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress).IsActive) - require.True(t, k.GetValidatorStatus(ctx, bandtesting.Validators[1].ValAddress).IsActive) - testRequest(t, k, ctx, types.RequestID(1), types.RESOLVE_STATUS_SUCCESS, 0, false) - testRequest(t, k, ctx, types.RequestID(2), types.RESOLVE_STATUS_FAILURE, 2, true) - testRequest(t, k, ctx, types.RequestID(3), types.RESOLVE_STATUS_OPEN, 1, true) - testRequest(t, k, ctx, types.RequestID(4), types.RESOLVE_STATUS_SUCCESS, 2, true) + require.Equal(sdk.Events{}, ctx.EventManager().Events()) + require.Equal(types.RequestID(1), k.GetRequestLastExpired(ctx)) + require.True(k.GetValidatorStatus(ctx, validators[0].Address).IsActive) + require.True(k.GetValidatorStatus(ctx, validators[1].Address).IsActive) + suite.testRequest(k, ctx, types.RequestID(1), types.RESOLVE_STATUS_SUCCESS, 0, false) + suite.testRequest(k, ctx, types.RequestID(2), types.RESOLVE_STATUS_FAILURE, 2, true) + suite.testRequest(k, ctx, types.RequestID(3), types.RESOLVE_STATUS_OPEN, 1, true) + suite.testRequest(k, ctx, types.RequestID(4), types.RESOLVE_STATUS_SUCCESS, 2, true) // At block 9, request#3 is expired and validator 2 becomes inactive. ctx = ctx.WithBlockHeight(9).WithBlockTime(bandtesting.ParseTime(9000)).WithEventManager(sdk.NewEventManager()) k.ProcessExpiredRequests(ctx) - require.Equal(t, sdk.Events{sdk.NewEvent( + require.Equal(sdk.Events{sdk.NewEvent( types.EventTypeResolve, sdk.NewAttribute(types.AttributeKeyID, "3"), sdk.NewAttribute(types.AttributeKeyResolveStatus, "3"), ), sdk.NewEvent( types.EventTypeDeactivate, - sdk.NewAttribute(types.AttributeKeyValidator, bandtesting.Validators[1].ValAddress.String()), + sdk.NewAttribute(types.AttributeKeyValidator, validators[1].Address.String()), )}, ctx.EventManager().Events()) - require.Equal(t, types.RequestID(3), k.GetRequestLastExpired(ctx)) - require.True(t, k.GetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress).IsActive) - require.False(t, k.GetValidatorStatus(ctx, bandtesting.Validators[1].ValAddress).IsActive) - require.Equal(t, types.NewResult( - BasicClientID, req3.OracleScriptID, req3.Calldata, uint64(len(req3.RequestedValidators)), req3.MinCount, + require.Equal(types.RequestID(3), k.GetRequestLastExpired(ctx)) + require.True(k.GetValidatorStatus(ctx, validators[0].Address).IsActive) + require.False(k.GetValidatorStatus(ctx, validators[1].Address).IsActive) + require.Equal(types.NewResult( + basicClientID, req3.OracleScriptID, req3.Calldata, uint64(len(req3.RequestedValidators)), req3.MinCount, 3, 1, req3.RequestTime, bandtesting.ParseTime(9000).Unix(), types.RESOLVE_STATUS_EXPIRED, nil, ), k.MustGetResult(ctx, 3)) - testRequest(t, k, ctx, types.RequestID(1), types.RESOLVE_STATUS_SUCCESS, 0, false) - testRequest(t, k, ctx, types.RequestID(2), types.RESOLVE_STATUS_FAILURE, 0, false) - testRequest(t, k, ctx, types.RequestID(3), types.RESOLVE_STATUS_EXPIRED, 0, false) - testRequest(t, k, ctx, types.RequestID(4), types.RESOLVE_STATUS_SUCCESS, 2, true) + suite.testRequest(k, ctx, types.RequestID(1), types.RESOLVE_STATUS_SUCCESS, 0, false) + suite.testRequest(k, ctx, types.RequestID(2), types.RESOLVE_STATUS_FAILURE, 0, false) + suite.testRequest(k, ctx, types.RequestID(3), types.RESOLVE_STATUS_EXPIRED, 0, false) + suite.testRequest(k, ctx, types.RequestID(4), types.RESOLVE_STATUS_SUCCESS, 2, true) // At block 10, nothing should happen ctx = ctx.WithBlockHeight(10).WithBlockTime(bandtesting.ParseTime(10000)).WithEventManager(sdk.NewEventManager()) k.ProcessExpiredRequests(ctx) - require.Equal(t, sdk.Events{}, ctx.EventManager().Events()) - require.Equal(t, types.RequestID(3), k.GetRequestLastExpired(ctx)) - testRequest(t, k, ctx, types.RequestID(1), types.RESOLVE_STATUS_SUCCESS, 0, false) - testRequest(t, k, ctx, types.RequestID(2), types.RESOLVE_STATUS_FAILURE, 0, false) - testRequest(t, k, ctx, types.RequestID(3), types.RESOLVE_STATUS_EXPIRED, 0, false) - testRequest(t, k, ctx, types.RequestID(4), types.RESOLVE_STATUS_SUCCESS, 2, true) + require.Equal(sdk.Events{}, ctx.EventManager().Events()) + require.Equal(types.RequestID(3), k.GetRequestLastExpired(ctx)) + suite.testRequest(k, ctx, types.RequestID(1), types.RESOLVE_STATUS_SUCCESS, 0, false) + suite.testRequest(k, ctx, types.RequestID(2), types.RESOLVE_STATUS_FAILURE, 0, false) + suite.testRequest(k, ctx, types.RequestID(3), types.RESOLVE_STATUS_EXPIRED, 0, false) + suite.testRequest(k, ctx, types.RequestID(4), types.RESOLVE_STATUS_SUCCESS, 2, true) // At block 13, last expired request becomes 4. ctx = ctx.WithBlockHeight(13).WithBlockTime(bandtesting.ParseTime(13000)).WithEventManager(sdk.NewEventManager()) k.ProcessExpiredRequests(ctx) - require.Equal(t, sdk.Events{}, ctx.EventManager().Events()) - require.Equal(t, types.RequestID(4), k.GetRequestLastExpired(ctx)) - testRequest(t, k, ctx, types.RequestID(1), types.RESOLVE_STATUS_SUCCESS, 0, false) - testRequest(t, k, ctx, types.RequestID(2), types.RESOLVE_STATUS_FAILURE, 0, false) - testRequest(t, k, ctx, types.RequestID(3), types.RESOLVE_STATUS_EXPIRED, 0, false) - testRequest(t, k, ctx, types.RequestID(4), types.RESOLVE_STATUS_SUCCESS, 0, false) + require.Equal(sdk.Events{}, ctx.EventManager().Events()) + require.Equal(types.RequestID(4), k.GetRequestLastExpired(ctx)) + suite.testRequest(k, ctx, types.RequestID(1), types.RESOLVE_STATUS_SUCCESS, 0, false) + suite.testRequest(k, ctx, types.RequestID(2), types.RESOLVE_STATUS_FAILURE, 0, false) + suite.testRequest(k, ctx, types.RequestID(3), types.RESOLVE_STATUS_EXPIRED, 0, false) + suite.testRequest(k, ctx, types.RequestID(4), types.RESOLVE_STATUS_SUCCESS, 0, false) } diff --git a/x/oracle/keeper/result.go b/x/oracle/keeper/result.go index 05732751f..8b6311abc 100644 --- a/x/oracle/keeper/result.go +++ b/x/oracle/keeper/result.go @@ -5,11 +5,12 @@ import ( "fmt" "time" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" + sdk "github.com/cosmos/cosmos-sdk/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - host "github.com/cosmos/ibc-go/v7/modules/core/24-host" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) const ( @@ -116,7 +117,7 @@ func (k Keeper) SaveResult( r.ClientID, id, reportCount, r.RequestTime, ctx.BlockTime().Unix(), status, result, ) - if _, err := k.channelKeeper.SendPacket( + if _, err := k.ics4Wrapper.SendPacket( ctx, channelCap, sourcePort, diff --git a/x/oracle/keeper/result_test.go b/x/oracle/keeper/result_test.go index 98254c0a1..3157e7594 100644 --- a/x/oracle/keeper/result_test.go +++ b/x/oracle/keeper/result_test.go @@ -1,66 +1,66 @@ package keeper_test import ( - "testing" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/x/oracle/types" + bandtesting "github.com/bandprotocol/chain/v3/testing" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) -func TestResultBasicFunctions(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestResultBasicFunctions() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() // We start by setting result of request#1. result := types.NewResult( - "alice", 1, BasicCalldata, 1, 1, 1, 1, 1589535020, 1589535022, 1, BasicResult, + "alice", 1, basicCalldata, 1, 1, 1, 1, 1589535020, 1589535022, 1, basicResult, ) k.SetResult(ctx, 1, result) // GetResult and MustGetResult should return what we set. result, err := k.GetResult(ctx, 1) - require.NoError(t, err) - require.Equal(t, result, result) + require.NoError(err) + require.Equal(result, result) result = k.MustGetResult(ctx, 1) - require.Equal(t, result, result) + require.Equal(result, result) // GetResult of another request should return error. _, err = k.GetResult(ctx, 2) - require.ErrorIs(t, err, types.ErrResultNotFound) - require.Panics(t, func() { k.MustGetResult(ctx, 2) }) + require.ErrorIs(err, types.ErrResultNotFound) + require.Panics(func() { k.MustGetResult(ctx, 2) }) // HasResult should also perform correctly. - require.True(t, k.HasResult(ctx, 1)) - require.False(t, k.HasResult(ctx, 2)) + require.True(k.HasResult(ctx, 1)) + require.False(k.HasResult(ctx, 2)) } -func TestSaveResultOK(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestSaveResultOK() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() ctx = ctx.WithBlockTime(bandtesting.ParseTime(200)) k.SetRequest(ctx, 42, defaultRequest()) // See report_test.go - k.SetReport(ctx, 42, types.NewReport(bandtesting.Validators[0].ValAddress, true, nil)) - k.SaveResult(ctx, 42, types.RESOLVE_STATUS_SUCCESS, BasicResult) + k.SetReport(ctx, 42, types.NewReport(validators[0].Address, true, nil)) + k.SaveResult(ctx, 42, types.RESOLVE_STATUS_SUCCESS, basicResult) expect := types.NewResult( - BasicClientID, 1, BasicCalldata, 2, 2, 42, 1, bandtesting.ParseTime(0).Unix(), - bandtesting.ParseTime(200).Unix(), types.RESOLVE_STATUS_SUCCESS, BasicResult, + basicClientID, 1, basicCalldata, 2, 2, 42, 1, bandtesting.ParseTime(0).Unix(), + bandtesting.ParseTime(200).Unix(), types.RESOLVE_STATUS_SUCCESS, basicResult, ) result, err := k.GetResult(ctx, 42) - require.NoError(t, err) - require.Equal(t, expect, result) + require.NoError(err) + require.Equal(expect, result) } -func TestResolveSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestResolveSuccess() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() k.SetRequest(ctx, 42, defaultRequest()) // See report_test.go - k.SetReport(ctx, 42, types.NewReport(bandtesting.Validators[0].ValAddress, true, nil)) - k.ResolveSuccess(ctx, 42, BasicResult, 1234) - require.Equal(t, types.RESOLVE_STATUS_SUCCESS, k.MustGetResult(ctx, 42).ResolveStatus) - require.Equal(t, BasicResult, k.MustGetResult(ctx, 42).Result) - require.Equal(t, sdk.Events{sdk.NewEvent( + k.SetReport(ctx, 42, types.NewReport(validators[0].Address, true, nil)) + k.ResolveSuccess(ctx, 42, basicResult, 1234) + require.Equal(types.RESOLVE_STATUS_SUCCESS, k.MustGetResult(ctx, 42).ResolveStatus) + require.Equal(basicResult, k.MustGetResult(ctx, 42).Result) + require.Equal(sdk.Events{sdk.NewEvent( types.EventTypeResolve, sdk.NewAttribute(types.AttributeKeyID, "42"), sdk.NewAttribute(types.AttributeKeyResolveStatus, "1"), @@ -69,16 +69,17 @@ func TestResolveSuccess(t *testing.T) { )}, ctx.EventManager().Events()) } -func TestResolveFailure(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestResolveFailure() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() k.SetRequest(ctx, 42, defaultRequest()) // See report_test.go - k.SetReport(ctx, 42, types.NewReport(bandtesting.Validators[0].ValAddress, true, nil)) + k.SetReport(ctx, 42, types.NewReport(validators[0].Address, true, nil)) k.ResolveFailure(ctx, 42, "REASON") - require.Equal(t, types.RESOLVE_STATUS_FAILURE, k.MustGetResult(ctx, 42).ResolveStatus) - require.Empty(t, k.MustGetResult(ctx, 42).Result) - require.Equal(t, sdk.Events{sdk.NewEvent( + require.Equal(types.RESOLVE_STATUS_FAILURE, k.MustGetResult(ctx, 42).ResolveStatus) + require.Empty(k.MustGetResult(ctx, 42).Result) + require.Equal(sdk.Events{sdk.NewEvent( types.EventTypeResolve, sdk.NewAttribute(types.AttributeKeyID, "42"), sdk.NewAttribute(types.AttributeKeyResolveStatus, "2"), @@ -86,16 +87,17 @@ func TestResolveFailure(t *testing.T) { )}, ctx.EventManager().Events()) } -func TestResolveExpired(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestResolveExpired() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() k.SetRequest(ctx, 42, defaultRequest()) // See report_test.go - k.SetReport(ctx, 42, types.NewReport(bandtesting.Validators[0].ValAddress, true, nil)) + k.SetReport(ctx, 42, types.NewReport(validators[0].Address, true, nil)) k.ResolveExpired(ctx, 42) - require.Equal(t, types.RESOLVE_STATUS_EXPIRED, k.MustGetResult(ctx, 42).ResolveStatus) - require.Empty(t, k.MustGetResult(ctx, 42).Result) - require.Equal(t, sdk.Events{sdk.NewEvent( + require.Equal(types.RESOLVE_STATUS_EXPIRED, k.MustGetResult(ctx, 42).ResolveStatus) + require.Empty(k.MustGetResult(ctx, 42).Result) + require.Equal(sdk.Events{sdk.NewEvent( types.EventTypeResolve, sdk.NewAttribute(types.AttributeKeyID, "42"), sdk.NewAttribute(types.AttributeKeyResolveStatus, "3"), diff --git a/x/oracle/keeper/snapshotter.go b/x/oracle/keeper/snapshotter.go index f4a47c973..a5a0c7408 100644 --- a/x/oracle/keeper/snapshotter.go +++ b/x/oracle/keeper/snapshotter.go @@ -4,15 +4,18 @@ import ( "fmt" "io" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + errorsmod "cosmossdk.io/errors" - "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - snapshot "github.com/cosmos/cosmos-sdk/snapshots/types" + "cosmossdk.io/log" + snapshot "cosmossdk.io/store/snapshots/types" + storetypes "cosmossdk.io/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/pkg/filecache" - "github.com/bandprotocol/chain/v2/pkg/gzip" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/pkg/filecache" + "github.com/bandprotocol/chain/v3/pkg/gzip" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) var _ snapshot.ExtensionSnapshotter = &OracleSnapshotter{} @@ -22,10 +25,10 @@ const SnapshotFormat = 1 type OracleSnapshotter struct { keeper *Keeper - cms sdk.MultiStore + cms storetypes.MultiStore } -func NewOracleSnapshotter(cms sdk.MultiStore, keeper *Keeper) *OracleSnapshotter { +func NewOracleSnapshotter(cms storetypes.MultiStore, keeper *Keeper) *OracleSnapshotter { return &OracleSnapshotter{ keeper: keeper, cms: cms, @@ -50,7 +53,7 @@ func (os *OracleSnapshotter) SnapshotExtension(height uint64, payloadWriter snap return err } - ctx := sdk.NewContext(cacheMS, tmproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(cacheMS, cmtproto.Header{}, false, log.NewNopLogger()) seenBefore := make(map[string]bool) // write all oracle scripts to snapshot @@ -95,7 +98,7 @@ func (os *OracleSnapshotter) processAllItems( restore func(sdk.Context, *Keeper, []byte, map[string]bool) error, finalize func(sdk.Context, *Keeper, map[string]bool) error, ) error { - ctx := sdk.NewContext(os.cms, tmproto.Header{Height: int64(height)}, false, log.NewNopLogger()) + ctx := sdk.NewContext(os.cms, cmtproto.Header{Height: int64(height)}, false, log.NewNopLogger()) // get all filename that we need to find and construct a map to store found status foundCode := make(map[string]bool) @@ -163,7 +166,7 @@ func restoreV1(ctx sdk.Context, k *Keeper, compressedCode []byte, foundCode map[ max(types.MaxExecutableSize, types.MaxWasmCodeSize, types.MaxCompiledWasmCodeSize), ) if err != nil { - return types.ErrUncompressionFailed.Wrapf(err.Error()) + return types.ErrUncompressionFailed.Wrap(err.Error()) } // check if we really need this file or not first diff --git a/x/oracle/keeper/snapshotter_integration_test.go b/x/oracle/keeper/snapshotter_integration_test.go index 89f013272..0c40e8721 100644 --- a/x/oracle/keeper/snapshotter_integration_test.go +++ b/x/oracle/keeper/snapshotter_integration_test.go @@ -3,22 +3,28 @@ package keeper_test import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/x/oracle/keeper" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + + bandtesting "github.com/bandprotocol/chain/v3/testing" + "github.com/bandprotocol/chain/v3/x/oracle/keeper" ) func TestSnapshotter(t *testing.T) { // setup source app - srcApp, srcCtx := bandtesting.CreateTestApp(t, true) + srcDir := testutil.GetTempDir(t) + srcApp := bandtesting.SetupWithCustomHome(false, srcDir) + srcCtx := srcApp.BaseApp.NewUncachedContext(false, cmtproto.Header{}) srcKeeper := srcApp.OracleKeeper // create snapshot - srcApp.Commit() + _, err := srcApp.Commit() + require.NoError(t, err) srcHashToCode := getMappingHashToCode(srcCtx, &srcKeeper) snapshotHeight := uint64(srcApp.LastBlockHeight()) snapshot, err := srcApp.SnapshotManager().Create(snapshotHeight) @@ -26,8 +32,9 @@ func TestSnapshotter(t *testing.T) { assert.NotNil(t, snapshot) // restore snapshot - destApp := bandtesting.SetupWithEmptyStore(t, "testing") - destCtx := destApp.NewUncachedContext(false, tmproto.Header{}) + destDir := testutil.GetTempDir(t) + destApp := bandtesting.SetupWithCustomHome(false, destDir) + destCtx := destApp.BaseApp.NewUncachedContext(false, cmtproto.Header{}) destKeeper := destApp.OracleKeeper require.NoError(t, destApp.SnapshotManager().Restore(*snapshot)) for i := uint32(0); i < snapshot.Chunks; i++ { diff --git a/x/oracle/keeper/validation.go b/x/oracle/keeper/validation.go index 32e5c5250..bcdf367ab 100644 --- a/x/oracle/keeper/validation.go +++ b/x/oracle/keeper/validation.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // ContainsVal returns whether the given slice of validators contains the target validator. diff --git a/x/oracle/keeper/validator_status.go b/x/oracle/keeper/validator_status.go index 15357a099..b7f1c3c0b 100644 --- a/x/oracle/keeper/validator_status.go +++ b/x/oracle/keeper/validator_status.go @@ -4,11 +4,14 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" - distr "github.com/cosmos/cosmos-sdk/x/distribution/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // valWithPower is an internal type to track validator with voting power inside of AllocateTokens. @@ -19,45 +22,77 @@ type valWithPower struct { // AllocateTokens allocates a portion of fee collected in the previous blocks to validators that // that are actively performing oracle tasks. Note that this reward is also subjected to comm tax. -func (k Keeper) AllocateTokens(ctx sdk.Context, previousVotes []abci.VoteInfo) { +func (k Keeper) AllocateTokens(ctx sdk.Context, previousVotes []abci.VoteInfo) error { toReward := []valWithPower{} totalPower := int64(0) for _, vote := range previousVotes { - val := k.stakingKeeper.ValidatorByConsAddr(ctx, vote.Validator.Address) - if k.GetValidatorStatus(ctx, val.GetOperator()).IsActive { + val, err := k.stakingKeeper.ValidatorByConsAddr(ctx, vote.Validator.Address) + if err != nil { + continue + } + operator, err := sdk.ValAddressFromBech32(val.GetOperator()) + if err != nil { + continue + } + if k.GetValidatorStatus(ctx, operator).IsActive { toReward = append(toReward, valWithPower{val: val, power: vote.Validator.Power}) totalPower += vote.Validator.Power } } if totalPower == 0 { // No active validators performing oracle tasks, nothing needs to be done here. - return + return nil } feeCollector := k.authKeeper.GetModuleAccount(ctx, k.feeCollectorName) totalFee := sdk.NewDecCoinsFromCoins(k.bankKeeper.GetAllBalances(ctx, feeCollector.GetAddress())...) // Compute the fee allocated for oracle module to distribute to active validators. - oracleRewardRatio := sdk.NewDecWithPrec(int64(k.GetParams(ctx).OracleRewardPercentage), 2) + oracleRewardRatio := math.LegacyNewDecWithPrec(int64(k.GetParams(ctx).OracleRewardPercentage), 2) oracleRewardInt, _ := totalFee.MulDecTruncate(oracleRewardRatio).TruncateDecimal() + // Transfer the oracle reward portion from fee collector to distr module. - err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, k.feeCollectorName, distr.ModuleName, oracleRewardInt) + err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, k.feeCollectorName, distrtypes.ModuleName, oracleRewardInt) if err != nil { - panic(err) + return err } // Convert the transferred tokens back to DecCoins for internal distr allocations. oracleReward := sdk.NewDecCoinsFromCoins(oracleRewardInt...) + communityTax, err := k.distrKeeper.GetCommunityTax(ctx) + if err != nil { + return err + } + + // Fund community pool with a portion of the oracle reward. + communityFund, _ := oracleReward.MulDecTruncate(communityTax).TruncateDecimal() + err = k.distrKeeper.FundCommunityPool( + ctx, + communityFund, + k.authKeeper.GetModuleAccount(ctx, distrtypes.ModuleName).GetAddress(), + ) + if err != nil { + panic(err) + } + oracleReward = oracleReward.Sub(sdk.NewDecCoinsFromCoins(communityFund...)) remaining := oracleReward - rewardMultiplier := sdk.OneDec().Sub(k.distrKeeper.GetCommunityTax(ctx)) + // Allocate non-community pool tokens to active validators weighted by voting power. for _, each := range toReward { - powerFraction := sdk.NewDec(each.power).QuoTruncate(sdk.NewDec(totalPower)) - reward := oracleReward.MulDecTruncate(rewardMultiplier).MulDecTruncate(powerFraction) - k.distrKeeper.AllocateTokensToValidator(ctx, each.val, reward) + powerFraction := math.LegacyNewDec(each.power).QuoTruncate(math.LegacyNewDec(totalPower)) + reward := oracleReward.MulDecTruncate(powerFraction) + err := k.distrKeeper.AllocateTokensToValidator(ctx, each.val, reward) + if err != nil { + // Should never hit + return err + } remaining = remaining.Sub(reward) } - // Allocate the remaining coins to the community pool. - feePool := k.distrKeeper.GetFeePool(ctx) - feePool.CommunityPool = feePool.CommunityPool.Add(remaining...) - k.distrKeeper.SetFeePool(ctx, feePool) + + // Remaining tokens are sent to proposer. + proposer, err := k.stakingKeeper.ValidatorByConsAddr(ctx, ctx.BlockHeader().ProposerAddress) + if err != nil { + // Should never hit + return err + } + return k.distrKeeper.AllocateTokensToValidator(ctx, proposer, remaining) } // GetValidatorStatus returns the validator status for the given validator. Note that validator diff --git a/x/oracle/keeper/validator_status_test.go b/x/oracle/keeper/validator_status_test.go index 690f6ebdd..7e1dd5b18 100644 --- a/x/oracle/keeper/validator_status_test.go +++ b/x/oracle/keeper/validator_status_test.go @@ -1,268 +1,270 @@ package keeper_test import ( - "testing" "time" + "go.uber.org/mock/gomock" + abci "github.com/cometbft/cometbft/abci/types" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/stretchr/testify/require" - - bandapp "github.com/bandprotocol/chain/v2/app" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/x/oracle/keeper" - "github.com/bandprotocol/chain/v2/x/oracle/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + + oracletestutil "github.com/bandprotocol/chain/v3/x/oracle/testutil" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) -func defaultVotes() []abci.VoteInfo { - return []abci.VoteInfo{{ - Validator: abci.Validator{ - Address: bandtesting.Validators[0].PubKey.Address(), - Power: 70, - }, - SignedLastBlock: true, - }, { - Validator: abci.Validator{ - Address: bandtesting.Validators[1].PubKey.Address(), - Power: 20, - }, - SignedLastBlock: true, - }, { - Validator: abci.Validator{ - Address: bandtesting.Validators[2].PubKey.Address(), - Power: 10, - }, - SignedLastBlock: true, - }} +var defaultVotes = []abci.VoteInfo{{ + Validator: abci.Validator{ + Address: valConsPk0.Address(), + Power: 70, + }, +}, { + Validator: abci.Validator{ + Address: valConsPk1.Address(), + Power: 20, + }, +}, { + Validator: abci.Validator{ + Address: valConsPk2.Address(), + Power: 10, + }, +}} + +func (suite *KeeperTestSuite) mockValidators() []*gomock.Call { + return []*gomock.Call{ + suite.stakingKeeper.EXPECT(). + ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk0)). + Return(validators[0].Validator, nil).AnyTimes(), + suite.stakingKeeper.EXPECT(). + ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk1)). + Return(validators[1].Validator, nil).AnyTimes(), + suite.stakingKeeper.EXPECT(). + ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk2)). + Return(validators[2].Validator, nil).AnyTimes(), + } } -func SetupFeeCollector(app *bandapp.BandApp, ctx sdk.Context, k keeper.Keeper) authtypes.ModuleAccountI { - // Set collected fee to 1000000uband and 70% oracle reward proportion. - feeCollector := app.AccountKeeper.GetModuleAccount(ctx, authtypes.FeeCollectorName) - _ = app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, Coins1000000uband) - _ = app.BankKeeper.SendCoinsFromModuleToModule( - ctx, - minttypes.ModuleName, - authtypes.FeeCollectorName, - Coins1000000uband, +func (suite *KeeperTestSuite) mockFundCommunityPool(amount sdk.Coins, sender sdk.AccAddress) *gomock.Call { + return suite.distrKeeper.EXPECT().FundCommunityPool( + gomock.Any(), + amount, sender, ) - app.AccountKeeper.SetAccount(ctx, feeCollector) - - params := k.GetParams(ctx) - params.OracleRewardPercentage = 70 - _ = k.SetParams(ctx, params) - - return feeCollector } -func TestAllocateTokenNoActiveValidators(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestAllocateTokenNoActiveValidators() { + ctx := suite.ctx + k := suite.oracleKeeper - feeCollector := SetupFeeCollector(app.BandApp, ctx, k) - - require.Equal(t, Coins1000000uband, app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress())) // No active oracle validators so nothing should happen. - k.AllocateTokens(ctx, defaultVotes()) - - distAccount := app.AccountKeeper.GetModuleAccount(ctx, disttypes.ModuleName) - require.Equal(t, Coins1000000uband, app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress())) - require.Empty(t, app.BankKeeper.GetAllBalances(ctx, distAccount.GetAddress())) + // Expect only try to sum of validator power + suite.mockValidators() + suite.Require().NoError(k.AllocateTokens(ctx, defaultVotes)) } -func TestAllocateTokensOneActive(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper - - feeCollector := SetupFeeCollector(app.BandApp, ctx, k) +func (suite *KeeperTestSuite) TestAllocateTokensOneActive() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() - require.Equal(t, Coins1000000uband, app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress())) - // From 70% of fee, 2% should go to community pool, the rest goes to the only active validator. - err := k.Activate(ctx, bandtesting.Validators[1].ValAddress) - require.NoError(t, err) - k.AllocateTokens(ctx, defaultVotes()) - - distAccount := app.AccountKeeper.GetModuleAccount(ctx, disttypes.ModuleName) - require.Equal( - t, - sdk.NewCoins(sdk.NewInt64Coin("uband", 300000)), - app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()), - ) - require.Equal( - t, - sdk.NewCoins(sdk.NewInt64Coin("uband", 700000)), - app.BankKeeper.GetAllBalances(ctx, distAccount.GetAddress()), - ) - require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDec(14000)}}, - app.DistrKeeper.GetFeePool(ctx).CommunityPool, - ) - require.Empty(t, app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[0].ValAddress)) - require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDec(686000)}}, - app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[1].ValAddress).Rewards, + // Set Oracle param for reward percentage + params := types.DefaultParams() + params.OracleRewardPercentage = 70 + err := k.SetParams(ctx, params) + require.NoError(err) + + err = k.Activate(ctx, validators[1].Address) + require.NoError(err) + + // Set validator 1 as the proposer + ctx = ctx.WithProposer(valConsPk1.Address().Bytes()) + + // Mock all keeper that will be called when allocate token by order + feeCollectorAcc := authtypes.NewEmptyModuleAccount("fee_collector") + distAcc := authtypes.NewEmptyModuleAccount(distrtypes.ModuleName) + suite.mockValidators() + + oracletestutil.ChainGoMockCalls( + suite.authKeeper.EXPECT().GetModuleAccount(gomock.Any(), "fee_collector").Return(feeCollectorAcc), + suite.bankKeeper.EXPECT().GetAllBalances(gomock.Any(), feeCollectorAcc.GetAddress()).Return(coins1000000uband), + suite.bankKeeper.EXPECT(). + SendCoinsFromModuleToModule(gomock.Any(), "fee_collector", distrtypes.ModuleName, sdk.NewCoins(sdk.NewInt64Coin("uband", 700000))), + suite.distrKeeper.EXPECT().GetCommunityTax(gomock.Any()).Return(math.LegacyNewDecWithPrec(2, 2), nil), + suite.authKeeper.EXPECT().GetModuleAccount(gomock.Any(), distrtypes.ModuleName).Return(distAcc), + suite.mockFundCommunityPool(sdk.NewCoins(sdk.NewInt64Coin("uband", 14000)), distAcc.GetAddress()), + suite.distrKeeper.EXPECT(). + AllocateTokensToValidator(gomock.Any(), validators[1].Validator, sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDec(686000)}}), + suite.distrKeeper.EXPECT(). + AllocateTokensToValidator(gomock.Any(), validators[1].Validator, (sdk.DecCoins)(nil)), ) - require.Empty(t, app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[2].ValAddress)) -} -func TestAllocateTokensAllActive(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, true) - k := app.OracleKeeper - - feeCollector := SetupFeeCollector(app.BandApp, ctx, k) + require.NoError(k.AllocateTokens(ctx, defaultVotes)) +} - require.Equal(t, Coins1000000uband, app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress())) - // From 70% of fee, 2% should go to community pool, the rest get split to validators. - k.AllocateTokens(ctx, defaultVotes()) +func (suite *KeeperTestSuite) TestAllocateTokensAllActive() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() - distAccount := app.AccountKeeper.GetModuleAccount(ctx, disttypes.ModuleName) - require.Equal( - t, - sdk.NewCoins(sdk.NewInt64Coin("uband", 300000)), - app.BankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()), - ) - require.Equal( - t, - sdk.NewCoins(sdk.NewInt64Coin("uband", 700000)), - app.BankKeeper.GetAllBalances(ctx, distAccount.GetAddress()), - ) - require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDec(14000)}}, - app.DistrKeeper.GetFeePool(ctx).CommunityPool, - ) - require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDec(480200)}}, - app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[0].ValAddress).Rewards, - ) - require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDec(137200)}}, - app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[1].ValAddress).Rewards, - ) - require.Equal( - t, - sdk.DecCoins{{Denom: "uband", Amount: sdk.NewDec(68600)}}, - app.DistrKeeper.GetValidatorOutstandingRewards(ctx, bandtesting.Validators[2].ValAddress).Rewards, + // Set Oracle param for reward percentage + params := types.DefaultParams() + params.OracleRewardPercentage = 70 + err := k.SetParams(ctx, params) + require.NoError(err) + + err = k.Activate(ctx, validators[0].Address) + require.NoError(err) + err = k.Activate(ctx, validators[1].Address) + require.NoError(err) + err = k.Activate(ctx, validators[2].Address) + require.NoError(err) + + // Set validator 0 as the proposer + ctx = ctx.WithProposer(valConsPk0.Address().Bytes()) + + // Mock all keeper that will be called when allocate token by order + feeCollectorAcc := authtypes.NewEmptyModuleAccount("fee_collector") + distAcc := authtypes.NewEmptyModuleAccount(distrtypes.ModuleName) + suite.mockValidators() + oracletestutil.ChainGoMockCalls( + suite.authKeeper.EXPECT().GetModuleAccount(gomock.Any(), "fee_collector").Return(feeCollectorAcc), + suite.bankKeeper.EXPECT().GetAllBalances(gomock.Any(), feeCollectorAcc.GetAddress()).Return(coins1000000uband), + suite.bankKeeper.EXPECT(). + SendCoinsFromModuleToModule(gomock.Any(), "fee_collector", distrtypes.ModuleName, sdk.NewCoins(sdk.NewInt64Coin("uband", 700000))), + suite.distrKeeper.EXPECT().GetCommunityTax(gomock.Any()).Return(math.LegacyNewDecWithPrec(2, 2), nil), + suite.authKeeper.EXPECT().GetModuleAccount(gomock.Any(), distrtypes.ModuleName).Return(distAcc), + suite.mockFundCommunityPool(sdk.NewCoins(sdk.NewInt64Coin("uband", 14000)), distAcc.GetAddress()), + suite.distrKeeper.EXPECT(). + AllocateTokensToValidator(gomock.Any(), validators[0].Validator, sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDec(480200)}}), + suite.distrKeeper.EXPECT(). + AllocateTokensToValidator(gomock.Any(), validators[1].Validator, sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDec(137200)}}), + suite.distrKeeper.EXPECT(). + AllocateTokensToValidator(gomock.Any(), validators[2].Validator, sdk.DecCoins{{Denom: "uband", Amount: math.LegacyNewDec(68600)}}), + suite.distrKeeper.EXPECT(). + AllocateTokensToValidator(gomock.Any(), validators[0].Validator, (sdk.DecCoins)(nil)), ) + + require.NoError(k.AllocateTokens(ctx, defaultVotes)) } -func TestGetDefaultValidatorStatus(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestGetDefaultValidatorStatus() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() - vs := k.GetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress) - require.Equal(t, types.NewValidatorStatus(false, time.Time{}), vs) + vs := k.GetValidatorStatus(ctx, validators[0].Address) + require.Equal(types.NewValidatorStatus(false, time.Time{}), vs) } -func TestGetSetValidatorStatus(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestGetSetValidatorStatus() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() now := time.Now().UTC() // After setting status of the 1st validator, we should be able to get it back. - k.SetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress, types.NewValidatorStatus(true, now)) - vs := k.GetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress) - require.Equal(t, types.NewValidatorStatus(true, now), vs) - vs = k.GetValidatorStatus(ctx, bandtesting.Validators[1].ValAddress) - require.Equal(t, types.NewValidatorStatus(false, time.Time{}), vs) + k.SetValidatorStatus(ctx, validators[0].Address, types.NewValidatorStatus(true, now)) + vs := k.GetValidatorStatus(ctx, validators[0].Address) + require.Equal(types.NewValidatorStatus(true, now), vs) + vs = k.GetValidatorStatus(ctx, validators[1].Address) + require.Equal(types.NewValidatorStatus(false, time.Time{}), vs) } -func TestActivateValidatorOK(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestActivateValidatorOK() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() now := time.Now().UTC() ctx = ctx.WithBlockTime(now) - err := k.Activate(ctx, bandtesting.Validators[0].ValAddress) - require.NoError(t, err) - vs := k.GetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress) - require.Equal(t, types.NewValidatorStatus(true, now), vs) - vs = k.GetValidatorStatus(ctx, bandtesting.Validators[1].ValAddress) - require.Equal(t, types.NewValidatorStatus(false, time.Time{}), vs) + err := k.Activate(ctx, validators[0].Address) + require.NoError(err) + vs := k.GetValidatorStatus(ctx, validators[0].Address) + require.Equal(types.NewValidatorStatus(true, now), vs) + vs = k.GetValidatorStatus(ctx, validators[1].Address) + require.Equal(types.NewValidatorStatus(false, time.Time{}), vs) } -func TestFailActivateAlreadyActive(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestFailActivateAlreadyActive() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() now := time.Now().UTC() ctx = ctx.WithBlockTime(now) - err := k.Activate(ctx, bandtesting.Validators[0].ValAddress) - require.NoError(t, err) - err = k.Activate(ctx, bandtesting.Validators[0].ValAddress) - require.ErrorIs(t, err, types.ErrValidatorAlreadyActive) + err := k.Activate(ctx, validators[0].Address) + require.NoError(err) + err = k.Activate(ctx, validators[0].Address) + require.ErrorIs(err, types.ErrValidatorAlreadyActive) } -func TestFailActivateTooSoon(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestFailActivateTooSoon() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() now := time.Now().UTC() // Set validator to be inactive just now. - k.SetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress, types.NewValidatorStatus(false, now)) + k.SetValidatorStatus(ctx, validators[0].Address, types.NewValidatorStatus(false, now)) // You can't activate until it's been at least InactivePenaltyDuration nanosec. penaltyDuration := k.GetParams(ctx).InactivePenaltyDuration require.ErrorIs( - t, - k.Activate(ctx.WithBlockTime(now), bandtesting.Validators[0].ValAddress), + k.Activate(ctx.WithBlockTime(now), validators[0].Address), types.ErrTooSoonToActivate, ) require.ErrorIs( - t, - k.Activate(ctx.WithBlockTime(now.Add(time.Duration(penaltyDuration/2))), bandtesting.Validators[0].ValAddress), + k.Activate(ctx.WithBlockTime(now.Add(time.Duration(penaltyDuration/2))), validators[0].Address), types.ErrTooSoonToActivate, ) // So far there must be no changes to the validator's status. - vs := k.GetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress) - require.Equal(t, types.NewValidatorStatus(false, now), vs) + vs := k.GetValidatorStatus(ctx, validators[0].Address) + require.Equal(types.NewValidatorStatus(false, now), vs) // Now the time has come. require.NoError( - t, - k.Activate(ctx.WithBlockTime(now.Add(time.Duration(penaltyDuration))), bandtesting.Validators[0].ValAddress), + k.Activate(ctx.WithBlockTime(now.Add(time.Duration(penaltyDuration))), validators[0].Address), ) - vs = k.GetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress) - require.Equal(t, types.NewValidatorStatus(true, now.Add(time.Duration(penaltyDuration))), vs) + vs = k.GetValidatorStatus(ctx, validators[0].Address) + require.Equal(types.NewValidatorStatus(true, now.Add(time.Duration(penaltyDuration))), vs) } -func TestMissReportSuccess(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestMissReportSuccess() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() now := time.Now().UTC() next := now.Add(time.Duration(10)) - k.SetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress, types.NewValidatorStatus(true, now)) - k.MissReport(ctx.WithBlockTime(next), bandtesting.Validators[0].ValAddress, next) - vs := k.GetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress) - require.Equal(t, types.NewValidatorStatus(false, next), vs) + k.SetValidatorStatus(ctx, validators[0].Address, types.NewValidatorStatus(true, now)) + k.MissReport(ctx.WithBlockTime(next), validators[0].Address, next) + vs := k.GetValidatorStatus(ctx, validators[0].Address) + require.Equal(types.NewValidatorStatus(false, next), vs) } -func TestMissReportTooSoonNoop(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestMissReportTooSoonNoop() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() prev := time.Now().UTC() now := prev.Add(time.Duration(10)) - k.SetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress, types.NewValidatorStatus(true, now)) - k.MissReport(ctx.WithBlockTime(prev), bandtesting.Validators[0].ValAddress, prev) - vs := k.GetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress) - require.Equal(t, types.NewValidatorStatus(true, now), vs) + k.SetValidatorStatus(ctx, validators[0].Address, types.NewValidatorStatus(true, now)) + k.MissReport(ctx.WithBlockTime(prev), validators[0].Address, prev) + vs := k.GetValidatorStatus(ctx, validators[0].Address) + require.Equal(types.NewValidatorStatus(true, now), vs) } -func TestMissReportAlreadyInactiveNoop(t *testing.T) { - app, ctx := bandtesting.CreateTestApp(t, false) - k := app.OracleKeeper +func (suite *KeeperTestSuite) TestMissReportAlreadyInactiveNoop() { + ctx := suite.ctx + k := suite.oracleKeeper + require := suite.Require() now := time.Now().UTC() next := now.Add(time.Duration(10)) - k.SetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress, types.NewValidatorStatus(false, now)) - k.MissReport(ctx.WithBlockTime(next), bandtesting.Validators[0].ValAddress, next) - vs := k.GetValidatorStatus(ctx, bandtesting.Validators[0].ValAddress) - require.Equal(t, types.NewValidatorStatus(false, now), vs) + k.SetValidatorStatus(ctx, validators[0].Address, types.NewValidatorStatus(false, now)) + k.MissReport(ctx.WithBlockTime(next), validators[0].Address, next) + vs := k.GetValidatorStatus(ctx, validators[0].Address) + require.Equal(types.NewValidatorStatus(false, now), vs) } diff --git a/x/oracle/legacy/v039/types.go b/x/oracle/legacy/v039/types.go index 31c789cef..06023a796 100644 --- a/x/oracle/legacy/v039/types.go +++ b/x/oracle/legacy/v039/types.go @@ -1,7 +1,7 @@ package v039 import ( - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // DataSource represents data source information diff --git a/x/oracle/migrations/v2/migrate.go b/x/oracle/migrations/v2/migrate.go index c6a788c64..6d578eae3 100644 --- a/x/oracle/migrations/v2/migrate.go +++ b/x/oracle/migrations/v2/migrate.go @@ -1,11 +1,13 @@ package v2 import ( + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/oracle/exported" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/exported" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) const ( @@ -18,7 +20,7 @@ const ( // module state. func Migrate( ctx sdk.Context, - store sdk.KVStore, + store storetypes.KVStore, legacySubspace exported.Subspace, cdc codec.BinaryCodec, ) error { diff --git a/x/oracle/migrations/v2/migrator_test.go b/x/oracle/migrations/v2/migrator_test.go index 288a06510..2ba54b29f 100644 --- a/x/oracle/migrations/v2/migrator_test.go +++ b/x/oracle/migrations/v2/migrator_test.go @@ -3,15 +3,18 @@ package v2_test import ( "testing" + "github.com/stretchr/testify/require" + + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/stretchr/testify/require" - "github.com/bandprotocol/chain/v2/x/oracle" - "github.com/bandprotocol/chain/v2/x/oracle/exported" - v2 "github.com/bandprotocol/chain/v2/x/oracle/migrations/v2" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle" + "github.com/bandprotocol/chain/v3/x/oracle/exported" + v2 "github.com/bandprotocol/chain/v3/x/oracle/migrations/v2" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) type mockSubspace struct { @@ -30,8 +33,8 @@ func TestMigrate(t *testing.T) { encCfg := moduletestutil.MakeTestEncodingConfig(oracle.AppModuleBasic{}) cdc := encCfg.Codec - storeKey := sdk.NewKVStoreKey(v2.ModuleName) - tKey := sdk.NewTransientStoreKey("transient_test") + storeKey := storetypes.NewKVStoreKey(v2.ModuleName) + tKey := storetypes.NewTransientStoreKey("transient_test") ctx := testutil.DefaultContext(storeKey, tKey) store := ctx.KVStore(storeKey) diff --git a/x/oracle/module.go b/x/oracle/module.go index 1b1fd8552..7171365ea 100644 --- a/x/oracle/module.go +++ b/x/oracle/module.go @@ -5,33 +5,47 @@ import ( "encoding/json" "fmt" - abci "github.com/cometbft/cometbft/abci/types" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + + "cosmossdk.io/core/appmodule" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - "github.com/bandprotocol/chain/v2/hooks/common" - "github.com/bandprotocol/chain/v2/x/oracle/client/cli" - "github.com/bandprotocol/chain/v2/x/oracle/exported" - "github.com/bandprotocol/chain/v2/x/oracle/keeper" - "github.com/bandprotocol/chain/v2/x/oracle/simulation" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/hooks/common" + "github.com/bandprotocol/chain/v3/x/oracle/client/cli" + "github.com/bandprotocol/chain/v3/x/oracle/exported" + "github.com/bandprotocol/chain/v3/x/oracle/keeper" + "github.com/bandprotocol/chain/v3/x/oracle/simulation" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // ConsensusVersion defines the current x/oracle module consensus version. const ConsensusVersion = 2 var ( - _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} _ module.AppModuleSimulation = AppModule{} - _ porttypes.IBCModule = IBCModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} + _ appmodule.HasEndBlocker = AppModule{} + + _ porttypes.IBCModule = (*IBCModule)(nil) +) + +// Module init related flags +const ( + FlagWithOwasmCacheSize = "oracle-script-cache-size" ) // AppModuleBasic is Band Oracle's module basic object. @@ -50,7 +64,7 @@ func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } // RegisterInterfaces registers the module's interface types -func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { +func (AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { types.RegisterInterfaces(registry) } @@ -60,13 +74,13 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { } // Validation check of the Genesis -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { - var gs types.GenesisState - if err := cdc.UnmarshalJSON(bz, &gs); err != nil { +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { + var data types.GenesisState + if err := cdc.UnmarshalJSON(bz, &data); err != nil { return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) } - return gs.Validate() + return data.Validate() } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the oracle module. @@ -81,11 +95,6 @@ func (AppModuleBasic) GetTxCmd() *cobra.Command { return cli.NewTxCmd() } -// GetQueryCmd returns cobra CLI command to query chain state (SDK AppModuleBasic interface). -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - // AppModule represents the AppModule for this module. type AppModule struct { AppModuleBasic @@ -95,7 +104,7 @@ type AppModule struct { hook common.Hook // for simulation accountKeeper types.AccountKeeper - bankKeeper simulation.BankKeeper + bankKeeper types.BankKeeper stakingKeeper types.StakingKeeper } @@ -104,7 +113,7 @@ func NewAppModule( cdc codec.Codec, k keeper.Keeper, ak types.AccountKeeper, - bk simulation.BankKeeper, + bk types.BankKeeper, sk types.StakingKeeper, ss exported.Subspace, h common.Hook, @@ -120,8 +129,16 @@ func NewAppModule( } } -// RegisterInvariants is a no-op function to satisfy SDK AppModule interface. -func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// AddModuleInitFlags implements servertypes.ModuleInitFlags interface. +func AddModuleInitFlags(startCmd *cobra.Command) { + startCmd.Flags().Uint32(FlagWithOwasmCacheSize, 100, "Number of oracle scripts to cache") +} // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { @@ -136,11 +153,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { } // InitGenesis performs genesis initialization for the oracle module. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) InitGenesis(ctx, am.keeper, &genesisState) - return []abci.ValidatorUpdate{} } // ExportGenesis returns the current state as genesis raw bytes. @@ -152,15 +168,16 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } -// BeginBlock processes ABCI begin block message for this oracle module (SDK AppModule interface). -func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { - handleBeginBlock(ctx, req, am.keeper) +// BeginBlock returns the begin blocker for the oracle module. +func (am AppModule) BeginBlock(ctx context.Context) error { + c := sdk.UnwrapSDKContext(ctx) + return BeginBlocker(c, am.keeper) } // EndBlock processes ABCI end block message for this oracle module (SDK AppModule interface). -func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - handleEndBlock(ctx, am.keeper) - return []abci.ValidatorUpdate{} +func (am AppModule) EndBlock(ctx context.Context) error { + c := sdk.UnwrapSDKContext(ctx) + return EndBlocker(c, am.keeper) } // AppModuleSimulation functions @@ -171,7 +188,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } // RegisterStoreDecoder registers a decoder for feegrant module's types -func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { sdr[types.StoreKey] = simulation.NewDecodeStore(am.cdc) } diff --git a/x/oracle/simulation/decoder.go b/x/oracle/simulation/decoder.go index 761456e27..a54f6edfd 100644 --- a/x/oracle/simulation/decoder.go +++ b/x/oracle/simulation/decoder.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/kv" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // NewDecodeStore returns a decoder function closure that unmarshals the KVPair's diff --git a/x/oracle/simulation/decoder_test.go b/x/oracle/simulation/decoder_test.go index 36fef761c..a20bcd443 100644 --- a/x/oracle/simulation/decoder_test.go +++ b/x/oracle/simulation/decoder_test.go @@ -5,15 +5,16 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/stretchr/testify/require" - "github.com/bandprotocol/chain/v2/x/oracle" - "github.com/bandprotocol/chain/v2/x/oracle/simulation" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle" + "github.com/bandprotocol/chain/v3/x/oracle/simulation" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) var ( @@ -104,8 +105,8 @@ func TestDecodeStore(t *testing.T) { {"other", ""}, } - for i, tt := range tests { - i, tt := i, tt + for idx, test := range tests { + i, tt := idx, test t.Run(tt.name, func(t *testing.T) { switch i { case len(tests) - 1: diff --git a/x/oracle/simulation/genesis.go b/x/oracle/simulation/genesis.go index f4b36a151..8be1e20ff 100644 --- a/x/oracle/simulation/genesis.go +++ b/x/oracle/simulation/genesis.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // GenMaxRawRequestCount returns randomize MaxRawRequestCount @@ -70,67 +70,67 @@ func GenIBCRequestEnabled(r *rand.Rand) bool { func RandomizedGenState(simState *module.SimulationState) { var maxRawRequestCount uint64 simState.AppParams.GetOrGenerate( - simState.Cdc, string(types.KeyMaxRawRequestCount), &maxRawRequestCount, simState.Rand, + string(types.KeyMaxRawRequestCount), &maxRawRequestCount, simState.Rand, func(r *rand.Rand) { maxRawRequestCount = GenMaxRawRequestCount(r) }, ) var maxAskCount uint64 simState.AppParams.GetOrGenerate( - simState.Cdc, string(types.KeyMaxAskCount), &maxAskCount, simState.Rand, + string(types.KeyMaxAskCount), &maxAskCount, simState.Rand, func(r *rand.Rand) { maxAskCount = GenMaxAskCount(r) }, ) var maxCalldataSize uint64 simState.AppParams.GetOrGenerate( - simState.Cdc, string(types.KeyMaxCalldataSize), &maxCalldataSize, simState.Rand, + string(types.KeyMaxCalldataSize), &maxCalldataSize, simState.Rand, func(r *rand.Rand) { maxCalldataSize = GenMaxCalldataSize(r) }, ) var maxReportDataSize uint64 simState.AppParams.GetOrGenerate( - simState.Cdc, string(types.KeyMaxReportDataSize), &maxReportDataSize, simState.Rand, + string(types.KeyMaxReportDataSize), &maxReportDataSize, simState.Rand, func(r *rand.Rand) { maxReportDataSize = GenMaxReportDataSize(r) }, ) var expirationBlockCount uint64 simState.AppParams.GetOrGenerate( - simState.Cdc, string(types.KeyExpirationBlockCount), &expirationBlockCount, simState.Rand, + string(types.KeyExpirationBlockCount), &expirationBlockCount, simState.Rand, func(r *rand.Rand) { expirationBlockCount = GenExpirationBlockCount(r) }, ) var baseOwasmGas uint64 simState.AppParams.GetOrGenerate( - simState.Cdc, string(types.KeyBaseOwasmGas), &baseOwasmGas, simState.Rand, + string(types.KeyBaseOwasmGas), &baseOwasmGas, simState.Rand, func(r *rand.Rand) { baseOwasmGas = GenBaseOwasmGas(r) }, ) var perValidatorRequestGas uint64 simState.AppParams.GetOrGenerate( - simState.Cdc, string(types.KeyPerValidatorRequestGas), &perValidatorRequestGas, simState.Rand, + string(types.KeyPerValidatorRequestGas), &perValidatorRequestGas, simState.Rand, func(r *rand.Rand) { perValidatorRequestGas = GenPerValidatorRequestGas(r) }, ) var samplingTryCount uint64 simState.AppParams.GetOrGenerate( - simState.Cdc, string(types.KeySamplingTryCount), &samplingTryCount, simState.Rand, + string(types.KeySamplingTryCount), &samplingTryCount, simState.Rand, func(r *rand.Rand) { samplingTryCount = GenSamplingTryCount(r) }, ) var oracleRewardPercentage uint64 simState.AppParams.GetOrGenerate( - simState.Cdc, string(types.KeyOracleRewardPercentage), &oracleRewardPercentage, simState.Rand, + string(types.KeyOracleRewardPercentage), &oracleRewardPercentage, simState.Rand, func(r *rand.Rand) { oracleRewardPercentage = GenOracleRewardPercentage(r) }, ) var inactivePenaltyDuration uint64 simState.AppParams.GetOrGenerate( - simState.Cdc, string(types.KeyInactivePenaltyDuration), &inactivePenaltyDuration, simState.Rand, + string(types.KeyInactivePenaltyDuration), &inactivePenaltyDuration, simState.Rand, func(r *rand.Rand) { inactivePenaltyDuration = GenInactivePenaltyDuration(r) }, ) var ibcRequestEnabled bool simState.AppParams.GetOrGenerate( - simState.Cdc, string(types.KeyIBCRequestEnabled), &ibcRequestEnabled, simState.Rand, + string(types.KeyIBCRequestEnabled), &ibcRequestEnabled, simState.Rand, func(r *rand.Rand) { ibcRequestEnabled = GenIBCRequestEnabled(r) }, ) diff --git a/x/oracle/simulation/genesis_test.go b/x/oracle/simulation/genesis_test.go index aa00e6209..75e604617 100644 --- a/x/oracle/simulation/genesis_test.go +++ b/x/oracle/simulation/genesis_test.go @@ -5,17 +5,19 @@ import ( "math/rand" "testing" + "github.com/stretchr/testify/require" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/stretchr/testify/require" - "github.com/bandprotocol/chain/v2/x/oracle" - "github.com/bandprotocol/chain/v2/x/oracle/simulation" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle" + "github.com/bandprotocol/chain/v3/x/oracle/simulation" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) func TestRandomizedGenState(t *testing.T) { diff --git a/x/oracle/simulation/operations.go b/x/oracle/simulation/operations.go index 27110086d..7fa947981 100644 --- a/x/oracle/simulation/operations.go +++ b/x/oracle/simulation/operations.go @@ -12,9 +12,9 @@ import ( "github.com/cosmos/cosmos-sdk/x/simulation" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/bandprotocol/chain/v2/testing/testdata" - "github.com/bandprotocol/chain/v2/x/oracle/keeper" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/testing/testdata" + "github.com/bandprotocol/chain/v3/x/oracle/keeper" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // Simulation operation weights constants @@ -59,43 +59,43 @@ func WeightedOperations( weightMsgActivate int ) - appParams.GetOrGenerate(cdc, OpWeightMsgRequestData, &weightMsgRequestData, nil, + appParams.GetOrGenerate(OpWeightMsgRequestData, &weightMsgRequestData, nil, func(_ *rand.Rand) { weightMsgRequestData = DefaultWeightMsgRequestData }, ) - appParams.GetOrGenerate(cdc, OpWeightMsgReportData, &weightMsgReportData, nil, + appParams.GetOrGenerate(OpWeightMsgReportData, &weightMsgReportData, nil, func(_ *rand.Rand) { weightMsgReportData = DefaultWeightMsgReportData }, ) - appParams.GetOrGenerate(cdc, OpWeightMsgCreateDataSource, &weightMsgCreateDataSource, nil, + appParams.GetOrGenerate(OpWeightMsgCreateDataSource, &weightMsgCreateDataSource, nil, func(_ *rand.Rand) { weightMsgCreateDataSource = DefaultWeightMsgCreateDataSource }, ) - appParams.GetOrGenerate(cdc, OpWeightMsgEditDataSource, &weightMsgEditDataSource, nil, + appParams.GetOrGenerate(OpWeightMsgEditDataSource, &weightMsgEditDataSource, nil, func(_ *rand.Rand) { weightMsgEditDataSource = DefaultWeightMsgEditDataSource }, ) - appParams.GetOrGenerate(cdc, OpWeightMsgCreateOracleScript, &weightMsgCreateOracleScript, nil, + appParams.GetOrGenerate(OpWeightMsgCreateOracleScript, &weightMsgCreateOracleScript, nil, func(_ *rand.Rand) { weightMsgCreateOracleScript = DefaultWeightMsgCreateOracleScript }, ) - appParams.GetOrGenerate(cdc, OpWeightMsgEditOracleScript, &weightMsgEditOracleScript, nil, + appParams.GetOrGenerate(OpWeightMsgEditOracleScript, &weightMsgEditOracleScript, nil, func(_ *rand.Rand) { weightMsgEditOracleScript = DefaultWeightMsgEditOracleScript }, ) - appParams.GetOrGenerate(cdc, OpWeightMsgActivate, &weightMsgActivate, nil, + appParams.GetOrGenerate(OpWeightMsgActivate, &weightMsgActivate, nil, func(_ *rand.Rand) { weightMsgActivate = DefaultWeightMsgActivate }, @@ -141,8 +141,18 @@ func SimulateMsgRequestData( keeper keeper.Keeper, ) simtypes.Operation { return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + msgType := sdk.MsgTypeURL(&types.MsgRequestData{}) simAccount, _ := simtypes.RandomAcc(r, accs) + params := keeper.GetParams(ctx) + if params.MaxRawRequestCount < 3 { + return simtypes.NoOpMsg( + types.ModuleName, + msgType, + "max raw request count less than provided oracle script", + ), nil, nil + } + // Get deployed oracle script from one of random accounts for sending request to. oCount := keeper.GetOracleScriptCount(ctx) oid := types.OracleScriptID(0) @@ -157,7 +167,7 @@ func SimulateMsgRequestData( if oid == 0 { return simtypes.NoOpMsg( types.ModuleName, - types.MsgRequestData{}.Type(), + msgType, "no oracle script available", ), nil, nil } @@ -168,16 +178,20 @@ func SimulateMsgRequestData( if did < 3 { return simtypes.NoOpMsg( types.ModuleName, - types.MsgRequestData{}.Type(), + msgType, "data sources are not enough", ), nil, nil } // Find the number of active validator to define ask count value maxAskCount := 0 - sk.IterateBondedValidatorsByPower(ctx, + _ = sk.IterateBondedValidatorsByPower(ctx, func(idx int64, val stakingtypes.ValidatorI) (stop bool) { - if keeper.GetValidatorStatus(ctx, val.GetOperator()).IsActive { + operator, err := sdk.ValAddressFromBech32(val.GetOperator()) + if err != nil { + return false + } + if keeper.GetValidatorStatus(ctx, operator).IsActive { maxAskCount++ } @@ -187,7 +201,7 @@ func SimulateMsgRequestData( if maxAskCount == 0 { return simtypes.NoOpMsg( types.ModuleName, - types.MsgRequestData{}.Type(), + msgType, "active validators are not enough", ), nil, nil } @@ -223,6 +237,7 @@ func SimulateMsgReportData( keeper keeper.Keeper, ) simtypes.Operation { return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + msgType := sdk.MsgTypeURL(&types.MsgReportData{}) var simAccount simtypes.Account // Get available request that we will send report to @@ -251,7 +266,7 @@ func SimulateMsgReportData( if rid == 0 { return simtypes.NoOpMsg( types.ModuleName, - types.MsgReportData{}.Type(), + msgType, "no request available", ), nil, nil } @@ -316,6 +331,7 @@ func SimulateMsgEditDataSource( keeper keeper.Keeper, ) simtypes.Operation { return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + msgType := sdk.MsgTypeURL(&types.MsgEditDataSource{}) var simAccount simtypes.Account ownerAccount, _ := simtypes.RandomAcc(r, accs) treaAccount, _ := simtypes.RandomAcc(r, accs) @@ -336,7 +352,7 @@ func SimulateMsgEditDataSource( if did == 0 { return simtypes.NoOpMsg( types.ModuleName, - types.MsgEditDataSource{}.Type(), + msgType, "no data source available", ), nil, nil } @@ -395,6 +411,7 @@ func SimulateMsgEditOracleScript( keeper keeper.Keeper, ) simtypes.Operation { return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + msgType := sdk.MsgTypeURL(&types.MsgEditOracleScript{}) var simAccount simtypes.Account // Get available oracle script that we will edit it @@ -413,7 +430,7 @@ func SimulateMsgEditOracleScript( if oid == 0 { return simtypes.NoOpMsg( types.ModuleName, - types.MsgEditOracleScript{}.Type(), + msgType, "no oracle script available", ), nil, nil } @@ -444,13 +461,14 @@ func SimulateMsgActivate( keeper keeper.Keeper, ) simtypes.Operation { return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + msgType := sdk.MsgTypeURL(&types.MsgActivate{}) simAccount, _ := simtypes.RandomAcc(r, accs) // Send no op message if the status of the account is already active if keeper.GetValidatorStatus(ctx, sdk.ValAddress(simAccount.Address)).IsActive { return simtypes.NoOpMsg( types.ModuleName, - types.MsgActivate{}.Type(), + msgType, "already activate", ), nil, nil } @@ -471,10 +489,7 @@ func BuildOperationInput( r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, - msg interface { - sdk.Msg - Type() string - }, + msg sdk.Msg, simAccount simtypes.Account, ak types.AccountKeeper, bk simulation.BankKeeper, @@ -489,7 +504,6 @@ func BuildOperationInput( TxGen: txConfig, Cdc: nil, Msg: msg, - MsgType: msg.Type(), Context: ctx, SimAccount: simAccount, AccountKeeper: ak, diff --git a/x/oracle/simulation/operations_test.go b/x/oracle/simulation/operations_test.go index b51f68973..81780563f 100644 --- a/x/oracle/simulation/operations_test.go +++ b/x/oracle/simulation/operations_test.go @@ -6,45 +6,51 @@ import ( "testing" "time" + "github.com/stretchr/testify/suite" + abci "github.com/cometbft/cometbft/abci/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + + "github.com/cosmos/gogoproto/proto" + + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/bank/testutil" - "github.com/stretchr/testify/suite" + banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - bandtesting "github.com/bandprotocol/chain/v2/testing" - "github.com/bandprotocol/chain/v2/x/oracle/simulation" - "github.com/bandprotocol/chain/v2/x/oracle/types" + band "github.com/bandprotocol/chain/v3/app" + bandtesting "github.com/bandprotocol/chain/v3/testing" + "github.com/bandprotocol/chain/v3/x/oracle/simulation" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) type SimTestSuite struct { suite.Suite ctx sdk.Context - app *bandtesting.TestingApp + app *band.BandApp r *rand.Rand accs []simtypes.Account } +func init() { + band.SetBech32AddressPrefixesAndBip44CoinTypeAndSeal(sdk.GetConfig()) +} + func (suite *SimTestSuite) SetupTest() { - app, _ := bandtesting.CreateTestApp(suite.T(), true) - suite.app = app - suite.ctx = app.BaseApp.NewContext(false, tmproto.Header{ChainID: bandtesting.ChainID}) + dir := testutil.GetTempDir(suite.T()) + suite.app = bandtesting.SetupWithCustomHome(false, dir) + suite.ctx = suite.app.BaseApp.NewContext(false).WithChainID(bandtesting.ChainID) + s := rand.NewSource(1) suite.r = rand.New(s) suite.accs = suite.getTestingAccounts(suite.r, 10) - // begin a new block - suite.app.BeginBlock( - abci.RequestBeginBlock{ - Header: tmproto.Header{ - ChainID: bandtesting.ChainID, - Height: suite.app.LastBlockHeight() + 1, - AppHash: suite.app.LastCommitID().Hash, - }, - }, - ) + _, err := suite.app.FinalizeBlock(&abci.RequestFinalizeBlock{ + Height: suite.app.LastBlockHeight() + 1, + Hash: suite.app.LastCommitID().Hash, + }) + suite.NoError(err) } // TestWeightedOperations tests the weights of the operations. @@ -62,17 +68,19 @@ func (suite *SimTestSuite) TestWeightedOperations() { ) expected := []struct { - weight int - opMsgRoute string - opMsgName string + weight int + opMsgName string }{ - {simulation.DefaultWeightMsgRequestData, types.ModuleName, types.TypeMsgRequestData}, - {simulation.DefaultWeightMsgReportData, types.ModuleName, types.TypeMsgReportData}, - {simulation.DefaultWeightMsgCreateDataSource, types.ModuleName, types.TypeMsgCreateDataSource}, - {simulation.DefaultWeightMsgEditDataSource, types.ModuleName, types.TypeMsgEditDataSource}, - {simulation.DefaultWeightMsgCreateOracleScript, types.ModuleName, types.TypeMsgCreateOracleScript}, - {simulation.DefaultWeightMsgEditOracleScript, types.ModuleName, types.TypeMsgEditOracleScript}, - {simulation.DefaultWeightMsgActivate, types.ModuleName, types.TypeMsgActivate}, + {simulation.DefaultWeightMsgRequestData, sdk.MsgTypeURL(&types.MsgRequestData{})}, + {simulation.DefaultWeightMsgReportData, sdk.MsgTypeURL(&types.MsgReportData{})}, + {simulation.DefaultWeightMsgCreateDataSource, sdk.MsgTypeURL(&types.MsgCreateDataSource{})}, + {simulation.DefaultWeightMsgEditDataSource, sdk.MsgTypeURL(&types.MsgEditDataSource{})}, + { + simulation.DefaultWeightMsgCreateOracleScript, + sdk.MsgTypeURL(&types.MsgCreateOracleScript{}), + }, + {simulation.DefaultWeightMsgEditOracleScript, sdk.MsgTypeURL(&types.MsgEditOracleScript{})}, + {simulation.DefaultWeightMsgActivate, sdk.MsgTypeURL(&types.MsgActivate{})}, } for i, w := range weightesOps { @@ -81,7 +89,6 @@ func (suite *SimTestSuite) TestWeightedOperations() { // by WeightedOperations. if the ordering in WeightedOperations changes some tests // will fail suite.Require().Equal(expected[i].weight, w.Weight(), "weight should be the same") - suite.Require().Equal(expected[i].opMsgRoute, operationMsg.Route, "route should be the same") suite.Require().Equal(expected[i].opMsgName, operationMsg.Name, "operation Msg name should be the same") } } @@ -96,6 +103,20 @@ func (suite *SimTestSuite) TestSimulateMsgRequestData() { ds.Fee = sdk.NewCoins() suite.app.OracleKeeper.SetDataSource(suite.ctx, types.DataSourceID(i), ds) } + // Prepare active validators + err := suite.app.StakingKeeper.IterateBondedValidatorsByPower(suite.ctx, + func(idx int64, val stakingtypes.ValidatorI) (stop bool) { + operator, err := sdk.ValAddressFromBech32(val.GetOperator()) + if err != nil { + return false + } + + _ = suite.app.OracleKeeper.Activate(suite.ctx, operator) + + return false + }, + ) + suite.Require().NoError(err) // Simulate MsgRequestData op := simulation.SimulateMsgRequestData( @@ -109,7 +130,7 @@ func (suite *SimTestSuite) TestSimulateMsgRequestData() { // Verify the fields of the message var msg types.MsgRequestData - err = types.AminoCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) @@ -124,8 +145,7 @@ func (suite *SimTestSuite) TestSimulateMsgRequestData() { suite.Require().Equal(uint64(169271), msg.PrepareGas) suite.Require().Equal(uint64(115894), msg.ExecuteGas) suite.Require().Equal("band1ghekyjucln7y67ntx7cf27m9dpuxxemnvh82dt", msg.Sender) - suite.Require().Equal(types.TypeMsgRequestData, msg.Type()) - suite.Require().Equal(types.ModuleName, msg.Route()) + suite.Require().Equal(sdk.MsgTypeURL(&types.MsgRequestData{}), sdk.MsgTypeURL(&msg)) suite.Require().Len(futureOperations, 0) } @@ -163,15 +183,14 @@ func (suite *SimTestSuite) TestSimulateMsgReportData() { // Verify the fields of the message var msg types.MsgReportData - err = types.AminoCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(types.RequestID(1), msg.RequestID) suite.Require().Equal(3, len(msg.RawReports)) suite.Require().Equal("bandvaloper1tnh2q55v8wyygtt9srz5safamzdengsn4qqe0j", msg.Validator) - suite.Require().Equal(types.TypeMsgReportData, msg.Type()) - suite.Require().Equal(types.ModuleName, msg.Route()) + suite.Require().Equal(sdk.MsgTypeURL(&types.MsgReportData{}), sdk.MsgTypeURL(&msg)) suite.Require().Len(futureOperations, 0) } @@ -189,7 +208,7 @@ func (suite *SimTestSuite) TestSimulateMsgCreateDataSource() { // Verify the fields of the message var msg types.MsgCreateDataSource - err = types.AminoCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) @@ -202,8 +221,7 @@ func (suite *SimTestSuite) TestSimulateMsgCreateDataSource() { suite.Require().Equal(sdk.Coins(nil), msg.Fee) suite.Require().Equal("band13rmqzzysyz4qh3yg6rvknd6u9rvrd98qvy9azu", msg.Treasury) suite.Require().Equal("band1n5sqxutsmk6eews5z9z673wv7n9wah8hjlxyuf", msg.Owner) - suite.Require().Equal(types.TypeMsgCreateDataSource, msg.Type()) - suite.Require().Equal(types.ModuleName, msg.Route()) + suite.Require().Equal(sdk.MsgTypeURL(&types.MsgCreateDataSource{}), sdk.MsgTypeURL(&msg)) suite.Require().Len(futureOperations, 0) } @@ -235,7 +253,7 @@ func (suite *SimTestSuite) TestSimulateMsgEditDataSource() { // Verify the fields of the message var msg types.MsgEditDataSource - err = types.AminoCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) @@ -249,8 +267,7 @@ func (suite *SimTestSuite) TestSimulateMsgEditDataSource() { suite.Require().Equal(sdk.Coins(nil), msg.Fee) suite.Require().Equal("band1n5sqxutsmk6eews5z9z673wv7n9wah8hjlxyuf", msg.Treasury) suite.Require().Equal("band1n5sqxutsmk6eews5z9z673wv7n9wah8hjlxyuf", msg.Owner) - suite.Require().Equal(types.TypeMsgEditDataSource, msg.Type()) - suite.Require().Equal(types.ModuleName, msg.Route()) + suite.Require().Equal(sdk.MsgTypeURL(&types.MsgEditDataSource{}), sdk.MsgTypeURL(&msg)) suite.Require().Len(futureOperations, 0) } @@ -268,7 +285,7 @@ func (suite *SimTestSuite) TestSimulateMsgCreateOracleScript() { // Verify the fields of the message var msg types.MsgCreateOracleScript - err = types.AminoCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) @@ -281,10 +298,9 @@ func (suite *SimTestSuite) TestSimulateMsgCreateOracleScript() { suite.Require(). Equal("nDQfwRLGIWozYaOAilMBcObErwgTDNGWnwQMUgFFSKtPDMEoEQCTKVREqrXZSGLqwTMcxHfWotDllNkIJPMbXzjDVjPOOjCFuIvT", msg.SourceCodeURL) suite.Require(). - Equal("0061736d0100000001100360000060047e7e7e7e0060027e7e00022f0203656e761161736b5f65787465726e616c5f64617461000103656e760f7365745f72657475726e5f6461746100020303020000040501700101010503010011071e030770726570617265000207657865637574650003066d656d6f727902000a4e022601017e42014201418008ad22004204100042024202200042041000420342032000420410000b2501017f4100210002400340200041016a2100200041e400490d000b0b418008ad420410010b0b0b01004180080b0462656562006f046e616d65013704001161736b5f65787465726e616c5f64617461010f7365745f72657475726e5f64617461020770726570617265030765786563757465020e02020100026c3003010003696478040d030002743001027431020274320505010002543006090100066d656d6f7279", hex.EncodeToString(msg.Code)) + Equal("0061736d0100000001100360000060047e7e7e7e0060027e7e00022f0203656e761161736b5f65787465726e616c5f64617461000103656e760f7365745f72657475726e5f6461746100020303020000040501700101010503010011071e030770726570617265000207657865637574650003066d656d6f727902000a4e022601017e42014201418008ad22004204100042024202200042041000420342032000420410000b2501017f4100210002400340200041016a2100200041e400490d000b0b418008ad420410010b0b0b01004180080b0474657374006f046e616d65013704001161736b5f65787465726e616c5f64617461010f7365745f72657475726e5f64617461020770726570617265030765786563757465020e02020100026c3003010003696478040d030002743001027431020274320505010002543006090100066d656d6f7279", hex.EncodeToString(msg.Code)) suite.Require().Equal("band1n5sqxutsmk6eews5z9z673wv7n9wah8hjlxyuf", msg.Owner) - suite.Require().Equal(types.TypeMsgCreateOracleScript, msg.Type()) - suite.Require().Equal(types.ModuleName, msg.Route()) + suite.Require().Equal(sdk.MsgTypeURL(&types.MsgCreateOracleScript{}), sdk.MsgTypeURL(&msg)) suite.Require().Len(futureOperations, 0) } @@ -316,7 +332,7 @@ func (suite *SimTestSuite) TestSimulateMsgEditOracleScript() { // Verify the fields of the message var msg types.MsgEditOracleScript - err = types.AminoCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) @@ -330,10 +346,9 @@ func (suite *SimTestSuite) TestSimulateMsgEditOracleScript() { suite.Require(). Equal("WozYaOAilMBcObErwgTDNGWnwQMUgFFSKtPDMEoEQCTKVREqrXZSGLqwTMcxHfWotDllNkIJPMbXzjDVjPOOjCFuIvTyhXKLyhUS", msg.SourceCodeURL) suite.Require(). - Equal("0061736d0100000001100360000060047e7e7e7e0060027e7e00022f0203656e761161736b5f65787465726e616c5f64617461000103656e760f7365745f72657475726e5f6461746100020303020000040501700101010503010011071e030770726570617265000207657865637574650003066d656d6f727902000a4e022601017e42014201418008ad22004204100042024202200042041000420342032000420410000b2501017f4100210002400340200041016a2100200041e400490d000b0b418008ad420410010b0b0b01004180080b0462656562006f046e616d65013704001161736b5f65787465726e616c5f64617461010f7365745f72657475726e5f64617461020770726570617265030765786563757465020e02020100026c3003010003696478040d030002743001027431020274320505010002543006090100066d656d6f7279", hex.EncodeToString(msg.Code)) + Equal("0061736d0100000001100360000060047e7e7e7e0060027e7e00022f0203656e761161736b5f65787465726e616c5f64617461000103656e760f7365745f72657475726e5f6461746100020303020000040501700101010503010011071e030770726570617265000207657865637574650003066d656d6f727902000a4e022601017e42014201418008ad22004204100042024202200042041000420342032000420410000b2501017f4100210002400340200041016a2100200041e400490d000b0b418008ad420410010b0b0b01004180080b0474657374006f046e616d65013704001161736b5f65787465726e616c5f64617461010f7365745f72657475726e5f64617461020770726570617265030765786563757465020e02020100026c3003010003696478040d030002743001027431020274320505010002543006090100066d656d6f7279", hex.EncodeToString(msg.Code)) suite.Require().Equal("band1tnh2q55v8wyygtt9srz5safamzdengsneky62e", msg.Owner) - suite.Require().Equal(types.TypeMsgEditOracleScript, msg.Type()) - suite.Require().Equal(types.ModuleName, msg.Route()) + suite.Require().Equal(sdk.MsgTypeURL(&types.MsgEditOracleScript{}), sdk.MsgTypeURL(&msg)) suite.Require().Len(futureOperations, 0) } @@ -351,27 +366,27 @@ func (suite *SimTestSuite) TestSimulateMsgActivate() { // Verify the fields of the message var msg types.MsgActivate - err = types.AminoCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal("bandvaloper1n5sqxutsmk6eews5z9z673wv7n9wah8h7fz8ez", msg.Validator) - suite.Require().Equal(types.TypeMsgActivate, msg.Type()) - suite.Require().Equal(types.ModuleName, msg.Route()) + suite.Require().Equal(sdk.MsgTypeURL(&types.MsgActivate{}), sdk.MsgTypeURL(&msg)) suite.Require().Len(futureOperations, 0) } func (suite *SimTestSuite) getTestingAccounts(r *rand.Rand, n int) []simtypes.Account { accounts := simtypes.RandomAccounts(r, n) - initAmt := suite.app.StakingKeeper.TokensFromConsensusPower(suite.ctx, 200) + initAmt := sdk.TokensFromConsensusPower(200, sdk.DefaultPowerReduction) initCoins := sdk.NewCoins(sdk.NewCoin("uband", initAmt)) // add coins to the accounts for _, account := range accounts { acc := suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, account.Address) suite.app.AccountKeeper.SetAccount(suite.ctx, acc) - suite.Require().NoError(testutil.FundAccount(suite.app.BankKeeper, suite.ctx, account.Address, initCoins)) + suite.Require(). + NoError(banktestutil.FundAccount(suite.ctx, suite.app.BankKeeper, account.Address, initCoins)) } return accounts diff --git a/x/oracle/testutil/expected_keepers_mocks.go b/x/oracle/testutil/expected_keepers_mocks.go new file mode 100644 index 000000000..d5d8d5229 --- /dev/null +++ b/x/oracle/testutil/expected_keepers_mocks.go @@ -0,0 +1,434 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: x/oracle/types/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/oracle/types/expected_keepers.go -package testutil -destination x/oracle/testutil/expected_keepers_mocks.go +// + +// Package testutil is a generated GoMock package. +package testutil + +import ( + context "context" + reflect "reflect" + time "time" + + math "cosmossdk.io/math" + types "github.com/cosmos/cosmos-sdk/types" + authz "github.com/cosmos/cosmos-sdk/x/authz" + types0 "github.com/cosmos/cosmos-sdk/x/staking/types" + types1 "github.com/cosmos/ibc-go/modules/capability/types" + gomock "go.uber.org/mock/gomock" +) + +// MockAccountKeeper is a mock of AccountKeeper interface. +type MockAccountKeeper struct { + ctrl *gomock.Controller + recorder *MockAccountKeeperMockRecorder +} + +// MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. +type MockAccountKeeperMockRecorder struct { + mock *MockAccountKeeper +} + +// NewMockAccountKeeper creates a new mock instance. +func NewMockAccountKeeper(ctrl *gomock.Controller) *MockAccountKeeper { + mock := &MockAccountKeeper{ctrl: ctrl} + mock.recorder = &MockAccountKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder { + return m.recorder +} + +// GetAccount mocks base method. +func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types.AccAddress) types.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccount", ctx, addr) + ret0, _ := ret[0].(types.AccountI) + return ret0 +} + +// GetAccount indicates an expected call of GetAccount. +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) +} + +// GetModuleAccount mocks base method. +func (m *MockAccountKeeper) GetModuleAccount(ctx context.Context, moduleName string) types.ModuleAccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAccount", ctx, moduleName) + ret0, _ := ret[0].(types.ModuleAccountI) + return ret0 +} + +// GetModuleAccount indicates an expected call of GetModuleAccount. +func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccount), ctx, moduleName) +} + +// MockBankKeeper is a mock of BankKeeper interface. +type MockBankKeeper struct { + ctrl *gomock.Controller + recorder *MockBankKeeperMockRecorder +} + +// MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. +type MockBankKeeperMockRecorder struct { + mock *MockBankKeeper +} + +// NewMockBankKeeper creates a new mock instance. +func NewMockBankKeeper(ctrl *gomock.Controller) *MockBankKeeper { + mock := &MockBankKeeper{ctrl: ctrl} + mock.recorder = &MockBankKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockBankKeeper) EXPECT() *MockBankKeeperMockRecorder { + return m.recorder +} + +// GetAllBalances mocks base method. +func (m *MockBankKeeper) GetAllBalances(ctx context.Context, addr types.AccAddress) types.Coins { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllBalances", ctx, addr) + ret0, _ := ret[0].(types.Coins) + return ret0 +} + +// GetAllBalances indicates an expected call of GetAllBalances. +func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBalances", reflect.TypeOf((*MockBankKeeper)(nil).GetAllBalances), ctx, addr) +} + +// SendCoins mocks base method. +func (m *MockBankKeeper) SendCoins(ctx context.Context, from, to types.AccAddress, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoins", ctx, from, to, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoins indicates an expected call of SendCoins. +func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, from, to, amt any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, from, to, amt) +} + +// SendCoinsFromModuleToModule mocks base method. +func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromModuleToModule", ctx, senderModule, recipientModule, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoinsFromModuleToModule indicates an expected call of SendCoinsFromModuleToModule. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderModule, recipientModule, amt any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToModule), ctx, senderModule, recipientModule, amt) +} + +// SpendableCoins mocks base method. +func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types.AccAddress) types.Coins { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SpendableCoins", ctx, addr) + ret0, _ := ret[0].(types.Coins) + return ret0 +} + +// SpendableCoins indicates an expected call of SpendableCoins. +func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) +} + +// MockStakingKeeper is a mock of StakingKeeper interface. +type MockStakingKeeper struct { + ctrl *gomock.Controller + recorder *MockStakingKeeperMockRecorder +} + +// MockStakingKeeperMockRecorder is the mock recorder for MockStakingKeeper. +type MockStakingKeeperMockRecorder struct { + mock *MockStakingKeeper +} + +// NewMockStakingKeeper creates a new mock instance. +func NewMockStakingKeeper(ctrl *gomock.Controller) *MockStakingKeeper { + mock := &MockStakingKeeper{ctrl: ctrl} + mock.recorder = &MockStakingKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder { + return m.recorder +} + +// IterateBondedValidatorsByPower mocks base method. +func (m *MockStakingKeeper) IterateBondedValidatorsByPower(arg0 context.Context, arg1 func(int64, types0.ValidatorI) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IterateBondedValidatorsByPower", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// IterateBondedValidatorsByPower indicates an expected call of IterateBondedValidatorsByPower. +func (mr *MockStakingKeeperMockRecorder) IterateBondedValidatorsByPower(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateBondedValidatorsByPower", reflect.TypeOf((*MockStakingKeeper)(nil).IterateBondedValidatorsByPower), arg0, arg1) +} + +// Validator mocks base method. +func (m *MockStakingKeeper) Validator(arg0 context.Context, arg1 types.ValAddress) (types0.ValidatorI, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Validator", arg0, arg1) + ret0, _ := ret[0].(types0.ValidatorI) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Validator indicates an expected call of Validator. +func (mr *MockStakingKeeperMockRecorder) Validator(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validator", reflect.TypeOf((*MockStakingKeeper)(nil).Validator), arg0, arg1) +} + +// ValidatorByConsAddr mocks base method. +func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 context.Context, arg1 types.ConsAddress) (types0.ValidatorI, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidatorByConsAddr", arg0, arg1) + ret0, _ := ret[0].(types0.ValidatorI) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ValidatorByConsAddr indicates an expected call of ValidatorByConsAddr. +func (mr *MockStakingKeeperMockRecorder) ValidatorByConsAddr(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorByConsAddr", reflect.TypeOf((*MockStakingKeeper)(nil).ValidatorByConsAddr), arg0, arg1) +} + +// MockDistrKeeper is a mock of DistrKeeper interface. +type MockDistrKeeper struct { + ctrl *gomock.Controller + recorder *MockDistrKeeperMockRecorder +} + +// MockDistrKeeperMockRecorder is the mock recorder for MockDistrKeeper. +type MockDistrKeeperMockRecorder struct { + mock *MockDistrKeeper +} + +// NewMockDistrKeeper creates a new mock instance. +func NewMockDistrKeeper(ctrl *gomock.Controller) *MockDistrKeeper { + mock := &MockDistrKeeper{ctrl: ctrl} + mock.recorder = &MockDistrKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDistrKeeper) EXPECT() *MockDistrKeeperMockRecorder { + return m.recorder +} + +// AllocateTokensToValidator mocks base method. +func (m *MockDistrKeeper) AllocateTokensToValidator(ctx context.Context, val types0.ValidatorI, tokens types.DecCoins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AllocateTokensToValidator", ctx, val, tokens) + ret0, _ := ret[0].(error) + return ret0 +} + +// AllocateTokensToValidator indicates an expected call of AllocateTokensToValidator. +func (mr *MockDistrKeeperMockRecorder) AllocateTokensToValidator(ctx, val, tokens any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllocateTokensToValidator", reflect.TypeOf((*MockDistrKeeper)(nil).AllocateTokensToValidator), ctx, val, tokens) +} + +// FundCommunityPool mocks base method. +func (m *MockDistrKeeper) FundCommunityPool(ctx context.Context, amount types.Coins, sender types.AccAddress) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FundCommunityPool", ctx, amount, sender) + ret0, _ := ret[0].(error) + return ret0 +} + +// FundCommunityPool indicates an expected call of FundCommunityPool. +func (mr *MockDistrKeeperMockRecorder) FundCommunityPool(ctx, amount, sender any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FundCommunityPool", reflect.TypeOf((*MockDistrKeeper)(nil).FundCommunityPool), ctx, amount, sender) +} + +// GetCommunityTax mocks base method. +func (m *MockDistrKeeper) GetCommunityTax(ctx context.Context) (math.LegacyDec, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCommunityTax", ctx) + ret0, _ := ret[0].(math.LegacyDec) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCommunityTax indicates an expected call of GetCommunityTax. +func (mr *MockDistrKeeperMockRecorder) GetCommunityTax(ctx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCommunityTax", reflect.TypeOf((*MockDistrKeeper)(nil).GetCommunityTax), ctx) +} + +// MockPortKeeper is a mock of PortKeeper interface. +type MockPortKeeper struct { + ctrl *gomock.Controller + recorder *MockPortKeeperMockRecorder +} + +// MockPortKeeperMockRecorder is the mock recorder for MockPortKeeper. +type MockPortKeeperMockRecorder struct { + mock *MockPortKeeper +} + +// NewMockPortKeeper creates a new mock instance. +func NewMockPortKeeper(ctrl *gomock.Controller) *MockPortKeeper { + mock := &MockPortKeeper{ctrl: ctrl} + mock.recorder = &MockPortKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPortKeeper) EXPECT() *MockPortKeeperMockRecorder { + return m.recorder +} + +// BindPort mocks base method. +func (m *MockPortKeeper) BindPort(ctx types.Context, portID string) *types1.Capability { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BindPort", ctx, portID) + ret0, _ := ret[0].(*types1.Capability) + return ret0 +} + +// BindPort indicates an expected call of BindPort. +func (mr *MockPortKeeperMockRecorder) BindPort(ctx, portID any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BindPort", reflect.TypeOf((*MockPortKeeper)(nil).BindPort), ctx, portID) +} + +// MockAuthzKeeper is a mock of AuthzKeeper interface. +type MockAuthzKeeper struct { + ctrl *gomock.Controller + recorder *MockAuthzKeeperMockRecorder +} + +// MockAuthzKeeperMockRecorder is the mock recorder for MockAuthzKeeper. +type MockAuthzKeeperMockRecorder struct { + mock *MockAuthzKeeper +} + +// NewMockAuthzKeeper creates a new mock instance. +func NewMockAuthzKeeper(ctrl *gomock.Controller) *MockAuthzKeeper { + mock := &MockAuthzKeeper{ctrl: ctrl} + mock.recorder = &MockAuthzKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAuthzKeeper) EXPECT() *MockAuthzKeeperMockRecorder { + return m.recorder +} + +// DeleteGrant mocks base method. +func (m *MockAuthzKeeper) DeleteGrant(ctx context.Context, grantee, granter types.AccAddress, msgType string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteGrant", ctx, grantee, granter, msgType) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteGrant indicates an expected call of DeleteGrant. +func (mr *MockAuthzKeeperMockRecorder) DeleteGrant(ctx, grantee, granter, msgType any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteGrant", reflect.TypeOf((*MockAuthzKeeper)(nil).DeleteGrant), ctx, grantee, granter, msgType) +} + +// DispatchActions mocks base method. +func (m *MockAuthzKeeper) DispatchActions(ctx context.Context, grantee types.AccAddress, msgs []types.Msg) ([][]byte, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DispatchActions", ctx, grantee, msgs) + ret0, _ := ret[0].([][]byte) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DispatchActions indicates an expected call of DispatchActions. +func (mr *MockAuthzKeeperMockRecorder) DispatchActions(ctx, grantee, msgs any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DispatchActions", reflect.TypeOf((*MockAuthzKeeper)(nil).DispatchActions), ctx, grantee, msgs) +} + +// GetAuthorization mocks base method. +func (m *MockAuthzKeeper) GetAuthorization(ctx context.Context, grantee, granter types.AccAddress, msgType string) (authz.Authorization, *time.Time) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAuthorization", ctx, grantee, granter, msgType) + ret0, _ := ret[0].(authz.Authorization) + ret1, _ := ret[1].(*time.Time) + return ret0, ret1 +} + +// GetAuthorization indicates an expected call of GetAuthorization. +func (mr *MockAuthzKeeperMockRecorder) GetAuthorization(ctx, grantee, granter, msgType any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorization", reflect.TypeOf((*MockAuthzKeeper)(nil).GetAuthorization), ctx, grantee, granter, msgType) +} + +// GetAuthorizations mocks base method. +func (m *MockAuthzKeeper) GetAuthorizations(ctx context.Context, grantee, granter types.AccAddress) ([]authz.Authorization, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAuthorizations", ctx, grantee, granter) + ret0, _ := ret[0].([]authz.Authorization) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAuthorizations indicates an expected call of GetAuthorizations. +func (mr *MockAuthzKeeperMockRecorder) GetAuthorizations(ctx, grantee, granter any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizations", reflect.TypeOf((*MockAuthzKeeper)(nil).GetAuthorizations), ctx, grantee, granter) +} + +// GranterGrants mocks base method. +func (m *MockAuthzKeeper) GranterGrants(ctx context.Context, req *authz.QueryGranterGrantsRequest) (*authz.QueryGranterGrantsResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GranterGrants", ctx, req) + ret0, _ := ret[0].(*authz.QueryGranterGrantsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GranterGrants indicates an expected call of GranterGrants. +func (mr *MockAuthzKeeperMockRecorder) GranterGrants(ctx, req any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GranterGrants", reflect.TypeOf((*MockAuthzKeeper)(nil).GranterGrants), ctx, req) +} + +// SaveGrant mocks base method. +func (m *MockAuthzKeeper) SaveGrant(ctx context.Context, grantee, granter types.AccAddress, authorization authz.Authorization, expiration *time.Time) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SaveGrant", ctx, grantee, granter, authorization, expiration) + ret0, _ := ret[0].(error) + return ret0 +} + +// SaveGrant indicates an expected call of SaveGrant. +func (mr *MockAuthzKeeperMockRecorder) SaveGrant(ctx, grantee, granter, authorization, expiration any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveGrant", reflect.TypeOf((*MockAuthzKeeper)(nil).SaveGrant), ctx, grantee, granter, authorization, expiration) +} diff --git a/x/oracle/testutil/helpers.go b/x/oracle/testutil/helpers.go new file mode 100644 index 000000000..18d5aa581 --- /dev/null +++ b/x/oracle/testutil/helpers.go @@ -0,0 +1,13 @@ +package testutil + +import gomock "go.uber.org/mock/gomock" + +// ChainGoMockCalls is a helper function to chain multiple gomock calls together. +func ChainGoMockCalls(calls ...*gomock.Call) *gomock.Call { + for i := 1; i < len(calls); i++ { + calls[i].After(calls[i-1]) + } + + // return the last call + return calls[len(calls)-1] +} diff --git a/x/oracle/types/codec.go b/x/oracle/types/codec.go index e68c98c42..f9fc072c5 100644 --- a/x/oracle/types/codec.go +++ b/x/oracle/types/codec.go @@ -4,11 +4,17 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) +// ModuleCdc references the global x/oracle module codec. Note, the codec +// should ONLY be used in certain instances of tests and for JSON encoding. +// +// The actual codec used for serialization should be provided to x/oracle and +// defined at the application level. +var ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) + // RegisterLegacyAminoCodec registers the necessary x/oracle interfaces and concrete types // on the provided LegacyAmino codec. These types are used for Amino JSON serialization. func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { @@ -37,23 +43,3 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } - -var ( - amino = codec.NewLegacyAmino() - - // ModuleCdc references the global x/oracle module codec. Note, the codec - // should ONLY be used in certain instances of tests and for JSON encoding. - // - // The actual codec used for serialization should be provided to x/oracle and - // defined at the application level. - ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) - - // AminoCdc is a amino codec created to support amino json compatible msgs. - AminoCdc = codec.NewAminoCodec(amino) -) - -func init() { - RegisterLegacyAminoCodec(amino) - cryptocodec.RegisterCrypto(amino) - amino.Seal() -} diff --git a/x/oracle/types/exec_env_test.go b/x/oracle/types/exec_env_test.go index 340622b2e..f8ff6f85f 100644 --- a/x/oracle/types/exec_env_test.go +++ b/x/oracle/types/exec_env_test.go @@ -4,10 +4,13 @@ import ( "testing" "time" - "github.com/bandprotocol/go-owasm/api" + "github.com/stretchr/testify/require" + "github.com/cometbft/cometbft/crypto/secp256k1" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" + + "github.com/bandprotocol/go-owasm/api" ) var ( @@ -29,7 +32,7 @@ func mockExecEnv() *ExecuteEnv { minCount := uint64(1) requestHeight := int64(999) requestTime := time.Unix(1581589700, 0) - clientID := "beeb" + clientID := "test" request := NewRequest( oracleScriptID, calldata, @@ -58,7 +61,7 @@ func mockFreshPrepareEnv() *PrepareEnv { minCount := uint64(1) requestHeight := int64(999) requestTime := time.Unix(1581589700, 0) - clientID := "beeb" + clientID := "test" request := NewRequest( oracleScriptID, calldata, diff --git a/x/oracle/types/expected_keepers.go b/x/oracle/types/expected_keepers.go index a78335cf9..67dd40201 100644 --- a/x/oracle/types/expected_keepers.go +++ b/x/oracle/types/expected_keepers.go @@ -4,57 +4,42 @@ import ( "context" "time" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/authz" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" ) // AccountKeeper defines the expected account keeper. type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI - GetModuleAccount(ctx sdk.Context, name string) authtypes.ModuleAccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI + GetModuleAccount(ctx context.Context, moduleName string) sdk.ModuleAccountI } // BankKeeper defines the expected bank keeper. type BankKeeper interface { - GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error - SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error + GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins + SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error + SendCoins(ctx context.Context, from, to sdk.AccAddress, amt sdk.Coins) error + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins } // StakingKeeper defines the expected staking keeper. type StakingKeeper interface { - ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI - IterateBondedValidatorsByPower( - ctx sdk.Context, - fn func(index int64, validator stakingtypes.ValidatorI) (stop bool), - ) - Validator(ctx sdk.Context, address sdk.ValAddress) stakingtypes.ValidatorI + ValidatorByConsAddr(context.Context, sdk.ConsAddress) (stakingtypes.ValidatorI, error) + IterateBondedValidatorsByPower(context.Context, + func(index int64, validator stakingtypes.ValidatorI) (stop bool)) error + Validator(context.Context, sdk.ValAddress) (stakingtypes.ValidatorI, error) } // DistrKeeper defines the expected distribution keeper. type DistrKeeper interface { - GetCommunityTax(ctx sdk.Context) (percent sdk.Dec) - GetFeePool(ctx sdk.Context) (feePool distrtypes.FeePool) - SetFeePool(ctx sdk.Context, feePool distrtypes.FeePool) - AllocateTokensToValidator(ctx sdk.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins) -} - -// ChannelKeeper defines the expected IBC channel keeper -type ChannelKeeper interface { - SendPacket( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - sourcePort string, - sourceChannel string, - timeoutHeight ibcclienttypes.Height, - timeoutTimestamp uint64, - data []byte, - ) (sequence uint64, err error) + GetCommunityTax(ctx context.Context) (math.LegacyDec, error) + AllocateTokensToValidator(ctx context.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins) error + FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error } // PortKeeper defines the expected IBC port keeper @@ -64,20 +49,19 @@ type PortKeeper interface { // AuthzKeeper defines the expected authz keeper. for query and testing only don't use to create/remove grant on deliver tx type AuthzKeeper interface { - DispatchActions(ctx sdk.Context, grantee sdk.AccAddress, msgs []sdk.Msg) ([][]byte, error) + DispatchActions(ctx context.Context, grantee sdk.AccAddress, msgs []sdk.Msg) ([][]byte, error) GetAuthorization( - ctx sdk.Context, - grantee sdk.AccAddress, - granter sdk.AccAddress, + ctx context.Context, + grantee, granter sdk.AccAddress, msgType string, ) (authz.Authorization, *time.Time) - GetAuthorizations(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress) ([]authz.Authorization, error) + GetAuthorizations(ctx context.Context, grantee, granter sdk.AccAddress) ([]authz.Authorization, error) SaveGrant( - ctx sdk.Context, + ctx context.Context, grantee, granter sdk.AccAddress, authorization authz.Authorization, expiration *time.Time, ) error - DeleteGrant(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress, msgType string) error - GranterGrants(c context.Context, req *authz.QueryGranterGrantsRequest) (*authz.QueryGranterGrantsResponse, error) + DeleteGrant(ctx context.Context, grantee, granter sdk.AccAddress, msgType string) error + GranterGrants(ctx context.Context, req *authz.QueryGranterGrantsRequest) (*authz.QueryGranterGrantsResponse, error) } diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go index a2526f008..4234f2340 100644 --- a/x/oracle/types/genesis.pb.go +++ b/x/oracle/types/genesis.pb.go @@ -94,24 +94,24 @@ func init() { func init() { proto.RegisterFile("oracle/v1/genesis.proto", fileDescriptor_14b982a0a6345d1d) } var fileDescriptor_14b982a0a6345d1d = []byte{ - // 272 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0x2f, 0x4a, 0x4c, - 0xce, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x84, 0x48, 0xe8, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, - 0x83, 0x45, 0xf5, 0x41, 0x2c, 0x88, 0x02, 0x29, 0x31, 0x84, 0x4e, 0xa8, 0x52, 0xb0, 0xb8, 0xd2, - 0x51, 0x46, 0x2e, 0x1e, 0x77, 0x88, 0x51, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x42, 0xfa, 0x5c, 0x6c, - 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x82, 0x7a, 0x70, - 0xa3, 0xf5, 0x02, 0xc0, 0x12, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0x95, 0x09, 0xd9, - 0x71, 0xf1, 0xa4, 0x24, 0x96, 0x24, 0xc6, 0x17, 0xe7, 0x97, 0x16, 0x25, 0xa7, 0x16, 0x4b, 0x30, - 0x29, 0x30, 0x6b, 0x70, 0x1b, 0x89, 0x22, 0x69, 0x73, 0x49, 0x2c, 0x49, 0x0c, 0x06, 0xcb, 0x42, - 0xb5, 0x72, 0xa7, 0xc0, 0x45, 0x8a, 0x85, 0x5c, 0xb8, 0xf8, 0x20, 0x4a, 0xe3, 0x8b, 0x93, 0x8b, - 0x32, 0x0b, 0x4a, 0x8a, 0x25, 0x98, 0xc1, 0x26, 0x88, 0x23, 0x99, 0xe0, 0x0f, 0x66, 0x05, 0x83, - 0xe5, 0xa1, 0x66, 0xf0, 0xe6, 0x23, 0x89, 0x15, 0x3b, 0x79, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, - 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, - 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x7e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, - 0x7e, 0x52, 0x62, 0x5e, 0x0a, 0xd8, 0xdf, 0xc9, 0xf9, 0x39, 0xfa, 0xc9, 0x19, 0x89, 0x99, 0x79, - 0xfa, 0x65, 0x46, 0xfa, 0x15, 0xd0, 0x20, 0xd1, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, - 0xab, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xee, 0x58, 0x41, 0x41, 0x6d, 0x01, 0x00, 0x00, + // 271 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0x31, 0x4b, 0xc3, 0x40, + 0x18, 0x86, 0x73, 0x56, 0x0a, 0x26, 0x55, 0x30, 0xa8, 0x0d, 0x1d, 0xce, 0xe2, 0xd4, 0x29, 0x1f, + 0x6d, 0x77, 0x87, 0x52, 0x10, 0x27, 0xc5, 0x6c, 0x2e, 0xe5, 0xcb, 0xe5, 0x48, 0x03, 0x6d, 0x2e, + 0xe4, 0xbb, 0x06, 0xfd, 0x17, 0xfe, 0x29, 0xa1, 0x63, 0x47, 0x27, 0x91, 0xe4, 0x8f, 0x88, 0x97, + 0xa3, 0x66, 0xfb, 0x78, 0xdf, 0xe7, 0x7d, 0xe0, 0xce, 0x1d, 0xaa, 0x12, 0xc5, 0x46, 0x42, 0x35, + 0x85, 0x54, 0xe6, 0x92, 0x32, 0x0a, 0x8b, 0x52, 0x69, 0xe5, 0x9f, 0xb5, 0x45, 0x58, 0x4d, 0x47, + 0x57, 0xa9, 0x4a, 0x95, 0x49, 0xe1, 0xef, 0x6a, 0x81, 0xd1, 0xcd, 0xff, 0xd2, 0xa2, 0x26, 0xbf, + 0xfb, 0x64, 0xee, 0xe0, 0xa1, 0x55, 0x45, 0x1a, 0xb5, 0xf4, 0xc1, 0xed, 0x17, 0x58, 0xe2, 0x96, + 0x02, 0x36, 0x66, 0x13, 0x6f, 0x76, 0x19, 0x1e, 0xd5, 0xe1, 0xb3, 0x29, 0x16, 0xa7, 0xfb, 0xef, + 0x5b, 0xe7, 0xc5, 0x62, 0xfe, 0xbd, 0x3b, 0x48, 0x50, 0xe3, 0x8a, 0xd4, 0xae, 0x14, 0x92, 0x82, + 0x93, 0x71, 0x6f, 0xe2, 0xcd, 0xae, 0x3b, 0xb3, 0x25, 0x6a, 0x8c, 0x4c, 0x6b, 0xa7, 0x5e, 0x72, + 0x4c, 0xc8, 0x5f, 0xba, 0x17, 0x2d, 0xba, 0x22, 0x51, 0x66, 0x85, 0xa6, 0xa0, 0x67, 0x0c, 0xc3, + 0x8e, 0xe1, 0xc9, 0x5c, 0x91, 0xe9, 0xad, 0xe3, 0x5c, 0x75, 0x32, 0x5a, 0x3c, 0xee, 0x6b, 0xce, + 0x0e, 0x35, 0x67, 0x3f, 0x35, 0x67, 0x1f, 0x0d, 0x77, 0x0e, 0x0d, 0x77, 0xbe, 0x1a, 0xee, 0xbc, + 0x42, 0x9a, 0xe9, 0xf5, 0x2e, 0x0e, 0x85, 0xda, 0x42, 0x8c, 0x79, 0x62, 0xde, 0x2d, 0xd4, 0x06, + 0xc4, 0x1a, 0xb3, 0x1c, 0xaa, 0x39, 0xbc, 0xd9, 0x2f, 0x01, 0xfd, 0x5e, 0x48, 0x8a, 0xfb, 0x86, + 0x98, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xc9, 0x3d, 0x64, 0xc0, 0x6d, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/oracle/types/keys_test.go b/x/oracle/types/keys_test.go index bb71bc905..eea641a0e 100644 --- a/x/oracle/types/keys_test.go +++ b/x/oracle/types/keys_test.go @@ -4,8 +4,9 @@ import ( "encoding/hex" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestRequestStoreKey(t *testing.T) { diff --git a/x/oracle/types/msgs.go b/x/oracle/types/msgs.go index 28077b567..85537ba63 100644 --- a/x/oracle/types/msgs.go +++ b/x/oracle/types/msgs.go @@ -4,33 +4,29 @@ import ( "bytes" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -// oracle message types -const ( - TypeMsgRequestData = "request" - TypeMsgReportData = "report" - TypeMsgCreateDataSource = "create_data_source" - TypeMsgEditDataSource = "edit_data_source" - TypeMsgCreateOracleScript = "create_oracle_script" - TypeMsgEditOracleScript = "edit_oracle_script" - TypeMsgActivate = "activate" - TypeMsgAddReporter = "add_reporter" - TypeMsgRemoveReporter = "remove_reporter" - TypeMsgUpdateParams = "update_params" -) - var ( - _ sdk.Msg = &MsgRequestData{} - _ sdk.Msg = &MsgReportData{} - _ sdk.Msg = &MsgCreateDataSource{} - _ sdk.Msg = &MsgEditDataSource{} - _ sdk.Msg = &MsgCreateOracleScript{} - _ sdk.Msg = &MsgEditOracleScript{} - _ sdk.Msg = &MsgActivate{} - _ sdk.Msg = &MsgUpdateParams{} + _ sdk.Msg = (*MsgRequestData)(nil) + _ sdk.Msg = (*MsgReportData)(nil) + _ sdk.Msg = (*MsgCreateDataSource)(nil) + _ sdk.Msg = (*MsgEditDataSource)(nil) + _ sdk.Msg = (*MsgCreateOracleScript)(nil) + _ sdk.Msg = (*MsgEditOracleScript)(nil) + _ sdk.Msg = (*MsgActivate)(nil) + _ sdk.Msg = (*MsgUpdateParams)(nil) + + _ sdk.HasValidateBasic = (*MsgRequestData)(nil) + _ sdk.HasValidateBasic = (*MsgReportData)(nil) + _ sdk.HasValidateBasic = (*MsgCreateDataSource)(nil) + _ sdk.HasValidateBasic = (*MsgEditDataSource)(nil) + _ sdk.HasValidateBasic = (*MsgCreateOracleScript)(nil) + _ sdk.HasValidateBasic = (*MsgEditOracleScript)(nil) + _ sdk.HasValidateBasic = (*MsgActivate)(nil) + _ sdk.HasValidateBasic = (*MsgUpdateParams)(nil) ) // NewMsgRequestData creates a new MsgRequestData instance. @@ -56,12 +52,6 @@ func NewMsgRequestData( } } -// Route returns the route of MsgRequestData - "oracle" (sdk.Msg interface). -func (m MsgRequestData) Route() string { return RouterKey } - -// Type returns the message type of MsgRequestData (sdk.Msg interface). -func (m MsgRequestData) Type() string { return TypeMsgRequestData } - // ValidateBasic checks whether the given MsgRequestData instance (sdk.Msg interface). func (m MsgRequestData) ValidateBasic() error { sender, err := sdk.AccAddressFromBech32(m.Sender) @@ -99,17 +89,6 @@ func (m MsgRequestData) ValidateBasic() error { return nil } -// GetSigners returns the required signers for the given MsgRequestData (sdk.Msg interface). -func (m MsgRequestData) GetSigners() []sdk.AccAddress { - sender, _ := sdk.AccAddressFromBech32(m.Sender) - return []sdk.AccAddress{sender} -} - -// GetSignBytes returns raw JSON bytes to be signed by the signers (sdk.Msg interface). -func (m MsgRequestData) GetSignBytes() []byte { - return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&m)) -} - // NewMsgReportData creates a new MsgReportData instance func NewMsgReportData(requestID RequestID, rawReports []RawReport, validator sdk.ValAddress) *MsgReportData { return &MsgReportData{ @@ -119,12 +98,6 @@ func NewMsgReportData(requestID RequestID, rawReports []RawReport, validator sdk } } -// Route returns the route of MsgReportData - "oracle" (sdk.Msg interface). -func (m MsgReportData) Route() string { return RouterKey } - -// Type returns the message type of MsgReportData (sdk.Msg interface). -func (m MsgReportData) Type() string { return TypeMsgReportData } - // ValidateBasic checks whether the given MsgReportData instance (sdk.Msg interface). func (m MsgReportData) ValidateBasic() error { valAddr, err := sdk.ValAddressFromBech32(m.Validator) @@ -147,17 +120,6 @@ func (m MsgReportData) ValidateBasic() error { return nil } -// GetSigners returns the required signers for the given MsgReportData (sdk.Msg interface). -func (m MsgReportData) GetSigners() []sdk.AccAddress { - validator, _ := sdk.ValAddressFromBech32(m.Validator) - return []sdk.AccAddress{sdk.AccAddress(validator)} -} - -// GetSignBytes returns raw JSON bytes to be signed by the signers (sdk.Msg interface). -func (m MsgReportData) GetSignBytes() []byte { - return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&m)) -} - // NewMsgCreateDataSource creates a new MsgCreateDataSource instance func NewMsgCreateDataSource( name, description string, executable []byte, fee sdk.Coins, treasury, owner, sender sdk.AccAddress, @@ -173,12 +135,6 @@ func NewMsgCreateDataSource( } } -// Route returns the route of MsgCreateDataSource - "oracle" (sdk.Msg interface). -func (m MsgCreateDataSource) Route() string { return RouterKey } - -// Type returns the message type of MsgCreateDataSource (sdk.Msg interface). -func (m MsgCreateDataSource) Type() string { return TypeMsgCreateDataSource } - // ValidateBasic checks whether the given MsgCreateDataSource instance (sdk.Msg interface). func (m MsgCreateDataSource) ValidateBasic() error { treasury, err := sdk.AccAddressFromBech32(m.Treasury) @@ -223,17 +179,6 @@ func (m MsgCreateDataSource) ValidateBasic() error { return nil } -// GetSigners returns the required signers for the given MsgCreateDataSource (sdk.Msg interface). -func (m MsgCreateDataSource) GetSigners() []sdk.AccAddress { - sender, _ := sdk.AccAddressFromBech32(m.Sender) - return []sdk.AccAddress{sender} -} - -// GetSignBytes returns raw JSON bytes to be signed by the signers (sdk.Msg interface). -func (m MsgCreateDataSource) GetSignBytes() []byte { - return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&m)) -} - // NewMsgEditDataSource creates a new MsgEditDataSource instance func NewMsgEditDataSource( dataSourceID DataSourceID, @@ -255,12 +200,6 @@ func NewMsgEditDataSource( } } -// Route returns the route of MsgEditDataSource - "oracle" (sdk.Msg interface). -func (m MsgEditDataSource) Route() string { return RouterKey } - -// Type returns the message type of MsgEditDataSource (sdk.Msg interface). -func (m MsgEditDataSource) Type() string { return TypeMsgEditDataSource } - // ValidateBasic checks whether the given MsgEditDataSource instance (sdk.Msg interface). func (m MsgEditDataSource) ValidateBasic() error { treasury, err := sdk.AccAddressFromBech32(m.Treasury) @@ -302,17 +241,6 @@ func (m MsgEditDataSource) ValidateBasic() error { return nil } -// GetSigners returns the required signers for the given MsgEditDataSource (sdk.Msg interface). -func (m MsgEditDataSource) GetSigners() []sdk.AccAddress { - sender, _ := sdk.AccAddressFromBech32(m.Sender) - return []sdk.AccAddress{sender} -} - -// GetSignBytes returns raw JSON bytes to be signed by the signers (sdk.Msg interface). -func (m MsgEditDataSource) GetSignBytes() []byte { - return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&m)) -} - // NewMsgCreateOracleScript creates a new MsgCreateOracleScript instance func NewMsgCreateOracleScript( name, description, schema, sourceCodeURL string, code []byte, owner, sender sdk.AccAddress, @@ -328,12 +256,6 @@ func NewMsgCreateOracleScript( } } -// Route returns the route of MsgCreateOracleScript - "oracle" (sdk.Msg interface). -func (m MsgCreateOracleScript) Route() string { return RouterKey } - -// Type returns the message type of MsgCreateOracleScript (sdk.Msg interface). -func (m MsgCreateOracleScript) Type() string { return TypeMsgCreateOracleScript } - // ValidateBasic checks whether the given MsgCreateOracleScript instance (sdk.Msg interface). func (m MsgCreateOracleScript) ValidateBasic() error { owner, err := sdk.AccAddressFromBech32(m.Owner) @@ -374,17 +296,6 @@ func (m MsgCreateOracleScript) ValidateBasic() error { return nil } -// GetSigners returns the required signers for the given MsgCreateOracleScript (sdk.Msg interface). -func (m MsgCreateOracleScript) GetSigners() []sdk.AccAddress { - sender, _ := sdk.AccAddressFromBech32(m.Sender) - return []sdk.AccAddress{sender} -} - -// GetSignBytes returns raw JSON bytes to be signed by the signers (sdk.Msg interface). -func (m MsgCreateOracleScript) GetSignBytes() []byte { - return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&m)) -} - // NewMsgEditOracleScript creates a new MsgEditOracleScript instance func NewMsgEditOracleScript( oracleScriptID OracleScriptID, @@ -404,12 +315,6 @@ func NewMsgEditOracleScript( } } -// Route returns the route of MsgEditOracleScript - "oracle" (sdk.Msg interface). -func (m MsgEditOracleScript) Route() string { return RouterKey } - -// Type returns the message type of MsgEditOracleScript (sdk.Msg interface). -func (m MsgEditOracleScript) Type() string { return TypeMsgEditOracleScript } - // ValidateBasic checks whether the given MsgEditOracleScript instance (sdk.Msg interface). func (m MsgEditOracleScript) ValidateBasic() error { owner, err := sdk.AccAddressFromBech32(m.Owner) @@ -447,17 +352,6 @@ func (m MsgEditOracleScript) ValidateBasic() error { return nil } -// GetSigners returns the required signers for the given MsgEditOracleScript (sdk.Msg interface). -func (m MsgEditOracleScript) GetSigners() []sdk.AccAddress { - sender, _ := sdk.AccAddressFromBech32(m.Sender) - return []sdk.AccAddress{sender} -} - -// GetSignBytes returns raw JSON bytes to be signed by the signers (sdk.Msg interface). -func (m MsgEditOracleScript) GetSignBytes() []byte { - return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&m)) -} - // NewMsgActivate creates a new MsgActivate instance func NewMsgActivate(validator sdk.ValAddress) *MsgActivate { return &MsgActivate{ @@ -465,12 +359,6 @@ func NewMsgActivate(validator sdk.ValAddress) *MsgActivate { } } -// Route returns the route of MsgActivate - "oracle" (sdk.Msg interface). -func (m MsgActivate) Route() string { return RouterKey } - -// Type returns the message type of MsgActivate (sdk.Msg interface). -func (m MsgActivate) Type() string { return TypeMsgActivate } - // ValidateBasic checks whether the given MsgActivate instance (sdk.Msg interface). func (m MsgActivate) ValidateBasic() error { val, err := sdk.ValAddressFromBech32(m.Validator) @@ -483,17 +371,6 @@ func (m MsgActivate) ValidateBasic() error { return nil } -// GetSigners returns the required signers for the given MsgActivate (sdk.Msg interface). -func (m MsgActivate) GetSigners() []sdk.AccAddress { - val, _ := sdk.ValAddressFromBech32(m.Validator) - return []sdk.AccAddress{sdk.AccAddress(val)} -} - -// GetSignBytes returns raw JSON bytes to be signed by the signers (sdk.Msg interface). -func (m MsgActivate) GetSignBytes() []byte { - return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&m)) -} - // NewMsgActivate creates a new MsgActivate instance func NewMsgUpdateParams(authority string, params Params) *MsgUpdateParams { return &MsgUpdateParams{ @@ -502,17 +379,6 @@ func NewMsgUpdateParams(authority string, params Params) *MsgUpdateParams { } } -// GetSignBytes implements the LegacyMsg interface. -func (m MsgUpdateParams) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) -} - -// GetSigners returns the expected signers for a MsgUpdateParams message. -func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(m.Authority) - return []sdk.AccAddress{addr} -} - // ValidateBasic does a sanity check on the provided data. func (m *MsgUpdateParams) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { @@ -525,9 +391,3 @@ func (m *MsgUpdateParams) ValidateBasic() error { return nil } - -// Route returns the route of MsgUpdateParams - "oracle" (sdk.Msg interface). -func (m MsgUpdateParams) Route() string { return RouterKey } - -// Type returns the message type of MsgUpdateParams (sdk.Msg interface). -func (m MsgUpdateParams) Type() string { return TypeMsgUpdateParams } diff --git a/x/oracle/types/msgs_test.go b/x/oracle/types/msgs_test.go index 4634feb7f..ee4df9573 100644 --- a/x/oracle/types/msgs_test.go +++ b/x/oracle/types/msgs_test.go @@ -4,9 +4,13 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/cometbft/cometbft/crypto/secp256k1" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" ) var ( @@ -20,8 +24,8 @@ var ( GoodTestValAddr2 = sdk.ValAddress(MsgPk.Address()) GoodCoins = sdk.NewCoins() - BadCoins = []sdk.Coin{{Denom: "uband", Amount: sdk.NewInt(-1)}} - FeeCoins = sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(1000))) + BadCoins = []sdk.Coin{{Denom: "uband", Amount: math.NewInt(-1)}} + FeeCoins = sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(1000))) ) type validateTestCase struct { @@ -31,7 +35,9 @@ type validateTestCase struct { func performValidateTests(t *testing.T, cases []validateTestCase) { for _, tc := range cases { - err := tc.msg.ValidateBasic() + m, ok := tc.msg.(sdk.HasValidateBasic) + require.True(t, ok) + err := m.ValidateBasic() if tc.valid { require.NoError(t, err) } else { @@ -40,186 +46,6 @@ func performValidateTests(t *testing.T, cases []validateTestCase) { } } -func TestMsgRoute(t *testing.T) { - require.Equal(t, "oracle", MsgCreateDataSource{}.Route()) - require.Equal(t, "oracle", MsgEditDataSource{}.Route()) - require.Equal(t, "oracle", MsgCreateOracleScript{}.Route()) - require.Equal(t, "oracle", MsgEditOracleScript{}.Route()) - require.Equal(t, "oracle", MsgRequestData{}.Route()) - require.Equal(t, "oracle", MsgReportData{}.Route()) - require.Equal(t, "oracle", MsgActivate{}.Route()) -} - -func TestMsgType(t *testing.T) { - require.Equal(t, "create_data_source", MsgCreateDataSource{}.Type()) - require.Equal(t, "edit_data_source", MsgEditDataSource{}.Type()) - require.Equal(t, "create_oracle_script", MsgCreateOracleScript{}.Type()) - require.Equal(t, "edit_oracle_script", MsgEditOracleScript{}.Type()) - require.Equal(t, "request", MsgRequestData{}.Type()) - require.Equal(t, "report", MsgReportData{}.Type()) - require.Equal(t, "activate", MsgActivate{}.Type()) -} - -func TestMsgGetSigners(t *testing.T) { - signerAcc := sdk.AccAddress([]byte("01234567890123456789")) - signerVal := sdk.ValAddress([]byte("01234567890123456789")) - anotherAcc := sdk.AccAddress([]byte("98765432109876543210")) - anotherVal := sdk.ValAddress([]byte("98765432109876543210")) - treasuryAcc := sdk.AccAddress([]byte("treasury")) - signers := []sdk.AccAddress{signerAcc} - emptyCoins := sdk.NewCoins() - require.Equal( - t, - signers, - NewMsgCreateDataSource( - "name", - "desc", - []byte("exec"), - emptyCoins, - treasuryAcc, - anotherAcc, - signerAcc, - ).GetSigners(), - ) - require.Equal( - t, - signers, - NewMsgEditDataSource( - 1, - "name", - "desc", - []byte("exec"), - emptyCoins, - treasuryAcc, - anotherAcc, - signerAcc, - ).GetSigners(), - ) - require.Equal( - t, - signers, - NewMsgCreateOracleScript("name", "desc", "schema", "url", []byte("code"), anotherAcc, signerAcc).GetSigners(), - ) - require.Equal( - t, - signers, - NewMsgEditOracleScript(1, "name", "desc", "schema", "url", []byte("code"), anotherAcc, signerAcc).GetSigners(), - ) - require.Equal( - t, - signers, - NewMsgRequestData(1, []byte("calldata"), 10, 5, "client-id", emptyCoins, 1, 1, signerAcc).GetSigners(), - ) - require.Equal( - t, - []sdk.AccAddress{anotherAcc}, - NewMsgReportData(1, []RawReport{{1, 1, []byte("data1")}, {2, 2, []byte("data2")}}, anotherVal).GetSigners(), - ) - require.Equal(t, signers, NewMsgActivate(signerVal).GetSigners()) -} - -func TestMsgGetSignBytes(t *testing.T) { - sdk.GetConfig().SetBech32PrefixForAccount("band", "band"+sdk.PrefixPublic) - sdk.GetConfig(). - SetBech32PrefixForValidator("band"+sdk.PrefixValidator+sdk.PrefixOperator, "band"+sdk.PrefixValidator+sdk.PrefixOperator+sdk.PrefixPublic) - sdk.GetConfig(). - SetBech32PrefixForConsensusNode("band"+sdk.PrefixValidator+sdk.PrefixConsensus, "band"+sdk.PrefixValidator+sdk.PrefixConsensus+sdk.PrefixPublic) - require.Equal( - t, - `{"type":"oracle/CreateDataSource","value":{"description":"desc","executable":"ZXhlYw==","fee":[{"amount":"1000","denom":"uband"}],"name":"name","owner":"band1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq2vqal4","sender":"band1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq2vqal4","treasury":"band1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq2vqal4"}}`, - string( - NewMsgCreateDataSource( - "name", - "desc", - []byte("exec"), - FeeCoins, - GoodTestAddr, - GoodTestAddr, - GoodTestAddr, - ).GetSignBytes(), - ), - ) - require.Equal( - t, - `{"type":"oracle/EditDataSource","value":{"data_source_id":"1","description":"desc","executable":"ZXhlYw==","fee":[{"amount":"1000","denom":"uband"}],"name":"name","owner":"band1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq2vqal4","sender":"band1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq2vqal4","treasury":"band1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq2vqal4"}}`, - string( - NewMsgEditDataSource( - 1, - "name", - "desc", - []byte("exec"), - FeeCoins, - GoodTestAddr, - GoodTestAddr, - GoodTestAddr, - ).GetSignBytes(), - ), - ) - require.Equal( - t, - `{"type":"oracle/CreateOracleScript","value":{"code":"Y29kZQ==","description":"desc","name":"name","owner":"band1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq2vqal4","schema":"schema","sender":"band1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq2vqal4","source_code_url":"url"}}`, - string( - NewMsgCreateOracleScript( - "name", - "desc", - "schema", - "url", - []byte("code"), - GoodTestAddr, - GoodTestAddr, - ).GetSignBytes(), - ), - ) - require.Equal( - t, - `{"type":"oracle/EditOracleScript","value":{"code":"Y29kZQ==","description":"desc","name":"name","oracle_script_id":"1","owner":"band1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq2vqal4","schema":"schema","sender":"band1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq2vqal4","source_code_url":"url"}}`, - string( - NewMsgEditOracleScript( - 1, - "name", - "desc", - "schema", - "url", - []byte("code"), - GoodTestAddr, - GoodTestAddr, - ).GetSignBytes(), - ), - ) - require.Equal( - t, - `{"type":"oracle/Request","value":{"ask_count":"10","calldata":"Y2FsbGRhdGE=","client_id":"client-id","execute_gas":"250000","fee_limit":[{"amount":"1000","denom":"uband"}],"min_count":"5","oracle_script_id":"1","prepare_gas":"50000","sender":"band1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq2vqal4"}}`, - string( - NewMsgRequestData( - 1, - []byte("calldata"), - 10, - 5, - "client-id", - FeeCoins, - 50000, - 250000, - GoodTestAddr, - ).GetSignBytes(), - ), - ) - require.Equal( - t, - `{"type":"oracle/Report","value":{"raw_reports":[{"data":"ZGF0YTE=","exit_code":1,"external_id":"1"},{"data":"ZGF0YTI=","exit_code":2,"external_id":"2"}],"request_id":"1","validator":"bandvaloper1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqx6y767"}}`, - string( - NewMsgReportData( - 1, - []RawReport{{1, 1, []byte("data1")}, {2, 2, []byte("data2")}}, - GoodTestValAddr, - ).GetSignBytes(), - ), - ) - require.Equal(t, - `{"type":"oracle/Activate","value":{"validator":"bandvaloper1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqx6y767"}}`, - string(NewMsgActivate(GoodTestValAddr).GetSignBytes()), - ) -} - func TestMsgCreateDataSourceValidation(t *testing.T) { performValidateTests(t, []validateTestCase{ { diff --git a/x/oracle/types/oracle.pb.go b/x/oracle/types/oracle.pb.go index 782e1609d..f9c95db9a 100644 --- a/x/oracle/types/oracle.pb.go +++ b/x/oracle/types/oracle.pb.go @@ -1560,116 +1560,116 @@ func init() { func init() { proto.RegisterFile("oracle/v1/oracle.proto", fileDescriptor_652b57db11528d07) } var fileDescriptor_652b57db11528d07 = []byte{ - // 1740 bytes of a gzipped FileDescriptorProto + // 1741 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcd, 0x6f, 0x23, 0x59, 0x11, 0x4f, 0xdb, 0x4e, 0x62, 0x97, 0x9d, 0xaf, 0x37, 0x99, 0x8c, 0xc7, 0xbb, 0xd8, 0x21, 0x5a, - 0xd0, 0x30, 0x02, 0x9b, 0x04, 0x84, 0x98, 0x59, 0x3e, 0x14, 0x3b, 0x9e, 0xc5, 0x28, 0x9a, 0xb1, - 0x9e, 0x93, 0x11, 0x42, 0x42, 0xad, 0xe7, 0xee, 0x17, 0xe7, 0x29, 0xfd, 0xc5, 0x7b, 0xed, 0xc4, - 0xd9, 0x1b, 0x37, 0xb4, 0xa7, 0xbd, 0x20, 0x71, 0x60, 0xa5, 0x95, 0xf6, 0xc6, 0x15, 0xf1, 0x0f, - 0x70, 0x9a, 0x1b, 0x7b, 0x42, 0x9c, 0xbc, 0xc8, 0x73, 0x81, 0x3f, 0x80, 0x0b, 0x5c, 0xd0, 0xfb, - 0x68, 0xb7, 0x6d, 0xb2, 0x0c, 0x93, 0x01, 0x0e, 0x9c, 0xe2, 0xfa, 0x55, 0x55, 0x77, 0xbd, 0xaa, - 0x5f, 0xd5, 0xab, 0x0e, 0xec, 0x84, 0x9c, 0x38, 0x1e, 0x6d, 0x5c, 0xee, 0x37, 0xf4, 0xaf, 0x7a, - 0xc4, 0xc3, 0x38, 0x44, 0x05, 0x23, 0x5d, 0xee, 0x57, 0xb6, 0x07, 0xe1, 0x20, 0x54, 0x68, 0x43, - 0xfe, 0xd2, 0x06, 0x95, 0xda, 0x20, 0x0c, 0x07, 0x1e, 0x6d, 0x28, 0xa9, 0x3f, 0x3c, 0x6b, 0xc4, - 0xcc, 0xa7, 0x22, 0x26, 0x7e, 0x64, 0x0c, 0xaa, 0x4e, 0x28, 0xfc, 0x50, 0x34, 0xfa, 0x44, 0xc8, - 0xc7, 0xf7, 0x69, 0x4c, 0xf6, 0x1b, 0x4e, 0xc8, 0x02, 0xad, 0xdf, 0xfb, 0xab, 0x05, 0x70, 0x44, - 0x62, 0xd2, 0x0b, 0x87, 0xdc, 0xa1, 0x68, 0x1b, 0x96, 0xc3, 0xab, 0x80, 0xf2, 0xb2, 0xb5, 0x6b, - 0x3d, 0x28, 0x60, 0x2d, 0x20, 0x04, 0xb9, 0x80, 0xf8, 0xb4, 0x9c, 0x51, 0xa0, 0xfa, 0x8d, 0x76, - 0xa1, 0xe8, 0x52, 0xe1, 0x70, 0x16, 0xc5, 0x2c, 0x0c, 0xca, 0x59, 0xa5, 0x9a, 0x85, 0x50, 0x05, - 0xf2, 0x67, 0xcc, 0xa3, 0xca, 0x33, 0xa7, 0xd4, 0x53, 0x59, 0xea, 0x62, 0x4e, 0x89, 0x18, 0xf2, - 0xeb, 0xf2, 0xb2, 0xd6, 0x25, 0x32, 0xfa, 0x09, 0x64, 0xcf, 0x28, 0x2d, 0xaf, 0xec, 0x66, 0x1f, - 0x14, 0x0f, 0xee, 0xd7, 0xf5, 0x01, 0xea, 0xf2, 0x00, 0x75, 0x73, 0x80, 0x7a, 0x2b, 0x64, 0x41, - 0xf3, 0xeb, 0x2f, 0xc6, 0xb5, 0xa5, 0x5f, 0x7f, 0x56, 0x7b, 0x30, 0x60, 0xf1, 0xf9, 0xb0, 0x5f, - 0x77, 0x42, 0xbf, 0x61, 0x4e, 0xab, 0xff, 0x7c, 0x4d, 0xb8, 0x17, 0x8d, 0xf8, 0x3a, 0xa2, 0x42, - 0x39, 0x08, 0x2c, 0x9f, 0xfb, 0x38, 0xf7, 0xe7, 0x8f, 0x6b, 0xd6, 0xde, 0xef, 0x2d, 0x28, 0x3d, - 0x53, 0xc9, 0xed, 0xa9, 0x80, 0xff, 0x67, 0x27, 0xdf, 0x81, 0x15, 0xe1, 0x9c, 0x53, 0x9f, 0x98, - 0x73, 0x1b, 0x09, 0x3d, 0x82, 0x0d, 0xa1, 0x6a, 0x60, 0x3b, 0xa1, 0x4b, 0xed, 0x21, 0xf7, 0xca, - 0x2b, 0xd2, 0xa0, 0xb9, 0x35, 0x19, 0xd7, 0xd6, 0x74, 0x79, 0x5a, 0xa1, 0x4b, 0x4f, 0xf1, 0x31, - 0x5e, 0x13, 0xa9, 0xc8, 0x3d, 0x73, 0xa2, 0xdf, 0x5a, 0x00, 0x98, 0x5c, 0x61, 0xfa, 0xd3, 0x21, - 0x15, 0x31, 0xfa, 0x2e, 0x14, 0xe9, 0x28, 0xa6, 0x3c, 0x20, 0x9e, 0xcd, 0x5c, 0x75, 0xaa, 0x5c, - 0xf3, 0xed, 0xc9, 0xb8, 0x06, 0x6d, 0x03, 0x77, 0x8e, 0xfe, 0x36, 0x27, 0x61, 0x48, 0x1c, 0x3a, - 0x2e, 0x7a, 0x02, 0xeb, 0x2e, 0x89, 0x89, 0x6d, 0x62, 0x62, 0xae, 0x4a, 0x41, 0xae, 0xb9, 0x3b, - 0x19, 0xd7, 0x4a, 0x29, 0x61, 0xd4, 0x33, 0xe6, 0x64, 0x5c, 0x72, 0x53, 0xc9, 0x95, 0xa9, 0x70, - 0x88, 0xe7, 0x49, 0x4c, 0x65, 0xaa, 0x84, 0xa7, 0xb2, 0x89, 0xfb, 0x67, 0x16, 0x14, 0x54, 0xdc, - 0x51, 0xc8, 0xdf, 0x38, 0xec, 0xb7, 0xa0, 0x40, 0x47, 0x2c, 0x56, 0x39, 0x54, 0x11, 0xaf, 0xe1, - 0xbc, 0x04, 0x64, 0xaa, 0x64, 0x31, 0x67, 0xe2, 0xc8, 0xcd, 0xc4, 0xf0, 0x97, 0x2c, 0xac, 0x26, - 0x89, 0x7b, 0x0a, 0x9b, 0xba, 0xeb, 0x6c, 0x5d, 0xd0, 0x34, 0x8c, 0x77, 0x26, 0xe3, 0xda, 0xfa, - 0x2c, 0x69, 0x54, 0x28, 0x0b, 0x08, 0x5e, 0x0f, 0x67, 0xe5, 0xf9, 0x0c, 0x64, 0xe6, 0x33, 0x80, - 0xf6, 0x61, 0x9b, 0xeb, 0xd7, 0x52, 0xd7, 0xbe, 0x24, 0x1e, 0x73, 0x49, 0x1c, 0x72, 0x51, 0xce, - 0xee, 0x66, 0x1f, 0x14, 0xf0, 0x9d, 0xa9, 0xee, 0xf9, 0x54, 0x25, 0x4f, 0xe8, 0xb3, 0xc0, 0x76, - 0xc2, 0x61, 0x10, 0x2b, 0x72, 0xe5, 0x70, 0xde, 0x67, 0x41, 0x4b, 0xca, 0xe8, 0x4b, 0xb0, 0x6e, - 0x7c, 0xec, 0x73, 0xca, 0x06, 0xe7, 0xb1, 0x22, 0x59, 0x16, 0xaf, 0x19, 0xf4, 0x07, 0x0a, 0x44, - 0x5f, 0x84, 0x52, 0x62, 0x26, 0xe7, 0x85, 0x22, 0x5a, 0x16, 0x17, 0x0d, 0x76, 0xc2, 0x7c, 0x8a, - 0xbe, 0x02, 0x05, 0xc7, 0x63, 0x34, 0x50, 0xc7, 0x5f, 0x55, 0x44, 0x2c, 0x4d, 0xc6, 0xb5, 0x7c, - 0x4b, 0x81, 0x9d, 0x23, 0x9c, 0xd7, 0xea, 0x8e, 0x8b, 0xbe, 0x07, 0x25, 0x4e, 0xae, 0x6c, 0xe3, - 0x2d, 0xca, 0x79, 0xd5, 0xb8, 0x77, 0xeb, 0xd3, 0xd9, 0x55, 0x4f, 0x69, 0xd9, 0xcc, 0xc9, 0xa6, - 0xc5, 0x45, 0x3e, 0x45, 0x04, 0x7a, 0x02, 0x45, 0xd6, 0x77, 0x6c, 0xe7, 0x9c, 0x04, 0x01, 0xf5, - 0xca, 0x85, 0x5d, 0x6b, 0xc1, 0xbd, 0xd3, 0x6c, 0xb5, 0xb4, 0xb2, 0xb9, 0x2e, 0x99, 0x90, 0xca, - 0x18, 0x58, 0xdf, 0x31, 0xbf, 0x51, 0x4d, 0x52, 0x87, 0x3a, 0xc3, 0x98, 0xda, 0x03, 0x22, 0xca, - 0xa0, 0x72, 0x03, 0x06, 0x7a, 0x8f, 0x08, 0x53, 0xeb, 0x5f, 0x58, 0xb0, 0x62, 0xc8, 0xf6, 0x36, - 0x14, 0xa6, 0x49, 0x37, 0x7d, 0x9f, 0x02, 0xe8, 0x21, 0x6c, 0xb1, 0xc0, 0xee, 0xd3, 0xb3, 0x90, - 0x53, 0x9b, 0x53, 0x11, 0x7a, 0x97, 0x9a, 0x53, 0x79, 0xbc, 0xc1, 0x82, 0xa6, 0xc2, 0xb1, 0x86, - 0xd1, 0xbb, 0x50, 0xd4, 0x39, 0x90, 0xcf, 0xd5, 0xf5, 0x2b, 0x1e, 0x6c, 0x2f, 0xa6, 0x40, 0x2a, - 0x4d, 0x06, 0x80, 0x27, 0x40, 0x12, 0xd7, 0xaf, 0xb2, 0x70, 0x4f, 0x53, 0xc9, 0x64, 0xa6, 0x4b, - 0x9c, 0x0b, 0x1a, 0xcb, 0xde, 0x9a, 0xaf, 0x86, 0xf5, 0x2f, 0xab, 0x71, 0x13, 0x7d, 0x33, 0xff, - 0x21, 0xfa, 0x2e, 0x34, 0xb0, 0xe4, 0x22, 0x11, 0x17, 0xf3, 0x5c, 0x24, 0xe2, 0x42, 0x73, 0x71, - 0x8e, 0xa8, 0xcb, 0x0b, 0x44, 0x3d, 0x87, 0xc2, 0x19, 0xa5, 0xb6, 0xc7, 0x7c, 0x16, 0xff, 0x37, - 0x26, 0x7d, 0xfe, 0x8c, 0xd2, 0x63, 0xf9, 0x70, 0xc9, 0x8a, 0x88, 0xd3, 0x88, 0x70, 0xcd, 0x8a, - 0x55, 0xcd, 0x0a, 0x03, 0xbd, 0x47, 0xc4, 0x22, 0x6d, 0xf2, 0x9f, 0x43, 0x1b, 0x0a, 0x7b, 0x37, - 0x54, 0xe7, 0xd0, 0xb9, 0x08, 0xc2, 0x2b, 0x8f, 0xba, 0x03, 0xea, 0xd3, 0x20, 0x46, 0x8f, 0x00, - 0x92, 0xce, 0x9a, 0x8e, 0x8d, 0xca, 0x64, 0x5c, 0x2b, 0x18, 0x2f, 0x95, 0xf2, 0x54, 0xc0, 0x05, - 0x63, 0xdd, 0x71, 0xcd, 0x6b, 0x7e, 0x97, 0x81, 0x72, 0xf2, 0x1e, 0x11, 0x85, 0x81, 0xa0, 0xb7, - 0xa3, 0xc1, 0x7c, 0x20, 0x99, 0xd7, 0x08, 0x44, 0x55, 0x35, 0x10, 0xa6, 0x70, 0x59, 0x53, 0xd5, - 0x40, 0xe8, 0xc2, 0x2d, 0x8e, 0x8e, 0xdc, 0x3f, 0x8f, 0x0e, 0x65, 0xa2, 0xda, 0x42, 0x9b, 0x2c, - 0x27, 0x26, 0x0a, 0x53, 0x26, 0xdf, 0x97, 0x73, 0x4a, 0x9b, 0x88, 0x98, 0xc4, 0x43, 0xa1, 0x46, - 0xd0, 0xfa, 0x41, 0x79, 0xb6, 0x63, 0xb4, 0x41, 0x4f, 0xe9, 0xe5, 0x04, 0x9b, 0x11, 0xe5, 0x2d, - 0xca, 0xa9, 0x18, 0x7a, 0xb1, 0x2a, 0x68, 0x09, 0x1b, 0xc9, 0x24, 0xf1, 0x0f, 0x59, 0xd9, 0xe2, - 0x12, 0xf8, 0xff, 0xeb, 0x9c, 0xf9, 0xc2, 0xae, 0xdc, 0xba, 0xb0, 0xab, 0xaf, 0x28, 0x6c, 0xfe, - 0xd5, 0x85, 0x2d, 0xfc, 0x3b, 0x85, 0x85, 0xdb, 0x16, 0xb6, 0x78, 0x43, 0x61, 0x23, 0xd8, 0x98, - 0x5e, 0x85, 0xc6, 0xe1, 0x2d, 0x28, 0x30, 0x61, 0x13, 0x27, 0x66, 0x97, 0x54, 0x15, 0x38, 0x8f, - 0xf3, 0x4c, 0x1c, 0x2a, 0x19, 0x3d, 0x86, 0x65, 0xc1, 0x02, 0x47, 0x8f, 0xed, 0xe2, 0x41, 0xa5, - 0xae, 0xd7, 0xe5, 0x7a, 0xb2, 0x2e, 0xd7, 0x4f, 0x92, 0x75, 0xb9, 0x99, 0x97, 0x33, 0xe6, 0xc3, - 0xcf, 0x6a, 0x16, 0xd6, 0x2e, 0xe6, 0x8d, 0x87, 0xb0, 0xa1, 0x9f, 0x35, 0x7d, 0x2f, 0x2a, 0xc3, - 0x2a, 0x71, 0x5d, 0x4e, 0x85, 0x30, 0x77, 0x46, 0x22, 0xca, 0x1d, 0x32, 0x0a, 0xaf, 0x28, 0xd7, - 0xb4, 0xc1, 0x5a, 0xd8, 0x7b, 0x91, 0x83, 0x95, 0x2e, 0xe1, 0xc4, 0x17, 0x68, 0x1f, 0xee, 0xfa, - 0x64, 0x64, 0xcf, 0x5c, 0x97, 0xa6, 0x1a, 0x6a, 0x52, 0x60, 0xe4, 0x93, 0x51, 0x7a, 0x57, 0xea, - 0xba, 0xec, 0xc1, 0x9a, 0x74, 0x49, 0xd9, 0xa2, 0x9f, 0x5d, 0xf4, 0xc9, 0xe8, 0x30, 0x21, 0xcc, - 0x43, 0xd8, 0x92, 0x36, 0x09, 0xbb, 0x6c, 0xc1, 0xde, 0xa7, 0xa6, 0x73, 0x37, 0x7c, 0x32, 0x6a, - 0x19, 0xbc, 0xc7, 0xde, 0xa7, 0xa8, 0x01, 0xdb, 0x2a, 0x04, 0x75, 0xf7, 0xd8, 0xa9, 0xb9, 0x26, - 0xa1, 0x7c, 0x8e, 0xbe, 0x96, 0x8e, 0x12, 0x87, 0x6f, 0xc2, 0x0e, 0x1d, 0x45, 0x8c, 0x13, 0xb9, - 0xda, 0xda, 0x7d, 0x2f, 0x74, 0x2e, 0xe6, 0xa8, 0xb9, 0x9d, 0x6a, 0x9b, 0x52, 0xa9, 0x43, 0x7a, - 0x07, 0xd6, 0xe5, 0x1c, 0xb7, 0xc3, 0x2b, 0x22, 0x7c, 0x35, 0x58, 0x15, 0x55, 0x71, 0x49, 0xa2, - 0xcf, 0x24, 0x28, 0x67, 0xef, 0x23, 0xb8, 0x1f, 0x51, 0x9e, 0x6e, 0x3e, 0xd3, 0xac, 0xa4, 0xa3, - 0x7a, 0x27, 0xa2, 0x7c, 0x9a, 0x7b, 0x93, 0x19, 0xe9, 0xfa, 0x55, 0x40, 0x82, 0xf8, 0x91, 0xc7, - 0x82, 0x81, 0x1d, 0xf3, 0x6b, 0x13, 0x92, 0x9e, 0xde, 0x9b, 0x89, 0xe6, 0x84, 0x5f, 0xeb, 0x70, - 0xbe, 0x0d, 0x65, 0xd3, 0xdb, 0x9c, 0x5e, 0x11, 0xee, 0xda, 0x11, 0xe5, 0x0e, 0x0d, 0x62, 0x32, - 0xd0, 0x34, 0xce, 0x61, 0xf3, 0x09, 0x86, 0x95, 0xba, 0x3b, 0xd5, 0xa2, 0xc7, 0x70, 0x9f, 0x05, - 0x9a, 0x5e, 0x76, 0x44, 0x03, 0xe2, 0xc5, 0xd7, 0xb6, 0x3b, 0xd4, 0xe7, 0x35, 0x3b, 0xc6, 0xbd, - 0xc4, 0xa0, 0xab, 0xf5, 0x47, 0x46, 0x8d, 0xda, 0x70, 0x47, 0x6e, 0x36, 0xc9, 0xa1, 0x68, 0x40, - 0xfa, 0x1e, 0x75, 0x15, 0xb3, 0xf3, 0xcd, 0xbb, 0x93, 0x71, 0x6d, 0xab, 0xd3, 0x6c, 0x99, 0x33, - 0xb5, 0xb5, 0x12, 0x6f, 0xb1, 0xbe, 0x33, 0x0f, 0x3d, 0xce, 0xff, 0xf2, 0xe3, 0xda, 0x92, 0x62, - 0xe3, 0xbb, 0x80, 0xba, 0x34, 0x70, 0x59, 0x30, 0x30, 0x4d, 0x74, 0xcc, 0x84, 0xba, 0xe2, 0xd2, - 0x91, 0x20, 0x49, 0x99, 0x95, 0x37, 0xd8, 0xb4, 0xef, 0x93, 0x1b, 0xec, 0x87, 0x30, 0xb3, 0x39, - 0xa1, 0x7b, 0xb0, 0xaa, 0x18, 0x90, 0x8c, 0x45, 0xbc, 0x22, 0xc5, 0x8e, 0x8b, 0xbe, 0x00, 0x60, - 0x56, 0xb1, 0x64, 0x00, 0x16, 0x70, 0xc1, 0x20, 0xd3, 0x6b, 0xea, 0x93, 0x0c, 0xdc, 0x31, 0x51, - 0x3e, 0xa7, 0x9c, 0x9d, 0x31, 0x47, 0x9f, 0xf8, 0xcb, 0x90, 0x77, 0xce, 0x09, 0x0b, 0xd2, 0x69, - 0x5b, 0x9c, 0x8c, 0x6b, 0xab, 0x2d, 0x89, 0x75, 0x8e, 0xf0, 0xaa, 0x52, 0x76, 0xdc, 0xf9, 0xcd, - 0x2b, 0xb3, 0xb8, 0x79, 0xcd, 0xcf, 0xb8, 0xec, 0xeb, 0xcc, 0xb8, 0x85, 0xef, 0x87, 0xdc, 0x1b, - 0x7f, 0xf6, 0x2c, 0xdf, 0xe6, 0xb3, 0xc7, 0x64, 0xe9, 0x37, 0x16, 0x14, 0xbb, 0x9c, 0x39, 0xd4, - 0x5c, 0x46, 0xf2, 0xdb, 0xef, 0xda, 0xef, 0x87, 0x5e, 0x92, 0x72, 0x2d, 0xa1, 0x2a, 0x80, 0x3f, - 0xf4, 0x62, 0x16, 0x79, 0x6c, 0x3a, 0x3c, 0x66, 0x10, 0xb4, 0x0e, 0x99, 0x68, 0x64, 0x1a, 0x3a, - 0x13, 0x8d, 0x16, 0xf2, 0x93, 0x7b, 0x9d, 0xfc, 0xbc, 0xfa, 0x72, 0x7e, 0xf8, 0x77, 0x0b, 0xd6, - 0xe6, 0x66, 0x34, 0xfa, 0x0e, 0xd4, 0x70, 0xbb, 0xf7, 0xec, 0xf8, 0x79, 0xdb, 0xee, 0x9d, 0x1c, - 0x9e, 0x9c, 0xf6, 0xec, 0x67, 0xdd, 0xf6, 0x53, 0xfb, 0xf4, 0x69, 0xaf, 0xdb, 0x6e, 0x75, 0x9e, - 0x74, 0xda, 0x47, 0x9b, 0x4b, 0x95, 0x7b, 0x1f, 0x7c, 0xb4, 0x7b, 0xe7, 0x06, 0x33, 0xf4, 0x2d, - 0xd8, 0x59, 0x80, 0x7b, 0xa7, 0xad, 0x56, 0xbb, 0xd7, 0xdb, 0xb4, 0x2a, 0x95, 0x0f, 0x3e, 0xda, - 0xfd, 0x1c, 0xed, 0x0d, 0x7e, 0x4f, 0x0e, 0x3b, 0xc7, 0xa7, 0xb8, 0xbd, 0x99, 0xb9, 0xd1, 0xcf, - 0x68, 0x6f, 0xf0, 0x6b, 0xff, 0xa8, 0xdb, 0xc1, 0xed, 0xa3, 0xcd, 0xec, 0x8d, 0x7e, 0x46, 0x5b, - 0xc9, 0xfd, 0xfc, 0x93, 0xea, 0x52, 0xb3, 0xf3, 0x62, 0x52, 0xb5, 0x3e, 0x9d, 0x54, 0xad, 0x3f, - 0x4d, 0xaa, 0xd6, 0x87, 0x2f, 0xab, 0x4b, 0x9f, 0xbe, 0xac, 0x2e, 0xfd, 0xf1, 0x65, 0x75, 0xe9, - 0xc7, 0x8d, 0x99, 0xed, 0xb3, 0x4f, 0x02, 0x57, 0x5d, 0x22, 0x4e, 0xe8, 0x35, 0x14, 0xa9, 0x1b, - 0x97, 0x07, 0x8d, 0x91, 0xf9, 0xef, 0x8d, 0x5e, 0x45, 0xfb, 0x2b, 0xca, 0xe2, 0x1b, 0xff, 0x08, - 0x00, 0x00, 0xff, 0xff, 0xc7, 0xb2, 0x70, 0xfb, 0xde, 0x11, 0x00, 0x00, + 0xd0, 0x30, 0x02, 0x9b, 0xcc, 0x22, 0xc4, 0xcc, 0xf2, 0xa1, 0xd8, 0xf1, 0x2c, 0x46, 0xd1, 0x8c, + 0xf5, 0x9c, 0x8c, 0x10, 0x12, 0x6a, 0x3d, 0x77, 0xbf, 0x38, 0x4f, 0xe9, 0x2f, 0xde, 0x6b, 0x27, + 0xce, 0xde, 0xb8, 0xa1, 0x3d, 0xed, 0x05, 0x89, 0x03, 0x2b, 0xad, 0xb4, 0x37, 0xae, 0x88, 0x7f, + 0x80, 0xd3, 0xdc, 0xd8, 0x13, 0xe2, 0xe4, 0x45, 0x9e, 0x0b, 0xfc, 0x01, 0x5c, 0xe0, 0x82, 0xde, + 0x47, 0xbb, 0x6d, 0xe3, 0x65, 0x98, 0x59, 0xe0, 0xb0, 0xa7, 0xb8, 0x7e, 0x55, 0xd5, 0x5d, 0xaf, + 0xea, 0x57, 0xf5, 0xaa, 0x03, 0x7b, 0x21, 0x27, 0x8e, 0x47, 0x1b, 0x57, 0x87, 0x0d, 0xfd, 0xab, + 0x1e, 0xf1, 0x30, 0x0e, 0x51, 0xc1, 0x48, 0x57, 0x87, 0x95, 0xdd, 0x41, 0x38, 0x08, 0x15, 0xda, + 0x90, 0xbf, 0xb4, 0x41, 0xa5, 0x36, 0x08, 0xc3, 0x81, 0x47, 0x1b, 0x4a, 0xea, 0x0f, 0xcf, 0x1b, + 0x31, 0xf3, 0xa9, 0x88, 0x89, 0x1f, 0x19, 0x83, 0xaa, 0x13, 0x0a, 0x3f, 0x14, 0x8d, 0x3e, 0x11, + 0xf2, 0xf1, 0x7d, 0x1a, 0x93, 0xc3, 0x86, 0x13, 0xb2, 0x40, 0xeb, 0x0f, 0xfe, 0x66, 0x01, 0x1c, + 0x93, 0x98, 0xf4, 0xc2, 0x21, 0x77, 0x28, 0xda, 0x85, 0xd5, 0xf0, 0x3a, 0xa0, 0xbc, 0x6c, 0xed, + 0x5b, 0xf7, 0x0a, 0x58, 0x0b, 0x08, 0x41, 0x2e, 0x20, 0x3e, 0x2d, 0x67, 0x14, 0xa8, 0x7e, 0xa3, + 0x7d, 0x28, 0xba, 0x54, 0x38, 0x9c, 0x45, 0x31, 0x0b, 0x83, 0x72, 0x56, 0xa9, 0x66, 0x21, 0x54, + 0x81, 0xfc, 0x39, 0xf3, 0xa8, 0xf2, 0xcc, 0x29, 0xf5, 0x54, 0x96, 0xba, 0x98, 0x53, 0x22, 0x86, + 0xfc, 0xa6, 0xbc, 0xaa, 0x75, 0x89, 0x8c, 0x7e, 0x0a, 0xd9, 0x73, 0x4a, 0xcb, 0x6b, 0xfb, 0xd9, + 0x7b, 0xc5, 0x07, 0x77, 0xeb, 0xfa, 0x00, 0x75, 0x79, 0x80, 0xba, 0x39, 0x40, 0xbd, 0x15, 0xb2, + 0xa0, 0xf9, 0xcd, 0xe7, 0xe3, 0xda, 0xca, 0x6f, 0x3e, 0xad, 0xdd, 0x1b, 0xb0, 0xf8, 0x62, 0xd8, + 0xaf, 0x3b, 0xa1, 0xdf, 0x30, 0xa7, 0xd5, 0x7f, 0xbe, 0x21, 0xdc, 0xcb, 0x46, 0x7c, 0x13, 0x51, + 0xa1, 0x1c, 0x04, 0x96, 0xcf, 0x7d, 0x94, 0xfb, 0xcb, 0x47, 0x35, 0xeb, 0xe0, 0x0f, 0x16, 0x94, + 0x9e, 0xaa, 0xe4, 0xf6, 0x54, 0xc0, 0xff, 0xb7, 0x93, 0xef, 0xc1, 0x9a, 0x70, 0x2e, 0xa8, 0x4f, + 0xcc, 0xb9, 0x8d, 0x84, 0x1e, 0xc2, 0x96, 0x50, 0x35, 0xb0, 0x9d, 0xd0, 0xa5, 0xf6, 0x90, 0x7b, + 0xe5, 0x35, 0x69, 0xd0, 0xdc, 0x99, 0x8c, 0x6b, 0x1b, 0xba, 0x3c, 0xad, 0xd0, 0xa5, 0x67, 0xf8, + 0x04, 0x6f, 0x88, 0x54, 0xe4, 0x9e, 0x39, 0xd1, 0xef, 0x2c, 0x00, 0x4c, 0xae, 0x31, 0xfd, 0xd9, + 0x90, 0x8a, 0x18, 0x7d, 0x0f, 0x8a, 0x74, 0x14, 0x53, 0x1e, 0x10, 0xcf, 0x66, 0xae, 0x3a, 0x55, + 0xae, 0xf9, 0xe6, 0x64, 0x5c, 0x83, 0xb6, 0x81, 0x3b, 0xc7, 0x7f, 0x9f, 0x93, 0x30, 0x24, 0x0e, + 0x1d, 0x17, 0x3d, 0x86, 0x4d, 0x97, 0xc4, 0xc4, 0x36, 0x31, 0x31, 0x57, 0xa5, 0x20, 0xd7, 0xdc, + 0x9f, 0x8c, 0x6b, 0xa5, 0x94, 0x30, 0xea, 0x19, 0x73, 0x32, 0x2e, 0xb9, 0xa9, 0xe4, 0xca, 0x54, + 0x38, 0xc4, 0xf3, 0x24, 0xa6, 0x32, 0x55, 0xc2, 0x53, 0xd9, 0xc4, 0xfd, 0x73, 0x0b, 0x0a, 0x2a, + 0xee, 0x28, 0xe4, 0x9f, 0x3b, 0xec, 0x37, 0xa0, 0x40, 0x47, 0x2c, 0x56, 0x39, 0x54, 0x11, 0x6f, + 0xe0, 0xbc, 0x04, 0x64, 0xaa, 0x64, 0x31, 0x67, 0xe2, 0xc8, 0xcd, 0xc4, 0xf0, 0xd7, 0x2c, 0xac, + 0x27, 0x89, 0x7b, 0x02, 0xdb, 0xba, 0xeb, 0x6c, 0x5d, 0xd0, 0x34, 0x8c, 0xb7, 0x26, 0xe3, 0xda, + 0xe6, 0x2c, 0x69, 0x54, 0x28, 0x0b, 0x08, 0xde, 0x0c, 0x67, 0xe5, 0xf9, 0x0c, 0x64, 0xe6, 0x33, + 0x80, 0x0e, 0x61, 0x97, 0xeb, 0xd7, 0x52, 0xd7, 0xbe, 0x22, 0x1e, 0x73, 0x49, 0x1c, 0x72, 0x51, + 0xce, 0xee, 0x67, 0xef, 0x15, 0xf0, 0xad, 0xa9, 0xee, 0xd9, 0x54, 0x25, 0x4f, 0xe8, 0xb3, 0xc0, + 0x76, 0xc2, 0x61, 0x10, 0x2b, 0x72, 0xe5, 0x70, 0xde, 0x67, 0x41, 0x4b, 0xca, 0xe8, 0x2b, 0xb0, + 0x69, 0x7c, 0xec, 0x0b, 0xca, 0x06, 0x17, 0xb1, 0x22, 0x59, 0x16, 0x6f, 0x18, 0xf4, 0x87, 0x0a, + 0x44, 0x5f, 0x86, 0x52, 0x62, 0x26, 0xe7, 0x85, 0x22, 0x5a, 0x16, 0x17, 0x0d, 0x76, 0xca, 0x7c, + 0x8a, 0xbe, 0x06, 0x05, 0xc7, 0x63, 0x34, 0x50, 0xc7, 0x5f, 0x57, 0x44, 0x2c, 0x4d, 0xc6, 0xb5, + 0x7c, 0x4b, 0x81, 0x9d, 0x63, 0x9c, 0xd7, 0xea, 0x8e, 0x8b, 0xbe, 0x0f, 0x25, 0x4e, 0xae, 0x6d, + 0xe3, 0x2d, 0xca, 0x79, 0xd5, 0xb8, 0xb7, 0xeb, 0xd3, 0xd9, 0x55, 0x4f, 0x69, 0xd9, 0xcc, 0xc9, + 0xa6, 0xc5, 0x45, 0x3e, 0x45, 0x04, 0x7a, 0x0c, 0x45, 0xd6, 0x77, 0x6c, 0xe7, 0x82, 0x04, 0x01, + 0xf5, 0xca, 0x85, 0x7d, 0x6b, 0xc1, 0xbd, 0xd3, 0x6c, 0xb5, 0xb4, 0xb2, 0xb9, 0x29, 0x99, 0x90, + 0xca, 0x18, 0x58, 0xdf, 0x31, 0xbf, 0x51, 0x4d, 0x52, 0x87, 0x3a, 0xc3, 0x98, 0xda, 0x03, 0x22, + 0xca, 0xa0, 0x72, 0x03, 0x06, 0x7a, 0x97, 0x08, 0x53, 0xeb, 0x5f, 0x5a, 0xb0, 0x66, 0xc8, 0xf6, + 0x26, 0x14, 0xa6, 0x49, 0x37, 0x7d, 0x9f, 0x02, 0xe8, 0x3e, 0xec, 0xb0, 0xc0, 0xee, 0xd3, 0xf3, + 0x90, 0x53, 0x9b, 0x53, 0x11, 0x7a, 0x57, 0x9a, 0x53, 0x79, 0xbc, 0xc5, 0x82, 0xa6, 0xc2, 0xb1, + 0x86, 0xd1, 0x3b, 0x50, 0xd4, 0x39, 0x90, 0xcf, 0xd5, 0xf5, 0x2b, 0x3e, 0xd8, 0x5d, 0x4c, 0x81, + 0x54, 0x9a, 0x0c, 0x00, 0x4f, 0x80, 0x24, 0xae, 0x5f, 0x67, 0xe1, 0x8e, 0xa6, 0x92, 0xc9, 0x4c, + 0x97, 0x38, 0x97, 0x34, 0x96, 0xbd, 0x35, 0x5f, 0x0d, 0xeb, 0xdf, 0x56, 0x63, 0x19, 0x7d, 0x33, + 0xff, 0x25, 0xfa, 0x2e, 0x34, 0xb0, 0xe4, 0x22, 0x11, 0x97, 0xf3, 0x5c, 0x24, 0xe2, 0x52, 0x73, + 0x71, 0x8e, 0xa8, 0xab, 0x0b, 0x44, 0xbd, 0x80, 0xc2, 0x39, 0xa5, 0xb6, 0xc7, 0x7c, 0x16, 0xff, + 0x2f, 0x26, 0x7d, 0xfe, 0x9c, 0xd2, 0x13, 0xf9, 0x70, 0xc9, 0x8a, 0x88, 0xd3, 0x88, 0x70, 0xcd, + 0x8a, 0x75, 0xcd, 0x0a, 0x03, 0xbd, 0x4b, 0xc4, 0x22, 0x6d, 0xf2, 0x9f, 0x41, 0x1b, 0x0a, 0x07, + 0x4b, 0xaa, 0x73, 0xe4, 0x5c, 0x06, 0xe1, 0xb5, 0x47, 0xdd, 0x01, 0xf5, 0x69, 0x10, 0xa3, 0x87, + 0x00, 0x49, 0x67, 0x4d, 0xc7, 0x46, 0x65, 0x32, 0xae, 0x15, 0x8c, 0x97, 0x4a, 0x79, 0x2a, 0xe0, + 0x82, 0xb1, 0xee, 0xb8, 0xe6, 0x35, 0xbf, 0xcf, 0x40, 0x39, 0x79, 0x8f, 0x88, 0xc2, 0x40, 0xd0, + 0xd7, 0xa3, 0xc1, 0x7c, 0x20, 0x99, 0x57, 0x08, 0x44, 0x55, 0x35, 0x10, 0xa6, 0x70, 0x59, 0x53, + 0xd5, 0x40, 0xe8, 0xc2, 0x2d, 0x8e, 0x8e, 0xdc, 0xbf, 0x8e, 0x0e, 0x65, 0xa2, 0xda, 0x42, 0x9b, + 0xac, 0x26, 0x26, 0x0a, 0x53, 0x26, 0x3f, 0x90, 0x73, 0x4a, 0x9b, 0x88, 0x98, 0xc4, 0x43, 0xa1, + 0x46, 0xd0, 0xe6, 0x83, 0xf2, 0x6c, 0xc7, 0x68, 0x83, 0x9e, 0xd2, 0xcb, 0x09, 0x36, 0x23, 0xca, + 0x5b, 0x94, 0x53, 0x31, 0xf4, 0x62, 0x55, 0xd0, 0x12, 0x36, 0x92, 0x49, 0xe2, 0x1f, 0xb3, 0xb2, + 0xc5, 0x25, 0xf0, 0xc5, 0xeb, 0x9c, 0xf9, 0xc2, 0xae, 0xbd, 0x76, 0x61, 0xd7, 0x5f, 0x52, 0xd8, + 0xfc, 0xcb, 0x0b, 0x5b, 0xf8, 0x4f, 0x0a, 0x0b, 0xaf, 0x5b, 0xd8, 0xe2, 0x92, 0xc2, 0x46, 0xb0, + 0x35, 0xbd, 0x0a, 0x8d, 0xc3, 0x1b, 0x50, 0x60, 0xc2, 0x26, 0x4e, 0xcc, 0xae, 0xa8, 0x2a, 0x70, + 0x1e, 0xe7, 0x99, 0x38, 0x52, 0x32, 0x7a, 0x04, 0xab, 0x82, 0x05, 0x8e, 0x1e, 0xdb, 0xc5, 0x07, + 0x95, 0xba, 0x5e, 0x97, 0xeb, 0xc9, 0xba, 0x5c, 0x3f, 0x4d, 0xd6, 0xe5, 0x66, 0x5e, 0xce, 0x98, + 0x0f, 0x3e, 0xad, 0x59, 0x58, 0xbb, 0x98, 0x37, 0x1e, 0xc1, 0x96, 0x7e, 0xd6, 0xf4, 0xbd, 0xa8, + 0x0c, 0xeb, 0xc4, 0x75, 0x39, 0x15, 0xc2, 0xdc, 0x19, 0x89, 0x28, 0x77, 0xc8, 0x28, 0xbc, 0xa6, + 0x5c, 0xd3, 0x06, 0x6b, 0xe1, 0xe0, 0x79, 0x0e, 0xd6, 0xba, 0x84, 0x13, 0x5f, 0xa0, 0x43, 0xb8, + 0xed, 0x93, 0x91, 0x3d, 0x73, 0x5d, 0x9a, 0x6a, 0xa8, 0x49, 0x81, 0x91, 0x4f, 0x46, 0xe9, 0x5d, + 0xa9, 0xeb, 0x72, 0x00, 0x1b, 0xd2, 0x25, 0x65, 0x8b, 0x7e, 0x76, 0xd1, 0x27, 0xa3, 0xa3, 0x84, + 0x30, 0xf7, 0x61, 0x47, 0xda, 0x24, 0xec, 0xb2, 0x05, 0x7b, 0x8f, 0x9a, 0xce, 0xdd, 0xf2, 0xc9, + 0xa8, 0x65, 0xf0, 0x1e, 0x7b, 0x8f, 0xa2, 0x06, 0xec, 0xaa, 0x10, 0xd4, 0xdd, 0x63, 0xa7, 0xe6, + 0x9a, 0x84, 0xf2, 0x39, 0xfa, 0x5a, 0x3a, 0x4e, 0x1c, 0xbe, 0x05, 0x7b, 0x74, 0x14, 0x31, 0x4e, + 0xe4, 0x6a, 0x6b, 0xf7, 0xbd, 0xd0, 0xb9, 0x9c, 0xa3, 0xe6, 0x6e, 0xaa, 0x6d, 0x4a, 0xa5, 0x0e, + 0xe9, 0x2d, 0xd8, 0x94, 0x73, 0xdc, 0x0e, 0xaf, 0x89, 0xf0, 0xd5, 0x60, 0x55, 0x54, 0xc5, 0x25, + 0x89, 0x3e, 0x95, 0xa0, 0x9c, 0xbd, 0x0f, 0xe1, 0x6e, 0x44, 0x79, 0xba, 0xf9, 0x4c, 0xb3, 0x92, + 0x8e, 0xea, 0xbd, 0x88, 0xf2, 0x69, 0xee, 0x4d, 0x66, 0xa4, 0xeb, 0xd7, 0x01, 0x09, 0xe2, 0x47, + 0x1e, 0x0b, 0x06, 0x76, 0xcc, 0x6f, 0x4c, 0x48, 0x7a, 0x7a, 0x6f, 0x27, 0x9a, 0x53, 0x7e, 0xa3, + 0xc3, 0xf9, 0x0e, 0x94, 0x4d, 0x6f, 0x73, 0x7a, 0x4d, 0xb8, 0x6b, 0x47, 0x94, 0x3b, 0x34, 0x88, + 0xc9, 0x40, 0xd3, 0x38, 0x87, 0xcd, 0x27, 0x18, 0x56, 0xea, 0xee, 0x54, 0x8b, 0x1e, 0xc1, 0x5d, + 0x16, 0x68, 0x7a, 0xd9, 0x11, 0x0d, 0x88, 0x17, 0xdf, 0xd8, 0xee, 0x50, 0x9f, 0xd7, 0xec, 0x18, + 0x77, 0x12, 0x83, 0xae, 0xd6, 0x1f, 0x1b, 0x35, 0x6a, 0xc3, 0x2d, 0xb9, 0xd9, 0x24, 0x87, 0xa2, + 0x01, 0xe9, 0x7b, 0xd4, 0x55, 0xcc, 0xce, 0x37, 0x6f, 0x4f, 0xc6, 0xb5, 0x9d, 0x4e, 0xb3, 0x65, + 0xce, 0xd4, 0xd6, 0x4a, 0xbc, 0xc3, 0xfa, 0xce, 0x3c, 0xf4, 0x28, 0xff, 0xab, 0x8f, 0x6a, 0x2b, + 0x8a, 0x8d, 0xef, 0x00, 0xea, 0xd2, 0xc0, 0x65, 0xc1, 0xc0, 0x34, 0xd1, 0x09, 0x13, 0xea, 0x8a, + 0x4b, 0x47, 0x82, 0x24, 0x65, 0x56, 0xde, 0x60, 0xd3, 0xbe, 0x4f, 0x6e, 0xb0, 0x1f, 0xc1, 0xcc, + 0xe6, 0x84, 0xee, 0xc0, 0xba, 0x62, 0x40, 0x32, 0x16, 0xf1, 0x9a, 0x14, 0x3b, 0x2e, 0xfa, 0x12, + 0x80, 0x59, 0xc5, 0x92, 0x01, 0x58, 0xc0, 0x05, 0x83, 0x4c, 0xaf, 0xa9, 0x8f, 0x33, 0x70, 0xcb, + 0x44, 0xf9, 0x8c, 0x72, 0x76, 0xce, 0x1c, 0x7d, 0xe2, 0xaf, 0x42, 0xde, 0xb9, 0x20, 0x2c, 0x48, + 0xa7, 0x6d, 0x71, 0x32, 0xae, 0xad, 0xb7, 0x24, 0xd6, 0x39, 0xc6, 0xeb, 0x4a, 0xd9, 0x71, 0xe7, + 0x37, 0xaf, 0xcc, 0xe2, 0xe6, 0x35, 0x3f, 0xe3, 0xb2, 0xaf, 0x32, 0xe3, 0x16, 0xbe, 0x1f, 0x72, + 0x9f, 0xfb, 0xb3, 0x67, 0xf5, 0x75, 0x3e, 0x7b, 0x4c, 0x96, 0x7e, 0x6b, 0x41, 0xb1, 0xcb, 0x99, + 0x43, 0xcd, 0x65, 0x24, 0xbf, 0xfd, 0x6e, 0xfc, 0x7e, 0xe8, 0x25, 0x29, 0xd7, 0x12, 0xaa, 0x02, + 0xf8, 0x43, 0x2f, 0x66, 0x91, 0xc7, 0xa6, 0xc3, 0x63, 0x06, 0x41, 0x9b, 0x90, 0x89, 0x46, 0xa6, + 0xa1, 0x33, 0xd1, 0x68, 0x21, 0x3f, 0xb9, 0x57, 0xc9, 0xcf, 0xcb, 0x2f, 0xe7, 0xfb, 0xff, 0xb0, + 0x60, 0x63, 0x6e, 0x46, 0xa3, 0xef, 0x42, 0x0d, 0xb7, 0x7b, 0x4f, 0x4f, 0x9e, 0xb5, 0xed, 0xde, + 0xe9, 0xd1, 0xe9, 0x59, 0xcf, 0x7e, 0xda, 0x6d, 0x3f, 0xb1, 0xcf, 0x9e, 0xf4, 0xba, 0xed, 0x56, + 0xe7, 0x71, 0xa7, 0x7d, 0xbc, 0xbd, 0x52, 0xb9, 0xf3, 0xfe, 0x87, 0xfb, 0xb7, 0x96, 0x98, 0xa1, + 0x6f, 0xc3, 0xde, 0x02, 0xdc, 0x3b, 0x6b, 0xb5, 0xda, 0xbd, 0xde, 0xb6, 0x55, 0xa9, 0xbc, 0xff, + 0xe1, 0xfe, 0x67, 0x68, 0x97, 0xf8, 0x3d, 0x3e, 0xea, 0x9c, 0x9c, 0xe1, 0xf6, 0x76, 0x66, 0xa9, + 0x9f, 0xd1, 0x2e, 0xf1, 0x6b, 0xff, 0xb8, 0xdb, 0xc1, 0xed, 0xe3, 0xed, 0xec, 0x52, 0x3f, 0xa3, + 0xad, 0xe4, 0x7e, 0xf1, 0x71, 0x75, 0xa5, 0xd9, 0x79, 0x3e, 0xa9, 0x5a, 0x9f, 0x4c, 0xaa, 0xd6, + 0x9f, 0x27, 0x55, 0xeb, 0x83, 0x17, 0xd5, 0x95, 0x4f, 0x5e, 0x54, 0x57, 0xfe, 0xf4, 0xa2, 0xba, + 0xf2, 0x93, 0xc6, 0xcc, 0xf6, 0xd9, 0x27, 0x81, 0xab, 0x2e, 0x11, 0x27, 0xf4, 0x1a, 0x8a, 0xd4, + 0x8d, 0xab, 0xb7, 0x1b, 0x23, 0xf3, 0xdf, 0x1b, 0xbd, 0x8a, 0xf6, 0xd7, 0x94, 0xc5, 0xdb, 0xff, + 0x0c, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xd7, 0x55, 0x7a, 0xde, 0x11, 0x00, 0x00, } func (this *DataSource) Equal(that interface{}) bool { diff --git a/x/oracle/types/packets_test.go b/x/oracle/types/packets_test.go index 63de063a7..5a3f3f94f 100644 --- a/x/oracle/types/packets_test.go +++ b/x/oracle/types/packets_test.go @@ -4,8 +4,11 @@ import ( "encoding/hex" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func mustDecodeString(hexstr string) []byte { @@ -23,7 +26,7 @@ func TestGetBytesRequestPacket(t *testing.T) { Calldata: mustDecodeString("030000004254436400000000000000"), AskCount: 1, MinCount: 1, - FeeLimit: sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(10000))), + FeeLimit: sdk.NewCoins(sdk.NewCoin("uband", math.NewInt(10000))), PrepareGas: 100, ExecuteGas: 100, } diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index ebb1d59ab..1c20318dd 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -1543,98 +1544,101 @@ func init() { func init() { proto.RegisterFile("oracle/v1/query.proto", fileDescriptor_34238c8dfdfcd7ec) } var fileDescriptor_34238c8dfdfcd7ec = []byte{ - // 1448 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcb, 0x6f, 0xdb, 0xc6, - 0x13, 0x36, 0x6d, 0x47, 0x96, 0xc6, 0xb2, 0x63, 0xaf, 0xf3, 0xb0, 0x69, 0x5b, 0x76, 0x18, 0xff, - 0x7e, 0x51, 0x1e, 0x10, 0x6b, 0x37, 0x68, 0xd1, 0x34, 0x28, 0x10, 0xd7, 0x28, 0xaa, 0xa2, 0x40, - 0x12, 0x19, 0x48, 0x5f, 0x07, 0x61, 0x4d, 0x32, 0x32, 0x11, 0x99, 0x54, 0xb8, 0x94, 0x61, 0x23, - 0x35, 0x0a, 0xa4, 0xe8, 0xa9, 0x87, 0xb6, 0x28, 0xd0, 0x1c, 0x72, 0xeb, 0xb5, 0xff, 0x48, 0x8e, - 0x01, 0x7a, 0xe9, 0xa1, 0x08, 0x0a, 0xa7, 0x7f, 0x48, 0xc1, 0xdd, 0x59, 0x72, 0xf9, 0x90, 0x9c, - 0xfa, 0xd4, 0x9b, 0x38, 0xfb, 0xed, 0xcc, 0x37, 0x33, 0xbb, 0xb3, 0x1f, 0x04, 0xe7, 0xfd, 0x80, - 0x5a, 0x5d, 0xc7, 0xdc, 0x5f, 0x37, 0x1f, 0xf7, 0x9d, 0xe0, 0xb0, 0xd1, 0x0b, 0xfc, 0xd0, 0x27, - 0x15, 0x61, 0x6e, 0xec, 0xaf, 0xeb, 0xe7, 0x3a, 0x7e, 0xc7, 0xe7, 0x56, 0x33, 0xfa, 0x25, 0x00, - 0xfa, 0x52, 0xc7, 0xf7, 0x3b, 0x5d, 0xc7, 0xa4, 0x3d, 0xd7, 0xa4, 0x9e, 0xe7, 0x87, 0x34, 0x74, - 0x7d, 0x8f, 0xe1, 0xea, 0x85, 0xc4, 0x2b, 0x3a, 0xe2, 0x76, 0xe3, 0x1c, 0x90, 0xfb, 0x51, 0x94, - 0x0f, 0xfd, 0xbe, 0x17, 0xb2, 0x96, 0xf3, 0xb8, 0xef, 0xb0, 0xd0, 0xf8, 0x45, 0x83, 0xb9, 0x94, - 0x99, 0xf5, 0x7c, 0x8f, 0x39, 0xe4, 0x1a, 0xcc, 0xda, 0x34, 0xa4, 0x6d, 0xe6, 0xf7, 0x03, 0xcb, - 0x69, 0x5b, 0xd1, 0xea, 0xbc, 0xb6, 0xaa, 0xd5, 0xc7, 0x5b, 0x67, 0xa3, 0x85, 0x6d, 0x6e, 0xe7, - 0x9b, 0x48, 0x03, 0xe6, 0x44, 0xa4, 0x36, 0xb3, 0x02, 0xb7, 0x17, 0x22, 0x7a, 0x94, 0xa3, 0x67, - 0xc5, 0xd2, 0x36, 0x5f, 0x11, 0xf8, 0xcb, 0x30, 0x15, 0x88, 0xf0, 0x88, 0x1c, 0xe3, 0xc8, 0x2a, - 0x1a, 0x39, 0xc8, 0x30, 0x61, 0x86, 0xf3, 0xda, 0xa2, 0x21, 0x45, 0xb2, 0x64, 0x11, 0x2a, 0x9c, - 0xd4, 0x2e, 0x65, 0xbb, 0x9c, 0x4c, 0xa5, 0x55, 0x8e, 0x0c, 0x1f, 0x53, 0xb6, 0x6b, 0x5c, 0x81, - 0x59, 0x65, 0x03, 0xa6, 0x41, 0x60, 0x3c, 0x02, 0x70, 0x70, 0xb5, 0xc5, 0x7f, 0x1b, 0x1f, 0xc0, - 0x85, 0x18, 0x28, 0xd2, 0x90, 0xfe, 0xd7, 0x60, 0x5a, 0x4d, 0xda, 0xb5, 0x31, 0xe3, 0x6a, 0x92, - 0x71, 0xd3, 0x36, 0xee, 0xc3, 0xc5, 0xdc, 0x7e, 0x0c, 0xf7, 0x0e, 0x4c, 0x2a, 0x0e, 0xf8, 0xee, - 0xc9, 0x8d, 0xf3, 0x8d, 0xb8, 0xa1, 0x0d, 0x65, 0x0f, 0x24, 0x4e, 0x8d, 0x2d, 0x98, 0xe7, 0x2e, - 0xef, 0x2a, 0xb5, 0x92, 0xa4, 0xea, 0x30, 0x93, 0xae, 0x6e, 0x4c, 0x6b, 0x5a, 0x2d, 0x6d, 0xd3, - 0x36, 0xbe, 0x80, 0x85, 0x02, 0x2f, 0x48, 0xed, 0x36, 0x4c, 0xa5, 0xdc, 0x20, 0xb9, 0x8b, 0x0a, - 0xb9, 0xd4, 0xbe, 0xaa, 0xea, 0xdc, 0xb8, 0x89, 0xa7, 0x04, 0x49, 0x49, 0x6e, 0xcb, 0x00, 0xb2, - 0x93, 0x31, 0xab, 0x0a, 0x5a, 0x9a, 0xb6, 0xf1, 0xab, 0x06, 0xe7, 0xd2, 0xdb, 0x90, 0xcc, 0x0d, - 0x98, 0x40, 0x14, 0xd2, 0x20, 0x0a, 0x0d, 0x09, 0x96, 0x10, 0xb2, 0x1e, 0xa1, 0x7b, 0x7e, 0x10, - 0xb2, 0xf9, 0xd1, 0xd5, 0xb1, 0xfa, 0xe4, 0xc6, 0x6c, 0x0a, 0x1d, 0xad, 0x6c, 0x8e, 0xbf, 0x78, - 0xb5, 0x32, 0xd2, 0x92, 0x38, 0x72, 0x15, 0x4a, 0x81, 0xc3, 0xfa, 0x5d, 0x71, 0xb6, 0xb2, 0x3b, - 0xa2, 0x85, 0x16, 0x02, 0x8c, 0x4f, 0x60, 0x91, 0x73, 0xbc, 0xe7, 0x78, 0xb6, 0xeb, 0x75, 0x30, - 0xba, 0xbc, 0x20, 0xe4, 0x3a, 0xcc, 0xee, 0xd3, 0xae, 0x6b, 0xd3, 0xd0, 0x0f, 0xda, 0xd4, 0xb6, - 0x03, 0x87, 0x31, 0x3c, 0x7b, 0x33, 0xf1, 0xc2, 0x1d, 0x61, 0x37, 0xee, 0xc2, 0x52, 0xb1, 0x2f, - 0xcc, 0xdb, 0x84, 0xc9, 0xa4, 0x5e, 0x91, 0x9b, 0xb1, 0xfa, 0xf8, 0xe6, 0xf4, 0xf1, 0xab, 0x15, - 0x40, 0x68, 0x73, 0x8b, 0xb5, 0x20, 0x2e, 0x20, 0x8b, 0x2f, 0xed, 0x3d, 0x1a, 0xd0, 0xbd, 0xf8, - 0xd2, 0x7e, 0x84, 0xdd, 0x90, 0xd6, 0xd8, 0x7b, 0xa9, 0xc7, 0x2d, 0x58, 0x54, 0x35, 0x69, 0x01, - 0xc5, 0x32, 0x21, 0xcc, 0xd8, 0x82, 0xf3, 0xdc, 0xcf, 0x03, 0x99, 0xc7, 0xa9, 0x92, 0xfe, 0x14, - 0xef, 0x93, 0xe2, 0x05, 0x09, 0x6d, 0x40, 0x89, 0x85, 0x34, 0xec, 0x4b, 0x42, 0xba, 0x42, 0x28, - 0x46, 0x6f, 0x73, 0x44, 0x0b, 0x91, 0x46, 0x0f, 0xbd, 0x35, 0x99, 0xe8, 0xac, 0x73, 0x2a, 0x52, - 0xe4, 0x2a, 0xcc, 0x04, 0xb8, 0x3f, 0xc6, 0x8e, 0x72, 0xec, 0x59, 0x69, 0x97, 0xfc, 0x6f, 0xe1, - 0x7d, 0x56, 0x23, 0x62, 0x02, 0x2b, 0x30, 0xe9, 0xb2, 0xb6, 0xdc, 0xc0, 0x83, 0x95, 0x5b, 0xe0, - 0xc6, 0xc0, 0xb8, 0x82, 0xd2, 0x70, 0xba, 0x63, 0x73, 0x13, 0x73, 0x56, 0xbc, 0x20, 0x01, 0x1d, - 0xca, 0x4a, 0xf4, 0xb1, 0x68, 0xe0, 0xc9, 0x6f, 0xa3, 0x86, 0x87, 0xed, 0x8e, 0x15, 0xba, 0xfb, - 0x4e, 0x5c, 0xcf, 0xf8, 0x94, 0x7c, 0x05, 0xcb, 0x03, 0xd6, 0xd1, 0xf9, 0x2d, 0x80, 0x98, 0x8a, - 0x38, 0x8c, 0xe9, 0x16, 0x65, 0x36, 0xb6, 0x14, 0xb4, 0xf1, 0x5c, 0xc3, 0x61, 0x83, 0xd1, 0xb6, - 0x1d, 0x1a, 0x58, 0xbb, 0xff, 0x7a, 0x66, 0x45, 0x09, 0x5a, 0xb4, 0xdb, 0xe5, 0x43, 0x5a, 0xf4, - 0x27, 0xfe, 0x8e, 0xc6, 0x3d, 0x65, 0x8f, 0x52, 0x6f, 0x44, 0x99, 0xb2, 0x47, 0xe2, 0x11, 0x59, - 0x84, 0xca, 0x9e, 0xeb, 0xe1, 0xe2, 0xb8, 0x58, 0xdc, 0x73, 0x3d, 0xf1, 0x78, 0x7c, 0x06, 0x7a, - 0x11, 0x39, 0xcc, 0xfb, 0xbd, 0xec, 0xf4, 0x59, 0x51, 0x92, 0x2e, 0x9a, 0x57, 0xf1, 0x28, 0x32, - 0x3c, 0x1c, 0xd4, 0x08, 0xb8, 0x17, 0xb8, 0xc9, 0xeb, 0x31, 0x0f, 0x13, 0xec, 0x70, 0x6f, 0xc7, - 0xef, 0x32, 0x6c, 0x95, 0xfc, 0x4c, 0x27, 0x32, 0x3a, 0x2c, 0x91, 0xb1, 0x4c, 0x22, 0x9f, 0xa7, - 0xab, 0x8c, 0xf1, 0x30, 0x8f, 0xf7, 0x61, 0xaa, 0x17, 0x19, 0xda, 0x62, 0x92, 0xc9, 0x16, 0x5e, - 0x50, 0xaf, 0x3d, 0x6e, 0x88, 0x06, 0x5e, 0xb5, 0x97, 0x7c, 0x30, 0xe3, 0xd9, 0x28, 0xac, 0xa8, - 0xae, 0x1f, 0x38, 0x81, 0xfb, 0xd0, 0xb5, 0xb8, 0x94, 0x90, 0x19, 0x2d, 0x40, 0xd9, 0xda, 0xa5, - 0xae, 0x27, 0xdb, 0x57, 0x69, 0x4d, 0xf0, 0xef, 0xa6, 0x4d, 0x96, 0xa0, 0x12, 0x9f, 0x06, 0x6c, - 0x5c, 0x62, 0xc8, 0xbc, 0x0b, 0x63, 0x99, 0x77, 0x21, 0xba, 0x56, 0xce, 0x41, 0xe8, 0x04, 0x1e, - 0xed, 0x46, 0xeb, 0xa2, 0x7b, 0x20, 0x4d, 0x4d, 0xbb, 0xe0, 0x21, 0x3e, 0x93, 0x7f, 0x88, 0x53, - 0x97, 0xa3, 0x24, 0xce, 0x8e, 0xfc, 0x8e, 0xf8, 0x31, 0xb7, 0xe3, 0xd1, 0xb0, 0x1f, 0x38, 0xf3, - 0x13, 0xfc, 0xf5, 0x4f, 0x0c, 0xbc, 0xe6, 0xf4, 0xa0, 0x6d, 0x3b, 0x5d, 0x7a, 0x38, 0x5f, 0xc6, - 0x9a, 0xd3, 0x83, 0xad, 0xe8, 0xdb, 0xf8, 0x53, 0x83, 0xd5, 0xc1, 0x95, 0xc1, 0xda, 0xff, 0xc7, - 0x4b, 0xb3, 0x00, 0x65, 0x97, 0x61, 0x7e, 0x25, 0x3e, 0xb5, 0x26, 0x5c, 0xc6, 0xd3, 0xdb, 0xf8, - 0x6d, 0x1a, 0xce, 0xf0, 0xf4, 0xc8, 0x0e, 0x94, 0x84, 0xea, 0x23, 0xcb, 0xd9, 0x0b, 0x90, 0x12, - 0x89, 0x7a, 0x6d, 0xd0, 0xb2, 0x28, 0x86, 0xb1, 0xf0, 0xf4, 0xf7, 0xbf, 0x7f, 0x1e, 0x9d, 0x23, - 0xb3, 0x66, 0xa2, 0x3d, 0x2d, 0xe1, 0xf9, 0x21, 0x8c, 0x6f, 0xf1, 0xbb, 0x9c, 0x75, 0xa1, 0xe8, - 0x3a, 0x7d, 0xa9, 0x78, 0x11, 0xbd, 0x5f, 0xe6, 0xde, 0x97, 0xc9, 0xa2, 0xe2, 0x3d, 0x4a, 0xd6, - 0x7c, 0x12, 0x8b, 0xc1, 0x23, 0xf2, 0x9d, 0x06, 0x90, 0x88, 0x2b, 0x72, 0xa9, 0xc8, 0x63, 0x4a, - 0xec, 0xe9, 0xc6, 0x30, 0x08, 0x86, 0x7e, 0x8b, 0x87, 0xbe, 0x46, 0xea, 0x99, 0xd0, 0x58, 0x7d, - 0x86, 0x14, 0xe2, 0x5e, 0x1c, 0x91, 0x1f, 0x34, 0xa8, 0xaa, 0x3a, 0x8a, 0x5c, 0xce, 0x86, 0x29, - 0xd0, 0x78, 0xfa, 0xda, 0x70, 0x10, 0xb2, 0xb9, 0xc9, 0xd9, 0x34, 0xc8, 0x0d, 0x33, 0x2b, 0xf1, - 0x71, 0xcc, 0x32, 0xf3, 0x49, 0x76, 0xec, 0x1e, 0x91, 0x10, 0x26, 0xe4, 0x7d, 0xae, 0x0d, 0x9c, - 0x73, 0x82, 0xc6, 0x49, 0x73, 0xd0, 0xa8, 0x73, 0x06, 0x06, 0x59, 0x55, 0x18, 0xe0, 0xd9, 0x65, - 0xe6, 0x93, 0xe4, 0x5c, 0x1f, 0x91, 0xe7, 0x1a, 0x9c, 0xcd, 0xa8, 0x20, 0xf2, 0xff, 0xac, 0xfb, - 0x62, 0xc9, 0xa5, 0x5f, 0x39, 0x11, 0x87, 0x74, 0xde, 0xe5, 0x74, 0xd6, 0x89, 0xa9, 0xd0, 0xe9, - 0x09, 0x6c, 0x3b, 0xa1, 0x95, 0x7b, 0x87, 0x8f, 0xc8, 0xb7, 0x1a, 0x54, 0xe2, 0x77, 0x8d, 0xac, - 0x66, 0xe3, 0x65, 0xf5, 0x90, 0x7e, 0x69, 0x08, 0x02, 0xb9, 0xac, 0x73, 0x2e, 0xd7, 0xc9, 0x55, - 0x85, 0x4b, 0xf2, 0x5e, 0x16, 0xb2, 0x78, 0xa6, 0x01, 0x24, 0xa2, 0x23, 0x7f, 0x66, 0x73, 0x12, - 0x28, 0x7f, 0x66, 0xf3, 0x9a, 0xc5, 0xd8, 0xe4, 0x44, 0x6e, 0x93, 0x5b, 0xa9, 0x1e, 0x09, 0x50, - 0x11, 0x8d, 0xa8, 0x6f, 0x69, 0xa1, 0x74, 0x44, 0x9e, 0x6a, 0x50, 0x89, 0xc5, 0x48, 0xbe, 0x3e, - 0x59, 0xb5, 0x93, 0xaf, 0x4f, 0x4e, 0xc9, 0x14, 0x5e, 0x25, 0x19, 0xb8, 0xb8, 0x3c, 0xdf, 0x6b, - 0x30, 0x93, 0xd5, 0x2e, 0x24, 0x77, 0x36, 0x06, 0xa8, 0x1f, 0xbd, 0x7e, 0x32, 0x10, 0x99, 0xad, - 0x71, 0x66, 0x35, 0xb2, 0xa4, 0x30, 0xa3, 0x1c, 0xdc, 0x4e, 0x1a, 0x18, 0x0d, 0x4b, 0xa1, 0xa1, - 0xf3, 0xc3, 0x32, 0x25, 0xce, 0xf3, 0xc3, 0x32, 0xad, 0xd2, 0x0b, 0x87, 0xa5, 0xd0, 0xe3, 0xe4, - 0x1b, 0x98, 0x4a, 0x29, 0x16, 0xb2, 0x36, 0xe0, 0x42, 0xa6, 0xd4, 0x96, 0xfe, 0xbf, 0x13, 0x50, - 0x18, 0xf8, 0x12, 0x0f, 0xbc, 0x48, 0x16, 0xf2, 0x97, 0xb7, 0xcd, 0x44, 0xbc, 0xaf, 0xa1, 0xaa, - 0x2a, 0x8d, 0xfc, 0xf0, 0x2a, 0xd0, 0x3d, 0xfa, 0xda, 0x70, 0xd0, 0x1b, 0x44, 0xe7, 0xc2, 0x84, - 0x91, 0x9f, 0x34, 0x98, 0x2b, 0x78, 0x73, 0xc9, 0xb5, 0x01, 0x01, 0x0a, 0x24, 0x8b, 0x7e, 0xfd, - 0x8d, 0xb0, 0x43, 0x38, 0xed, 0x47, 0xc0, 0x43, 0x39, 0x3e, 0x36, 0x9b, 0x2f, 0x8e, 0x6b, 0xda, - 0xcb, 0xe3, 0x9a, 0xf6, 0xd7, 0x71, 0x4d, 0xfb, 0xf1, 0x75, 0x6d, 0xe4, 0xe5, 0xeb, 0xda, 0xc8, - 0x1f, 0xaf, 0x6b, 0x23, 0x5f, 0x9a, 0x1d, 0x37, 0xdc, 0xed, 0xef, 0x34, 0x2c, 0x7f, 0xcf, 0xdc, - 0xa1, 0x9e, 0xcd, 0xff, 0x65, 0xb1, 0xfc, 0xae, 0xc9, 0x75, 0x80, 0xb9, 0xbf, 0x61, 0x1e, 0x48, - 0xb7, 0xe1, 0x61, 0xcf, 0x61, 0x3b, 0x25, 0x8e, 0x78, 0xfb, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xf0, 0x4e, 0x38, 0xd4, 0xf7, 0x11, 0x00, 0x00, + // 1504 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0x3a, 0xa9, 0x63, 0xbf, 0x38, 0x69, 0x32, 0x49, 0x5b, 0x67, 0x93, 0x38, 0xc9, 0x36, + 0x50, 0xf7, 0xcb, 0x4b, 0xd2, 0x0a, 0x44, 0xa9, 0x40, 0x4d, 0x23, 0x84, 0x25, 0xd4, 0x0f, 0x47, + 0x2a, 0x5f, 0x07, 0x6b, 0x62, 0x6f, 0x9d, 0x55, 0xed, 0x5d, 0x77, 0x67, 0x6d, 0x25, 0x2a, 0x11, + 0x52, 0x11, 0x27, 0x0e, 0x80, 0x90, 0xe0, 0xd0, 0x1b, 0x57, 0xc4, 0xad, 0x27, 0xfe, 0x82, 0x1e, + 0xab, 0x72, 0xe1, 0x54, 0xa1, 0x94, 0xff, 0x03, 0xb4, 0x33, 0x6f, 0x77, 0x67, 0x3f, 0xec, 0x94, + 0x43, 0x0e, 0xdc, 0xb2, 0x33, 0xbf, 0x79, 0xef, 0xf7, 0xde, 0xbc, 0xf7, 0xe6, 0xe7, 0xc0, 0x29, + 0xdb, 0xa1, 0x8d, 0xb6, 0xa1, 0xf7, 0xd7, 0xf5, 0x87, 0x3d, 0xc3, 0xd9, 0xaf, 0x74, 0x1d, 0xdb, + 0xb5, 0x49, 0x5e, 0x2c, 0x57, 0xfa, 0xeb, 0xea, 0x5c, 0xcb, 0x6e, 0xd9, 0x7c, 0x55, 0xf7, 0xfe, + 0x12, 0x00, 0x75, 0xb1, 0x65, 0xdb, 0xad, 0xb6, 0xa1, 0xd3, 0xae, 0xa9, 0x53, 0xcb, 0xb2, 0x5d, + 0xea, 0x9a, 0xb6, 0xc5, 0x70, 0x77, 0xbe, 0x61, 0xb3, 0x8e, 0xcd, 0xea, 0xe2, 0x98, 0xf8, 0xc0, + 0xad, 0xd3, 0xa1, 0x43, 0xf4, 0xc1, 0xd7, 0xb5, 0x39, 0x20, 0x77, 0x3d, 0x02, 0x37, 0xed, 0x9e, + 0xe5, 0xb2, 0x9a, 0xf1, 0xb0, 0x67, 0x30, 0x57, 0xfb, 0x49, 0x81, 0xd9, 0xc8, 0x32, 0xeb, 0xda, + 0x16, 0x33, 0xc8, 0x05, 0x98, 0x69, 0x52, 0x97, 0xd6, 0x99, 0xdd, 0x73, 0x1a, 0x46, 0xbd, 0xe1, + 0xed, 0x16, 0x95, 0x15, 0xa5, 0x3c, 0x56, 0x3b, 0xe9, 0x6d, 0x6c, 0xf3, 0x75, 0x7e, 0x88, 0x54, + 0x60, 0x56, 0x78, 0xaa, 0xb3, 0x86, 0x63, 0x76, 0x5d, 0x44, 0x67, 0x38, 0x7a, 0x46, 0x6c, 0x6d, + 0xf3, 0x1d, 0x81, 0x3f, 0x0b, 0x93, 0x8e, 0x70, 0x8f, 0xc8, 0x51, 0x8e, 0x2c, 0xe0, 0x22, 0x07, + 0x69, 0x3a, 0x4c, 0x73, 0x5e, 0x5b, 0xd4, 0xa5, 0x48, 0x96, 0x2c, 0x40, 0x9e, 0x93, 0xda, 0xa5, + 0x6c, 0x97, 0x93, 0xc9, 0xd7, 0x72, 0xde, 0xc2, 0x47, 0x94, 0xed, 0x6a, 0xe7, 0x60, 0x46, 0x3a, + 0x80, 0x61, 0x10, 0x18, 0xf3, 0x00, 0x1c, 0x5c, 0xa8, 0xf1, 0xbf, 0xb5, 0xf7, 0xe1, 0x74, 0x00, + 0x14, 0x61, 0xf8, 0xf6, 0xd7, 0x60, 0x4a, 0x0e, 0xda, 0x6c, 0x62, 0xc4, 0x85, 0x30, 0xe2, 0x6a, + 0x53, 0xbb, 0x0b, 0x67, 0x12, 0xe7, 0xd1, 0xdd, 0xdb, 0x30, 0x21, 0x19, 0xe0, 0xa7, 0x27, 0x36, + 0x4e, 0x55, 0x82, 0xbb, 0xae, 0x48, 0x67, 0x20, 0x34, 0xaa, 0x6d, 0x41, 0x91, 0x9b, 0xbc, 0x2d, + 0xe5, 0xca, 0x27, 0x55, 0x86, 0xe9, 0x68, 0x76, 0x03, 0x5a, 0x53, 0x72, 0x6a, 0xab, 0x4d, 0xed, + 0x33, 0x98, 0x4f, 0xb1, 0x82, 0xd4, 0xae, 0xc3, 0x64, 0xc4, 0x0c, 0x92, 0x3b, 0x23, 0x91, 0x8b, + 0x9c, 0x2b, 0xc8, 0xc6, 0xb5, 0xab, 0x58, 0x25, 0x48, 0xca, 0xe7, 0xb6, 0x04, 0xe0, 0xdf, 0x64, + 0xc0, 0x2a, 0x8f, 0x2b, 0xd5, 0xa6, 0xf6, 0x8b, 0x02, 0x73, 0xd1, 0x63, 0x48, 0xe6, 0x12, 0x8c, + 0x23, 0x0a, 0x69, 0x10, 0x89, 0x86, 0x0f, 0xf6, 0x21, 0x64, 0xdd, 0x43, 0x77, 0x6d, 0xc7, 0x65, + 0xc5, 0xcc, 0xca, 0x68, 0x79, 0x62, 0x63, 0x26, 0x82, 0xf6, 0x76, 0x36, 0xc7, 0x9e, 0xbd, 0x5c, + 0x1e, 0xa9, 0xf9, 0x38, 0x72, 0x1e, 0xb2, 0x8e, 0xc1, 0x7a, 0x6d, 0x51, 0x5b, 0xf1, 0x13, 0xde, + 0x46, 0x0d, 0x01, 0x5a, 0x07, 0x16, 0x38, 0xc7, 0x3b, 0x86, 0xd5, 0x34, 0xad, 0x16, 0x7a, 0xf7, + 0x1b, 0x84, 0xdc, 0x82, 0x99, 0x3e, 0x6d, 0x9b, 0x4d, 0xea, 0xda, 0x4e, 0x9d, 0x36, 0x9b, 0x8e, + 0xc1, 0x98, 0xa8, 0xbd, 0xcd, 0xd5, 0x17, 0x4f, 0x2f, 0x2f, 0x61, 0xef, 0xdd, 0xf3, 0x31, 0x37, + 0x04, 0x64, 0xdb, 0x75, 0x3c, 0x63, 0xd3, 0xfd, 0xd8, 0xba, 0x76, 0x1b, 0x16, 0xd3, 0xdd, 0x61, + 0x6a, 0x74, 0x98, 0x08, 0x53, 0xea, 0x79, 0x1a, 0x2d, 0x8f, 0x6d, 0x4e, 0x1d, 0xbe, 0x5c, 0x06, + 0x84, 0x56, 0xb7, 0x58, 0x0d, 0x82, 0x1c, 0xb3, 0xa0, 0xaf, 0xef, 0x50, 0x87, 0x76, 0x82, 0xbe, + 0xfe, 0x10, 0x2f, 0xcc, 0x5f, 0x0d, 0xac, 0x67, 0xbb, 0x7c, 0x05, 0xf3, 0x2e, 0xe7, 0x45, 0x40, + 0x31, 0x93, 0x08, 0xd3, 0x5a, 0x70, 0x8a, 0xdb, 0x09, 0xe2, 0x3b, 0xae, 0xbc, 0x7c, 0x8c, 0x5d, + 0x29, 0x39, 0x42, 0xce, 0x1b, 0x90, 0x65, 0x2e, 0x75, 0x7b, 0x3e, 0x67, 0x55, 0xe2, 0x1c, 0xa0, + 0xb7, 0x39, 0xa2, 0x86, 0x48, 0xed, 0x37, 0x05, 0xcd, 0x55, 0x99, 0x28, 0x10, 0xe3, 0xb8, 0x88, + 0x93, 0x9b, 0x30, 0xed, 0xa0, 0x8b, 0xc0, 0x5c, 0x86, 0x9b, 0x2b, 0xbe, 0x78, 0x7a, 0x79, 0x0e, + 0xcd, 0x45, 0xad, 0x9c, 0xf4, 0x4f, 0xf8, 0xd1, 0x5f, 0xc3, 0x99, 0x22, 0xd3, 0xc5, 0xf0, 0x97, + 0x61, 0xc2, 0x64, 0x75, 0xff, 0x00, 0x67, 0x9a, 0xab, 0x81, 0x19, 0x00, 0x83, 0x2b, 0xf2, 0x17, + 0x8e, 0xad, 0x74, 0x6f, 0x61, 0x4e, 0x25, 0x47, 0xc8, 0xf1, 0x2a, 0xe4, 0x24, 0x82, 0xa3, 0x43, + 0x63, 0x0f, 0x90, 0x5a, 0x09, 0x5b, 0xe1, 0x46, 0xc3, 0x35, 0xfb, 0x46, 0x40, 0x23, 0xa8, 0xe1, + 0x2f, 0x60, 0x69, 0xc0, 0x3e, 0xba, 0xbd, 0x06, 0x10, 0x90, 0x14, 0xad, 0x12, 0xad, 0x8e, 0xd8, + 0xc1, 0x9a, 0x84, 0xd6, 0x9e, 0x28, 0x38, 0x2d, 0xd1, 0xdb, 0xb6, 0x41, 0x9d, 0xc6, 0xee, 0x7f, + 0x1e, 0xba, 0x44, 0x85, 0x5c, 0x83, 0xb6, 0xdb, 0xfc, 0x95, 0xc9, 0x88, 0x27, 0xc9, 0xff, 0xf6, + 0xde, 0x2b, 0xca, 0x1e, 0x44, 0x1e, 0xb9, 0x1c, 0x65, 0x0f, 0xc4, 0x2b, 0xb8, 0x00, 0xf9, 0x8e, + 0x69, 0xe1, 0xe6, 0x98, 0xd8, 0xec, 0x98, 0x96, 0x78, 0xfd, 0x3e, 0x01, 0x35, 0x8d, 0x1c, 0xc6, + 0xfd, 0x6e, 0x7c, 0x7c, 0x2e, 0x4b, 0x41, 0xa7, 0x0d, 0xdc, 0x60, 0x96, 0x6a, 0x16, 0xbe, 0x34, + 0x08, 0xb8, 0xe3, 0x98, 0xe1, 0xf3, 0x57, 0x84, 0x71, 0xb6, 0xdf, 0xd9, 0xb1, 0xdb, 0x22, 0x97, + 0xf9, 0x9a, 0xff, 0x19, 0x0d, 0x24, 0x33, 0x2c, 0x90, 0xd1, 0x58, 0x20, 0x9f, 0x46, 0xb3, 0x8c, + 0xfe, 0x30, 0x8e, 0xf7, 0x60, 0xb2, 0xeb, 0x2d, 0xd4, 0xc5, 0x28, 0xf6, 0xaf, 0xf0, 0xb4, 0x3c, + 0x94, 0xf0, 0x80, 0x37, 0xb1, 0x0b, 0xdd, 0xf0, 0x83, 0x69, 0xbf, 0x67, 0x60, 0x59, 0x36, 0x7d, + 0xcf, 0x70, 0xcc, 0xfb, 0x66, 0x83, 0xcb, 0x24, 0x3f, 0xa2, 0x79, 0xc8, 0x35, 0x76, 0xa9, 0x69, + 0xf9, 0xd7, 0x97, 0xaf, 0x8d, 0xf3, 0xef, 0x6a, 0x93, 0x7c, 0x00, 0xf9, 0xa0, 0x1a, 0xb0, 0x5f, + 0x5f, 0xa3, 0x29, 0xc2, 0x33, 0xb1, 0xb7, 0x6f, 0x34, 0xf6, 0xf6, 0x79, 0x6d, 0x6b, 0xec, 0xb9, + 0x86, 0x63, 0xd1, 0xb6, 0xb7, 0x2f, 0x2e, 0x18, 0xfc, 0xa5, 0x6a, 0x33, 0x45, 0x6c, 0x9c, 0x48, + 0x8a, 0x0d, 0xaf, 0xbc, 0x82, 0xce, 0xca, 0x8a, 0xf2, 0xf2, 0xbf, 0xc9, 0x22, 0xe4, 0x99, 0xd9, + 0xb2, 0xa8, 0xdb, 0x73, 0x8c, 0xe2, 0x38, 0x57, 0x38, 0xe1, 0x02, 0xbf, 0x16, 0xba, 0x57, 0x6f, + 0x1a, 0x6d, 0xba, 0x5f, 0xcc, 0xe1, 0xb5, 0xd0, 0xbd, 0x2d, 0xef, 0x5b, 0xfb, 0x47, 0x81, 0x95, + 0xc1, 0xc9, 0xc3, 0xeb, 0xf9, 0xff, 0x67, 0x6f, 0x1e, 0x72, 0x26, 0xc3, 0x14, 0x64, 0xf9, 0xe0, + 0x1c, 0x37, 0x19, 0xcf, 0xc0, 0xc6, 0xaf, 0x53, 0x70, 0x82, 0x67, 0x80, 0xec, 0x40, 0x56, 0x88, + 0x5f, 0xb2, 0x14, 0x6f, 0xa3, 0x88, 0x56, 0x56, 0x4b, 0x83, 0xb6, 0x45, 0xbe, 0xb4, 0xf9, 0xc7, + 0x7f, 0xfc, 0xfd, 0x63, 0x66, 0x96, 0xcc, 0xe8, 0xa1, 0x04, 0x6f, 0x08, 0xcb, 0xf7, 0x61, 0x6c, + 0x8b, 0x4f, 0x84, 0xb8, 0x09, 0x49, 0xde, 0xaa, 0x8b, 0xe9, 0x9b, 0x68, 0xfd, 0x2c, 0xb7, 0xbe, + 0x44, 0x16, 0x24, 0xeb, 0x5e, 0xb0, 0xfa, 0xa3, 0x40, 0x13, 0x1f, 0x90, 0x6f, 0x14, 0x80, 0x50, + 0x63, 0x92, 0xd5, 0x34, 0x8b, 0x11, 0xcd, 0xab, 0x6a, 0xc3, 0x20, 0xe8, 0xfa, 0x2d, 0xee, 0xfa, + 0x02, 0x29, 0xc7, 0x5c, 0x63, 0xf6, 0x19, 0x52, 0x08, 0xee, 0xe2, 0x80, 0x7c, 0xa7, 0x40, 0x41, + 0x96, 0x93, 0xe4, 0x6c, 0xdc, 0x4d, 0x8a, 0xd4, 0x55, 0xd7, 0x86, 0x83, 0x90, 0xcd, 0x55, 0xce, + 0xa6, 0x42, 0x2e, 0xe9, 0xf1, 0x5f, 0x3a, 0x38, 0xac, 0x99, 0xfe, 0x28, 0x3e, 0xbc, 0x0f, 0x88, + 0x0b, 0xe3, 0xfe, 0x54, 0x28, 0x0d, 0x9c, 0x96, 0x82, 0xc6, 0x51, 0xd3, 0x54, 0x2b, 0x73, 0x06, + 0x1a, 0x59, 0x91, 0x18, 0x60, 0xed, 0x32, 0xfd, 0x51, 0x58, 0xd7, 0x07, 0xe4, 0x89, 0x02, 0x27, + 0x63, 0x4a, 0x8f, 0xbc, 0x19, 0x37, 0x9f, 0xae, 0x3c, 0xd5, 0x73, 0x47, 0xe2, 0x90, 0xce, 0x3b, + 0x9c, 0xce, 0x3a, 0xd1, 0x25, 0x3a, 0x5d, 0x81, 0xad, 0x87, 0xb4, 0x12, 0x52, 0xe0, 0x80, 0x7c, + 0xad, 0x40, 0x3e, 0x68, 0x55, 0xb2, 0x12, 0xf7, 0x17, 0xd7, 0x7c, 0xea, 0xea, 0x10, 0x04, 0x72, + 0x59, 0xe7, 0x5c, 0x2e, 0x92, 0xf3, 0x12, 0x97, 0xf0, 0xd5, 0x4d, 0x65, 0xf1, 0xb3, 0x02, 0x10, + 0xea, 0x9e, 0x64, 0xcd, 0x26, 0x24, 0x5c, 0xb2, 0x66, 0x93, 0xb2, 0x49, 0xdb, 0xe4, 0x44, 0xae, + 0x93, 0x6b, 0x91, 0x3b, 0x12, 0xa0, 0x34, 0x1a, 0xde, 0xbd, 0x45, 0x55, 0xdc, 0x01, 0x79, 0xac, + 0x40, 0x3e, 0x10, 0x3b, 0xc9, 0xfc, 0xc4, 0x05, 0x57, 0x32, 0x3f, 0x09, 0xa5, 0x94, 0xda, 0x4a, + 0xbe, 0xe3, 0xf4, 0xf4, 0x7c, 0xab, 0xc0, 0x74, 0x5c, 0x01, 0x91, 0x44, 0x6d, 0x0c, 0xd0, 0x50, + 0x6a, 0xf9, 0x68, 0x20, 0x32, 0x5b, 0xe3, 0xcc, 0x4a, 0x64, 0x51, 0x62, 0x46, 0x39, 0xb8, 0x1e, + 0x5e, 0xa0, 0x37, 0x2c, 0xc5, 0xef, 0x84, 0xe4, 0xb0, 0x8c, 0xfc, 0x00, 0x49, 0x0e, 0xcb, 0xe8, + 0x2f, 0x91, 0xd4, 0x61, 0x29, 0x7e, 0x73, 0x90, 0xaf, 0x60, 0x32, 0xa2, 0x7b, 0xc8, 0xda, 0x80, + 0x86, 0x8c, 0x68, 0x36, 0xf5, 0x8d, 0x23, 0x50, 0xe8, 0x78, 0x95, 0x3b, 0x5e, 0x20, 0xf3, 0xc9, + 0xe6, 0xad, 0x33, 0xe1, 0xef, 0x4b, 0x28, 0xc8, 0x7a, 0x25, 0x39, 0xbc, 0x52, 0xd4, 0x93, 0xba, + 0x36, 0x1c, 0xf4, 0x1a, 0xde, 0xb9, 0xbc, 0x61, 0xe4, 0x07, 0x05, 0x66, 0x53, 0x9e, 0x65, 0x72, + 0x61, 0x80, 0x83, 0x14, 0xe1, 0xa3, 0x5e, 0x7c, 0x2d, 0xec, 0x10, 0x4e, 0x7d, 0x0f, 0xb8, 0xef, + 0x8f, 0x8f, 0xcd, 0xea, 0xb3, 0xc3, 0x92, 0xf2, 0xfc, 0xb0, 0xa4, 0xfc, 0x75, 0x58, 0x52, 0xbe, + 0x7f, 0x55, 0x1a, 0x79, 0xfe, 0xaa, 0x34, 0xf2, 0xe7, 0xab, 0xd2, 0xc8, 0xe7, 0x7a, 0xcb, 0x74, + 0x77, 0x7b, 0x3b, 0x95, 0x86, 0xdd, 0xd1, 0x77, 0xa8, 0xd5, 0xe4, 0xff, 0x6c, 0x6a, 0xd8, 0x6d, + 0x9d, 0x4b, 0x05, 0xbd, 0x7f, 0x45, 0xdf, 0xf3, 0xcd, 0xba, 0xfb, 0x5d, 0x83, 0xed, 0x64, 0x39, + 0xe2, 0xca, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xac, 0x04, 0xd5, 0x71, 0x19, 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/oracle/types/result_test.go b/x/oracle/types/result_test.go index 90e7199ba..3189137f7 100644 --- a/x/oracle/types/result_test.go +++ b/x/oracle/types/result_test.go @@ -9,7 +9,7 @@ import ( // Using for evm test to show how to encode result func TestEncodeResult(t *testing.T) { result := NewResult( - "beeb", + "test", 1, mustDecodeString("0000000342544300000000000003e8"), 1, @@ -22,7 +22,7 @@ func TestEncodeResult(t *testing.T) { mustDecodeString("00000000009443ee"), ) expectedEncodedResult := mustDecodeString( - "0a046265656210011a0f0000000342544300000000000003e8200128013002380140d8f7f8f60548daf7f8f60550015a0800000000009443ee", + "0a047465737410011a0f0000000342544300000000000003e8200128013002380140d8f7f8f60548daf7f8f60550015a0800000000009443ee", ) require.Equal(t, expectedEncodedResult, ModuleCdc.MustMarshal(&result)) } diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go index 7fead1f72..c9779b73d 100644 --- a/x/oracle/types/tx.pb.go +++ b/x/oracle/types/tx.pb.go @@ -1081,83 +1081,84 @@ func init() { func init() { proto.RegisterFile("oracle/v1/tx.proto", fileDescriptor_31571edce0094a5d) } var fileDescriptor_31571edce0094a5d = []byte{ - // 1206 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4d, 0x6f, 0xdb, 0x46, - 0x13, 0xb6, 0x2c, 0x59, 0x11, 0x47, 0xb2, 0x13, 0x33, 0x89, 0x4d, 0x31, 0x6f, 0x24, 0xbd, 0x42, - 0x60, 0x28, 0x29, 0x2c, 0xc6, 0x6e, 0x51, 0x20, 0xee, 0x29, 0xb2, 0xfb, 0x61, 0x34, 0x4a, 0x0b, - 0xba, 0xb9, 0x04, 0x28, 0xd4, 0x15, 0xb9, 0xa6, 0x09, 0x8b, 0x5c, 0x75, 0x97, 0xf2, 0xc7, 0xb5, - 0xc7, 0x5e, 0xda, 0xfe, 0x83, 0xa0, 0xc7, 0x9e, 0x72, 0xe8, 0x5f, 0x28, 0x90, 0x63, 0xd0, 0x5e, - 0x7a, 0x52, 0x0b, 0x19, 0x45, 0xfa, 0x1b, 0x7a, 0x2a, 0xb8, 0xbb, 0xa2, 0x48, 0x59, 0xf2, 0x47, - 0x90, 0xe6, 0x62, 0x73, 0xe6, 0x99, 0x1d, 0x0e, 0x9f, 0x67, 0x66, 0x77, 0x05, 0x2a, 0xa1, 0xc8, - 0xea, 0x60, 0xe3, 0x60, 0xcd, 0x08, 0x8e, 0xea, 0x5d, 0x4a, 0x02, 0xa2, 0x2a, 0xc2, 0x57, 0x3f, - 0x58, 0xd3, 0x6f, 0x38, 0xc4, 0x21, 0xdc, 0x6b, 0x84, 0x4f, 0x22, 0x40, 0x5f, 0x1a, 0x2d, 0x92, - 0xa1, 0xc2, 0x5f, 0xb2, 0x08, 0xf3, 0x08, 0x33, 0xda, 0x88, 0x85, 0x60, 0x1b, 0x07, 0x68, 0xcd, - 0xb0, 0x88, 0xeb, 0x4b, 0xbc, 0x28, 0xf0, 0x96, 0x48, 0x28, 0x0c, 0x09, 0x2d, 0xcb, 0xa5, 0x1e, - 0x73, 0xc2, 0xb4, 0x1e, 0x73, 0x24, 0xb0, 0x88, 0x3c, 0xd7, 0x27, 0x06, 0xff, 0x2b, 0x5c, 0xd5, - 0x93, 0x34, 0x2c, 0x34, 0x99, 0x63, 0xe2, 0xaf, 0x7b, 0x98, 0x05, 0x5b, 0x28, 0x40, 0xea, 0x63, - 0xb8, 0x26, 0x2a, 0x69, 0x31, 0x8b, 0xba, 0xdd, 0xa0, 0xe5, 0xda, 0x5a, 0xaa, 0x92, 0xaa, 0x65, - 0x1a, 0x77, 0x06, 0xfd, 0xf2, 0xc2, 0x67, 0x1c, 0xdb, 0xe1, 0xd0, 0xf6, 0xd6, 0x3f, 0xa7, 0x3c, - 0xe6, 0x02, 0x89, 0xdb, 0xb6, 0xaa, 0x43, 0xce, 0x42, 0x9d, 0x8e, 0x8d, 0x02, 0xa4, 0xcd, 0x56, - 0x52, 0xb5, 0x82, 0x19, 0xd9, 0xea, 0x2d, 0x50, 0x10, 0xdb, 0x6f, 0x59, 0xa4, 0xe7, 0x07, 0x5a, - 0x3a, 0x7c, 0x89, 0x99, 0x43, 0x6c, 0x7f, 0x33, 0xb4, 0x43, 0xd0, 0x73, 0x7d, 0x09, 0x66, 0x04, - 0xe8, 0xb9, 0xbe, 0x00, 0xef, 0x82, 0x62, 0x75, 0x5c, 0xec, 0xf3, 0xf2, 0xe6, 0x2a, 0xa9, 0x9a, - 0xd2, 0x28, 0x0c, 0xfa, 0xe5, 0xdc, 0x26, 0x77, 0x6e, 0x6f, 0x99, 0x39, 0x01, 0x6f, 0xdb, 0xea, - 0x1e, 0x28, 0xbb, 0x18, 0xb7, 0x3a, 0xae, 0xe7, 0x06, 0x5a, 0xb6, 0x92, 0xae, 0xe5, 0xd7, 0x8b, - 0x75, 0xc9, 0x58, 0x48, 0x6f, 0x5d, 0xd2, 0x5b, 0xdf, 0x24, 0xae, 0xdf, 0xb8, 0xff, 0xa2, 0x5f, - 0x9e, 0xf9, 0xe9, 0x8f, 0x72, 0xcd, 0x71, 0x83, 0xbd, 0x5e, 0xbb, 0x6e, 0x11, 0x4f, 0xd2, 0x2b, - 0xff, 0xad, 0x32, 0x7b, 0xdf, 0x08, 0x8e, 0xbb, 0x98, 0xf1, 0x05, 0xcc, 0xcc, 0xed, 0x62, 0xfc, - 0x28, 0x4c, 0xae, 0x96, 0x21, 0xdf, 0xa5, 0xb8, 0x8b, 0x28, 0x6e, 0x39, 0x88, 0x69, 0x57, 0x78, - 0xcd, 0x20, 0x5d, 0x1f, 0x23, 0x16, 0x06, 0xe0, 0x23, 0x6c, 0xf5, 0x02, 0x11, 0x90, 0x13, 0x01, - 0xd2, 0x15, 0x06, 0xdc, 0x87, 0x2c, 0xc3, 0xbe, 0x8d, 0xa9, 0xa6, 0xf0, 0x6f, 0xd2, 0x7e, 0xfd, - 0x79, 0xf5, 0x86, 0xac, 0xf5, 0xa1, 0x6d, 0x53, 0xcc, 0xd8, 0x4e, 0x40, 0x5d, 0xdf, 0x31, 0x65, - 0xdc, 0x46, 0xf5, 0xef, 0x67, 0xe5, 0xd4, 0x37, 0xaf, 0x9e, 0xdf, 0x93, 0x8e, 0x6f, 0x5f, 0x3d, - 0xbf, 0x27, 0x25, 0x30, 0xa4, 0xac, 0x55, 0x0d, 0x96, 0x92, 0x22, 0x9b, 0x98, 0x75, 0x89, 0xcf, - 0x70, 0xf5, 0xaf, 0x14, 0xcc, 0x73, 0xa8, 0x4b, 0xa8, 0x90, 0xff, 0x01, 0x00, 0x15, 0x81, 0x23, - 0xe1, 0xf5, 0x41, 0xbf, 0xac, 0xc8, 0xe5, 0x5c, 0xf3, 0x91, 0x61, 0x2a, 0x32, 0x7a, 0xdb, 0x56, - 0x3f, 0x80, 0x3c, 0x45, 0x87, 0x2d, 0xca, 0x93, 0x31, 0x6d, 0x96, 0x53, 0x7d, 0xa3, 0x1e, 0x8d, - 0x40, 0xdd, 0x44, 0x87, 0xe2, 0x4d, 0x8d, 0x4c, 0xc8, 0xb2, 0x09, 0x74, 0xe8, 0x60, 0xea, 0xfb, - 0xa0, 0x1c, 0xa0, 0x8e, 0x6b, 0xa3, 0x80, 0x50, 0xde, 0x0a, 0x67, 0x7d, 0xfc, 0x28, 0x74, 0xe3, - 0xce, 0xf0, 0xfb, 0x47, 0xbe, 0x90, 0x82, 0xf9, 0x88, 0x82, 0x30, 0x7d, 0x75, 0x19, 0x6e, 0x26, - 0x3e, 0x33, 0x22, 0xe0, 0xbb, 0x34, 0x5c, 0x6f, 0x32, 0x67, 0x93, 0x62, 0x14, 0xe0, 0x10, 0xd9, - 0x21, 0x3d, 0x6a, 0x61, 0x55, 0x85, 0x8c, 0x8f, 0x3c, 0xcc, 0x09, 0x50, 0x4c, 0xfe, 0xac, 0x56, - 0x20, 0x6f, 0x63, 0x31, 0x14, 0x2e, 0xf1, 0x79, 0x33, 0x2b, 0x66, 0xdc, 0xa5, 0x96, 0x40, 0x8a, - 0x89, 0xda, 0x1d, 0xcc, 0xbf, 0xa2, 0x60, 0xc6, 0x3c, 0xea, 0x97, 0x90, 0xde, 0xc5, 0x58, 0xcb, - 0xbc, 0xf9, 0x26, 0x0c, 0xf3, 0xaa, 0xef, 0x41, 0x2e, 0xa0, 0x18, 0xb1, 0x1e, 0x3d, 0x96, 0x33, - 0x31, 0x9d, 0xc2, 0x28, 0x52, 0xad, 0xc3, 0x1c, 0x39, 0xf4, 0x31, 0xd5, 0xb2, 0xe7, 0x2c, 0x11, - 0x61, 0xb1, 0x1e, 0xbd, 0x72, 0xc1, 0x1e, 0x7d, 0x67, 0x42, 0x8f, 0x2e, 0x4b, 0x81, 0xc6, 0x99, - 0xaf, 0xde, 0x86, 0x5b, 0x13, 0x04, 0x89, 0x04, 0xfb, 0x2d, 0x0d, 0x8b, 0x4d, 0xe6, 0x7c, 0x68, - 0xbb, 0x41, 0x4c, 0xae, 0x8f, 0x60, 0x21, 0xdc, 0x50, 0x5a, 0x8c, 0x9b, 0xa3, 0xce, 0xad, 0x0c, - 0xfa, 0xe5, 0xc2, 0x28, 0x8e, 0x37, 0x6f, 0xc2, 0x36, 0x0b, 0xf6, 0xc8, 0xb2, 0x23, 0xd9, 0x67, - 0xa7, 0xcb, 0x9e, 0x3e, 0x4f, 0xf6, 0xcc, 0x34, 0xd9, 0xe7, 0xde, 0x82, 0xec, 0xd9, 0xcb, 0xcb, - 0x7e, 0xe5, 0xb2, 0xb2, 0xe7, 0x2e, 0x28, 0xfb, 0xdd, 0x09, 0xb2, 0xdf, 0x94, 0xb2, 0x27, 0xf5, - 0xab, 0xde, 0x82, 0xe2, 0x29, 0x51, 0x23, 0xc9, 0x7f, 0x99, 0xe5, 0xd3, 0x2b, 0x5a, 0x22, 0x7e, - 0xda, 0xbc, 0xe6, 0x94, 0x2e, 0x41, 0x96, 0x59, 0x7b, 0xd8, 0x43, 0x52, 0x4b, 0x69, 0xa9, 0x0f, - 0xe0, 0xaa, 0xec, 0x1f, 0x8b, 0xd8, 0xb8, 0xd5, 0xa3, 0x1d, 0xae, 0xa5, 0xd2, 0x58, 0x1c, 0xf4, - 0xcb, 0xf3, 0xa2, 0xa8, 0x4d, 0x62, 0xe3, 0x27, 0xe6, 0x23, 0x73, 0x9e, 0x8d, 0x4c, 0xda, 0x09, - 0x0b, 0x09, 0xd7, 0xf0, 0xa9, 0x2b, 0x98, 0xfc, 0xf9, 0x2d, 0xcc, 0xd5, 0xea, 0x04, 0x82, 0x8b, - 0x89, 0xb9, 0x8a, 0xb3, 0x55, 0x2d, 0xc3, 0xed, 0x89, 0x34, 0x46, 0x44, 0xff, 0x20, 0x36, 0xc3, - 0x50, 0x86, 0x04, 0xcd, 0x6f, 0xfa, 0x4a, 0xf0, 0x7a, 0x53, 0x36, 0x92, 0x2d, 0x73, 0x9e, 0x6c, - 0x73, 0x97, 0x94, 0x2d, 0x3b, 0x49, 0xb6, 0xff, 0x6c, 0x2e, 0xce, 0xda, 0x0e, 0xc7, 0xb9, 0x97, - 0xdb, 0xe1, 0xb8, 0x3b, 0x92, 0xcc, 0x83, 0x7c, 0x93, 0x39, 0x0f, 0xad, 0xc0, 0x3d, 0x40, 0x01, - 0x4e, 0x9e, 0xa2, 0xa9, 0x8b, 0x9f, 0xa2, 0x2b, 0x93, 0x4f, 0xd1, 0xab, 0xb2, 0xaa, 0x61, 0xfe, - 0xea, 0x4d, 0xde, 0x20, 0x43, 0x33, 0xaa, 0xe2, 0xc7, 0x14, 0x5c, 0x6d, 0x32, 0xe7, 0x49, 0xd7, - 0x46, 0x01, 0xfe, 0x1c, 0x51, 0xe4, 0xf1, 0x03, 0x1d, 0xf5, 0x82, 0x3d, 0x42, 0xdd, 0xe0, 0xf8, - 0xfc, 0x52, 0xa2, 0x50, 0xd5, 0x80, 0x6c, 0x97, 0x67, 0xe0, 0xed, 0x91, 0x5f, 0x5f, 0x8c, 0x5d, - 0x20, 0x44, 0x6a, 0x79, 0x7b, 0x90, 0x61, 0x1b, 0x2b, 0xbc, 0xee, 0x28, 0x41, 0x58, 0xf7, 0x75, - 0x59, 0x77, 0xbc, 0xa0, 0x6a, 0x11, 0x96, 0xc7, 0x6a, 0x1c, 0xd6, 0xbf, 0xfe, 0x6c, 0x0e, 0xd2, - 0x4d, 0xe6, 0xa8, 0x9f, 0x42, 0x3e, 0x7e, 0x15, 0x2e, 0xc6, 0x5e, 0x9d, 0xbc, 0x40, 0xe9, 0xff, - 0x9f, 0x0a, 0x0d, 0x93, 0xaa, 0x9f, 0x00, 0xc4, 0xee, 0x55, 0xda, 0xf8, 0x82, 0x21, 0xa2, 0x57, - 0xa6, 0x21, 0x51, 0xa6, 0xa7, 0x70, 0xed, 0xd4, 0x05, 0xa5, 0x94, 0x5c, 0x35, 0x8e, 0xeb, 0x2b, - 0x67, 0xe3, 0x51, 0xee, 0x2f, 0x60, 0x61, 0xec, 0x2c, 0xfd, 0x5f, 0x72, 0x65, 0x12, 0xd5, 0xef, - 0x9c, 0x85, 0x46, 0x59, 0xbf, 0x02, 0x75, 0xc2, 0x76, 0x5d, 0x99, 0x54, 0x53, 0x3c, 0x42, 0xaf, - 0x9d, 0x17, 0x11, 0xe7, 0xe4, 0xd4, 0x3e, 0x55, 0x3a, 0x5d, 0x5b, 0x22, 0xfb, 0xca, 0xd9, 0x78, - 0x94, 0xbb, 0x01, 0xb9, 0x68, 0xa2, 0x96, 0x92, 0x6b, 0x86, 0x7e, 0xbd, 0x34, 0xd9, 0x1f, 0xe5, - 0x78, 0x0c, 0x85, 0xc4, 0x38, 0xe8, 0xc9, 0xf8, 0x38, 0xa6, 0x57, 0xa7, 0x63, 0xc3, 0x7c, 0x8d, - 0xed, 0x17, 0x83, 0x52, 0xea, 0xe5, 0xa0, 0x94, 0xfa, 0x73, 0x50, 0x4a, 0x7d, 0x7f, 0x52, 0x9a, - 0x79, 0x79, 0x52, 0x9a, 0xf9, 0xfd, 0xa4, 0x34, 0xf3, 0xd4, 0x88, 0xdd, 0x16, 0xda, 0xc8, 0xb7, - 0xf9, 0x2f, 0x3b, 0x8b, 0x74, 0x0c, 0x6b, 0x0f, 0xb9, 0xbe, 0x71, 0xb0, 0x6e, 0x1c, 0xc9, 0xdf, - 0x96, 0xe2, 0xea, 0xd0, 0xce, 0xf2, 0x88, 0x77, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x55, 0x57, - 0xf7, 0x3f, 0xb1, 0x0e, 0x00, 0x00, + // 1232 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0x36, 0xad, 0x9f, 0x88, 0x23, 0xd9, 0x89, 0x19, 0xff, 0x50, 0x74, 0x2d, 0x29, 0x82, 0x61, + 0x28, 0x2e, 0x2c, 0xc6, 0x4e, 0x51, 0x20, 0xee, 0xa1, 0x88, 0xec, 0xfe, 0x18, 0x8d, 0xd2, 0x82, + 0x6e, 0x7a, 0x08, 0x50, 0xa8, 0x2b, 0x72, 0x4d, 0x13, 0x96, 0x48, 0x95, 0x4b, 0xc9, 0xf6, 0xad, + 0xe8, 0xb1, 0x97, 0xb6, 0x6f, 0x50, 0xf4, 0x52, 0xa0, 0x27, 0x1f, 0xf2, 0x0a, 0x05, 0x72, 0x0c, + 0xd2, 0x4b, 0x4f, 0x6a, 0x21, 0x1f, 0xdc, 0x53, 0x1f, 0xa0, 0xa7, 0x82, 0xbb, 0x2b, 0x8a, 0x94, + 0x25, 0x3b, 0x36, 0xd2, 0x5c, 0x6c, 0xce, 0x7c, 0x33, 0xc3, 0xe1, 0xf7, 0xcd, 0x90, 0x2b, 0x90, + 0x1c, 0x17, 0xe9, 0x0d, 0xac, 0x76, 0xd6, 0x55, 0xef, 0xa8, 0xdc, 0x72, 0x1d, 0xcf, 0x91, 0x44, + 0xe6, 0x2b, 0x77, 0xd6, 0x95, 0x59, 0xd3, 0x31, 0x1d, 0xea, 0x55, 0xfd, 0x2b, 0x16, 0xa0, 0xcc, + 0x0f, 0x92, 0x78, 0x28, 0xf3, 0xe7, 0x74, 0x87, 0x34, 0x1d, 0xa2, 0xd6, 0x11, 0xf1, 0xc1, 0x3a, + 0xf6, 0xd0, 0xba, 0xaa, 0x3b, 0x96, 0xcd, 0xf1, 0x2c, 0xc3, 0x6b, 0xac, 0x20, 0x33, 0x38, 0xb4, + 0xc0, 0x53, 0x9b, 0xc4, 0xf4, 0xcb, 0x36, 0x89, 0xc9, 0x81, 0x19, 0xd4, 0xb4, 0x6c, 0x47, 0xa5, + 0x7f, 0x99, 0xab, 0x78, 0x1a, 0x83, 0xe9, 0x2a, 0x31, 0x35, 0xfc, 0x75, 0x1b, 0x13, 0x6f, 0x1b, + 0x79, 0x48, 0x7a, 0x0c, 0xb7, 0x58, 0x27, 0x35, 0xa2, 0xbb, 0x56, 0xcb, 0xab, 0x59, 0x86, 0x2c, + 0x14, 0x84, 0x52, 0xbc, 0xb2, 0xdc, 0xeb, 0xe6, 0xa7, 0x3f, 0xa5, 0xd8, 0x2e, 0x85, 0x76, 0xb6, + 0xff, 0x3d, 0xe7, 0xd1, 0xa6, 0x9d, 0xb0, 0x6d, 0x48, 0x0a, 0xa4, 0x74, 0xd4, 0x68, 0x18, 0xc8, + 0x43, 0xf2, 0x64, 0x41, 0x28, 0x65, 0xb4, 0xc0, 0x96, 0x16, 0x41, 0x44, 0xe4, 0xa0, 0xa6, 0x3b, + 0x6d, 0xdb, 0x93, 0x63, 0xfe, 0x4d, 0xb4, 0x14, 0x22, 0x07, 0x5b, 0xbe, 0xed, 0x83, 0x4d, 0xcb, + 0xe6, 0x60, 0x9c, 0x81, 0x4d, 0xcb, 0x66, 0xe0, 0x5d, 0x10, 0xf5, 0x86, 0x85, 0x6d, 0xda, 0x5e, + 0xa2, 0x20, 0x94, 0xc4, 0x4a, 0xa6, 0xd7, 0xcd, 0xa7, 0xb6, 0xa8, 0x73, 0x67, 0x5b, 0x4b, 0x31, + 0x78, 0xc7, 0x90, 0xf6, 0x41, 0xdc, 0xc3, 0xb8, 0xd6, 0xb0, 0x9a, 0x96, 0x27, 0x27, 0x0b, 0xb1, + 0x52, 0x7a, 0x23, 0x5b, 0xe6, 0x8c, 0xf9, 0xf4, 0x96, 0x39, 0xbd, 0xe5, 0x2d, 0xc7, 0xb2, 0x2b, + 0xf7, 0x9e, 0x77, 0xf3, 0x13, 0xbf, 0xfe, 0x99, 0x2f, 0x99, 0x96, 0xb7, 0xdf, 0xae, 0x97, 0x75, + 0xa7, 0xc9, 0xe9, 0xe5, 0xff, 0xd6, 0x88, 0x71, 0xa0, 0x7a, 0xc7, 0x2d, 0x4c, 0x68, 0x02, 0xd1, + 0x52, 0x7b, 0x18, 0x3f, 0xf2, 0x8b, 0x4b, 0x79, 0x48, 0xb7, 0x5c, 0xdc, 0x42, 0x2e, 0xae, 0x99, + 0x88, 0xc8, 0x37, 0x68, 0xcf, 0xc0, 0x5d, 0x1f, 0x21, 0xe2, 0x07, 0xe0, 0x23, 0xac, 0xb7, 0x3d, + 0x16, 0x90, 0x62, 0x01, 0xdc, 0xe5, 0x07, 0xdc, 0x83, 0x24, 0xc1, 0xb6, 0x81, 0x5d, 0x59, 0xa4, + 0xcf, 0x24, 0xbf, 0x7c, 0xb6, 0x36, 0xcb, 0x7b, 0x7d, 0x68, 0x18, 0x2e, 0x26, 0x64, 0xd7, 0x73, + 0x2d, 0xdb, 0xd4, 0x78, 0xdc, 0x66, 0xf1, 0xef, 0x9f, 0xf2, 0xc2, 0xb7, 0x67, 0x27, 0xab, 0xdc, + 0xf1, 0xdd, 0xd9, 0xc9, 0x2a, 0x97, 0x40, 0xe5, 0xb2, 0x16, 0x65, 0x98, 0x8f, 0x8a, 0xac, 0x61, + 0xd2, 0x72, 0x6c, 0x82, 0x8b, 0xff, 0x08, 0x30, 0x45, 0xa1, 0x96, 0xe3, 0x32, 0xf9, 0x1f, 0x00, + 0xb8, 0x2c, 0x70, 0x20, 0xbc, 0xd2, 0xeb, 0xe6, 0x45, 0x9e, 0x4e, 0x35, 0x1f, 0x18, 0x9a, 0xc8, + 0xa3, 0x77, 0x0c, 0xe9, 0x3d, 0x48, 0xbb, 0xe8, 0xb0, 0xe6, 0xd2, 0x62, 0x44, 0x9e, 0xa4, 0x54, + 0xcf, 0x96, 0x83, 0x15, 0x28, 0x6b, 0xe8, 0x90, 0xdd, 0xa9, 0x12, 0xf7, 0x59, 0xd6, 0xc0, 0xed, + 0x3b, 0x88, 0xf4, 0x3e, 0x88, 0x1d, 0xd4, 0xb0, 0x0c, 0xe4, 0x39, 0x2e, 0x1d, 0x05, 0xb1, 0x72, + 0xe7, 0xe5, 0xb3, 0xb5, 0x25, 0xfe, 0xf0, 0x5f, 0xf4, 0xb1, 0x28, 0x0b, 0x83, 0x9c, 0xcd, 0xe5, + 0x3e, 0x11, 0x03, 0x9f, 0xcf, 0xc5, 0x54, 0xc0, 0x85, 0x7f, 0x9f, 0xe2, 0x02, 0xcc, 0x45, 0x9e, + 0x37, 0x60, 0xe2, 0xfb, 0x18, 0xdc, 0xae, 0x12, 0x73, 0xcb, 0xc5, 0xc8, 0xc3, 0x3e, 0xb2, 0xeb, + 0xb4, 0x5d, 0x1d, 0x4b, 0x12, 0xc4, 0x6d, 0xd4, 0xc4, 0x94, 0x09, 0x51, 0xa3, 0xd7, 0x52, 0x01, + 0xd2, 0x06, 0x66, 0xdb, 0x61, 0x39, 0x36, 0x9d, 0x6a, 0x51, 0x0b, 0xbb, 0xa4, 0x1c, 0x70, 0x55, + 0x51, 0xbd, 0x81, 0xe9, 0xe3, 0x64, 0xb4, 0x90, 0x47, 0xfa, 0x12, 0x62, 0x7b, 0x18, 0xcb, 0xf1, + 0xd7, 0x3f, 0x8d, 0x7e, 0x5d, 0xe9, 0x1d, 0x48, 0x79, 0x2e, 0x46, 0xa4, 0xed, 0x1e, 0xf3, 0xe5, + 0x18, 0x3f, 0x48, 0x41, 0xa4, 0x54, 0x86, 0x84, 0x73, 0x68, 0x63, 0x57, 0x4e, 0x5e, 0x92, 0xc2, + 0xc2, 0x42, 0xc3, 0x7a, 0xe3, 0x15, 0x87, 0xf5, 0xed, 0x11, 0xc3, 0xba, 0xc0, 0x05, 0x1a, 0x66, + 0xbe, 0xb8, 0x04, 0x8b, 0x23, 0x04, 0x09, 0x04, 0xfb, 0x3d, 0x06, 0x33, 0x55, 0x62, 0x7e, 0x60, + 0x58, 0x5e, 0x48, 0xae, 0x0f, 0x61, 0xda, 0x7f, 0xb3, 0xd4, 0x08, 0x35, 0x07, 0x23, 0x5c, 0xe8, + 0x75, 0xf3, 0x99, 0x41, 0x1c, 0x9d, 0xe2, 0x88, 0xad, 0x65, 0x8c, 0x81, 0x65, 0x04, 0xb2, 0x4f, + 0x8e, 0x97, 0x3d, 0x76, 0x99, 0xec, 0xf1, 0x71, 0xb2, 0x27, 0xde, 0x80, 0xec, 0xc9, 0xab, 0xcb, + 0x7e, 0xe3, 0xaa, 0xb2, 0xa7, 0x5e, 0x51, 0xf6, 0xbb, 0x23, 0x64, 0x9f, 0xe3, 0xb2, 0x47, 0xf5, + 0x2b, 0x2e, 0x42, 0xf6, 0x9c, 0xa8, 0x81, 0xe4, 0xbf, 0x4d, 0xd2, 0xed, 0x65, 0x23, 0x11, 0xfe, + 0xec, 0x5c, 0x73, 0x4b, 0xe7, 0x21, 0x49, 0xf4, 0x7d, 0xdc, 0x44, 0x5c, 0x4b, 0x6e, 0x49, 0x0f, + 0xe0, 0x26, 0x9f, 0x1f, 0xdd, 0x31, 0x70, 0xad, 0xed, 0x36, 0xa8, 0x96, 0x62, 0x65, 0xa6, 0xd7, + 0xcd, 0x4f, 0xb1, 0xa6, 0xb6, 0x1c, 0x03, 0x3f, 0xd1, 0x1e, 0x69, 0x53, 0x64, 0x60, 0xba, 0x0d, + 0xbf, 0x11, 0x3f, 0x87, 0x6e, 0x5d, 0x46, 0xa3, 0xd7, 0x6f, 0x60, 0xaf, 0xd6, 0x46, 0x10, 0x9c, + 0x8d, 0xec, 0x55, 0x98, 0xad, 0x62, 0x1e, 0x96, 0x46, 0xd2, 0x18, 0x10, 0xfd, 0x23, 0x7b, 0x19, + 0xfa, 0x32, 0x44, 0x68, 0x7e, 0xdd, 0x67, 0x83, 0xeb, 0x6d, 0xd9, 0x40, 0xb6, 0xf8, 0x65, 0xb2, + 0x25, 0xae, 0x28, 0x5b, 0x72, 0x94, 0x6c, 0xff, 0xdb, 0x5e, 0x5c, 0xf4, 0x3a, 0x1c, 0xe6, 0x9e, + 0xbf, 0x0e, 0x87, 0xdd, 0x81, 0x64, 0x1d, 0x48, 0x57, 0x89, 0xf9, 0x50, 0xf7, 0xac, 0x0e, 0xf2, + 0x70, 0xf4, 0x73, 0x2a, 0x5c, 0xe3, 0x73, 0xba, 0x32, 0xfa, 0x73, 0x7a, 0x93, 0xb7, 0xd7, 0xbf, + 0x51, 0x71, 0x8e, 0x4e, 0x4a, 0xdf, 0x0c, 0xda, 0xf9, 0x59, 0x80, 0x9b, 0x55, 0x62, 0x3e, 0x69, + 0x19, 0xc8, 0xc3, 0x9f, 0x21, 0x17, 0x35, 0x89, 0xf4, 0x2e, 0x88, 0xa8, 0xed, 0xed, 0x3b, 0xae, + 0xe5, 0x1d, 0xf3, 0x9e, 0xc6, 0x73, 0x34, 0x08, 0x95, 0x54, 0x48, 0xb6, 0x68, 0x05, 0x3a, 0x27, + 0xe9, 0x8d, 0x99, 0xd0, 0x91, 0x82, 0x95, 0xe6, 0xe7, 0x09, 0x1e, 0xb6, 0xb9, 0x42, 0xfb, 0x0e, + 0x0a, 0xf8, 0x7d, 0xdf, 0xe6, 0x7d, 0x87, 0x1b, 0x2a, 0x66, 0x61, 0x61, 0xa8, 0xc7, 0x7e, 0xff, + 0x1b, 0xbf, 0x24, 0x20, 0x56, 0x25, 0xa6, 0xf4, 0x09, 0xa4, 0xc3, 0x87, 0xe3, 0x6c, 0xe8, 0xd6, + 0xd1, 0x23, 0x95, 0x72, 0x67, 0x2c, 0xd4, 0x2f, 0x2a, 0x7d, 0x0c, 0x10, 0x3a, 0x69, 0xc9, 0xc3, + 0x09, 0x7d, 0x44, 0x29, 0x8c, 0x43, 0x82, 0x4a, 0x4f, 0xe1, 0xd6, 0xb9, 0x93, 0x4a, 0x2e, 0x9a, + 0x35, 0x8c, 0x2b, 0x2b, 0x17, 0xe3, 0x41, 0xed, 0xcf, 0x61, 0x7a, 0xe8, 0xa3, 0xfa, 0x56, 0x34, + 0x33, 0x8a, 0x2a, 0xcb, 0x17, 0xa1, 0x41, 0xd5, 0xaf, 0x40, 0x1a, 0xf1, 0xde, 0x2e, 0x8c, 0xea, + 0x29, 0x1c, 0xa1, 0x94, 0x2e, 0x8b, 0x08, 0x73, 0x72, 0xee, 0x85, 0x95, 0x3b, 0xdf, 0x5b, 0xa4, + 0xfa, 0xca, 0xc5, 0x78, 0x50, 0xbb, 0x02, 0xa9, 0x60, 0xb5, 0xe6, 0xa3, 0x39, 0x7d, 0xbf, 0x92, + 0x1b, 0xed, 0x0f, 0x6a, 0x3c, 0x86, 0x4c, 0x64, 0x1d, 0x94, 0x68, 0x7c, 0x18, 0x53, 0x8a, 0xe3, + 0xb1, 0x7e, 0x3d, 0x25, 0xf1, 0xcd, 0xd9, 0xc9, 0xaa, 0x50, 0xd9, 0x79, 0xde, 0xcb, 0x09, 0x2f, + 0x7a, 0x39, 0xe1, 0xaf, 0x5e, 0x4e, 0xf8, 0xe1, 0x34, 0x37, 0xf1, 0xe2, 0x34, 0x37, 0xf1, 0xc7, + 0x69, 0x6e, 0xe2, 0xa9, 0x1a, 0x3a, 0x3d, 0xd4, 0x91, 0x6d, 0xd0, 0x9f, 0x7c, 0xba, 0xd3, 0x50, + 0xf5, 0x7d, 0x64, 0xd9, 0x6a, 0xe7, 0xbe, 0x7a, 0xc4, 0x7f, 0x74, 0xb2, 0xa3, 0x44, 0x3d, 0x49, + 0x23, 0xee, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0xff, 0x36, 0xfe, 0x11, 0xca, 0x0e, 0x00, 0x00, } func (this *MsgRequestData) Equal(that interface{}) bool { diff --git a/yoda/context.go b/yoda/context.go index c479abfa5..9363cf68f 100644 --- a/yoda/context.go +++ b/yoda/context.go @@ -5,12 +5,14 @@ import ( "time" rpcclient "github.com/cometbft/cometbft/rpc/client" + "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/pkg/filecache" - "github.com/bandprotocol/chain/v2/x/oracle/types" - "github.com/bandprotocol/chain/v2/yoda/executor" + band "github.com/bandprotocol/chain/v3/app" + "github.com/bandprotocol/chain/v3/pkg/filecache" + "github.com/bandprotocol/chain/v3/x/oracle/types" + "github.com/bandprotocol/chain/v3/yoda/executor" ) type FeeEstimationData struct { @@ -29,6 +31,7 @@ type ReportMsgWithKey struct { } type Context struct { + bandApp *band.BandApp client rpcclient.Client validator sdk.ValAddress gasPrices string diff --git a/yoda/event.go b/yoda/event.go index 7e8ac35e8..ac15cfccb 100644 --- a/yoda/event.go +++ b/yoda/event.go @@ -3,9 +3,9 @@ package yoda import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" + abci "github.com/cometbft/cometbft/abci/types" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) type rawRequest struct { @@ -16,8 +16,8 @@ type rawRequest struct { } // GetEventValues returns the list of all values in the given log with the given type and key. -func GetEventValues(log sdk.ABCIMessageLog, evType string, evKey string) (res []string) { - for _, ev := range log.Events { +func GetEventValues(events []abci.Event, evType string, evKey string) (res []string) { + for _, ev := range events { if ev.Type != evType { continue } @@ -32,8 +32,8 @@ func GetEventValues(log sdk.ABCIMessageLog, evType string, evKey string) (res [] } // GetEventValue checks and returns the exact value in the given log with the given type and key. -func GetEventValue(log sdk.ABCIMessageLog, evType string, evKey string) (string, error) { - values := GetEventValues(log, evType, evKey) +func GetEventValue(events []abci.Event, evType string, evKey string) (string, error) { + values := GetEventValues(events, evType, evKey) if len(values) == 0 { return "", fmt.Errorf("cannot find event with type: %s, key: %s", evType, evKey) } diff --git a/yoda/execute.go b/yoda/execute.go index 9f753c714..8eab974fd 100644 --- a/yoda/execute.go +++ b/yoda/execute.go @@ -7,6 +7,7 @@ import ( "time" ctypes "github.com/cometbft/cometbft/rpc/core/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -17,22 +18,18 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/authz" - band "github.com/bandprotocol/chain/v2/app" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) -// Proto codec for encoding/decoding proto message -var cdc = band.MakeEncodingConfig().Marshaler - func signAndBroadcast( c *Context, key *keyring.Record, msgs []sdk.Msg, gasLimit uint64, memo string, ) (string, error) { clientCtx := client.Context{ Client: c.client, - Codec: cdc, - TxConfig: band.MakeEncodingConfig().TxConfig, + Codec: c.bandApp.AppCodec(), + TxConfig: c.bandApp.GetTxConfig(), BroadcastMode: "sync", - InterfaceRegistry: band.MakeEncodingConfig().InterfaceRegistry, + InterfaceRegistry: c.bandApp.InterfaceRegistry(), } acc, err := queryAccount(clientCtx, key) if err != nil { @@ -42,7 +39,7 @@ func signAndBroadcast( txf := tx.Factory{}. WithAccountNumber(acc.GetAccountNumber()). WithSequence(acc.GetSequence()). - WithTxConfig(band.MakeEncodingConfig().TxConfig). + WithTxConfig(clientCtx.TxConfig). WithGas(gasLimit).WithGasAdjustment(1). WithChainID(cfg.ChainID). WithMemo(memo). @@ -62,7 +59,7 @@ func signAndBroadcast( return "", err } - err = tx.Sign(txf, key.Name, txb, true) + err = tx.Sign(context.Background(), txf, key.Name, txb, true) if err != nil { return "", err } @@ -136,8 +133,8 @@ func SubmitReport(c *Context, l *Logger, keyIndex int64, reports []ReportMsgWith clientCtx := client.Context{ Client: c.client, - TxConfig: band.MakeEncodingConfig().TxConfig, - InterfaceRegistry: band.MakeEncodingConfig().InterfaceRegistry, + TxConfig: c.bandApp.GetTxConfig(), + InterfaceRegistry: c.bandApp.InterfaceRegistry(), } gasLimit := estimateGas(c, l, msgs, feeEstimations) @@ -206,7 +203,7 @@ func GetExecutable(c *Context, l *Logger, hash string) ([]byte, error) { resValue, err := c.fileCache.GetFile(hash) if err != nil { l.Debug(":magnifying_glass_tilted_left: Fetching data source hash: %s from bandchain querier", hash) - bz := cdc.MustMarshal(&types.QueryDataRequest{ + bz := c.bandApp.AppCodec().MustMarshal(&types.QueryDataRequest{ DataHash: hash, }) res, err := abciQuery(c, l, "/oracle.v1.Query/Data", bz) @@ -215,7 +212,7 @@ func GetExecutable(c *Context, l *Logger, hash string) ([]byte, error) { return nil, err } var dr types.QueryDataResponse - err = cdc.Unmarshal(res.Response.GetValue(), &dr) + err = c.bandApp.AppCodec().Unmarshal(res.Response.GetValue(), &dr) if err != nil { l.Error(":exploding_head: Failed to unmarshal data source with error: %s", c, err.Error()) return nil, err @@ -239,7 +236,7 @@ func GetDataSourceHash(c *Context, l *Logger, id types.DataSourceID) (string, er } var d types.DataSource - cdc.MustUnmarshal(res.Response.Value, &d) + c.bandApp.AppCodec().MustUnmarshal(res.Response.Value, &d) return d.Filename, nil } @@ -253,7 +250,7 @@ func GetRequest(c *Context, l *Logger, id types.RequestID) (types.Request, error } var r types.Request - cdc.MustUnmarshal(res.Response.Value, &r) + c.bandApp.AppCodec().MustUnmarshal(res.Response.Value, &r) return r, nil } diff --git a/yoda/executor/docker.go b/yoda/executor/docker.go index 5704b8632..aed06797b 100644 --- a/yoda/executor/docker.go +++ b/yoda/executor/docker.go @@ -11,7 +11,7 @@ import ( "github.com/google/shlex" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) type DockerExec struct { diff --git a/yoda/executor/executor_test.go b/yoda/executor/executor_test.go index 7d37e832b..3d546cd29 100644 --- a/yoda/executor/executor_test.go +++ b/yoda/executor/executor_test.go @@ -8,36 +8,36 @@ import ( ) func TestParseExecutor(t *testing.T) { - name, url, timeout, err := parseExecutor("beeb:www.beebprotocol.com?timeout=3s") - require.Equal(t, name, "beeb") + name, url, timeout, err := parseExecutor("test:www.bandprotocol.com?timeout=3s") + require.Equal(t, name, "test") require.Equal(t, timeout, 3*time.Second) - require.Equal(t, url, "www.beebprotocol.com") + require.Equal(t, url, "www.bandprotocol.com") require.NoError(t, err) - name, url, timeout, err = parseExecutor("beeb2:www.beeb.com/anna/kondanna?timeout=300ms") - require.Equal(t, name, "beeb2") + name, url, timeout, err = parseExecutor("test2:www.test.com/anna/kondanna?timeout=300ms") + require.Equal(t, name, "test2") require.Equal(t, timeout, 300*time.Millisecond) - require.Equal(t, url, "www.beeb.com/anna/kondanna") + require.Equal(t, url, "www.test.com/anna/kondanna") require.NoError(t, err) - name, url, timeout, err = parseExecutor("beeb3:https://bandprotocol.com/gg/gg2/bandchain?timeout=1s300ms") - require.Equal(t, name, "beeb3") + name, url, timeout, err = parseExecutor("test3:https://bandprotocol.com/gg/gg2/bandchain?timeout=1s300ms") + require.Equal(t, name, "test3") require.Equal(t, timeout, 1*time.Second+300*time.Millisecond) require.Equal(t, url, "https://bandprotocol.com/gg/gg2/bandchain") require.NoError(t, err) } func TestParseExecutorWithoutRawQuery(t *testing.T) { - _, _, _, err := parseExecutor("beeb:www.beebprotocol.com") + _, _, _, err := parseExecutor("test:www.bandprotocol.com") require.EqualError(t, err, "invalid timeout, executor requires query timeout") } func TestParseExecutorInvalidExecutorError(t *testing.T) { - _, _, _, err := parseExecutor("beeb") - require.EqualError(t, err, "invalid executor, cannot parse executor: beeb") + _, _, _, err := parseExecutor("test") + require.EqualError(t, err, "invalid executor, cannot parse executor: test") } func TestParseExecutorInvalidTimeoutError(t *testing.T) { - _, _, _, err := parseExecutor("beeb:www.beebprotocol.com?timeout=beeb") - require.EqualError(t, err, "invalid timeout, cannot parse duration with error: time: invalid duration \"beeb\"") + _, _, _, err := parseExecutor("test:www.bandprotocol.com?timeout=test") + require.EqualError(t, err, "invalid timeout, cannot parse duration with error: time: invalid duration \"test\"") } diff --git a/yoda/executor/rest_test.go b/yoda/executor/rest_test.go index f50fad80f..561020305 100644 --- a/yoda/executor/rest_test.go +++ b/yoda/executor/rest_test.go @@ -15,7 +15,7 @@ func createDefaultServer() *httptest.Server { res.WriteHeader(200) ret := externalExecutionResponse{ Returncode: 0, - Stdout: "BEEB", + Stdout: "TEST", Stderr: "Stderr", } _ = json.NewEncoder(res).Encode(ret) @@ -40,7 +40,7 @@ func createExecuteFailScenarioServer() *httptest.Server { res.WriteHeader(200) ret := externalExecutionResponse{ Returncode: 1, - Stdout: "BEEB", + Stdout: "TEST", Stderr: "Stderr", } _ = json.NewEncoder(res).Encode(ret) @@ -55,14 +55,14 @@ func TestExecuteSuccess(t *testing.T) { res, err := executor.Exec([]byte("executable"), "calldata", nil) require.NoError(t, err) require.Equal(t, uint32(0), res.Code) - require.Equal(t, []byte("BEEB"), res.Output) + require.Equal(t, []byte("TEST"), res.Output) } func TestExecuteBadUrlFail(t *testing.T) { testServer := createDefaultServer() defer func() { testServer.Close() }() - executor := NewRestExec("www.beeb.com", 1*time.Second) // bad url + executor := NewRestExec("www.test.com", 1*time.Second) // bad url _, err := executor.Exec([]byte("executable"), "calldata", nil) require.Error(t, err) } diff --git a/yoda/gas.go b/yoda/gas.go index 0b4591fcb..004cfbbe1 100644 --- a/yoda/gas.go +++ b/yoda/gas.go @@ -1,9 +1,10 @@ package yoda import ( + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) // Constant used to estimate gas price of reports transaction. @@ -49,7 +50,7 @@ const ( writePendingListGas = (pendingResolveListByteLength+pendingRequestIDByteLength)*writeGasPerByte + writeFlatGas ) -func getTxByteLength(msgs []sdk.Msg) uint64 { +func getTxByteLength(cdc codec.Codec, msgs []sdk.Msg) uint64 { // base tx + reports size := baseTransactionSize @@ -79,7 +80,7 @@ func getRequestByteLength(f FeeEstimationData) uint64 { return size } -func getReportByteLength(msg *types.MsgReportData) uint64 { +func getReportByteLength(cdc codec.Codec, msg *types.MsgReportData) uint64 { report := types.NewReport( sdk.ValAddress(msg.Validator), true, @@ -88,8 +89,8 @@ func getReportByteLength(msg *types.MsgReportData) uint64 { return uint64(len(cdc.MustMarshal(&report))) } -func estimateReportHandlerGas(msg *types.MsgReportData, f FeeEstimationData) uint64 { - reportByteLength := getReportByteLength(msg) +func estimateReportHandlerGas(cdc codec.Codec, msg *types.MsgReportData, f FeeEstimationData) uint64 { + reportByteLength := getReportByteLength(cdc, msg) requestByteLength := getRequestByteLength(f) cost := 2*readGasPerByte*requestByteLength + writeGasPerByte*reportByteLength + baseReportDataHandlerGas @@ -109,7 +110,7 @@ func estimateReportHandlerGas(msg *types.MsgReportData, f FeeEstimationData) uin func estimateAuthAnteHandlerGas(c *Context, msgs []sdk.Msg) uint64 { gas := baseAuthAnteGas - txByteLength := getTxByteLength(msgs) + txByteLength := getTxByteLength(c.bandApp.AppCodec(), msgs) gas += txCostPerByte * txByteLength if len(c.gasPrices) > 0 { @@ -127,7 +128,7 @@ func estimateGas(c *Context, l *Logger, msgs []sdk.Msg, feeEstimations []FeeEsti if !ok { panic("Don't support non-report data message") } - gas += estimateReportHandlerGas(msg, feeEstimations[i]) + gas += estimateReportHandlerGas(c.bandApp.AppCodec(), msg, feeEstimations[i]) } l.Debug(":fuel_pump: Estimated gas is %d", gas) diff --git a/yoda/handler.go b/yoda/handler.go index 6e0182e42..8cfe67d0a 100644 --- a/yoda/handler.go +++ b/yoda/handler.go @@ -6,10 +6,11 @@ import ( abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/crypto/tmhash" + "github.com/cosmos/cosmos-sdk/crypto/keyring" - sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" - "github.com/bandprotocol/chain/v2/x/oracle/types" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) type processingResult struct { @@ -33,20 +34,8 @@ func handleTransaction(c *Context, l *Logger, tx abci.TxResult) { return } - logs, err := sdk.ParseABCILogs(tx.Result.Log) - if err != nil { - l.Error(":cold_sweat: Failed to parse transaction logs with error: %s", c, err.Error()) - return - } - - for _, log := range logs { - go handleRequestLog(c, l, log) - } -} - -func handleRequestLog(c *Context, l *Logger, log sdk.ABCIMessageLog) { - idStrs := GetEventValues(log, types.EventTypeRequest, types.AttributeKeyID) - + events := tx.Result.Events + idStrs := GetEventValues(events, types.EventTypeRequest, types.AttributeKeyID) for _, idStr := range idStrs { id, err := strconv.Atoi(idStr) if err != nil { @@ -185,7 +174,7 @@ func handleRawRequest( } vmsg := types.NewRequestVerification(cfg.ChainID, c.validator, id, req.externalID, req.dataSourceID) - sig, pubkey, err := kb.Sign(key.Name, vmsg.GetSignBytes()) + sig, pubkey, err := kb.Sign(key.Name, vmsg.GetSignBytes(), signing.SignMode_SIGN_MODE_DIRECT) if err != nil { l.Error(":skull: Failed to sign verify message: %s", c, err.Error()) processingResultCh <- processingResult{ diff --git a/yoda/keys.go b/yoda/keys.go index b202426c2..10018ce10 100644 --- a/yoda/keys.go +++ b/yoda/keys.go @@ -5,17 +5,19 @@ import ( "context" "fmt" + "github.com/kyokomi/emoji" + "github.com/spf13/cobra" + "github.com/spf13/viper" + + bip39 "github.com/cosmos/go-bip39" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/input" "github.com/cosmos/cosmos-sdk/crypto/hd" - bip39 "github.com/cosmos/go-bip39" - "github.com/kyokomi/emoji" - "github.com/spf13/cobra" - "github.com/spf13/viper" - band "github.com/bandprotocol/chain/v2/app" - "github.com/bandprotocol/chain/v2/x/oracle/types" + band "github.com/bandprotocol/chain/v3/app" + "github.com/bandprotocol/chain/v3/x/oracle/types" ) const ( @@ -26,22 +28,22 @@ const ( flagAddress = "address" ) -func keysCmd(c *Context) *cobra.Command { +func keysCmd() *cobra.Command { cmd := &cobra.Command{ Use: "keys", Aliases: []string{"k"}, Short: "Manage key held by the oracle process", } cmd.AddCommand( - keysAddCmd(c), - keysDeleteCmd(c), - keysListCmd(c), - keysShowCmd(c), + keysAddCmd(), + keysDeleteCmd(), + keysListCmd(), + keysShowCmd(), ) return cmd } -func keysAddCmd(c *Context) *cobra.Command { +func keysAddCmd() *cobra.Command { cmd := &cobra.Command{ Use: "add [name]", Aliases: []string{"a"}, @@ -72,9 +74,6 @@ func keysAddCmd(c *Context) *cobra.Command { fmt.Printf("Mnemonic: %s\n", mnemonic) } - if err != nil { - return err - } account, err := cmd.Flags().GetUint32(flagAccount) if err != nil { return err @@ -104,7 +103,7 @@ func keysAddCmd(c *Context) *cobra.Command { return cmd } -func keysDeleteCmd(c *Context) *cobra.Command { +func keysDeleteCmd() *cobra.Command { cmd := &cobra.Command{ Use: "delete [name]", Aliases: []string{"d"}, @@ -140,7 +139,7 @@ func keysDeleteCmd(c *Context) *cobra.Command { return cmd } -func keysListCmd(c *Context) *cobra.Command { +func keysListCmd() *cobra.Command { cmd := &cobra.Command{ Use: "list", Aliases: []string{"l"}, @@ -193,7 +192,7 @@ func keysListCmd(c *Context) *cobra.Command { return cmd } -func keysShowCmd(c *Context) *cobra.Command { +func keysShowCmd() *cobra.Command { cmd := &cobra.Command{ Use: "show [name]", Aliases: []string{"s"}, diff --git a/yoda/logger.go b/yoda/logger.go index fa7d4a3d6..9e6f6ddaa 100644 --- a/yoda/logger.go +++ b/yoda/logger.go @@ -3,16 +3,17 @@ package yoda import ( "os" - "github.com/cometbft/cometbft/libs/log" "github.com/kyokomi/emoji" + + "cosmossdk.io/log" ) type Logger struct { logger log.Logger } -func NewLogger(level log.Option) *Logger { - return &Logger{logger: log.NewFilter(log.NewTMLogger(os.Stdout), level)} +func NewLogger(level log.FilterFunc) *Logger { + return &Logger{log.NewLogger(os.Stdout, log.FilterOption(level))} } func (l *Logger) Debug(format string, args ...interface{}) { diff --git a/yoda/main.go b/yoda/main.go index cb00a2c9f..02a47de0f 100644 --- a/yoda/main.go +++ b/yoda/main.go @@ -6,14 +6,19 @@ import ( "path" "path/filepath" + "github.com/spf13/cobra" + "github.com/spf13/viper" + + dbm "github.com/cosmos/cosmos-db" + + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" - "github.com/spf13/cobra" - "github.com/spf13/viper" - band "github.com/bandprotocol/chain/v2/app" + band "github.com/bandprotocol/chain/v3/app" ) const ( @@ -48,7 +53,7 @@ var ( DefaultYodaHome string ) -func initConfig(c *Context, cmd *cobra.Command) error { +func initConfig(c *Context) error { viper.SetConfigFile(path.Join(c.home, "config.yaml")) _ = viper.ReadInConfig() // If we fail to read config file, we'll just rely on cmd flags. if err := viper.Unmarshal(&cfg); err != nil { @@ -78,7 +83,7 @@ func Main() { rootCmd.AddCommand( configCmd(), - keysCmd(ctx), + keysCmd(), runCmd(ctx), version.NewVersionCommand(), ) @@ -91,11 +96,27 @@ func Main() { if err := os.MkdirAll(home, os.ModePerm); err != nil { return err } - kb, err = keyring.New("band", keyring.BackendTest, home, nil, cdc) + + initAppOptions := viper.New() + tempDir := tempDir() + initAppOptions.Set(flags.FlagHome, tempDir) + tempApplication := band.NewBandApp( + log.NewNopLogger(), + dbm.NewMemDB(), + nil, + true, + map[int64]bool{}, + tempDir, + initAppOptions, + 100, + ) + ctx.bandApp = tempApplication + + kb, err = keyring.New("band", keyring.BackendTest, home, nil, tempApplication.AppCodec()) if err != nil { return err } - return initConfig(ctx, rootCmd) + return initConfig(ctx) } rootCmd.PersistentFlags().String(flags.FlagHome, DefaultYodaHome, "home directory") if err := rootCmd.Execute(); err != nil { @@ -103,3 +124,13 @@ func Main() { os.Exit(1) } } + +var tempDir = func() string { + dir, err := os.MkdirTemp("", ".band") + if err != nil { + dir = band.DefaultNodeHome + } + defer os.RemoveAll(dir) + + return dir +} diff --git a/yoda/run.go b/yoda/run.go index 2325543a5..bea9a5ab3 100644 --- a/yoda/run.go +++ b/yoda/run.go @@ -6,17 +6,20 @@ import ( "path/filepath" "time" - "github.com/cometbft/cometbft/libs/log" + "github.com/spf13/cobra" + "github.com/spf13/viper" + httpclient "github.com/cometbft/cometbft/rpc/client/http" - tmtypes "github.com/cometbft/cometbft/types" + cmttypes "github.com/cometbft/cometbft/types" + + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/cobra" - "github.com/spf13/viper" - "github.com/bandprotocol/chain/v2/pkg/filecache" - "github.com/bandprotocol/chain/v2/x/oracle/types" - "github.com/bandprotocol/chain/v2/yoda/executor" + "github.com/bandprotocol/chain/v3/pkg/filecache" + "github.com/bandprotocol/chain/v3/x/oracle/types" + "github.com/bandprotocol/chain/v3/yoda/executor" ) const ( @@ -54,7 +57,7 @@ func runImpl(c *Context, l *Logger) error { waitingMsgs[i] = []ReportMsgWithKey{} } - bz := cdc.MustMarshal(&types.QueryPendingRequestsRequest{ + bz := c.bandApp.AppCodec().MustMarshal(&types.QueryPendingRequestsRequest{ ValidatorAddress: c.validator.String(), }) resBz, err := c.client.ABCIQuery(context.Background(), "/oracle.v1.Query/PendingRequests", bz) @@ -62,7 +65,7 @@ func runImpl(c *Context, l *Logger) error { l.Error(":exploding_head: Failed to get pending requests with error: %s", c, err.Error()) } pendingRequests := types.QueryPendingRequestsResponse{} - cdc.MustUnmarshal(resBz.Response.Value, &pendingRequests) + c.bandApp.AppCodec().MustUnmarshal(resBz.Response.Value, &pendingRequests) l.Info(":mag: Found %d pending requests", len(pendingRequests.RequestIDs)) for _, id := range pendingRequests.RequestIDs { @@ -73,7 +76,7 @@ func runImpl(c *Context, l *Logger) error { for { select { case ev := <-eventChan: - go handleTransaction(c, l, ev.Data.(tmtypes.EventDataTx).TxResult) + go handleTransaction(c, l, ev.Data.(cmttypes.EventDataTx).TxResult) case keyIndex := <-c.freeKeys: if len(waitingMsgs[keyIndex]) != 0 { if uint64(len(waitingMsgs[keyIndex])) > c.maxReport { @@ -127,7 +130,7 @@ func runCmd(c *Context) *cobra.Command { c.gasPrices = cfg.GasPrices - allowLevel, err := log.AllowLevel(cfg.LogLevel) + allowLevel, err := log.ParseLogLevel(cfg.LogLevel) if err != nil { return err }