From fc501d1811a839fffc5a2d916d7b1b96f29048b9 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Fri, 23 Feb 2024 10:33:32 +0800 Subject: [PATCH 01/37] chore: add ignite dep --- config.yml | 21 ++++++++++++++ testutil/nullify/nullify.go | 57 +++++++++++++++++++++++++++++++++++++ testutil/sample/sample.go | 13 +++++++++ tools/tools.go | 11 +++++++ 4 files changed, 102 insertions(+) create mode 100644 config.yml create mode 100644 testutil/nullify/nullify.go create mode 100644 testutil/sample/sample.go create mode 100644 tools/tools.go diff --git a/config.yml b/config.yml new file mode 100644 index 000000000..868e0e1f3 --- /dev/null +++ b/config.yml @@ -0,0 +1,21 @@ +version: 1 +accounts: +- name: alice + coins: + - 20000token + - 200000000stake +- name: bob + coins: + - 10000token + - 100000000stake +client: + openapi: + path: docs/static/openapi.yml +faucet: + name: bob + coins: + - 5token + - 100000stake +validators: +- name: alice + bonded: 100000000stake diff --git a/testutil/nullify/nullify.go b/testutil/nullify/nullify.go new file mode 100644 index 000000000..3b968c09c --- /dev/null +++ b/testutil/nullify/nullify.go @@ -0,0 +1,57 @@ +// Package nullify provides methods to init nil values structs for test assertion. +package nullify + +import ( + "reflect" + "unsafe" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + coinType = reflect.TypeOf(sdk.Coin{}) + coinsType = reflect.TypeOf(sdk.Coins{}) +) + +// Fill analyze all struct fields and slices with +// reflection and initialize the nil and empty slices, +// structs, and pointers. +func Fill(x interface{}) interface{} { + v := reflect.Indirect(reflect.ValueOf(x)) + switch v.Kind() { + case reflect.Slice: + for i := 0; i < v.Len(); i++ { + obj := v.Index(i) + objPt := reflect.NewAt(obj.Type(), unsafe.Pointer(obj.UnsafeAddr())).Interface() + objPt = Fill(objPt) + obj.Set(reflect.ValueOf(objPt)) + } + case reflect.Struct: + for i := 0; i < v.NumField(); i++ { + f := reflect.Indirect(v.Field(i)) + if !f.CanSet() { + continue + } + switch f.Kind() { + case reflect.Slice: + f.Set(reflect.MakeSlice(f.Type(), 0, 0)) + case reflect.Struct: + switch f.Type() { + case coinType: + coin := reflect.New(coinType).Interface() + s := reflect.ValueOf(coin).Elem() + f.Set(s) + case coinsType: + coins := reflect.New(coinsType).Interface() + s := reflect.ValueOf(coins).Elem() + f.Set(s) + default: + objPt := reflect.NewAt(f.Type(), unsafe.Pointer(f.UnsafeAddr())).Interface() + s := Fill(objPt) + f.Set(reflect.ValueOf(s)) + } + } + } + } + return reflect.Indirect(v).Interface() +} diff --git a/testutil/sample/sample.go b/testutil/sample/sample.go new file mode 100644 index 000000000..98f2153ed --- /dev/null +++ b/testutil/sample/sample.go @@ -0,0 +1,13 @@ +package sample + +import ( + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// AccAddress returns a sample account address +func AccAddress() string { + pk := ed25519.GenPrivKey().PubKey() + addr := pk.Address() + return sdk.AccAddress(addr).String() +} diff --git a/tools/tools.go b/tools/tools.go new file mode 100644 index 000000000..6e7a12d40 --- /dev/null +++ b/tools/tools.go @@ -0,0 +1,11 @@ +//go:build tools + +package tools + +import ( + _ "github.com/cosmos/gogoproto/protoc-gen-gocosmos" + _ "github.com/golang/protobuf/protoc-gen-go" + _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway" + _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2" +) From 7e0cb8ee638b946d0e368c1bfabd082b242bc3c1 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Fri, 23 Feb 2024 12:09:10 +0800 Subject: [PATCH 02/37] feat(oracle): scaffold oracle module --- docs/static/openapi.yml | 74178 +++++++++++++++++++++++++ go.mod | 2 + go.sum | 2 + proto/exocore/oracle/genesis.proto | 12 + proto/exocore/oracle/params.proto | 12 + proto/exocore/oracle/query.proto | 26 + proto/exocore/oracle/tx.proto | 7 + testutil/keeper/oracle.go | 52 + x/delegation/types/query.pb.gw.go | 2 +- x/deposit/types/query.pb.gw.go | 2 +- x/oracle/client/cli/query.go | 31 + x/oracle/client/cli/query_params.go | 36 + x/oracle/client/cli/tx.go | 36 + x/oracle/genesis.go | 23 + x/oracle/genesis_test.go | 29 + x/oracle/keeper/keeper.go | 46 + x/oracle/keeper/msg_server.go | 17 + x/oracle/keeper/msg_server_test.go | 23 + x/oracle/keeper/params.go | 16 + x/oracle/keeper/params_test.go | 18 + x/oracle/keeper/query.go | 7 + x/oracle/keeper/query_params.go | 19 + x/oracle/keeper/query_params_test.go | 21 + x/oracle/module.go | 148 + x/oracle/module_simulation.go | 64 + x/oracle/simulation/helpers.go | 15 + x/oracle/types/codec.go | 23 + x/oracle/types/errors.go | 12 + x/oracle/types/expected_keepers.go | 18 + x/oracle/types/genesis.go | 24 + x/oracle/types/genesis.pb.go | 321 + x/oracle/types/genesis_test.go | 41 + x/oracle/types/keys.go | 19 + x/oracle/types/params.go | 39 + x/oracle/types/params.pb.go | 264 + x/oracle/types/query.pb.go | 537 + x/oracle/types/query.pb.gw.go | 153 + x/oracle/types/tx.pb.go | 81 + x/oracle/types/types.go | 1 + x/reward/types/query.pb.gw.go | 2 +- x/slash/types/query.pb.gw.go | 2 +- 41 files changed, 76377 insertions(+), 4 deletions(-) create mode 100644 docs/static/openapi.yml create mode 100644 proto/exocore/oracle/genesis.proto create mode 100644 proto/exocore/oracle/params.proto create mode 100644 proto/exocore/oracle/query.proto create mode 100644 proto/exocore/oracle/tx.proto create mode 100644 testutil/keeper/oracle.go create mode 100644 x/oracle/client/cli/query.go create mode 100644 x/oracle/client/cli/query_params.go create mode 100644 x/oracle/client/cli/tx.go create mode 100644 x/oracle/genesis.go create mode 100644 x/oracle/genesis_test.go create mode 100644 x/oracle/keeper/keeper.go create mode 100644 x/oracle/keeper/msg_server.go create mode 100644 x/oracle/keeper/msg_server_test.go create mode 100644 x/oracle/keeper/params.go create mode 100644 x/oracle/keeper/params_test.go create mode 100644 x/oracle/keeper/query.go create mode 100644 x/oracle/keeper/query_params.go create mode 100644 x/oracle/keeper/query_params_test.go create mode 100644 x/oracle/module.go create mode 100644 x/oracle/module_simulation.go create mode 100644 x/oracle/simulation/helpers.go create mode 100644 x/oracle/types/codec.go create mode 100644 x/oracle/types/errors.go create mode 100644 x/oracle/types/expected_keepers.go create mode 100644 x/oracle/types/genesis.go create mode 100644 x/oracle/types/genesis.pb.go create mode 100644 x/oracle/types/genesis_test.go create mode 100644 x/oracle/types/keys.go create mode 100644 x/oracle/types/params.go create mode 100644 x/oracle/types/params.pb.go create mode 100644 x/oracle/types/query.pb.go create mode 100644 x/oracle/types/query.pb.gw.go create mode 100644 x/oracle/types/tx.pb.go create mode 100644 x/oracle/types/types.go diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml new file mode 100644 index 000000000..51625bd7e --- /dev/null +++ b/docs/static/openapi.yml @@ -0,0 +1,74178 @@ +swagger: '2.0' +info: + title: HTTP API Console + name: '' + description: '' +paths: + /cosmos/auth/v1beta1/account_info/{address}: + get: + summary: AccountInfo queries account info which is common to all account types. + description: 'Since: cosmos-sdk 0.47' + operationId: CosmosAuthV1Beta1AccountInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + info: + description: info is the account info which is represented by BaseAccount. + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + account_number: + type: string + format: uint64 + sequence: + type: string + format: uint64 + description: |- + QueryAccountInfoResponse is the Query/AccountInfo response type. + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: address + description: address is the account address string. + in: path + required: true + type: string + tags: + - Query + /cosmos/auth/v1beta1/accounts: + get: + summary: Accounts returns all the existing accounts. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.43 + operationId: CosmosAuthV1Beta1Accounts + responses: + '200': + description: A successful response. + schema: + type: object + properties: + accounts: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: accounts are the existing accounts + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAccountsResponse is the response type for the Query/Accounts + RPC method. + + + Since: cosmos-sdk 0.43 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/auth/v1beta1/accounts/{address}: + get: + summary: Account returns account details based on address. + operationId: CosmosAuthV1Beta1Account + responses: + '200': + description: A successful response. + schema: + type: object + properties: + account: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + QueryAccountResponse is the response type for the Query/Account + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: address + description: address defines the address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/auth/v1beta1/address_by_id/{id}: + get: + summary: AccountAddressByID returns account address based on account number. + description: 'Since: cosmos-sdk 0.46.2' + operationId: CosmosAuthV1Beta1AccountAddressByID + responses: + '200': + description: A successful response. + schema: + type: object + properties: + account_address: + type: string + description: 'Since: cosmos-sdk 0.46.2' + title: >- + QueryAccountAddressByIDResponse is the response type for + AccountAddressByID rpc method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: id + description: |- + Deprecated, use account_id instead + + id is the account number of the address to be queried. This field + should have been an uint64 (like all account numbers), and will be + updated to uint64 in a future version of the auth query. + in: path + required: true + type: string + format: int64 + - name: account_id + description: |- + account_id is the account number of the address to be queried. + + Since: cosmos-sdk 0.47 + in: query + required: false + type: string + format: uint64 + tags: + - Query + /cosmos/auth/v1beta1/bech32: + get: + summary: Bech32Prefix queries bech32Prefix + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosAuthV1Beta1Bech32Prefix + responses: + '200': + description: A successful response. + schema: + type: object + properties: + bech32_prefix: + type: string + description: >- + Bech32PrefixResponse is the response type for Bech32Prefix rpc + method. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /cosmos/auth/v1beta1/bech32/{address_bytes}: + get: + summary: AddressBytesToString converts Account Address bytes to string + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosAuthV1Beta1AddressBytesToString + responses: + '200': + description: A successful response. + schema: + type: object + properties: + address_string: + type: string + description: >- + AddressBytesToStringResponse is the response type for + AddressString rpc method. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: address_bytes + in: path + required: true + type: string + format: byte + tags: + - Query + /cosmos/auth/v1beta1/bech32/{address_string}: + get: + summary: AddressStringToBytes converts Address string to bytes + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosAuthV1Beta1AddressStringToBytes + responses: + '200': + description: A successful response. + schema: + type: object + properties: + address_bytes: + type: string + format: byte + description: >- + AddressStringToBytesResponse is the response type for AddressBytes + rpc method. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: address_string + in: path + required: true + type: string + tags: + - Query + /cosmos/auth/v1beta1/module_accounts: + get: + summary: ModuleAccounts returns all the existing module accounts. + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosAuthV1Beta1ModuleAccounts + responses: + '200': + description: A successful response. + schema: + type: object + properties: + accounts: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + QueryModuleAccountsResponse is the response type for the + Query/ModuleAccounts RPC method. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /cosmos/auth/v1beta1/module_accounts/{name}: + get: + summary: ModuleAccountByName returns the module account info by module name + operationId: CosmosAuthV1Beta1ModuleAccountByName + responses: + '200': + description: A successful response. + schema: + type: object + properties: + account: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + QueryModuleAccountByNameResponse is the response type for the + Query/ModuleAccountByName RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: name + in: path + required: true + type: string + tags: + - Query + /cosmos/auth/v1beta1/params: + get: + summary: Params queries all parameters. + operationId: CosmosAuthV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + max_memo_characters: + type: string + format: uint64 + tx_sig_limit: + type: string + format: uint64 + tx_size_cost_per_byte: + type: string + format: uint64 + sig_verify_cost_ed25519: + type: string + format: uint64 + sig_verify_cost_secp256k1: + type: string + format: uint64 + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /cosmos/authz/v1beta1/grants: + get: + summary: Returns list of `Authorization`, granted to the grantee by the granter. + operationId: CosmosAuthzV1Beta1Grants + responses: + '200': + description: A successful response. + schema: + type: object + properties: + grants: + type: array + items: + type: object + properties: + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + time when the grant will expire and will be pruned. If + null, then the grant + + doesn't have a time expiration (other conditions in + `authorization` + + may apply to invalidate the grant) + description: |- + Grant gives permissions to execute + the provide method with expiration time. + description: >- + authorizations is a list of grants granted for grantee by + granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGrantsResponse is the response type for the + Query/Authorizations RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: granter + in: query + required: false + type: string + - name: grantee + in: query + required: false + type: string + - name: msg_type_url + description: >- + Optional, msg_type_url, when set, will query only grants matching + given msg type. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/authz/v1beta1/grants/grantee/{grantee}: + get: + summary: GranteeGrants returns a list of `GrantAuthorization` by grantee. + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosAuthzV1Beta1GranteeGrants + responses: + '200': + description: A successful response. + schema: + type: object + properties: + grants: + type: array + items: + type: object + properties: + granter: + type: string + grantee: + type: string + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + GrantAuthorization extends a grant with both the addresses + of the grantee and granter. + + It is used in genesis.proto and query.proto + description: grants is a list of grants granted to the grantee. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGranteeGrantsResponse is the response type for the + Query/GranteeGrants RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: grantee + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/authz/v1beta1/grants/granter/{granter}: + get: + summary: GranterGrants returns list of `GrantAuthorization`, granted by granter. + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosAuthzV1Beta1GranterGrants + responses: + '200': + description: A successful response. + schema: + type: object + properties: + grants: + type: array + items: + type: object + properties: + granter: + type: string + grantee: + type: string + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + GrantAuthorization extends a grant with both the addresses + of the grantee and granter. + + It is used in genesis.proto and query.proto + description: grants is a list of grants granted by the granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGranterGrantsResponse is the response type for the + Query/GranterGrants RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: granter + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/balances/{address}: + get: + summary: AllBalances queries the balance of all coins for a single account. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosBankV1Beta1AllBalances + responses: + '200': + description: A successful response. + schema: + type: object + properties: + balances: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: balances is the balances of all the coins. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllBalancesResponse is the response type for the + Query/AllBalances RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: address + description: address is the address to query balances for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/balances/{address}/by_denom: + get: + summary: Balance queries the balance of a single coin for a single account. + operationId: CosmosBankV1Beta1Balance + responses: + '200': + description: A successful response. + schema: + type: object + properties: + balance: + description: balance is the balance of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QueryBalanceResponse is the response type for the Query/Balance + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: address + description: address is the address to query balances for. + in: path + required: true + type: string + - name: denom + description: denom is the coin denom to query balances for. + in: query + required: false + type: string + tags: + - Query + /cosmos/bank/v1beta1/denom_owners/{denom}: + get: + summary: >- + DenomOwners queries for all account addresses that own a particular + token + + denomination. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.46 + operationId: CosmosBankV1Beta1DenomOwners + responses: + '200': + description: A successful response. + schema: + type: object + properties: + denom_owners: + type: array + items: + type: object + properties: + address: + type: string + description: >- + address defines the address that owns a particular + denomination. + balance: + description: >- + balance is the balance of the denominated coin for an + account. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DenomOwner defines structure representing an account that + owns or holds a + + particular denominated token. It contains the account + address and account + + balance of the denominated token. + + + Since: cosmos-sdk 0.46 + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDenomOwnersResponse defines the RPC response of a DenomOwners + RPC query. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: denom + description: >- + denom defines the coin denomination to query all account holders + for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/denoms_metadata: + get: + summary: |- + DenomsMetadata queries the client metadata for all registered coin + denominations. + operationId: CosmosBankV1Beta1DenomsMetadata + responses: + '200': + description: A successful response. + schema: + type: object + properties: + metadatas: + type: array + items: + type: object + properties: + description: + type: string + denom_units: + type: array + items: + type: object + properties: + denom: + type: string + description: >- + denom represents the string name of the given + denom unit (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one + must + + raise the base_denom to in order to equal the + given DenomUnit's denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a + DenomUnit of 'atom' with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: >- + aliases is a list of string aliases for the given + denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: >- + denom_units represents the list of DenomUnit's for a + given coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit + with exponent = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges + (eg: ATOM). This can + + be the same as the display. + + + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains + additional information. Optional. + + + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. + It's used to verify that + + the document didn't change. Optional. + + + Since: cosmos-sdk 0.46 + description: |- + Metadata represents a struct that describes + a basic token. + description: >- + metadata provides the client information for all the + registered tokens. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDenomsMetadataResponse is the response type for the + Query/DenomsMetadata RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/denoms_metadata/{denom}: + get: + summary: DenomsMetadata queries the client metadata of a given coin denomination. + operationId: CosmosBankV1Beta1DenomMetadata + responses: + '200': + description: A successful response. + schema: + type: object + properties: + metadata: + description: >- + metadata describes and provides all the client information for + the requested token. + type: object + properties: + description: + type: string + denom_units: + type: array + items: + type: object + properties: + denom: + type: string + description: >- + denom represents the string name of the given denom + unit (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one + must + + raise the base_denom to in order to equal the given + DenomUnit's denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a + DenomUnit of 'atom' with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: >- + aliases is a list of string aliases for the given + denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: >- + denom_units represents the list of DenomUnit's for a given + coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit + with exponent = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges (eg: + ATOM). This can + + be the same as the display. + + + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains + additional information. Optional. + + + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. + It's used to verify that + + the document didn't change. Optional. + + + Since: cosmos-sdk 0.46 + description: >- + QueryDenomMetadataResponse is the response type for the + Query/DenomMetadata RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: denom + description: denom is the coin denom to query the metadata for. + in: path + required: true + type: string + tags: + - Query + /cosmos/bank/v1beta1/params: + get: + summary: Params queries the parameters of x/bank module. + operationId: CosmosBankV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status + (whether a denom is + + sendable). + description: >- + Deprecated: Use of SendEnabled in params is deprecated. + + For genesis, use the newly added send_enabled field in the + genesis object. + + Storage, lookup, and manipulation of this information is + now in the keeper. + + + As of cosmos-sdk 0.47, this only exists for backwards + compatibility of genesis files. + default_send_enabled: + type: boolean + description: Params defines the parameters for the bank module. + description: >- + QueryParamsResponse defines the response type for querying x/bank + parameters. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/bank/v1beta1/send_enabled: + get: + summary: SendEnabled queries for SendEnabled entries. + description: >- + This query only returns denominations that have specific SendEnabled + settings. + + Any denomination that does not have a specific setting will use the + default + + params.default_send_enabled, and will not be returned by this query. + + + Since: cosmos-sdk 0.47 + operationId: CosmosBankV1Beta1SendEnabled + responses: + '200': + description: A successful response. + schema: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status + (whether a denom is + + sendable). + pagination: + description: >- + pagination defines the pagination in the response. This field + is only + + populated if the denoms field in the request is empty. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QuerySendEnabledResponse defines the RPC response of a SendEnable + query. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: denoms + description: >- + denoms is the specific denoms you want look up. Leave empty to get + all entries. + in: query + required: false + type: array + items: + type: string + collectionFormat: multi + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/spendable_balances/{address}: + get: + summary: >- + SpendableBalances queries the spendable balance of all coins for a + single + + account. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.46 + operationId: CosmosBankV1Beta1SpendableBalances + responses: + '200': + description: A successful response. + schema: + type: object + properties: + balances: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: balances is the spendable balances of all the coins. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QuerySpendableBalancesResponse defines the gRPC response structure + for querying + + an account's spendable balances. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: address + description: address is the address to query spendable balances for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/spendable_balances/{address}/by_denom: + get: + summary: >- + SpendableBalanceByDenom queries the spendable balance of a single denom + for + + a single account. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.47 + operationId: CosmosBankV1Beta1SpendableBalanceByDenom + responses: + '200': + description: A successful response. + schema: + type: object + properties: + balance: + description: balance is the balance of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QuerySpendableBalanceByDenomResponse defines the gRPC response + structure for + + querying an account's spendable balance for a specific denom. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: address + description: address is the address to query balances for. + in: path + required: true + type: string + - name: denom + description: denom is the coin denom to query balances for. + in: query + required: false + type: string + tags: + - Query + /cosmos/bank/v1beta1/supply: + get: + summary: TotalSupply queries the total supply of all coins. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosBankV1Beta1TotalSupply + responses: + '200': + description: A successful response. + schema: + type: object + properties: + supply: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: supply is the supply of the coins + pagination: + description: |- + pagination defines the pagination in the response. + + Since: cosmos-sdk 0.43 + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryTotalSupplyResponse is the response type for the + Query/TotalSupply RPC + + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/supply/by_denom: + get: + summary: SupplyOf queries the supply of a single coin. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosBankV1Beta1SupplyOf + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amount: + description: amount is the supply of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QuerySupplyOfResponse is the response type for the Query/SupplyOf + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: denom + description: denom is the coin denom to query balances for. + in: query + required: false + type: string + tags: + - Query + /cosmos/base/node/v1beta1/config: + get: + summary: Config queries for the operator configuration. + operationId: CosmosBaseNodeV1Beta1Config + responses: + '200': + description: A successful response. + schema: + type: object + properties: + minimum_gas_price: + type: string + description: >- + ConfigResponse defines the response structure for the Config gRPC + query. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Service + /cosmos/base/tendermint/v1beta1/abci_query: + get: + summary: >- + ABCIQuery defines a query handler that supports ABCI queries directly to + the + + application, bypassing Tendermint completely. The ABCI query must + contain + + a valid and supported path, including app, custom, p2p, and store. + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosBaseTendermintV1Beta1ABCIQuery + responses: + '200': + description: A successful response. + schema: + type: object + properties: + code: + type: integer + format: int64 + log: + type: string + title: nondeterministic + info: + type: string + title: nondeterministic + index: + type: string + format: int64 + key: + type: string + format: byte + value: + type: string + format: byte + proof_ops: + type: object + properties: + ops: + type: array + items: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + description: >- + ProofOp defines an operation used for calculating Merkle + root. The data could + + be arbitrary format, providing necessary data for + example neighbouring node + + hash. + + + Note: This type is a duplicate of the ProofOp proto type + defined in Tendermint. + description: >- + ProofOps is Merkle proof defined by the list of ProofOps. + + + Note: This type is a duplicate of the ProofOps proto type + defined in Tendermint. + height: + type: string + format: int64 + codespace: + type: string + description: >- + ABCIQueryResponse defines the response structure for the ABCIQuery + gRPC query. + + + Note: This type is a duplicate of the ResponseQuery proto type + defined in + + Tendermint. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: data + in: query + required: false + type: string + format: byte + - name: path + in: query + required: false + type: string + - name: height + in: query + required: false + type: string + format: int64 + - name: prove + in: query + required: false + type: boolean + tags: + - Service + /cosmos/base/tendermint/v1beta1/blocks/latest: + get: + summary: GetLatestBlock returns the latest block. + operationId: CosmosBaseTendermintV1Beta1GetLatestBlock + responses: + '200': + description: A successful response. + schema: + type: object + properties: + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + block: + title: 'Deprecated: please use `sdk_block` instead' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing + on the order first. + + This means that block.AppHash does not include these + txs. + title: >- + Data contains the set of transactions included in the + block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a + validator signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a + block was committed by a set of + validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a + set of validators attempting to mislead a light + client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was committed by + a set of validators. + sdk_block: + title: 'Since: cosmos-sdk 0.47' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer + address, formatted as a Bech32 string. + + In Tendermint, this type is `bytes`, but in the SDK, + we convert it to a Bech32 string + + for better UX. + + + original proposer of the block + description: Header defines the structure of a Tendermint block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing + on the order first. + + This means that block.AppHash does not include these + txs. + title: >- + Data contains the set of transactions included in the + block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a + validator signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a + block was committed by a set of + validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a + set of validators attempting to mislead a light + client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was committed by + a set of validators. + description: >- + Block is tendermint type Block, with the Header proposer + address + + field converted to bech32 string. + description: >- + GetLatestBlockResponse is the response type for the + Query/GetLatestBlock RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Service + /cosmos/base/tendermint/v1beta1/blocks/{height}: + get: + summary: GetBlockByHeight queries block for given height. + operationId: CosmosBaseTendermintV1Beta1GetBlockByHeight + responses: + '200': + description: A successful response. + schema: + type: object + properties: + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + block: + title: 'Deprecated: please use `sdk_block` instead' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing + on the order first. + + This means that block.AppHash does not include these + txs. + title: >- + Data contains the set of transactions included in the + block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a + validator signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a + block was committed by a set of + validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a + set of validators attempting to mislead a light + client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was committed by + a set of validators. + sdk_block: + title: 'Since: cosmos-sdk 0.47' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer + address, formatted as a Bech32 string. + + In Tendermint, this type is `bytes`, but in the SDK, + we convert it to a Bech32 string + + for better UX. + + + original proposer of the block + description: Header defines the structure of a Tendermint block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing + on the order first. + + This means that block.AppHash does not include these + txs. + title: >- + Data contains the set of transactions included in the + block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a + validator signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a + block was committed by a set of + validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a + set of validators attempting to mislead a light + client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was committed by + a set of validators. + description: >- + Block is tendermint type Block, with the Header proposer + address + + field converted to bech32 string. + description: >- + GetBlockByHeightResponse is the response type for the + Query/GetBlockByHeight RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: height + in: path + required: true + type: string + format: int64 + tags: + - Service + /cosmos/base/tendermint/v1beta1/node_info: + get: + summary: GetNodeInfo queries the current node info. + operationId: CosmosBaseTendermintV1Beta1GetNodeInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + default_node_info: + type: object + properties: + protocol_version: + type: object + properties: + p2p: + type: string + format: uint64 + block: + type: string + format: uint64 + app: + type: string + format: uint64 + default_node_id: + type: string + listen_addr: + type: string + network: + type: string + version: + type: string + channels: + type: string + format: byte + moniker: + type: string + other: + type: object + properties: + tx_index: + type: string + rpc_address: + type: string + application_version: + type: object + properties: + name: + type: string + app_name: + type: string + version: + type: string + git_commit: + type: string + build_tags: + type: string + go_version: + type: string + build_deps: + type: array + items: + type: object + properties: + path: + type: string + title: module path + version: + type: string + title: module version + sum: + type: string + title: checksum + title: Module is the type for VersionInfo + cosmos_sdk_version: + type: string + title: 'Since: cosmos-sdk 0.43' + description: VersionInfo is the type for the GetNodeInfoResponse message. + description: >- + GetNodeInfoResponse is the response type for the Query/GetNodeInfo + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Service + /cosmos/base/tendermint/v1beta1/syncing: + get: + summary: GetSyncing queries node syncing. + operationId: CosmosBaseTendermintV1Beta1GetSyncing + responses: + '200': + description: A successful response. + schema: + type: object + properties: + syncing: + type: boolean + description: >- + GetSyncingResponse is the response type for the Query/GetSyncing + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Service + /cosmos/base/tendermint/v1beta1/validatorsets/latest: + get: + summary: GetLatestValidatorSet queries latest validator-set. + operationId: CosmosBaseTendermintV1Beta1GetLatestValidatorSet + responses: + '200': + description: A successful response. + schema: + type: object + properties: + block_height: + type: string + format: int64 + validators: + type: array + items: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + description: Validator is the type for the validator-set. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + GetLatestValidatorSetResponse is the response type for the + Query/GetValidatorSetByHeight RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Service + /cosmos/base/tendermint/v1beta1/validatorsets/{height}: + get: + summary: GetValidatorSetByHeight queries validator-set at a given height. + operationId: CosmosBaseTendermintV1Beta1GetValidatorSetByHeight + responses: + '200': + description: A successful response. + schema: + type: object + properties: + block_height: + type: string + format: int64 + validators: + type: array + items: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + description: Validator is the type for the validator-set. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + GetValidatorSetByHeightResponse is the response type for the + Query/GetValidatorSetByHeight RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: height + in: path + required: true + type: string + format: int64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Service + /cosmos/consensus/v1/params: + get: + summary: Params queries the parameters of x/consensus_param module. + operationId: CosmosConsensusV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: >- + params are the tendermint consensus params stored in the + consensus module. + + Please note that `params.version` is not populated in this + response, it is + + tracked separately in the x/upgrade module. + type: object + properties: + block: + type: object + properties: + max_bytes: + type: string + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: + type: string + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + evidence: + type: object + properties: + max_age_num_blocks: + type: string + format: int64 + description: >- + Max age of evidence, in blocks. + + + The basic formula for calculating this is: + MaxAgeDuration / {average block + + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. + + + It should correspond with an app's "unbonding period" + or other similar + + mechanism for handling [Nothing-At-Stake + + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes + that can be committed in a single block. + + and should fall comfortably under the max block bytes. + + Default is 1048576 or 1MB + description: >- + EvidenceParams determine how we handle evidence of + malfeasance. + validator: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: >- + ValidatorParams restrict the public key types validators + can use. + + NOTE: uses ABCI pubkey naming, not Amino names. + version: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. + description: >- + QueryParamsResponse defines the response type for querying + x/consensus parameters. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/distribution/v1beta1/community_pool: + get: + summary: CommunityPool queries the community pool coins. + operationId: CosmosDistributionV1Beta1CommunityPool + responses: + '200': + description: A successful response. + schema: + type: object + properties: + pool: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: pool defines community pool's coins. + description: >- + QueryCommunityPoolResponse is the response type for the + Query/CommunityPool + + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards: + get: + summary: |- + DelegationTotalRewards queries the total rewards accrued by a each + validator. + operationId: CosmosDistributionV1Beta1DelegationTotalRewards + responses: + '200': + description: A successful response. + schema: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + validator_address: + type: string + reward: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a + decimal amount. + + + NOTE: The amount field is an Dec which implements the + custom method + + signatures required by gogoproto. + description: |- + DelegationDelegatorReward represents the properties + of a delegator's delegation reward. + description: rewards defines all the rewards accrued by a delegator. + total: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: total defines the sum of all the rewards. + description: |- + QueryDelegationTotalRewardsResponse is the response type for the + Query/DelegationTotalRewards RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: delegator_address + description: delegator_address defines the delegator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}: + get: + summary: DelegationRewards queries the total rewards accrued by a delegation. + operationId: CosmosDistributionV1Beta1DelegationRewards + responses: + '200': + description: A successful response. + schema: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: rewards defines the rewards accrued by a delegation. + description: |- + QueryDelegationRewardsResponse is the response type for the + Query/DelegationRewards RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: delegator_address + description: delegator_address defines the delegator address to query for. + in: path + required: true + type: string + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/delegators/{delegator_address}/validators: + get: + summary: DelegatorValidators queries the validators of a delegator. + operationId: CosmosDistributionV1Beta1DelegatorValidators + responses: + '200': + description: A successful response. + schema: + type: object + properties: + validators: + type: array + items: + type: string + description: >- + validators defines the validators a delegator is delegating + for. + description: |- + QueryDelegatorValidatorsResponse is the response type for the + Query/DelegatorValidators RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: delegator_address + description: delegator_address defines the delegator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address: + get: + summary: DelegatorWithdrawAddress queries withdraw address of a delegator. + operationId: CosmosDistributionV1Beta1DelegatorWithdrawAddress + responses: + '200': + description: A successful response. + schema: + type: object + properties: + withdraw_address: + type: string + description: withdraw_address defines the delegator address to query for. + description: |- + QueryDelegatorWithdrawAddressResponse is the response type for the + Query/DelegatorWithdrawAddress RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: delegator_address + description: delegator_address defines the delegator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/params: + get: + summary: Params queries params of the distribution module. + operationId: CosmosDistributionV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + community_tax: + type: string + base_proposer_reward: + type: string + description: >- + Deprecated: The base_proposer_reward field is deprecated + and is no longer used + + in the x/distribution module's reward mechanism. + bonus_proposer_reward: + type: string + description: >- + Deprecated: The bonus_proposer_reward field is deprecated + and is no longer used + + in the x/distribution module's reward mechanism. + withdraw_addr_enabled: + type: boolean + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/distribution/v1beta1/validators/{validator_address}: + get: + summary: >- + ValidatorDistributionInfo queries validator commission and + self-delegation rewards for validator + operationId: CosmosDistributionV1Beta1ValidatorDistributionInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + operator_address: + type: string + description: operator_address defines the validator operator address. + self_bond_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: self_bond_rewards defines the self delegations rewards. + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: commission defines the commission the validator received. + description: >- + QueryValidatorDistributionInfoResponse is the response type for + the Query/ValidatorDistributionInfo RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/validators/{validator_address}/commission: + get: + summary: ValidatorCommission queries accumulated commission for a validator. + operationId: CosmosDistributionV1Beta1ValidatorCommission + responses: + '200': + description: A successful response. + schema: + type: object + properties: + commission: + description: commission defines the commission the validator received. + type: object + properties: + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a + decimal amount. + + + NOTE: The amount field is an Dec which implements the + custom method + + signatures required by gogoproto. + title: |- + QueryValidatorCommissionResponse is the response type for the + Query/ValidatorCommission RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards: + get: + summary: ValidatorOutstandingRewards queries rewards of a validator address. + operationId: CosmosDistributionV1Beta1ValidatorOutstandingRewards + responses: + '200': + description: A successful response. + schema: + type: object + properties: + rewards: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a + decimal amount. + + + NOTE: The amount field is an Dec which implements the + custom method + + signatures required by gogoproto. + description: >- + ValidatorOutstandingRewards represents outstanding + (un-withdrawn) rewards + + for a validator inexpensive to track, allows simple sanity + checks. + description: >- + QueryValidatorOutstandingRewardsResponse is the response type for + the + + Query/ValidatorOutstandingRewards RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/validators/{validator_address}/slashes: + get: + summary: ValidatorSlashes queries slash events of a validator. + operationId: CosmosDistributionV1Beta1ValidatorSlashes + responses: + '200': + description: A successful response. + schema: + type: object + properties: + slashes: + type: array + items: + type: object + properties: + validator_period: + type: string + format: uint64 + fraction: + type: string + description: >- + ValidatorSlashEvent represents a validator slash event. + + Height is implicit within the store key. + + This is needed to calculate appropriate amount of staking + tokens + + for delegations which are withdrawn after a slash has + occurred. + description: slashes defines the slashes the validator received. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryValidatorSlashesResponse is the response type for the + Query/ValidatorSlashes RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true + type: string + - name: starting_height + description: >- + starting_height defines the optional starting height to query the + slashes. + in: query + required: false + type: string + format: uint64 + - name: ending_height + description: >- + starting_height defines the optional ending height to query the + slashes. + in: query + required: false + type: string + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/evidence/v1beta1/evidence: + get: + summary: AllEvidence queries all evidence. + operationId: CosmosEvidenceV1Beta1AllEvidence + responses: + '200': + description: A successful response. + schema: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: evidence returns all evidences. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllEvidenceResponse is the response type for the + Query/AllEvidence RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/evidence/v1beta1/evidence/{hash}: + get: + summary: Evidence queries evidence based on evidence hash. + operationId: CosmosEvidenceV1Beta1Evidence + responses: + '200': + description: A successful response. + schema: + type: object + properties: + evidence: + description: evidence returns the requested evidence. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + QueryEvidenceResponse is the response type for the Query/Evidence + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: hash + description: |- + hash defines the evidence hash of the requested evidence. + + Since: cosmos-sdk 0.47 + in: path + required: true + type: string + - name: evidence_hash + description: |- + evidence_hash defines the hash of the requested evidence. + Deprecated: Use hash, a HEX encoded string, instead. + in: query + required: false + type: string + format: byte + tags: + - Query + /cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}: + get: + summary: Allowance returns fee granted to the grantee by the granter. + operationId: CosmosFeegrantV1Beta1Allowance + responses: + '200': + description: A successful response. + schema: + type: object + properties: + allowance: + description: allowance is a allowance granted for grantee by granter. + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance + of their funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an + allowance of another user's funds. + allowance: + description: >- + allowance can be any of basic, periodic, allowed fee + allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + title: >- + Grant is stored in the KVStore to record a grant with full + context + description: >- + QueryAllowanceResponse is the response type for the + Query/Allowance RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: granter + description: >- + granter is the address of the user granting an allowance of their + funds. + in: path + required: true + type: string + - name: grantee + description: >- + grantee is the address of the user being granted an allowance of + another user's funds. + in: path + required: true + type: string + tags: + - Query + /cosmos/feegrant/v1beta1/allowances/{grantee}: + get: + summary: Allowances returns all the grants for address. + operationId: CosmosFeegrantV1Beta1Allowances + responses: + '200': + description: A successful response. + schema: + type: object + properties: + allowances: + type: array + items: + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance + of their funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an + allowance of another user's funds. + allowance: + description: >- + allowance can be any of basic, periodic, allowed fee + allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + title: >- + Grant is stored in the KVStore to record a grant with full + context + description: allowances are allowance's granted for grantee by granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllowancesResponse is the response type for the + Query/Allowances RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: grantee + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/feegrant/v1beta1/issued/{granter}: + get: + summary: AllowancesByGranter returns all the grants given by an address + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosFeegrantV1Beta1AllowancesByGranter + responses: + '200': + description: A successful response. + schema: + type: object + properties: + allowances: + type: array + items: + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance + of their funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an + allowance of another user's funds. + allowance: + description: >- + allowance can be any of basic, periodic, allowed fee + allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + title: >- + Grant is stored in the KVStore to record a grant with full + context + description: allowances that have been issued by the granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllowancesByGranterResponse is the response type for the + Query/AllowancesByGranter RPC method. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: granter + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/gov/v1/params/{params_type}: + get: + summary: Params queries all parameters of the gov module. + operationId: CosmosGovV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + voting_params: + description: |- + Deprecated: Prefer to use `params` instead. + voting_params defines the parameters related to voting. + type: object + properties: + voting_period: + type: string + description: Duration of the voting period. + deposit_params: + description: |- + Deprecated: Prefer to use `params` instead. + deposit_params defines the parameters related to deposit. + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. + Initial value: 2 + + months. + tally_params: + description: |- + Deprecated: Prefer to use `params` instead. + tally_params defines the parameters related to tally. + type: object + properties: + quorum: + type: string + description: >- + Minimum percentage of total stake needed to vote for a + result to be + + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. + Default value: 0.5. + veto_threshold: + type: string + description: >- + Minimum value of Veto votes to Total votes ratio for + proposal to be + + vetoed. Default value: 1/3. + params: + description: |- + params defines all the paramaters of x/gov module. + + Since: cosmos-sdk 0.47 + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. + Initial value: 2 + + months. + voting_period: + type: string + description: Duration of the voting period. + quorum: + type: string + description: >- + Minimum percentage of total stake needed to vote for a + result to be + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. + Default value: 0.5. + veto_threshold: + type: string + description: >- + Minimum value of Veto votes to Total votes ratio for + proposal to be + vetoed. Default value: 1/3. + min_initial_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value + that must be paid at proposal submission. + burn_vote_quorum: + type: boolean + title: burn deposits if a proposal does not meet quorum + burn_proposal_deposit_prevote: + type: boolean + title: burn deposits if the proposal does not enter voting period + burn_vote_veto: + type: boolean + title: burn deposits if quorum with vote type no_veto is met + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: params_type + description: >- + params_type defines which parameters to query for, can be one of + "voting", + + "tallying" or "deposit". + in: path + required: true + type: string + tags: + - Query + /cosmos/gov/v1/proposals: + get: + summary: Proposals queries all proposals based on given status. + operationId: CosmosGovV1Proposals + responses: + '200': + description: A successful response. + schema: + type: object + properties: + proposals: + type: array + items: + type: object + properties: + id: + type: string + format: uint64 + description: id defines the unique id of the proposal. + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain + at least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should + be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, + for URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions + as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently + available in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods + of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL + and the unpack + + methods only use the fully qualified type name after + the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages are the arbitrary messages to be executed if + the proposal passes. + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the + proposal. When + + querying a proposal via gRPC, this field is not + populated until the + + proposal's voting period has ended. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: >- + abstain_count is the number of abstain votes on a + proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto + votes on a proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + metadata: + type: string + description: >- + metadata is any arbitrary metadata attached to the + proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter + description: >- + Proposal defines the core field members of a governance + proposal. + description: proposals defines all the requested governance proposals. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryProposalsResponse is the response type for the + Query/Proposals RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_status + description: |- + proposal_status defines the status of the proposals. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + period. + - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + period. + - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + passed. + - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + been rejected. + - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + failed. + in: query + required: false + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + - name: voter + description: voter defines the voter address for the proposals. + in: query + required: false + type: string + - name: depositor + description: depositor defines the deposit addresses from the proposals. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/gov/v1/proposals/{proposal_id}: + get: + summary: Proposal queries proposal details based on ProposalID. + operationId: CosmosGovV1Proposal + responses: + '200': + description: A successful response. + schema: + type: object + properties: + proposal: + description: proposal is the requested governance proposal. + type: object + properties: + id: + type: string + format: uint64 + description: id defines the unique id of the proposal. + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages are the arbitrary messages to be executed if the + proposal passes. + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the + proposal. When + + querying a proposal via gRPC, this field is not populated + until the + + proposal's voting period has ended. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: >- + abstain_count is the number of abstain votes on a + proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes + on a proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + metadata: + type: string + description: >- + metadata is any arbitrary metadata attached to the + proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter + description: >- + QueryProposalResponse is the response type for the Query/Proposal + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + tags: + - Query + /cosmos/gov/v1/proposals/{proposal_id}/deposits: + get: + summary: Deposits queries all deposits of a single proposal. + operationId: CosmosGovV1Deposits + responses: + '200': + description: A successful response. + schema: + type: object + properties: + deposits: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: >- + depositor defines the deposit addresses from the + proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + Deposit defines an amount deposited by an account address to + an active + + proposal. + description: deposits defines the requested deposits. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDepositsResponse is the response type for the Query/Deposits + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}: + get: + summary: >- + Deposit queries single deposit information based proposalID, + depositAddr. + operationId: CosmosGovV1Deposit + responses: + '200': + description: A successful response. + schema: + type: object + properties: + deposit: + description: deposit defines the requested deposit. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: >- + depositor defines the deposit addresses from the + proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + QueryDepositResponse is the response type for the Query/Deposit + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: depositor + description: depositor defines the deposit addresses from the proposals. + in: path + required: true + type: string + tags: + - Query + /cosmos/gov/v1/proposals/{proposal_id}/tally: + get: + summary: TallyResult queries the tally of a proposal vote. + operationId: CosmosGovV1TallyResult + responses: + '200': + description: A successful response. + schema: + type: object + properties: + tally: + description: tally defines the requested tally. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: >- + abstain_count is the number of abstain votes on a + proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes on + a proposal. + description: >- + QueryTallyResultResponse is the response type for the Query/Tally + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + tags: + - Query + /cosmos/gov/v1/proposals/{proposal_id}/votes: + get: + summary: Votes queries votes of a given proposal. + operationId: CosmosGovV1Votes + responses: + '200': + description: A successful response. + schema: + type: object + properties: + votes: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: >- + weight is the vote weight associated with the vote + option. + description: >- + WeightedVoteOption defines a unit of vote for vote + split. + description: options is the weighted vote options. + metadata: + type: string + description: >- + metadata is any arbitrary metadata to attached to the + vote. + description: >- + Vote defines a vote on a governance proposal. + + A Vote consists of a proposal ID, the voter, and the vote + option. + description: votes defines the queried votes. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryVotesResponse is the response type for the Query/Votes RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}: + get: + summary: Vote queries voted information based on proposalID, voterAddr. + operationId: CosmosGovV1Vote + responses: + '200': + description: A successful response. + schema: + type: object + properties: + vote: + description: vote defines the queried vote. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: >- + weight is the vote weight associated with the vote + option. + description: >- + WeightedVoteOption defines a unit of vote for vote + split. + description: options is the weighted vote options. + metadata: + type: string + description: >- + metadata is any arbitrary metadata to attached to the + vote. + description: >- + QueryVoteResponse is the response type for the Query/Vote RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: voter + description: voter defines the voter address for the proposals. + in: path + required: true + type: string + tags: + - Query + /cosmos/gov/v1beta1/params/{params_type}: + get: + summary: Params queries all parameters of the gov module. + operationId: CosmosGovV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + voting_params: + description: voting_params defines the parameters related to voting. + type: object + properties: + voting_period: + type: string + description: Duration of the voting period. + deposit_params: + description: deposit_params defines the parameters related to deposit. + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. + Initial value: 2 + + months. + tally_params: + description: tally_params defines the parameters related to tally. + type: object + properties: + quorum: + type: string + format: byte + description: >- + Minimum percentage of total stake needed to vote for a + result to be + + considered valid. + threshold: + type: string + format: byte + description: >- + Minimum proportion of Yes votes for proposal to pass. + Default value: 0.5. + veto_threshold: + type: string + format: byte + description: >- + Minimum value of Veto votes to Total votes ratio for + proposal to be + + vetoed. Default value: 1/3. + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: params_type + description: >- + params_type defines which parameters to query for, can be one of + "voting", + + "tallying" or "deposit". + in: path + required: true + type: string + tags: + - Query + /cosmos/gov/v1beta1/proposals: + get: + summary: Proposals queries all proposals based on given status. + operationId: CosmosGovV1Beta1Proposals + responses: + '200': + description: A successful response. + schema: + type: object + properties: + proposals: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + content: + description: content is the proposal's content. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the + proposal. When + + querying a proposal via gRPC, this field is not + populated until the + + proposal's voting period has ended. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: >- + abstain is the number of abstain votes on a + proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: >- + no_with_veto is the number of no with veto votes on + a proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + description: >- + Proposal defines the core field members of a governance + proposal. + description: proposals defines all the requested governance proposals. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryProposalsResponse is the response type for the + Query/Proposals RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_status + description: |- + proposal_status defines the status of the proposals. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + period. + - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + period. + - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + passed. + - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + been rejected. + - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + failed. + in: query + required: false + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + - name: voter + description: voter defines the voter address for the proposals. + in: query + required: false + type: string + - name: depositor + description: depositor defines the deposit addresses from the proposals. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/gov/v1beta1/proposals/{proposal_id}: + get: + summary: Proposal queries proposal details based on ProposalID. + operationId: CosmosGovV1Beta1Proposal + responses: + '200': + description: A successful response. + schema: + type: object + properties: + proposal: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + content: + description: content is the proposal's content. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the + proposal. When + + querying a proposal via gRPC, this field is not populated + until the + + proposal's voting period has ended. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + description: >- + Proposal defines the core field members of a governance + proposal. + description: >- + QueryProposalResponse is the response type for the Query/Proposal + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + tags: + - Query + /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits: + get: + summary: Deposits queries all deposits of a single proposal. + operationId: CosmosGovV1Beta1Deposits + responses: + '200': + description: A successful response. + schema: + type: object + properties: + deposits: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: >- + depositor defines the deposit addresses from the + proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + Deposit defines an amount deposited by an account address to + an active + + proposal. + description: deposits defines the requested deposits. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDepositsResponse is the response type for the Query/Deposits + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}: + get: + summary: >- + Deposit queries single deposit information based proposalID, + depositAddr. + operationId: CosmosGovV1Beta1Deposit + responses: + '200': + description: A successful response. + schema: + type: object + properties: + deposit: + description: deposit defines the requested deposit. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: >- + depositor defines the deposit addresses from the + proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + QueryDepositResponse is the response type for the Query/Deposit + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: depositor + description: depositor defines the deposit addresses from the proposals. + in: path + required: true + type: string + tags: + - Query + /cosmos/gov/v1beta1/proposals/{proposal_id}/tally: + get: + summary: TallyResult queries the tally of a proposal vote. + operationId: CosmosGovV1Beta1TallyResult + responses: + '200': + description: A successful response. + schema: + type: object + properties: + tally: + description: tally defines the requested tally. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. + description: >- + QueryTallyResultResponse is the response type for the Query/Tally + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + tags: + - Query + /cosmos/gov/v1beta1/proposals/{proposal_id}/votes: + get: + summary: Votes queries votes of a given proposal. + operationId: CosmosGovV1Beta1Votes + responses: + '200': + description: A successful response. + schema: + type: object + properties: + votes: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + option: + description: >- + Deprecated: Prefer to use `options` instead. This field + is set in queries + + if and only if `len(options) == 1` and that option has + weight 1. In all + + other cases, this field will default to + VOTE_OPTION_UNSPECIFIED. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: >- + weight is the vote weight associated with the vote + option. + description: >- + WeightedVoteOption defines a unit of vote for vote + split. + + + Since: cosmos-sdk 0.43 + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 + description: >- + Vote defines a vote on a governance proposal. + + A Vote consists of a proposal ID, the voter, and the vote + option. + description: votes defines the queried votes. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryVotesResponse is the response type for the Query/Votes RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}: + get: + summary: Vote queries voted information based on proposalID, voterAddr. + operationId: CosmosGovV1Beta1Vote + responses: + '200': + description: A successful response. + schema: + type: object + properties: + vote: + description: vote defines the queried vote. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + option: + description: >- + Deprecated: Prefer to use `options` instead. This field is + set in queries + + if and only if `len(options) == 1` and that option has + weight 1. In all + + other cases, this field will default to + VOTE_OPTION_UNSPECIFIED. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: >- + weight is the vote weight associated with the vote + option. + description: >- + WeightedVoteOption defines a unit of vote for vote + split. + + + Since: cosmos-sdk 0.43 + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 + description: >- + QueryVoteResponse is the response type for the Query/Vote RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: voter + description: voter defines the voter address for the proposals. + in: path + required: true + type: string + tags: + - Query + /cosmos/mint/v1beta1/annual_provisions: + get: + summary: AnnualProvisions current minting annual provisions value. + operationId: CosmosMintV1Beta1AnnualProvisions + responses: + '200': + description: A successful response. + schema: + type: object + properties: + annual_provisions: + type: string + format: byte + description: >- + annual_provisions is the current minting annual provisions + value. + description: |- + QueryAnnualProvisionsResponse is the response type for the + Query/AnnualProvisions RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/mint/v1beta1/inflation: + get: + summary: Inflation returns the current minting inflation value. + operationId: CosmosMintV1Beta1Inflation + responses: + '200': + description: A successful response. + schema: + type: object + properties: + inflation: + type: string + format: byte + description: inflation is the current minting inflation value. + description: >- + QueryInflationResponse is the response type for the + Query/Inflation RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/mint/v1beta1/params: + get: + summary: Params returns the total set of minting parameters. + operationId: CosmosMintV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + mint_denom: + type: string + title: type of coin to mint + inflation_rate_change: + type: string + title: maximum annual change in inflation rate + inflation_max: + type: string + title: maximum inflation rate + inflation_min: + type: string + title: minimum inflation rate + goal_bonded: + type: string + title: goal of percent bonded atoms + blocks_per_year: + type: string + format: uint64 + title: expected blocks per year + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/nft/v1beta1/balance/{owner}/{class_id}: + get: + summary: >- + Balance queries the number of NFTs of a given class owned by the owner, + same as balanceOf in ERC721 + operationId: CosmosNftV1Beta1Balance + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amount: + type: string + format: uint64 + title: >- + amount is the number of all NFTs of a given class owned by the + owner + title: >- + QueryBalanceResponse is the response type for the Query/Balance + RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: owner + description: owner is the owner address of the nft + in: path + required: true + type: string + - name: class_id + description: class_id associated with the nft + in: path + required: true + type: string + tags: + - Query + /cosmos/nft/v1beta1/classes: + get: + summary: Classes queries all NFT classes + operationId: CosmosNftV1Beta1Classes + responses: + '200': + description: A successful response. + schema: + type: object + properties: + classes: + type: array + items: + type: object + properties: + id: + type: string + title: >- + id defines the unique identifier of the NFT + classification, similar to the contract address of + ERC721 + name: + type: string + title: >- + name defines the human-readable name of the NFT + classification. Optional + symbol: + type: string + title: >- + symbol is an abbreviated name for nft classification. + Optional + description: + type: string + title: >- + description is a brief description of nft + classification. Optional + uri: + type: string + title: >- + uri for the class metadata stored off chain. It can + define schema for Class and NFT `Data` attributes. + Optional + uri_hash: + type: string + title: >- + uri_hash is a hash of the document pointed by uri. + Optional + data: + title: >- + data is the app specific metadata of the NFT class. + Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: Class defines the class of the nft type. + description: class defines the class of the nft type. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryClassesResponse is the response type for the Query/Classes + RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/nft/v1beta1/classes/{class_id}: + get: + summary: Class queries an NFT class based on its id + operationId: CosmosNftV1Beta1Class + responses: + '200': + description: A successful response. + schema: + type: object + properties: + class: + description: class defines the class of the nft type. + type: object + properties: + id: + type: string + title: >- + id defines the unique identifier of the NFT + classification, similar to the contract address of ERC721 + name: + type: string + title: >- + name defines the human-readable name of the NFT + classification. Optional + symbol: + type: string + title: >- + symbol is an abbreviated name for nft classification. + Optional + description: + type: string + title: >- + description is a brief description of nft classification. + Optional + uri: + type: string + title: >- + uri for the class metadata stored off chain. It can define + schema for Class and NFT `Data` attributes. Optional + uri_hash: + type: string + title: >- + uri_hash is a hash of the document pointed by uri. + Optional + data: + title: >- + data is the app specific metadata of the NFT class. + Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + QueryClassResponse is the response type for the Query/Class RPC + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: class_id + description: class_id associated with the nft + in: path + required: true + type: string + tags: + - Query + /cosmos/nft/v1beta1/nfts: + get: + summary: >- + NFTs queries all NFTs of a given class or owner,choose at least one of + the two, similar to tokenByIndex in + + ERC721Enumerable + operationId: CosmosNftV1Beta1NFTs + responses: + '200': + description: A successful response. + schema: + type: object + properties: + nfts: + type: array + items: + type: object + properties: + class_id: + type: string + title: >- + class_id associated with the NFT, similar to the + contract address of ERC721 + id: + type: string + title: id is a unique identifier of the NFT + uri: + type: string + title: uri for the NFT metadata stored off chain + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri + data: + title: data is an app specific data of the NFT. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: NFT defines the NFT. + title: NFT defines the NFT + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryNFTsResponse is the response type for the Query/NFTs RPC + methods + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: class_id + description: class_id associated with the nft + in: query + required: false + type: string + - name: owner + description: owner is the owner address of the nft + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/nft/v1beta1/nfts/{class_id}/{id}: + get: + summary: NFT queries an NFT based on its class and id. + operationId: CosmosNftV1Beta1NFT + responses: + '200': + description: A successful response. + schema: + type: object + properties: + nft: + title: owner is the owner address of the nft + type: object + properties: + class_id: + type: string + title: >- + class_id associated with the NFT, similar to the contract + address of ERC721 + id: + type: string + title: id is a unique identifier of the NFT + uri: + type: string + title: uri for the NFT metadata stored off chain + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri + data: + title: data is an app specific data of the NFT. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: NFT defines the NFT. + title: QueryNFTResponse is the response type for the Query/NFT RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: class_id + description: class_id associated with the nft + in: path + required: true + type: string + - name: id + description: id is a unique identifier of the NFT + in: path + required: true + type: string + tags: + - Query + /cosmos/nft/v1beta1/owner/{class_id}/{id}: + get: + summary: >- + Owner queries the owner of the NFT based on its class and id, same as + ownerOf in ERC721 + operationId: CosmosNftV1Beta1Owner + responses: + '200': + description: A successful response. + schema: + type: object + properties: + owner: + type: string + title: owner is the owner address of the nft + title: >- + QueryOwnerResponse is the response type for the Query/Owner RPC + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: class_id + description: class_id associated with the nft + in: path + required: true + type: string + - name: id + description: id is a unique identifier of the NFT + in: path + required: true + type: string + tags: + - Query + /cosmos/nft/v1beta1/supply/{class_id}: + get: + summary: >- + Supply queries the number of NFTs from the given class, same as + totalSupply of ERC721. + operationId: CosmosNftV1Beta1Supply + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amount: + type: string + format: uint64 + title: amount is the number of all NFTs from the given class + title: >- + QuerySupplyResponse is the response type for the Query/Supply RPC + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: class_id + description: class_id associated with the nft + in: path + required: true + type: string + tags: + - Query + /cosmos/params/v1beta1/params: + get: + summary: |- + Params queries a specific parameter of a module, given its subspace and + key. + operationId: CosmosParamsV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + param: + description: param defines the queried parameter. + type: object + properties: + subspace: + type: string + key: + type: string + value: + type: string + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: subspace + description: subspace defines the module to query the parameter for. + in: query + required: false + type: string + - name: key + description: key defines the key of the parameter in the subspace. + in: query + required: false + type: string + tags: + - Query + /cosmos/params/v1beta1/subspaces: + get: + summary: >- + Subspaces queries for all registered subspaces and all keys for a + subspace. + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosParamsV1Beta1Subspaces + responses: + '200': + description: A successful response. + schema: + type: object + properties: + subspaces: + type: array + items: + type: object + properties: + subspace: + type: string + keys: + type: array + items: + type: string + description: >- + Subspace defines a parameter subspace name and all the keys + that exist for + + the subspace. + + + Since: cosmos-sdk 0.46 + description: >- + QuerySubspacesResponse defines the response types for querying for + all + + registered subspaces and all keys for a subspace. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/slashing/v1beta1/params: + get: + summary: Params queries the parameters of slashing module + operationId: CosmosSlashingV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + type: object + properties: + signed_blocks_window: + type: string + format: int64 + min_signed_per_window: + type: string + format: byte + downtime_jail_duration: + type: string + slash_fraction_double_sign: + type: string + format: byte + slash_fraction_downtime: + type: string + format: byte + description: >- + Params represents the parameters used for by the slashing + module. + title: >- + QueryParamsResponse is the response type for the Query/Params RPC + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/slashing/v1beta1/signing_infos: + get: + summary: SigningInfos queries signing info of all validators + operationId: CosmosSlashingV1Beta1SigningInfos + responses: + '200': + description: A successful response. + schema: + type: object + properties: + info: + type: array + items: + type: object + properties: + address: + type: string + start_height: + type: string + format: int64 + title: >- + Height at which validator was first a candidate OR was + unjailed + index_offset: + type: string + format: int64 + description: >- + Index which is incremented each time the validator was a + bonded + + in a block and may have signed a precommit or not. This + in conjunction with the + + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time + description: >- + Timestamp until which the validator is jailed due to + liveness downtime. + tombstoned: + type: boolean + description: >- + Whether or not a validator has been tombstoned (killed + out of validator set). It is set + + once the validator commits an equivocation or for any + other configured misbehiavor. + missed_blocks_counter: + type: string + format: int64 + description: >- + A counter kept to avoid unnecessary array reads. + + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. + description: >- + ValidatorSigningInfo defines a validator's signing info for + monitoring their + + liveness activity. + title: info is the signing info of all validators + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: >- + QuerySigningInfosResponse is the response type for the + Query/SigningInfos RPC + + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/slashing/v1beta1/signing_infos/{cons_address}: + get: + summary: SigningInfo queries the signing info of given cons address + operationId: CosmosSlashingV1Beta1SigningInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + val_signing_info: + title: >- + val_signing_info is the signing info of requested val cons + address + type: object + properties: + address: + type: string + start_height: + type: string + format: int64 + title: >- + Height at which validator was first a candidate OR was + unjailed + index_offset: + type: string + format: int64 + description: >- + Index which is incremented each time the validator was a + bonded + + in a block and may have signed a precommit or not. This in + conjunction with the + + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time + description: >- + Timestamp until which the validator is jailed due to + liveness downtime. + tombstoned: + type: boolean + description: >- + Whether or not a validator has been tombstoned (killed out + of validator set). It is set + + once the validator commits an equivocation or for any + other configured misbehiavor. + missed_blocks_counter: + type: string + format: int64 + description: >- + A counter kept to avoid unnecessary array reads. + + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. + description: >- + ValidatorSigningInfo defines a validator's signing info for + monitoring their + + liveness activity. + title: >- + QuerySigningInfoResponse is the response type for the + Query/SigningInfo RPC + + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: cons_address + description: cons_address is the address to query signing info of + in: path + required: true + type: string + tags: + - Query + /cosmos/staking/v1beta1/delegations/{delegator_addr}: + get: + summary: >- + DelegatorDelegations queries all delegations of a given delegator + address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1DelegatorDelegations + responses: + '200': + description: A successful response. + schema: + type: object + properties: + delegation_responses: + type: array + items: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of + the delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of + the validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an + account. It is + + owned by one delegator, and is associated with the + voting power of one + + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that + it contains a + + balance in addition to shares which is more suitable for + client responses. + description: >- + delegation_responses defines all the delegations' info of a + delegator. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryDelegatorDelegationsResponse is response type for the + Query/DelegatorDelegations RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations: + get: + summary: Redelegations queries redelegations of given address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1Redelegations + responses: + '200': + description: A successful response. + schema: + type: object + properties: + redelegation_responses: + type: array + items: + type: object + properties: + redelegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of + the delegator. + validator_src_address: + type: string + description: >- + validator_src_address is the validator redelegation + source operator address. + validator_dst_address: + type: string + description: >- + validator_dst_address is the validator redelegation + destination operator address. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the + redelegation took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for + redelegation completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance + when redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of + destination-validator shares created by + redelegation. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding + has been stopped by external modules + description: >- + RedelegationEntry defines a redelegation object + with relevant metadata. + description: entries are the redelegation entries. + description: >- + Redelegation contains the list of a particular + delegator's redelegating bonds + + from a particular source validator to a particular + destination validator. + entries: + type: array + items: + type: object + properties: + redelegation_entry: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the + redelegation took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for + redelegation completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance + when redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of + destination-validator shares created by + redelegation. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding + has been stopped by external modules + description: >- + RedelegationEntry defines a redelegation object + with relevant metadata. + balance: + type: string + description: >- + RedelegationEntryResponse is equivalent to a + RedelegationEntry except that it + + contains a balance in addition to shares which is more + suitable for client + + responses. + description: >- + RedelegationResponse is equivalent to a Redelegation except + that its entries + + contain a balance in addition to shares which is more + suitable for client + + responses. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryRedelegationsResponse is response type for the + Query/Redelegations RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + - name: src_validator_addr + description: src_validator_addr defines the validator address to redelegate from. + in: query + required: false + type: string + - name: dst_validator_addr + description: dst_validator_addr defines the validator address to redelegate to. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations: + get: + summary: >- + DelegatorUnbondingDelegations queries all unbonding delegations of a + given + + delegator address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1DelegatorUnbondingDelegations + responses: + '200': + description: A successful response. + schema: + type: object + properties: + unbonding_responses: + type: array + items: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding + took place. + completion_time: + type: string + format: date-time + description: >- + completion_time is the unix time for unbonding + completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially + scheduled to receive at completion. + balance: + type: string + description: >- + balance defines the tokens to receive at + completion. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has + been stopped by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object + with relevant metadata. + description: entries are the unbonding delegation entries. + description: >- + UnbondingDelegation stores all of a single delegator's + unbonding bonds + + for a single validator in an time-ordered list. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryUnbondingDelegatorDelegationsResponse is response type for + the + + Query/UnbondingDelegatorDelegations RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/staking/v1beta1/delegators/{delegator_addr}/validators: + get: + summary: |- + DelegatorValidators queries all validators info for given delegator + address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1DelegatorValidators + responses: + '200': + description: A successful response. + schema: + type: object + properties: + validators: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed + from bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at + which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for + the validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission + rates to be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to + delegators, as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate + which validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily + increase of the validator commission, as a + fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + description: >- + Validator defines a validator, together with the total + amount of the + + Validator's bond shares and their exchange rate to coins. + Slashing results in + + a decrease in the exchange rate, allowing correct + calculation of future + + undelegations without iterating over delegators. When coins + are delegated to + + this validator, the validator is credited with a delegation + whose number of + + bond shares is based on the amount of coins delegated + divided by the current + + exchange rate. Voting power can be calculated as total + bonded shares + + multiplied by exchange rate. + description: validators defines the validators' info of a delegator. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryDelegatorValidatorsResponse is response type for the + Query/DelegatorValidators RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}: + get: + summary: |- + DelegatorValidator queries validator info for given delegator validator + pair. + operationId: CosmosStakingV1Beta1DelegatorValidator + responses: + '200': + description: A successful response. + schema: + type: object + properties: + validator: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from + bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at + which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates + to be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, + as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase + of the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + description: >- + Validator defines a validator, together with the total amount + of the + + Validator's bond shares and their exchange rate to coins. + Slashing results in + + a decrease in the exchange rate, allowing correct calculation + of future + + undelegations without iterating over delegators. When coins + are delegated to + + this validator, the validator is credited with a delegation + whose number of + + bond shares is based on the amount of coins delegated divided + by the current + + exchange rate. Voting power can be calculated as total bonded + shares + + multiplied by exchange rate. + description: |- + QueryDelegatorValidatorResponse response type for the + Query/DelegatorValidator RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + - name: validator_addr + description: validator_addr defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/staking/v1beta1/historical_info/{height}: + get: + summary: HistoricalInfo queries the historical info for given height. + operationId: CosmosStakingV1Beta1HistoricalInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + hist: + description: hist defines the historical info at the given height. + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + valset: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the + validator's operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must + contain at least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name + should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, + for URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message + definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup + results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently + available in the official + + protobuf release, and it is not used for type + URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol + buffer message along with a + + URL that describes the type of the serialized + message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods + of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will + by default use + + 'type.googleapis.com/full.type.name' as the type URL + and the unpack + + methods only use the fully qualified type name after + the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" + will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded + message, with an + + additional field `@type` which contains the type + URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to + the `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed + from bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature + (ex. UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height + at which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time + for the validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission + rates to be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to + delegators, as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate + which validator can ever charge, as a + fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily + increase of the validator commission, as a + fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate + was changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has + been stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + description: >- + Validator defines a validator, together with the total + amount of the + + Validator's bond shares and their exchange rate to + coins. Slashing results in + + a decrease in the exchange rate, allowing correct + calculation of future + + undelegations without iterating over delegators. When + coins are delegated to + + this validator, the validator is credited with a + delegation whose number of + + bond shares is based on the amount of coins delegated + divided by the current + + exchange rate. Voting power can be calculated as total + bonded shares + + multiplied by exchange rate. + description: >- + QueryHistoricalInfoResponse is response type for the + Query/HistoricalInfo RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: height + description: height defines at which height to query the historical info. + in: path + required: true + type: string + format: int64 + tags: + - Query + /cosmos/staking/v1beta1/params: + get: + summary: Parameters queries the staking parameters. + operationId: CosmosStakingV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + unbonding_time: + type: string + description: unbonding_time is the time duration of unbonding. + max_validators: + type: integer + format: int64 + description: max_validators is the maximum number of validators. + max_entries: + type: integer + format: int64 + description: >- + max_entries is the max entries for either unbonding + delegation or redelegation (per pair/trio). + historical_entries: + type: integer + format: int64 + description: >- + historical_entries is the number of historical entries to + persist. + bond_denom: + type: string + description: bond_denom defines the bondable coin denomination. + min_commission_rate: + type: string + title: >- + min_commission_rate is the chain-wide minimum commission + rate that a validator can charge their delegators + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /cosmos/staking/v1beta1/pool: + get: + summary: Pool queries the pool info. + operationId: CosmosStakingV1Beta1Pool + responses: + '200': + description: A successful response. + schema: + type: object + properties: + pool: + description: pool defines the pool info. + type: object + properties: + not_bonded_tokens: + type: string + bonded_tokens: + type: string + description: QueryPoolResponse is response type for the Query/Pool RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /cosmos/staking/v1beta1/validators: + get: + summary: Validators queries all validators that match the given status. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1Validators + responses: + '200': + description: A successful response. + schema: + type: object + properties: + validators: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed + from bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at + which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for + the validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission + rates to be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to + delegators, as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate + which validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily + increase of the validator commission, as a + fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + description: >- + Validator defines a validator, together with the total + amount of the + + Validator's bond shares and their exchange rate to coins. + Slashing results in + + a decrease in the exchange rate, allowing correct + calculation of future + + undelegations without iterating over delegators. When coins + are delegated to + + this validator, the validator is credited with a delegation + whose number of + + bond shares is based on the amount of coins delegated + divided by the current + + exchange rate. Voting power can be calculated as total + bonded shares + + multiplied by exchange rate. + description: validators contains all the queried validators. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryValidatorsResponse is response type for the Query/Validators + RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: status + description: status enables to query for validators matching a given status. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/staking/v1beta1/validators/{validator_addr}: + get: + summary: Validator queries validator info for given validator address. + operationId: CosmosStakingV1Beta1Validator + responses: + '200': + description: A successful response. + schema: + type: object + properties: + validator: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from + bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at + which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates + to be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, + as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase + of the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + description: >- + Validator defines a validator, together with the total amount + of the + + Validator's bond shares and their exchange rate to coins. + Slashing results in + + a decrease in the exchange rate, allowing correct calculation + of future + + undelegations without iterating over delegators. When coins + are delegated to + + this validator, the validator is credited with a delegation + whose number of + + bond shares is based on the amount of coins delegated divided + by the current + + exchange rate. Voting power can be calculated as total bonded + shares + + multiplied by exchange rate. + title: >- + QueryValidatorResponse is response type for the Query/Validator + RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: validator_addr + description: validator_addr defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/staking/v1beta1/validators/{validator_addr}/delegations: + get: + summary: ValidatorDelegations queries delegate info for given validator. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1ValidatorDelegations + responses: + '200': + description: A successful response. + schema: + type: object + properties: + delegation_responses: + type: array + items: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of + the delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of + the validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an + account. It is + + owned by one delegator, and is associated with the + voting power of one + + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that + it contains a + + balance in addition to shares which is more suitable for + client responses. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: |- + QueryValidatorDelegationsResponse is response type for the + Query/ValidatorDelegations RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: validator_addr + description: validator_addr defines the validator address to query for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}: + get: + summary: Delegation queries delegate info for given validator delegator pair. + operationId: CosmosStakingV1Beta1Delegation + responses: + '200': + description: A successful response. + schema: + type: object + properties: + delegation_response: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an + account. It is + + owned by one delegator, and is associated with the voting + power of one + + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that it + contains a + + balance in addition to shares which is more suitable for + client responses. + description: >- + QueryDelegationResponse is response type for the Query/Delegation + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: validator_addr + description: validator_addr defines the validator address to query for. + in: path + required: true + type: string + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation: + get: + summary: |- + UnbondingDelegation queries unbonding info for given validator delegator + pair. + operationId: CosmosStakingV1Beta1UnbondingDelegation + responses: + '200': + description: A successful response. + schema: + type: object + properties: + unbond: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding + took place. + completion_time: + type: string + format: date-time + description: >- + completion_time is the unix time for unbonding + completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially + scheduled to receive at completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object + with relevant metadata. + description: entries are the unbonding delegation entries. + description: >- + UnbondingDelegation stores all of a single delegator's + unbonding bonds + + for a single validator in an time-ordered list. + description: >- + QueryDelegationResponse is response type for the + Query/UnbondingDelegation + + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: validator_addr + description: validator_addr defines the validator address to query for. + in: path + required: true + type: string + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations: + get: + summary: >- + ValidatorUnbondingDelegations queries unbonding delegations of a + validator. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1ValidatorUnbondingDelegations + responses: + '200': + description: A successful response. + schema: + type: object + properties: + unbonding_responses: + type: array + items: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding + took place. + completion_time: + type: string + format: date-time + description: >- + completion_time is the unix time for unbonding + completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially + scheduled to receive at completion. + balance: + type: string + description: >- + balance defines the tokens to receive at + completion. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has + been stopped by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object + with relevant metadata. + description: entries are the unbonding delegation entries. + description: >- + UnbondingDelegation stores all of a single delegator's + unbonding bonds + + for a single validator in an time-ordered list. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryValidatorUnbondingDelegationsResponse is response type for + the + + Query/ValidatorUnbondingDelegations RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: validator_addr + description: validator_addr defines the validator address to query for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/tx/v1beta1/decode: + post: + summary: TxDecode decodes the transaction. + description: 'Since: cosmos-sdk 0.47' + operationId: CosmosTxV1Beta1TxDecode + responses: + '200': + description: A successful response. + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.TxDecodeResponse' + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + description: |- + TxDecodeRequest is the request type for the Service.TxDecode + RPC method. + + Since: cosmos-sdk 0.47 + in: body + required: true + schema: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + description: |- + TxDecodeRequest is the request type for the Service.TxDecode + RPC method. + + Since: cosmos-sdk 0.47 + tags: + - Service + /cosmos/tx/v1beta1/decode/amino: + post: + summary: TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. + description: 'Since: cosmos-sdk 0.47' + operationId: CosmosTxV1Beta1TxDecodeAmino + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amino_json: + type: string + description: >- + TxDecodeAminoResponse is the response type for the + Service.TxDecodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + description: >- + TxDecodeAminoRequest is the request type for the + Service.TxDecodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + in: body + required: true + schema: + type: object + properties: + amino_binary: + type: string + format: byte + description: >- + TxDecodeAminoRequest is the request type for the + Service.TxDecodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + tags: + - Service + /cosmos/tx/v1beta1/encode: + post: + summary: TxEncode encodes the transaction. + description: 'Since: cosmos-sdk 0.47' + operationId: CosmosTxV1Beta1TxEncode + responses: + '200': + description: A successful response. + schema: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the encoded transaction bytes. + description: |- + TxEncodeResponse is the response type for the + Service.TxEncode method. + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + description: |- + TxEncodeRequest is the request type for the Service.TxEncode + RPC method. + + Since: cosmos-sdk 0.47 + in: body + required: true + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.TxEncodeRequest' + tags: + - Service + /cosmos/tx/v1beta1/encode/amino: + post: + summary: TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. + description: 'Since: cosmos-sdk 0.47' + operationId: CosmosTxV1Beta1TxEncodeAmino + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amino_binary: + type: string + format: byte + description: >- + TxEncodeAminoResponse is the response type for the + Service.TxEncodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + description: >- + TxEncodeAminoRequest is the request type for the + Service.TxEncodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + in: body + required: true + schema: + type: object + properties: + amino_json: + type: string + description: >- + TxEncodeAminoRequest is the request type for the + Service.TxEncodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + tags: + - Service + /cosmos/tx/v1beta1/simulate: + post: + summary: Simulate simulates executing a transaction for estimating gas usage. + operationId: CosmosTxV1Beta1Simulate + responses: + '200': + description: A successful response. + schema: + type: object + properties: + gas_info: + description: gas_info is the information about gas used in the simulation. + type: object + properties: + gas_wanted: + type: string + format: uint64 + description: >- + GasWanted is the maximum units of work we allow this tx to + perform. + gas_used: + type: string + format: uint64 + description: GasUsed is the amount of gas actually consumed. + result: + description: result is the result of the simulation. + type: object + properties: + data: + type: string + format: byte + description: >- + Data is any data returned from message or handler + execution. It MUST be + + length prefixed in order to separate data from multiple + message executions. + + Deprecated. This field is still populated, but prefer + msg_response instead + + because it also contains the Msg response typeURL. + log: + type: string + description: >- + Log contains the log information from message or handler + execution. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, + associated with an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx + and ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events contains a slice of Event objects that were emitted + during message + + or handler execution. + msg_responses: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + msg_responses contains the Msg handler responses type + packed in Anys. + + + Since: cosmos-sdk 0.46 + description: |- + SimulateResponse is the response type for the + Service.SimulateRPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + description: |- + SimulateRequest is the request type for the Service.Simulate + RPC method. + in: body + required: true + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.SimulateRequest' + tags: + - Service + /cosmos/tx/v1beta1/txs: + get: + summary: GetTxsEvent fetches txs by event. + operationId: CosmosTxV1Beta1GetTxsEvent + responses: + '200': + description: A successful response. + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.GetTxsEventResponse' + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: events + description: events is the list of transaction event type. + in: query + required: false + type: array + items: + type: string + collectionFormat: multi + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + - name: order_by + description: |2- + - ORDER_BY_UNSPECIFIED: ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. + - ORDER_BY_ASC: ORDER_BY_ASC defines ascending order + - ORDER_BY_DESC: ORDER_BY_DESC defines descending order + in: query + required: false + type: string + enum: + - ORDER_BY_UNSPECIFIED + - ORDER_BY_ASC + - ORDER_BY_DESC + default: ORDER_BY_UNSPECIFIED + - name: page + description: >- + page is the page number to query, starts at 1. If not provided, will + default to first page. + in: query + required: false + type: string + format: uint64 + - name: limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + tags: + - Service + post: + summary: BroadcastTx broadcast transaction. + operationId: CosmosTxV1Beta1BroadcastTx + responses: + '200': + description: A successful response. + schema: + type: object + properties: + tx_response: + description: tx_response is the queried TxResponses. + type: object + properties: + height: + type: string + format: int64 + title: The block height + txhash: + type: string + description: The transaction hash. + codespace: + type: string + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. + data: + type: string + description: Result bytes, if any. + raw_log: + type: string + description: >- + The output of the application's logger (raw string). May + be + + non-deterministic. + logs: + type: array + items: + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where + the key and value are + + strings instead of raw bytes. + description: >- + StringEvent defines en Event object wrapper where + all the attributes + + contain key/value pairs that are strings instead + of raw bytes. + description: >- + Events contains a slice of Event objects that were + emitted during some + + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed + tx ABCI message log. + description: >- + The output of the application's logger (typed). May be + non-deterministic. + info: + type: string + description: Additional information. May be non-deterministic. + gas_wanted: + type: string + format: int64 + description: Amount of gas requested for transaction. + gas_used: + type: string + format: int64 + description: Amount of gas consumed by transaction. + tx: + description: The request transaction bytes. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + timestamp: + type: string + description: >- + Time of the previous block. For heights > 1, it's the + weighted median of + + the timestamps of the valid votes in the block.LastCommit. + For height == 1, + + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, + associated with an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx + and ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a + transaction. Note, + + these events include those emitted by processing all the + messages and those + + emitted from the ante. Whereas Logs contains the events, + with + + additional metadata, emitted only by processing the + messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: |- + BroadcastTxResponse is the response type for the + Service.BroadcastTx method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + description: >- + BroadcastTxRequest is the request type for the + Service.BroadcastTxRequest + + RPC method. + in: body + required: true + schema: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + mode: + type: string + enum: + - BROADCAST_MODE_UNSPECIFIED + - BROADCAST_MODE_BLOCK + - BROADCAST_MODE_SYNC + - BROADCAST_MODE_ASYNC + default: BROADCAST_MODE_UNSPECIFIED + description: >- + BroadcastMode specifies the broadcast mode for the + TxService.Broadcast RPC method. + + - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x + onwards. + - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + a CheckTx execution response only. + - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + immediately. + description: >- + BroadcastTxRequest is the request type for the + Service.BroadcastTxRequest + + RPC method. + tags: + - Service + /cosmos/tx/v1beta1/txs/block/{height}: + get: + summary: GetBlockWithTxs fetches a block with decoded txs. + description: 'Since: cosmos-sdk 0.45.2' + operationId: CosmosTxV1Beta1GetBlockWithTxs + responses: + '200': + description: A successful response. + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.GetBlockWithTxsResponse' + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: height + description: height is the height of the block to query. + in: path + required: true + type: string + format: int64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Service + /cosmos/tx/v1beta1/txs/{hash}: + get: + summary: GetTx fetches a tx by hash. + operationId: CosmosTxV1Beta1GetTx + responses: + '200': + description: A successful response. + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.GetTxResponse' + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: hash + description: hash is the tx hash to query, encoded as a hex string. + in: path + required: true + type: string + tags: + - Service + /cosmos/upgrade/v1beta1/applied_plan/{name}: + get: + summary: AppliedPlan queries a previously applied upgrade plan by its name. + operationId: CosmosUpgradeV1Beta1AppliedPlan + responses: + '200': + description: A successful response. + schema: + type: object + properties: + height: + type: string + format: int64 + description: height is the block height at which the plan was applied. + description: >- + QueryAppliedPlanResponse is the response type for the + Query/AppliedPlan RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: name + description: name is the name of the applied plan to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/upgrade/v1beta1/authority: + get: + summary: Returns the account with authority to conduct upgrades + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosUpgradeV1Beta1Authority + responses: + '200': + description: A successful response. + schema: + type: object + properties: + address: + type: string + description: 'Since: cosmos-sdk 0.46' + title: QueryAuthorityResponse is the response type for Query/Authority + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /cosmos/upgrade/v1beta1/current_plan: + get: + summary: CurrentPlan queries the current upgrade plan. + operationId: CosmosUpgradeV1Beta1CurrentPlan + responses: + '200': + description: A successful response. + schema: + type: object + properties: + plan: + description: plan is the current upgrade plan. + type: object + properties: + name: + type: string + description: >- + Sets the name for the upgrade. This name will be used by + the upgraded + + version of the software to apply any special "on-upgrade" + commands during + + the first BeginBlock method after the upgrade is applied. + It is also used + + to detect whether a software version can handle a given + upgrade. If no + + upgrade handler with this name has been set in the + software, it will be + + assumed that the software is out-of-date when the upgrade + Time or Height is + + reached and the software will exit. + time: + type: string + format: date-time + description: >- + Deprecated: Time based upgrades have been deprecated. Time + based upgrade logic + + has been removed from the SDK. + + If this field is not empty, an error will be thrown. + height: + type: string + format: int64 + description: The height at which the upgrade must be performed. + info: + type: string + title: >- + Any application specific upgrade info to be included + on-chain + + such as a git commit that validators could automatically + upgrade to + upgraded_client_state: + description: >- + Deprecated: UpgradedClientState field has been deprecated. + IBC upgrade logic has been + + moved to the IBC module in the sub module 02-client. + + If this field is not empty, an error will be thrown. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + QueryCurrentPlanResponse is the response type for the + Query/CurrentPlan RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /cosmos/upgrade/v1beta1/module_versions: + get: + summary: ModuleVersions queries the list of module versions from state. + description: 'Since: cosmos-sdk 0.43' + operationId: CosmosUpgradeV1Beta1ModuleVersions + responses: + '200': + description: A successful response. + schema: + type: object + properties: + module_versions: + type: array + items: + type: object + properties: + name: + type: string + title: name of the app module + version: + type: string + format: uint64 + title: consensus version of the app module + description: |- + ModuleVersion specifies a module and its consensus version. + + Since: cosmos-sdk 0.43 + description: >- + module_versions is a list of module names with their consensus + versions. + description: >- + QueryModuleVersionsResponse is the response type for the + Query/ModuleVersions + + RPC method. + + + Since: cosmos-sdk 0.43 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: module_name + description: |- + module_name is a field to query a specific module + consensus version from state. Leaving this empty will + fetch the full list of module versions from state + in: query + required: false + type: string + tags: + - Query + /cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}: + get: + summary: >- + UpgradedConsensusState queries the consensus state that will serve + + as a trusted kernel for the next version of this chain. It will only be + + stored at the last height of this chain. + + UpgradedConsensusState RPC not supported with legacy querier + + This rpc is deprecated now that IBC has its own replacement + + (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) + operationId: CosmosUpgradeV1Beta1UpgradedConsensusState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + upgraded_consensus_state: + type: string + format: byte + title: 'Since: cosmos-sdk 0.43' + description: >- + QueryUpgradedConsensusStateResponse is the response type for the + Query/UpgradedConsensusState + + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: last_height + description: |- + last height of the current chain must be sent in request + as this is the height under which next consensus state is stored + in: path + required: true + type: string + format: int64 + tags: + - Query + /evmos/feemarket/v1/base_fee: + get: + summary: BaseFee queries the base fee of the parent block of the current block. + operationId: EthermintFeemarketV1BaseFee + responses: + '200': + description: A successful response. + schema: + type: object + properties: + base_fee: + type: string + title: base_fee is the EIP1559 base fee + description: QueryBaseFeeResponse returns the EIP1559 base fee. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/feemarket/v1/block_gas: + get: + summary: BlockGas queries the gas used at a given block height + operationId: EthermintFeemarketV1BlockGas + responses: + '200': + description: A successful response. + schema: + type: object + properties: + gas: + type: string + format: int64 + title: gas is the returned block gas + description: QueryBlockGasResponse returns block gas used for a given height. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/feemarket/v1/params: + get: + summary: Params queries the parameters of x/feemarket module. + operationId: EthermintFeemarketV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params define the evm module parameters. + type: object + properties: + no_base_fee: + type: boolean + title: >- + no_base_fee forces the EIP-1559 base fee to 0 (needed for + 0 price calls) + base_fee_change_denominator: + type: integer + format: int64 + description: >- + base_fee_change_denominator bounds the amount the base fee + can change + + between blocks. + elasticity_multiplier: + type: integer + format: int64 + description: >- + elasticity_multiplier bounds the maximum gas limit an + EIP-1559 block may + + have. + enable_height: + type: string + format: int64 + description: >- + enable_height defines at which block height the base fee + calculation is enabled. + base_fee: + type: string + description: base_fee for EIP-1559 blocks. + min_gas_price: + type: string + title: >- + min_gas_price defines the minimum gas price value for + cosmos and eth transactions + min_gas_multiplier: + type: string + title: >- + min_gas_multiplier bounds the minimum gas used to be + charged + + to senders based on gas limit + title: Params defines the EVM module parameters + description: >- + QueryParamsResponse defines the response type for querying x/evm + parameters. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/claims/v1/claims_records: + get: + summary: ClaimsRecords returns all claims records + operationId: EvmosClaimsV1ClaimsRecords + responses: + '200': + description: A successful response. + schema: + type: object + properties: + claims: + type: array + items: + type: object + properties: + address: + type: string + title: address of claiming user in either bech32 or hex format + initial_claimable_amount: + type: string + title: initial_claimable_amount for the user + actions_completed: + type: array + items: + type: boolean + title: >- + actions_completed is a slice that describes which + actions were completed + description: >- + ClaimsRecordAddress is the claims metadata per address that + is used at + + Genesis. + title: claims defines all claims records + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryClaimsRecordsResponse is the response type for the + Query/ClaimsRecords + + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /evmos/claims/v1/claims_records/{address}: + get: + summary: ClaimsRecord returns the claims record for a given address + operationId: EvmosClaimsV1ClaimsRecord + responses: + '200': + description: A successful response. + schema: + type: object + properties: + initial_claimable_amount: + type: string + title: initial_claimable_amount of the user + claims: + type: array + items: + type: object + properties: + action: + title: action enum + type: string + enum: + - ACTION_UNSPECIFIED + - ACTION_VOTE + - ACTION_DELEGATE + - ACTION_EVM + - ACTION_IBC_TRANSFER + default: ACTION_UNSPECIFIED + description: >- + Action defines the list of available actions to claim + the airdrop tokens. + + - ACTION_UNSPECIFIED: ACTION_UNSPECIFIED defines an invalid action. + - ACTION_VOTE: ACTION_VOTE defines a proposal vote. + - ACTION_DELEGATE: ACTION_DELEGATE defines an staking delegation. + - ACTION_EVM: ACTION_EVM defines an EVM transaction. + - ACTION_IBC_TRANSFER: ACTION_IBC_TRANSFER defines a fungible token transfer transaction via IBC. + completed: + type: boolean + title: completed is true if the action has been completed + claimable_amount: + type: string + title: >- + claimable_amount of tokens for the action. Zero if + completed + description: >- + Claim defines the action, completed flag and the remaining + claimable amount + + for a given user. This is only used during client queries. + title: claims of the user + description: >- + QueryClaimsRecordResponse is the response type for the + Query/ClaimsRecord RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: address + description: address defines the user to query claims record for + in: path + required: true + type: string + tags: + - Query + /evmos/claims/v1/params: + get: + summary: Params returns the claims module parameters + operationId: EvmosClaimsV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + enable_claims: + type: boolean + title: >- + enable_claims is the parameter to enable the claiming + process + airdrop_start_time: + type: string + format: date-time + title: >- + airdrop_start_time defines the timestamp of the airdrop + start + duration_until_decay: + type: string + title: duration_until_decay of claimable tokens begin + duration_of_decay: + type: string + title: duration_of_decay for token claim decay period + claims_denom: + type: string + title: claims_denom is the denomination of the claimable coin + authorized_channels: + type: array + items: + type: string + description: >- + authorized_channels is the list of authorized channel + identifiers that can perform address + + attestations via IBC. + evm_channels: + type: array + items: + type: string + title: >- + evm_channels is the list of channel identifiers from EVM + compatible chains + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/claims/v1/total_unclaimed: + get: + summary: TotalUnclaimed queries the total unclaimed tokens from the airdrop + operationId: EvmosClaimsV1TotalUnclaimed + responses: + '200': + description: A successful response. + schema: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: coins defines the unclaimed coins + description: >- + QueryTotalUnclaimedResponse is the response type for the + Query/TotalUnclaimed + + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/epochs/v1/current_epoch: + get: + summary: CurrentEpoch provide current epoch of specified identifier + operationId: EvmosEpochsV1CurrentEpoch + responses: + '200': + description: A successful response. + schema: + type: object + properties: + current_epoch: + type: string + format: int64 + title: current_epoch is the number of the current epoch + description: >- + QueryCurrentEpochResponse is the response type for the + Query/EpochInfos RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: identifier + description: identifier of the current epoch + in: query + required: false + type: string + tags: + - Query + /evmos/epochs/v1/epochs: + get: + summary: EpochInfos provide running epochInfos + operationId: EvmosEpochsV1EpochInfos + responses: + '200': + description: A successful response. + schema: + type: object + properties: + epochs: + type: array + items: + type: object + properties: + identifier: + type: string + title: identifier of the epoch + start_time: + type: string + format: date-time + title: start_time of the epoch + duration: + type: string + title: duration of the epoch + current_epoch: + type: string + format: int64 + title: current_epoch is the integer identifier of the epoch + current_epoch_start_time: + type: string + format: date-time + title: >- + current_epoch_start_time defines the timestamp of the + start of the epoch + epoch_counting_started: + type: boolean + title: >- + epoch_counting_started reflects if the counting for the + epoch has started + current_epoch_start_height: + type: string + format: int64 + title: current_epoch_start_height of the epoch + description: >- + EpochInfo defines the message interface containing the + relevant informations about + + an epoch. + title: epochs is a slice of all EpochInfos + pagination: + description: pagination defines an optional pagination for the request. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryEpochsInfoResponse is the response type for the + Query/EpochInfos RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /evmos/erc20/v1/params: + get: + summary: Params retrieves the erc20 module params + operationId: EvmosErc20V1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + title: params are the erc20 module parameters + type: object + properties: + enable_erc20: + type: boolean + description: >- + enable_erc20 is the parameter to enable the conversion of + Cosmos coins <--> ERC20 tokens. + enable_evm_hook: + type: boolean + description: >- + enable_evm_hook is the parameter to enable the EVM hook + that converts an ERC20 token to a Cosmos + + Coin by transferring the Tokens through a MsgEthereumTx to + the ModuleAddress Ethereum address. + description: |- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/erc20/v1/token_pairs: + get: + summary: TokenPairs retrieves registered token pairs + operationId: EvmosErc20V1TokenPairs + responses: + '200': + description: A successful response. + schema: + type: object + properties: + token_pairs: + type: array + items: + type: object + properties: + erc20_address: + type: string + title: erc20_address is the hex address of ERC20 contract token + denom: + type: string + title: >- + denom defines the cosmos base denomination to be mapped + to + enabled: + type: boolean + title: enabled defines the token mapping enable status + contract_owner: + title: >- + contract_owner is the an ENUM specifying the type of + ERC20 owner (0 invalid, 1 ModuleAccount, 2 external + address) + type: string + enum: + - OWNER_UNSPECIFIED + - OWNER_MODULE + - OWNER_EXTERNAL + default: OWNER_UNSPECIFIED + description: |- + Owner enumerates the ownership of a ERC20 contract. + + - OWNER_UNSPECIFIED: OWNER_UNSPECIFIED defines an invalid/undefined owner. + - OWNER_MODULE: OWNER_MODULE - erc20 is owned by the erc20 module account. + - OWNER_EXTERNAL: OWNER_EXTERNAL - erc20 is owned by an external account. + description: >- + TokenPair defines an instance that records a pairing + consisting of a native + + Cosmos Coin and an ERC20 token address. + title: >- + token_pairs is a slice of registered token pairs for the erc20 + module + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryTokenPairsResponse is the response type for the + Query/TokenPairs RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /evmos/erc20/v1/token_pairs/{token}: + get: + summary: TokenPair retrieves a registered token pair + operationId: EvmosErc20V1TokenPair + responses: + '200': + description: A successful response. + schema: + type: object + properties: + token_pair: + type: object + properties: + erc20_address: + type: string + title: erc20_address is the hex address of ERC20 contract token + denom: + type: string + title: denom defines the cosmos base denomination to be mapped to + enabled: + type: boolean + title: enabled defines the token mapping enable status + contract_owner: + title: >- + contract_owner is the an ENUM specifying the type of ERC20 + owner (0 invalid, 1 ModuleAccount, 2 external address) + type: string + enum: + - OWNER_UNSPECIFIED + - OWNER_MODULE + - OWNER_EXTERNAL + default: OWNER_UNSPECIFIED + description: |- + Owner enumerates the ownership of a ERC20 contract. + + - OWNER_UNSPECIFIED: OWNER_UNSPECIFIED defines an invalid/undefined owner. + - OWNER_MODULE: OWNER_MODULE - erc20 is owned by the erc20 module account. + - OWNER_EXTERNAL: OWNER_EXTERNAL - erc20 is owned by an external account. + description: >- + TokenPair defines an instance that records a pairing + consisting of a native + + Cosmos Coin and an ERC20 token address. + title: >- + token_pairs returns the info about a registered token pair for + the erc20 module + description: >- + QueryTokenPairResponse is the response type for the + Query/TokenPair RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: token + description: >- + token identifier can be either the hex contract address of the ERC20 + or the + + Cosmos base denomination + in: path + required: true + type: string + tags: + - Query + /evmos/erc20/v1/tx/convert_coin: + get: + summary: |- + ConvertCoin mints a ERC20 representation of the native Cosmos coin denom + that is registered on the token mapping. + operationId: EvmosErc20V1ConvertCoin + responses: + '200': + description: A successful response. + schema: + type: object + title: MsgConvertCoinResponse returns no fields + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: coin.denom + in: query + required: false + type: string + - name: coin.amount + in: query + required: false + type: string + - name: receiver + description: receiver is the hex address to receive ERC20 token + in: query + required: false + type: string + - name: sender + description: >- + sender is the cosmos bech32 address from the owner of the given + Cosmos coins + in: query + required: false + type: string + tags: + - Msg + /evmos/erc20/v1/tx/convert_erc20: + get: + summary: >- + ConvertERC20 mints a native Cosmos coin representation of the ERC20 + token + + contract that is registered on the token mapping. + operationId: EvmosErc20V1ConvertERC20 + responses: + '200': + description: A successful response. + schema: + type: object + title: MsgConvertERC20Response returns no fields + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: contract_address + description: >- + contract_address of an ERC20 token contract, that is registered in a + token pair + in: query + required: false + type: string + - name: amount + description: amount of ERC20 tokens to convert + in: query + required: false + type: string + - name: receiver + description: receiver is the bech32 address to receive native Cosmos coins + in: query + required: false + type: string + - name: sender + description: sender is the hex address from the owner of the given ERC20 tokens + in: query + required: false + type: string + tags: + - Msg + /evmos/incentives/v1/allocation_meters: + get: + summary: |- + AllocationMeters retrieves active allocation meters for a given + denomination + operationId: EvmosIncentivesV1AllocationMeters + responses: + '200': + description: A successful response. + schema: + type: object + properties: + allocation_meters: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + title: allocation_meters is a slice of all allocations + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryAllocationMetersResponse is the response type for the + Query/AllocationMeters RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /evmos/incentives/v1/allocation_meters/{denom}: + get: + summary: AllocationMeter retrieves a active gas meter + operationId: EvmosIncentivesV1AllocationMeter + responses: + '200': + description: A successful response. + schema: + type: object + properties: + allocation_meter: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + title: allocation_meter defines the allocation of the queried denom + description: |- + QueryAllocationMeterResponse is the response type for the + Query/AllocationMeter RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: denom + description: denom is the coin denom to query an allocation meter for. + in: path + required: true + type: string + tags: + - Query + /evmos/incentives/v1/gas_meters/{contract}: + get: + summary: GasMeters retrieves active gas meters for a given contract + operationId: EvmosIncentivesV1GasMeters + responses: + '200': + description: A successful response. + schema: + type: object + properties: + gas_meters: + type: array + items: + type: object + properties: + contract: + type: string + title: >- + contract is the hex address of the incentivized smart + contract + participant: + type: string + title: participant address that interacts with the incentive + cumulative_gas: + type: string + format: uint64 + title: cumulative_gas spent during the epoch + title: >- + GasMeter tracks the cumulative gas spent per participant in + one epoch + title: >- + gas_meters is a slice of the gas meters for an incentivized + smart contract + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGasMetersResponse is the response type for the + Query/Incentives RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: contract + description: >- + contract is the hex contract address of a incentivized smart + contract + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /evmos/incentives/v1/gas_meters/{contract}/{participant}: + get: + summary: GasMeter retrieves a active gas meter + operationId: EvmosIncentivesV1GasMeter + responses: + '200': + description: A successful response. + schema: + type: object + properties: + gas_meter: + type: string + format: uint64 + title: >- + gas_meter is a gas meter for one participant on an + incentivized smart contract + description: >- + QueryGasMeterResponse is the response type for the Query/Incentive + RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: contract + description: contract is the hex contract address of a contract + in: path + required: true + type: string + - name: participant + description: participant is the hex address of a user + in: path + required: true + type: string + tags: + - Query + /evmos/incentives/v1/incentives: + get: + summary: Incentives retrieves registered incentives + operationId: EvmosIncentivesV1Incentives + responses: + '200': + description: A successful response. + schema: + type: object + properties: + incentives: + type: array + items: + type: object + properties: + contract: + type: string + title: >- + contract address of the smart contract to be + incentivized + allocations: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a + decimal amount. + + + NOTE: The amount field is an Dec which implements the + custom method + + signatures required by gogoproto. + title: >- + allocations is a slice of denoms and percentages of + rewards to be allocated + epochs: + type: integer + format: int64 + title: >- + epochs defines the number of remaining epochs for the + incentive + start_time: + type: string + format: date-time + title: start_time of the incentive distribution + total_gas: + type: string + format: uint64 + title: >- + total_gas is the cumulative gas spent by all gas meters + of the incentive during the epoch + title: >- + Incentive defines an instance that organizes distribution + conditions for a + + given smart contract + title: incentives is a slice of all incentives + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryIncentivesResponse is the response type for the + Query/Incentives RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /evmos/incentives/v1/incentives/{contract}: + get: + summary: Incentive retrieves a registered incentive + operationId: EvmosIncentivesV1Incentive + responses: + '200': + description: A successful response. + schema: + type: object + properties: + incentive: + type: object + properties: + contract: + type: string + title: contract address of the smart contract to be incentivized + allocations: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a + decimal amount. + + + NOTE: The amount field is an Dec which implements the + custom method + + signatures required by gogoproto. + title: >- + allocations is a slice of denoms and percentages of + rewards to be allocated + epochs: + type: integer + format: int64 + title: >- + epochs defines the number of remaining epochs for the + incentive + start_time: + type: string + format: date-time + title: start_time of the incentive distribution + total_gas: + type: string + format: uint64 + title: >- + total_gas is the cumulative gas spent by all gas meters of + the incentive during the epoch + title: >- + Incentive defines an instance that organizes distribution + conditions for a + + given smart contract + description: >- + QueryIncentiveResponse is the response type for the + Query/Incentive RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: contract + description: >- + contract is the hex contract address of a incentivized smart + contract + in: path + required: true + type: string + tags: + - Query + /evmos/incentives/v1/params: + get: + summary: Params retrieves the incentives module params + operationId: EvmosIncentivesV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + title: params are the incentives module parameters + type: object + properties: + enable_incentives: + type: boolean + title: enable_incentives is the parameter to enable incentives + allocation_limit: + type: string + title: >- + allocation_limit is the maximum percentage an incentive + can allocate per denomination + incentives_epoch_identifier: + type: string + title: incentives_epoch_identifier for the epochs module hooks + reward_scaler: + type: string + title: reward_scaler is the scaling factor for capping rewards + description: |- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/inflation/v1/circulating_supply: + get: + summary: |- + CirculatingSupply retrieves the total number of tokens that are in + circulation (i.e. excluding unvested tokens). + operationId: EvmosInflationV1CirculatingSupply + responses: + '200': + description: A successful response. + schema: + type: object + properties: + circulating_supply: + title: circulating_supply is the total amount of coins in circulation + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: |- + QueryCirculatingSupplyResponse is the response type for the + Query/CirculatingSupply RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/inflation/v1/epoch_mint_provision: + get: + summary: EpochMintProvision retrieves current minting epoch provision value. + operationId: EvmosInflationV1EpochMintProvision + responses: + '200': + description: A successful response. + schema: + type: object + properties: + epoch_mint_provision: + description: >- + epoch_mint_provision is the current minting per epoch + provision value. + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + QueryEpochMintProvisionResponse is the response type for the + Query/EpochMintProvision RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/inflation/v1/inflation_rate: + get: + summary: InflationRate retrieves the inflation rate of the current period. + operationId: EvmosInflationV1InflationRate + responses: + '200': + description: A successful response. + schema: + type: object + properties: + inflation_rate: + type: string + title: >- + inflation_rate by which the total supply increases within one + period + description: >- + QueryInflationRateResponse is the response type for the + Query/InflationRate + + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/inflation/v1/params: + get: + summary: Params retrieves the total set of minting parameters. + operationId: EvmosInflationV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + mint_denom: + type: string + title: mint_denom specifies the type of coin to mint + exponential_calculation: + title: >- + exponential_calculation takes in the variables to + calculate exponential inflation + type: object + properties: + a: + type: string + title: a defines the initial value + r: + type: string + title: r defines the reduction factor + c: + type: string + title: c defines the parameter for long term inflation + bonding_target: + type: string + title: bonding_target + max_variance: + type: string + title: max_variance + inflation_distribution: + title: inflation_distribution of the minted denom + type: object + properties: + staking_rewards: + type: string + title: >- + staking_rewards defines the proportion of the minted + minted_denom that is + + to be allocated as staking rewards + usage_incentives: + type: string + title: >- + usage_incentives defines the proportion of the minted + minted_denom that is + + to be allocated to the incentives module address + community_pool: + type: string + title: >- + community_pool defines the proportion of the minted + minted_denom that is to + + be allocated to the community pool + enable_inflation: + type: boolean + title: >- + enable_inflation is the parameter that enables inflation + and halts increasing the skipped_epochs + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/inflation/v1/period: + get: + summary: Period retrieves current period. + operationId: EvmosInflationV1Period + responses: + '200': + description: A successful response. + schema: + type: object + properties: + period: + type: string + format: uint64 + description: period is the current minting per epoch provision value. + description: >- + QueryPeriodResponse is the response type for the Query/Period RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/inflation/v1/skipped_epochs: + get: + summary: SkippedEpochs retrieves the total number of skipped epochs. + operationId: EvmosInflationV1SkippedEpochs + responses: + '200': + description: A successful response. + schema: + type: object + properties: + skipped_epochs: + type: string + format: uint64 + description: >- + skipped_epochs is the number of epochs that the inflation + module has been disabled. + description: >- + QuerySkippedEpochsResponse is the response type for the + Query/SkippedEpochs + + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/recovery/v1/params: + get: + summary: Params retrieves the total set of recovery parameters. + operationId: EvmosRecoveryV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + enable_recovery: + type: boolean + title: enable_recovery IBC middleware + packet_timeout_duration: + type: string + title: >- + packet_timeout_duration is the duration added to timeout + timestamp for balances recovered via IBC packets + title: Params holds parameters for the recovery module + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/vesting/v2/balances/{address}: + get: + summary: >- + Balances retrieves the unvested, vested and locked tokens for a vesting + account + operationId: EvmosVestingV2Balances + responses: + '200': + description: A successful response. + schema: + type: object + properties: + locked: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: locked defines the current amount of locked tokens + unvested: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: unvested defines the current amount of unvested tokens + vested: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: vested defines the current amount of vested tokens + description: >- + QueryBalancesResponse is the response type for the Query/Balances + RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: address + description: address of the clawback vesting account + in: path + required: true + type: string + tags: + - Query + /evmos/vesting/v2/tx/clawback: + get: + summary: Clawback removes the unvested tokens from a ClawbackVestingAccount. + operationId: EvmosVestingV2Clawback + responses: + '200': + description: A successful response. + schema: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: coins is the slice of clawed back coins + description: MsgClawbackResponse defines the MsgClawback response type. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: funder_address + description: funder_address is the address which funded the account + in: query + required: false + type: string + - name: account_address + description: >- + account_address is the address of the ClawbackVestingAccount to claw + back + + from. + in: query + required: false + type: string + - name: dest_address + description: >- + dest_address specifies where the clawed-back tokens should be + transferred + + to. If empty, the tokens will be transferred back to the original + funder of + + the account. + in: query + required: false + type: string + tags: + - Msg + /evmos/vesting/v2/tx/convert_vesting_account: + get: + summary: >- + ConvertVestingAccount converts a ClawbackVestingAccount to an Eth + account + operationId: EvmosVestingV2ConvertVestingAccount + responses: + '200': + description: A successful response. + schema: + type: object + description: >- + MsgConvertVestingAccountResponse defines the + MsgConvertVestingAccount response type. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: vesting_address + description: vesting_address is the address of the vesting account to convert + in: query + required: false + type: string + tags: + - Msg + /evmos/vesting/v2/tx/create_clawback_vesting_account: + get: + summary: >- + CreateClawbackVestingAccount creats a vesting account that is subject to + clawback. + operationId: EvmosVestingV2CreateClawbackVestingAccount + responses: + '200': + description: A successful response. + schema: + type: object + description: |- + MsgCreateClawbackVestingAccountResponse defines the + MsgCreateClawbackVestingAccount response type. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: funder_address + description: >- + funder_address specifies the account that will be able to fund the + vesting account + in: query + required: false + type: string + - name: vesting_address + description: >- + vesting_address specifies the address that will receive the vesting + tokens + in: query + required: false + type: string + - name: enable_gov_clawback + description: >- + enable_gov_clawback specifies whether the governance module can + clawback this account + in: query + required: false + type: boolean + tags: + - Msg + /evmos/vesting/v2/tx/fund_vesting_account: + get: + summary: |- + FundVestingAccount funds an existing ClawbackVestingAccount with tokens + according to the vesting and lockup schedules. + operationId: EvmosVestingV2FundVestingAccount + responses: + '200': + description: A successful response. + schema: + type: object + description: |- + MsgFundVestingAccountResponse defines the + MsgFundVestingAccount response type. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: funder_address + description: funder_address specifies the account that funds the vesting account + in: query + required: false + type: string + - name: vesting_address + description: vesting_address specifies the account that receives the funds + in: query + required: false + type: string + - name: start_time + description: start_time defines the time at which the vesting period begins + in: query + required: false + type: string + format: date-time + tags: + - Msg + /evmos/vesting/v2/tx/update_vesting_funder: + get: + summary: |- + UpdateVestingFunder updates the funder address of an existing + ClawbackVestingAccount. + operationId: EvmosVestingV2UpdateVestingFunder + responses: + '200': + description: A successful response. + schema: + type: object + description: >- + MsgUpdateVestingFunderResponse defines the MsgUpdateVestingFunder + response + + type. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: funder_address + description: >- + funder_address is the current funder address of the + ClawbackVestingAccount + in: query + required: false + type: string + - name: new_funder_address + description: >- + new_funder_address is the new address to replace the existing + funder_address + in: query + required: false + type: string + - name: vesting_address + description: >- + vesting_address is the address of the ClawbackVestingAccount being + updated + in: query + required: false + type: string + tags: + - Msg + /exocore/delegation/v1/GetDelegationInfo: + get: + summary: Balance queries the balance of a single coin for a single account. + operationId: ExocoreDelegationV1QueryDelegationInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + TotalDelegatedAmount: + type: string + delegationInfos: + type: object + additionalProperties: + type: object + properties: + CanUndelegationAmount: + type: string + WaitUndelegationAmount: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: stakerID + in: query + required: false + type: string + - name: assetID + in: query + required: false + type: string + tags: + - Query + /exocore/delegation/v1/GetOperatorInfo: + get: + operationId: ExocoreDelegationV1QueryOperatorInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + EarningsAddr: + type: string + ApproveAddr: + type: string + OperatorMetaInfo: + type: string + ClientChainEarningsAddr: + type: object + properties: + EarningInfoList: + type: array + items: + type: object + properties: + lzClientChainID: + type: string + format: uint64 + clientChainEarningAddr: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: OperatorAddr + in: query + required: false + type: string + tags: + - Query + /exocore/delegation/v1/QuerySingleDelegationInfo: + get: + operationId: ExocoreDelegationV1QuerySingleDelegationInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + CanUndelegationAmount: + type: string + WaitUndelegationAmount: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: stakerID + in: query + required: false + type: string + - name: operatorAddr + in: query + required: false + type: string + - name: assetID + in: query + required: false + type: string + tags: + - Query + /exocore/deposit/v1/Params: + get: + summary: Params retrieves the deposit module params + operationId: ExocoreDepositV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: >- + GenesisState defines the restaking_assets_manage module's + genesis state. + description: |- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /ExocoreNetwork/exocore/oracle/params: + get: + summary: Parameters queries the parameters of the module. + operationId: ExocoreOracleParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /exocore/restaking_assets_manage/v1/QueAllClientChainInfo: + get: + operationId: ExocoreRestakingAssetsManageV1QueAllClientChainInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + allClientChainInfos: + type: object + additionalProperties: + type: object + properties: + Name: + type: string + MetaInfo: + type: string + ChainId: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + FinalizationBlocks: + type: string + format: uint64 + LayerZeroChainID: + type: string + format: uint64 + SignatureType: + type: string + AddressLength: + type: integer + format: int64 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /exocore/restaking_assets_manage/v1/QueAllStakingAssetsInfo: + get: + operationId: ExocoreRestakingAssetsManageV1QueAllStakingAssetsInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + allStakingAssetsInfo: + type: object + additionalProperties: + type: object + properties: + AssetBasicInfo: + type: object + properties: + Name: + type: string + Symbol: + type: string + Address: + type: string + Decimals: + type: integer + format: int64 + TotalSupply: + type: string + LayerZeroChainID: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + MetaInfo: + type: string + StakingTotalAmount: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /exocore/restaking_assets_manage/v1/QueClientChainInfoByIndex: + get: + summary: Balance queries the balance of a single coin for a single account. + operationId: ExocoreRestakingAssetsManageV1QueClientChainInfoByIndex + responses: + '200': + description: A successful response. + schema: + type: object + properties: + Name: + type: string + MetaInfo: + type: string + ChainId: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + FinalizationBlocks: + type: string + format: uint64 + LayerZeroChainID: + type: string + format: uint64 + SignatureType: + type: string + AddressLength: + type: integer + format: int64 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: chainIndex + in: query + required: false + type: string + format: uint64 + tags: + - Query + /exocore/restaking_assets_manage/v1/QueOperatorAssetInfos: + get: + operationId: ExocoreRestakingAssetsManageV1QueOperatorAssetInfos + responses: + '200': + description: A successful response. + schema: + type: object + properties: + assetInfos: + type: object + additionalProperties: + type: object + properties: + TotalAmountOrWantChangeValue: + type: string + OperatorOwnAmountOrWantChangeValue: + type: string + title: >- + todo: the field is used to mark operator's own assets + and is not temporarily used now + WaitUndelegationAmountOrWantChangeValue: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: operatorAddr + in: query + required: false + type: string + tags: + - Query + /exocore/restaking_assets_manage/v1/QueStakerAssetInfos: + get: + operationId: ExocoreRestakingAssetsManageV1QueStakerAssetInfos + responses: + '200': + description: A successful response. + schema: + type: object + properties: + assetInfos: + type: object + additionalProperties: + type: object + properties: + TotalDepositAmountOrWantChangeValue: + type: string + CanWithdrawAmountOrWantChangeValue: + type: string + WaitUndelegationAmountOrWantChangeValue: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: stakerID + in: query + required: false + type: string + tags: + - Query + /exocore/restaking_assets_manage/v1/QueStakerExoCoreAddr/{StakerID}: + get: + operationId: ExocoreRestakingAssetsManageV1QueStakerExoCoreAddr + responses: + '200': + description: A successful response. + schema: + type: object + properties: + ExCoreAddr: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: StakerID + in: path + required: true + type: string + tags: + - Query + /exocore/restaking_assets_manage/v1/QueStakerSpecifiedAssetAmount: + get: + operationId: ExocoreRestakingAssetsManageV1QueOperatorSpecifiedAssetAmount + responses: + '200': + description: A successful response. + schema: + type: object + properties: + TotalAmountOrWantChangeValue: + type: string + OperatorOwnAmountOrWantChangeValue: + type: string + title: >- + todo: the field is used to mark operator's own assets and is + not temporarily used now + WaitUndelegationAmountOrWantChangeValue: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: operatorAddr + in: query + required: false + type: string + - name: assetID + in: query + required: false + type: string + tags: + - Query + /exocore/restaking_assets_manage/v1/QueStakingAssetInfo: + get: + operationId: ExocoreRestakingAssetsManageV1QueStakingAssetInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + AssetBasicInfo: + type: object + properties: + Name: + type: string + Symbol: + type: string + Address: + type: string + Decimals: + type: integer + format: int64 + TotalSupply: + type: string + LayerZeroChainID: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + MetaInfo: + type: string + StakingTotalAmount: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: assetID + in: query + required: false + type: string + tags: + - Query + /exocore/reward/params: + get: + summary: Parameters queries the parameters of the module. + operationId: ExocoreRewardParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /exocore/slash/params: + get: + summary: Parameters queries the parameters of the module. + operationId: ExocoreSlashParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /exocore/withdraw/params: + get: + summary: Parameters queries the parameters of the module. + operationId: ExocoreWithdrawParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /ibc/apps/interchain_accounts/controller/v1/owners/{owner}/connections/{connection_id}: + get: + summary: >- + InterchainAccount returns the interchain account address for a given + owner address on a given connection + operationId: IbcApplicationsInterchainAccountsControllerV1InterchainAccount + responses: + '200': + description: A successful response. + schema: + type: object + properties: + address: + type: string + description: >- + QueryInterchainAccountResponse the response type for the + Query/InterchainAccount RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: owner + in: path + required: true + type: string + - name: connection_id + in: path + required: true + type: string + tags: + - Query + /ibc/apps/interchain_accounts/controller/v1/params: + get: + summary: Params queries all parameters of the ICA controller submodule. + operationId: IbcApplicationsInterchainAccountsControllerV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + controller_enabled: + type: boolean + description: >- + controller_enabled enables or disables the controller + submodule. + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /ibc/apps/interchain_accounts/host/v1/params: + get: + summary: Params queries all parameters of the ICA host submodule. + operationId: IbcApplicationsInterchainAccountsHostV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + host_enabled: + type: boolean + description: host_enabled enables or disables the host submodule. + allow_messages: + type: array + items: + type: string + description: >- + allow_messages defines a list of sdk message typeURLs + allowed to be executed on a host chain. + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /ibc/core/channel/v1/channels: + get: + summary: Channels queries all the IBC channels of a chain. + operationId: IbcCoreChannelV1Channels + responses: + '200': + description: A successful response. + schema: + type: object + properties: + channels: + type: array + items: + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: >- + State defines if a channel is in one of the following + states: + + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: >- + - ORDER_NONE_UNSPECIFIED: zero-value for channel + ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other + end of the channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: >- + list of connection identifiers, in order, along which + packets sent on + + this channel will travel + version: + type: string + title: >- + opaque channel version, which is agreed upon during the + handshake + port_id: + type: string + title: port identifier + channel_id: + type: string + title: channel identifier + description: >- + IdentifiedChannel defines a channel with additional port and + channel + + identifier fields. + description: list of stored channels of the chain. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryChannelsResponse is the response type for the Query/Channels + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}: + get: + summary: Channel queries an IBC Channel. + operationId: IbcCoreChannelV1Channel + responses: + '200': + description: A successful response. + schema: + type: object + properties: + channel: + title: channel associated with the request identifiers + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: >- + State defines if a channel is in one of the following + states: + + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: |- + - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other + end of the channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: >- + list of connection identifiers, in order, along which + packets sent on + + this channel will travel + version: + type: string + title: >- + opaque channel version, which is agreed upon during the + handshake + description: >- + Channel defines pipeline for exactly-once packet delivery + between specific + + modules on separate blockchains, which has at least one end + capable of + + sending packets and one end capable of receiving packets. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryChannelResponse is the response type for the Query/Channel + RPC method. + + Besides the Channel end, it includes a proof and the height from + which the + + proof was retrieved. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/client_state: + get: + summary: >- + ChannelClientState queries for the client state for the channel + associated + + with the provided channel identifiers. + operationId: IbcCoreChannelV1ChannelClientState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + identified_client_state: + title: client state associated with the channel + type: object + properties: + client_id: + type: string + title: client identifier + client_state: + title: client state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + IdentifiedClientState defines a client state with an + additional client + + identifier field. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryChannelClientStateResponse is the Response type for the + Query/QueryChannelClientState RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height}: + get: + summary: |- + ChannelConsensusState queries for the consensus state for the channel + associated with the provided channel identifiers. + operationId: IbcCoreChannelV1ChannelConsensusState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + consensus_state: + title: consensus state associated with the channel + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + client_id: + type: string + title: client ID associated with the consensus state + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryChannelClientStateResponse is the Response type for the + Query/QueryChannelClientState RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: revision_number + description: revision number of the consensus state + in: path + required: true + type: string + format: uint64 + - name: revision_height + description: revision height of the consensus state + in: path + required: true + type: string + format: uint64 + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/next_sequence: + get: + summary: >- + NextSequenceReceive returns the next receive sequence for a given + channel. + operationId: IbcCoreChannelV1NextSequenceReceive + responses: + '200': + description: A successful response. + schema: + type: object + properties: + next_sequence_receive: + type: string + format: uint64 + title: next sequence receive number + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QuerySequenceResponse is the request type for the + Query/QueryNextSequenceReceiveResponse RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements: + get: + summary: >- + PacketAcknowledgements returns all the packet acknowledgements + associated + + with a channel. + operationId: IbcCoreChannelV1PacketAcknowledgements + responses: + '200': + description: A successful response. + schema: + type: object + properties: + acknowledgements: + type: array + items: + type: object + properties: + port_id: + type: string + description: channel port identifier. + channel_id: + type: string + description: channel unique identifier. + sequence: + type: string + format: uint64 + description: packet sequence. + data: + type: string + format: byte + description: embedded data that represents packet state. + description: >- + PacketState defines the generic type necessary to retrieve + and store + + packet commitments, acknowledgements, and receipts. + + Caller is responsible for knowing the context necessary to + interpret this + + state as a commitment, acknowledgement, or a receipt. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryPacketAcknowledgemetsResponse is the request type for the + Query/QueryPacketAcknowledgements RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + - name: packet_commitment_sequences + description: list of packet sequences + in: query + required: false + type: array + items: + type: string + format: uint64 + collectionFormat: multi + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}: + get: + summary: PacketAcknowledgement queries a stored packet acknowledgement hash. + operationId: IbcCoreChannelV1PacketAcknowledgement + responses: + '200': + description: A successful response. + schema: + type: object + properties: + acknowledgement: + type: string + format: byte + title: packet associated with the request fields + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + QueryPacketAcknowledgementResponse defines the client query + response for a + + packet which also includes a proof and the height from which the + + proof was retrieved + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: sequence + description: packet sequence + in: path + required: true + type: string + format: uint64 + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments: + get: + summary: |- + PacketCommitments returns all the packet commitments hashes associated + with a channel. + operationId: IbcCoreChannelV1PacketCommitments + responses: + '200': + description: A successful response. + schema: + type: object + properties: + commitments: + type: array + items: + type: object + properties: + port_id: + type: string + description: channel port identifier. + channel_id: + type: string + description: channel unique identifier. + sequence: + type: string + format: uint64 + description: packet sequence. + data: + type: string + format: byte + description: embedded data that represents packet state. + description: >- + PacketState defines the generic type necessary to retrieve + and store + + packet commitments, acknowledgements, and receipts. + + Caller is responsible for knowing the context necessary to + interpret this + + state as a commitment, acknowledgement, or a receipt. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryPacketCommitmentsResponse is the request type for the + Query/QueryPacketCommitments RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks: + get: + summary: >- + UnreceivedAcks returns all the unreceived IBC acknowledgements + associated + + with a channel and sequences. + operationId: IbcCoreChannelV1UnreceivedAcks + responses: + '200': + description: A successful response. + schema: + type: object + properties: + sequences: + type: array + items: + type: string + format: uint64 + title: list of unreceived acknowledgement sequences + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryUnreceivedAcksResponse is the response type for the + Query/UnreceivedAcks RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: packet_ack_sequences + description: list of acknowledgement sequences + in: path + required: true + type: array + items: + type: string + format: uint64 + collectionFormat: csv + minItems: 1 + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets: + get: + summary: >- + UnreceivedPackets returns all the unreceived IBC packets associated with + a + + channel and sequences. + operationId: IbcCoreChannelV1UnreceivedPackets + responses: + '200': + description: A successful response. + schema: + type: object + properties: + sequences: + type: array + items: + type: string + format: uint64 + title: list of unreceived packet sequences + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryUnreceivedPacketsResponse is the response type for the + Query/UnreceivedPacketCommitments RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: packet_commitment_sequences + description: list of packet sequences + in: path + required: true + type: array + items: + type: string + format: uint64 + collectionFormat: csv + minItems: 1 + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}: + get: + summary: PacketCommitment queries a stored packet commitment hash. + operationId: IbcCoreChannelV1PacketCommitment + responses: + '200': + description: A successful response. + schema: + type: object + properties: + commitment: + type: string + format: byte + title: packet associated with the request fields + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + QueryPacketCommitmentResponse defines the client query response + for a packet + + which also includes a proof and the height from which the proof + was + + retrieved + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: sequence + description: packet sequence + in: path + required: true + type: string + format: uint64 + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}: + get: + summary: >- + PacketReceipt queries if a given packet sequence has been received on + the + + queried chain + operationId: IbcCoreChannelV1PacketReceipt + responses: + '200': + description: A successful response. + schema: + type: object + properties: + received: + type: boolean + title: success flag for if receipt exists + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + QueryPacketReceiptResponse defines the client query response for a + packet + + receipt which also includes a proof, and the height from which the + proof was + + retrieved + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: sequence + description: packet sequence + in: path + required: true + type: string + format: uint64 + tags: + - Query + /ibc/core/channel/v1/connections/{connection}/channels: + get: + summary: |- + ConnectionChannels queries all the channels associated with a connection + end. + operationId: IbcCoreChannelV1ConnectionChannels + responses: + '200': + description: A successful response. + schema: + type: object + properties: + channels: + type: array + items: + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: >- + State defines if a channel is in one of the following + states: + + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: >- + - ORDER_NONE_UNSPECIFIED: zero-value for channel + ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other + end of the channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: >- + list of connection identifiers, in order, along which + packets sent on + + this channel will travel + version: + type: string + title: >- + opaque channel version, which is agreed upon during the + handshake + port_id: + type: string + title: port identifier + channel_id: + type: string + title: channel identifier + description: >- + IdentifiedChannel defines a channel with additional port and + channel + + identifier fields. + description: list of channels associated with a connection. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryConnectionChannelsResponse is the Response type for the + Query/QueryConnectionChannels RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: connection + description: connection unique identifier + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/client/v1/client_states: + get: + summary: ClientStates queries all the IBC light clients of a chain. + operationId: IbcCoreClientV1ClientStates + responses: + '200': + description: A successful response. + schema: + type: object + properties: + client_states: + type: array + items: + type: object + properties: + client_id: + type: string + title: client identifier + client_state: + title: client state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + IdentifiedClientState defines a client state with an + additional client + + identifier field. + description: list of stored ClientStates of the chain. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + description: >- + QueryClientStatesResponse is the response type for the + Query/ClientStates RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/client/v1/client_states/{client_id}: + get: + summary: ClientState queries an IBC light client. + operationId: IbcCoreClientV1ClientState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + client_state: + title: client state associated with the request identifier + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryClientStateResponse is the response type for the + Query/ClientState RPC + + method. Besides the client state, it includes a proof and the + height from + + which the proof was retrieved. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: client_id + description: client state unique identifier + in: path + required: true + type: string + tags: + - Query + /ibc/core/client/v1/client_status/{client_id}: + get: + summary: Status queries the status of an IBC client. + operationId: IbcCoreClientV1ClientStatus + responses: + '200': + description: A successful response. + schema: + type: object + properties: + status: + type: string + description: >- + QueryClientStatusResponse is the response type for the + Query/ClientStatus RPC + + method. It returns the current status of the IBC client. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: client_id + description: client unique identifier + in: path + required: true + type: string + tags: + - Query + /ibc/core/client/v1/consensus_states/{client_id}: + get: + summary: |- + ConsensusStates queries all the consensus state associated with a given + client. + operationId: IbcCoreClientV1ConsensusStates + responses: + '200': + description: A successful response. + schema: + type: object + properties: + consensus_states: + type: array + items: + type: object + properties: + height: + title: consensus state height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each + height while keeping + + RevisionNumber the same. However some consensus + algorithms may choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as + the RevisionHeight + + gets reset + consensus_state: + title: consensus state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + ConsensusStateWithHeight defines a consensus state with an + additional height + + field. + title: consensus states associated with the identifier + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: |- + QueryConsensusStatesResponse is the response type for the + Query/ConsensusStates RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: client_id + description: client identifier + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/client/v1/consensus_states/{client_id}/heights: + get: + summary: >- + ConsensusStateHeights queries the height of every consensus states + associated with a given client. + operationId: IbcCoreClientV1ConsensusStateHeights + responses: + '200': + description: A successful response. + schema: + type: object + properties: + consensus_state_heights: + type: array + items: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms + may choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes + of updating and + + freezing clients + title: consensus state heights + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: |- + QueryConsensusStateHeightsResponse is the response type for the + Query/ConsensusStateHeights RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: client_id + description: client identifier + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/client/v1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}: + get: + summary: >- + ConsensusState queries a consensus state associated with a client state + at + + a given height. + operationId: IbcCoreClientV1ConsensusState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + consensus_state: + title: >- + consensus state associated with the client identifier at the + given height + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + QueryConsensusStateResponse is the response type for the + Query/ConsensusState + + RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: client_id + description: client identifier + in: path + required: true + type: string + - name: revision_number + description: consensus state revision number + in: path + required: true + type: string + format: uint64 + - name: revision_height + description: consensus state revision height + in: path + required: true + type: string + format: uint64 + - name: latest_height + description: >- + latest_height overrrides the height field and queries the latest + stored + + ConsensusState + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/client/v1/params: + get: + summary: ClientParams queries all parameters of the ibc client submodule. + operationId: IbcCoreClientV1ClientParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + allowed_clients: + type: array + items: + type: string + description: >- + allowed_clients defines the list of allowed client state + types which can be created + + and interacted with. If a client type is removed from the + allowed clients list, usage + + of this client will be disabled until it is added again to + the list. + description: >- + QueryClientParamsResponse is the response type for the + Query/ClientParams RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /ibc/core/client/v1/upgraded_client_states: + get: + summary: UpgradedClientState queries an Upgraded IBC light client. + operationId: IbcCoreClientV1UpgradedClientState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + upgraded_client_state: + title: client state associated with the request identifier + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + QueryUpgradedClientStateResponse is the response type for the + Query/UpgradedClientState RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /ibc/core/client/v1/upgraded_consensus_states: + get: + summary: UpgradedConsensusState queries an Upgraded IBC consensus state. + operationId: IbcCoreClientV1UpgradedConsensusState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + upgraded_consensus_state: + title: Consensus state associated with the request identifier + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + QueryUpgradedConsensusStateResponse is the response type for the + Query/UpgradedConsensusState RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /ibc/core/connection/v1/client_connections/{client_id}: + get: + summary: |- + ClientConnections queries the connection paths associated with a client + state. + operationId: IbcCoreConnectionV1ClientConnections + responses: + '200': + description: A successful response. + schema: + type: object + properties: + connection_paths: + type: array + items: + type: string + description: slice of all the connection paths associated with a client. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was generated + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryClientConnectionsResponse is the response type for the + Query/ClientConnections RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: client_id + description: client identifier associated with a connection + in: path + required: true + type: string + tags: + - Query + /ibc/core/connection/v1/connections: + get: + summary: Connections queries all the IBC connections of a chain. + operationId: IbcCoreConnectionV1Connections + responses: + '200': + description: A successful response. + schema: + type: object + properties: + connections: + type: array + items: + type: object + properties: + id: + type: string + description: connection identifier. + client_id: + type: string + description: client associated with this connection. + versions: + type: array + items: + type: object + properties: + identifier: + type: string + title: unique version identifier + features: + type: array + items: + type: string + title: >- + list of features compatible with the specified + identifier + description: >- + Version defines the versioning scheme used to + negotiate the IBC verison in + + the connection handshake. + title: >- + IBC version which can be utilised to determine encodings + or protocols for + + channels or packets utilising this connection + state: + description: current state of the connection end. + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + default: STATE_UNINITIALIZED_UNSPECIFIED + counterparty: + description: counterparty chain associated with this connection. + type: object + properties: + client_id: + type: string + description: >- + identifies the client on the counterparty chain + associated with a given + + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty + chain associated with a + + given connection. + prefix: + description: commitment merkle prefix of the counterparty chain. + type: object + properties: + key_prefix: + type: string + format: byte + title: >- + MerklePrefix is merkle path prefixed to the key. + + The constructed key from the Path and the key will + be append(Path.KeyPath, + + append(Path.KeyPrefix, key...)) + delay_period: + type: string + format: uint64 + description: delay period associated with this connection. + description: >- + IdentifiedConnection defines a connection with additional + connection + + identifier field. + description: list of stored connections of the chain. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryConnectionsResponse is the response type for the + Query/Connections RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/connection/v1/connections/{connection_id}: + get: + summary: Connection queries an IBC connection end. + operationId: IbcCoreConnectionV1Connection + responses: + '200': + description: A successful response. + schema: + type: object + properties: + connection: + title: connection associated with the request identifier + type: object + properties: + client_id: + type: string + description: client associated with this connection. + versions: + type: array + items: + type: object + properties: + identifier: + type: string + title: unique version identifier + features: + type: array + items: + type: string + title: >- + list of features compatible with the specified + identifier + description: >- + Version defines the versioning scheme used to negotiate + the IBC verison in + + the connection handshake. + description: >- + IBC version which can be utilised to determine encodings + or protocols for + + channels or packets utilising this connection. + state: + description: current state of the connection end. + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + default: STATE_UNINITIALIZED_UNSPECIFIED + counterparty: + description: counterparty chain associated with this connection. + type: object + properties: + client_id: + type: string + description: >- + identifies the client on the counterparty chain + associated with a given + + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty + chain associated with a + + given connection. + prefix: + description: commitment merkle prefix of the counterparty chain. + type: object + properties: + key_prefix: + type: string + format: byte + title: >- + MerklePrefix is merkle path prefixed to the key. + + The constructed key from the Path and the key will be + append(Path.KeyPath, + + append(Path.KeyPrefix, key...)) + delay_period: + type: string + format: uint64 + description: >- + delay period that must pass before a consensus state can + be used for + + packet-verification NOTE: delay period logic is only + implemented by some + + clients. + description: >- + ConnectionEnd defines a stateful object on a chain connected + to another + + separate one. + + NOTE: there must only be 2 defined ConnectionEnds to establish + + a connection between two chains. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryConnectionResponse is the response type for the + Query/Connection RPC + + method. Besides the connection end, it includes a proof and the + height from + + which the proof was retrieved. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: connection_id + description: connection unique identifier + in: path + required: true + type: string + tags: + - Query + /ibc/core/connection/v1/connections/{connection_id}/client_state: + get: + summary: |- + ConnectionClientState queries the client state associated with the + connection. + operationId: IbcCoreConnectionV1ConnectionClientState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + identified_client_state: + title: client state associated with the channel + type: object + properties: + client_id: + type: string + title: client identifier + client_state: + title: client state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + IdentifiedClientState defines a client state with an + additional client + + identifier field. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryConnectionClientStateResponse is the response type for the + Query/ConnectionClientState RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: connection_id + description: connection identifier + in: path + required: true + type: string + tags: + - Query + /ibc/core/connection/v1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height}: + get: + summary: |- + ConnectionConsensusState queries the consensus state associated with the + connection. + operationId: IbcCoreConnectionV1ConnectionConsensusState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + consensus_state: + title: consensus state associated with the channel + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + client_id: + type: string + title: client ID associated with the consensus state + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryConnectionConsensusStateResponse is the response type for the + Query/ConnectionConsensusState RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: connection_id + description: connection identifier + in: path + required: true + type: string + - name: revision_number + in: path + required: true + type: string + format: uint64 + - name: revision_height + in: path + required: true + type: string + format: uint64 + tags: + - Query + /ibc/core/connection/v1/params: + get: + summary: ConnectionParams queries all parameters of the ibc connection submodule. + operationId: IbcCoreConnectionV1ConnectionParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + max_expected_time_per_block: + type: string + format: uint64 + description: >- + maximum expected time per block (in nanoseconds), used to + enforce block delay. This parameter should reflect the + + largest amount of time that the chain might reasonably + take to produce the next block under normal operating + + conditions. A safe choice is 3-5x the expected time per + block. + description: >- + QueryConnectionParamsResponse is the response type for the + Query/ConnectionParams RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query +definitions: + cosmos.auth.v1beta1.AddressBytesToStringResponse: + type: object + properties: + address_string: + type: string + description: >- + AddressBytesToStringResponse is the response type for AddressString rpc + method. + + + Since: cosmos-sdk 0.46 + cosmos.auth.v1beta1.AddressStringToBytesResponse: + type: object + properties: + address_bytes: + type: string + format: byte + description: >- + AddressStringToBytesResponse is the response type for AddressBytes rpc + method. + + + Since: cosmos-sdk 0.46 + cosmos.auth.v1beta1.BaseAccount: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + account_number: + type: string + format: uint64 + sequence: + type: string + format: uint64 + description: >- + BaseAccount defines a base account type. It contains all the necessary + fields + + for basic account functionality. Any custom account type should extend + this + + type for additional functionality (e.g. vesting). + cosmos.auth.v1beta1.Bech32PrefixResponse: + type: object + properties: + bech32_prefix: + type: string + description: |- + Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + + Since: cosmos-sdk 0.46 + cosmos.auth.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.auth.v1beta1.Params: + type: object + properties: + max_memo_characters: + type: string + format: uint64 + tx_sig_limit: + type: string + format: uint64 + tx_size_cost_per_byte: + type: string + format: uint64 + sig_verify_cost_ed25519: + type: string + format: uint64 + sig_verify_cost_secp256k1: + type: string + format: uint64 + description: Params defines the parameters for the auth module. + cosmos.auth.v1beta1.QueryAccountAddressByIDResponse: + type: object + properties: + account_address: + type: string + description: 'Since: cosmos-sdk 0.46.2' + title: >- + QueryAccountAddressByIDResponse is the response type for + AccountAddressByID rpc method + cosmos.auth.v1beta1.QueryAccountInfoResponse: + type: object + properties: + info: + description: info is the account info which is represented by BaseAccount. + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + account_number: + type: string + format: uint64 + sequence: + type: string + format: uint64 + description: |- + QueryAccountInfoResponse is the Query/AccountInfo response type. + + Since: cosmos-sdk 0.47 + cosmos.auth.v1beta1.QueryAccountResponse: + type: object + properties: + account: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + QueryAccountResponse is the response type for the Query/Account RPC + method. + cosmos.auth.v1beta1.QueryAccountsResponse: + type: object + properties: + accounts: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: accounts are the existing accounts + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAccountsResponse is the response type for the Query/Accounts RPC + method. + + + Since: cosmos-sdk 0.43 + cosmos.auth.v1beta1.QueryModuleAccountByNameResponse: + type: object + properties: + account: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + QueryModuleAccountByNameResponse is the response type for the + Query/ModuleAccountByName RPC method. + cosmos.auth.v1beta1.QueryModuleAccountsResponse: + type: object + properties: + accounts: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + QueryModuleAccountsResponse is the response type for the + Query/ModuleAccounts RPC method. + + + Since: cosmos-sdk 0.46 + cosmos.auth.v1beta1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + max_memo_characters: + type: string + format: uint64 + tx_sig_limit: + type: string + format: uint64 + tx_size_cost_per_byte: + type: string + format: uint64 + sig_verify_cost_ed25519: + type: string + format: uint64 + sig_verify_cost_secp256k1: + type: string + format: uint64 + description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.base.query.v1beta1.PageRequest: + type: object + properties: + key: + type: string + format: byte + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + offset: + type: string + format: uint64 + description: |- + offset is a numeric offset that can be used when key is unavailable. + It is less efficient than using key. Only one of offset or key should + be set. + limit: + type: string + format: uint64 + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + count_total: + type: boolean + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in UIs. + + count_total is only respected when offset is used. It is ignored when + key + + is set. + reverse: + type: boolean + description: >- + reverse is set to true if results are to be returned in the descending + order. + + + Since: cosmos-sdk 0.43 + description: |- + message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } + title: |- + PageRequest is to be embedded in gRPC request messages for efficient + pagination. Ex: + cosmos.base.query.v1beta1.PageResponse: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: |- + total is total number of results available if PageRequest.count_total + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + google.protobuf.Any: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical + form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that + they + + expect it to use in the context of Any. However, for URLs which use + the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along with + a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + google.rpc.Status: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + cosmos.authz.v1beta1.Grant: + type: object + properties: + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + time when the grant will expire and will be pruned. If null, then the + grant + + doesn't have a time expiration (other conditions in `authorization` + + may apply to invalidate the grant) + description: |- + Grant gives permissions to execute + the provide method with expiration time. + cosmos.authz.v1beta1.GrantAuthorization: + type: object + properties: + granter: + type: string + grantee: + type: string + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + GrantAuthorization extends a grant with both the addresses of the grantee + and granter. + + It is used in genesis.proto and query.proto + cosmos.authz.v1beta1.MsgExecResponse: + type: object + properties: + results: + type: array + items: + type: string + format: byte + description: MsgExecResponse defines the Msg/MsgExecResponse response type. + cosmos.authz.v1beta1.MsgGrantResponse: + type: object + description: MsgGrantResponse defines the Msg/MsgGrant response type. + cosmos.authz.v1beta1.MsgRevokeResponse: + type: object + description: MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. + cosmos.authz.v1beta1.QueryGranteeGrantsResponse: + type: object + properties: + grants: + type: array + items: + type: object + properties: + granter: + type: string + grantee: + type: string + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + GrantAuthorization extends a grant with both the addresses of the + grantee and granter. + + It is used in genesis.proto and query.proto + description: grants is a list of grants granted to the grantee. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGranteeGrantsResponse is the response type for the + Query/GranteeGrants RPC method. + cosmos.authz.v1beta1.QueryGranterGrantsResponse: + type: object + properties: + grants: + type: array + items: + type: object + properties: + granter: + type: string + grantee: + type: string + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + GrantAuthorization extends a grant with both the addresses of the + grantee and granter. + + It is used in genesis.proto and query.proto + description: grants is a list of grants granted by the granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGranterGrantsResponse is the response type for the + Query/GranterGrants RPC method. + cosmos.authz.v1beta1.QueryGrantsResponse: + type: object + properties: + grants: + type: array + items: + type: object + properties: + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + time when the grant will expire and will be pruned. If null, + then the grant + + doesn't have a time expiration (other conditions in + `authorization` + + may apply to invalidate the grant) + description: |- + Grant gives permissions to execute + the provide method with expiration time. + description: authorizations is a list of grants granted for grantee by granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGrantsResponse is the response type for the Query/Authorizations RPC + method. + cosmos.bank.v1beta1.DenomOwner: + type: object + properties: + address: + type: string + description: address defines the address that owns a particular denomination. + balance: + description: balance is the balance of the denominated coin for an account. + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DenomOwner defines structure representing an account that owns or holds a + particular denominated token. It contains the account address and account + balance of the denominated token. + + Since: cosmos-sdk 0.46 + cosmos.bank.v1beta1.DenomUnit: + type: object + properties: + denom: + type: string + description: denom represents the string name of the given denom unit (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one must + + raise the base_denom to in order to equal the given DenomUnit's denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' + with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: aliases is a list of string aliases for the given denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + cosmos.bank.v1beta1.Input: + type: object + properties: + address: + type: string + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Input models transaction input. + cosmos.bank.v1beta1.Metadata: + type: object + properties: + description: + type: string + denom_units: + type: array + items: + type: object + properties: + denom: + type: string + description: >- + denom represents the string name of the given denom unit (e.g + uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one must + + raise the base_denom to in order to equal the given DenomUnit's + denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a DenomUnit of + 'atom' with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: aliases is a list of string aliases for the given denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: denom_units represents the list of DenomUnit's for a given coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit with exponent + = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges (eg: ATOM). This + can + + be the same as the display. + + + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains additional + information. Optional. + + + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. It's used to + verify that + + the document didn't change. Optional. + + + Since: cosmos-sdk 0.46 + description: |- + Metadata represents a struct that describes + a basic token. + cosmos.bank.v1beta1.MsgMultiSendResponse: + type: object + description: MsgMultiSendResponse defines the Msg/MultiSend response type. + cosmos.bank.v1beta1.MsgSendResponse: + type: object + description: MsgSendResponse defines the Msg/Send response type. + cosmos.bank.v1beta1.MsgSetSendEnabledResponse: + type: object + description: |- + MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + + Since: cosmos-sdk 0.47 + cosmos.bank.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.bank.v1beta1.Output: + type: object + properties: + address: + type: string + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Output models transaction outputs. + cosmos.bank.v1beta1.Params: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status (whether a + denom is + + sendable). + description: >- + Deprecated: Use of SendEnabled in params is deprecated. + + For genesis, use the newly added send_enabled field in the genesis + object. + + Storage, lookup, and manipulation of this information is now in the + keeper. + + + As of cosmos-sdk 0.47, this only exists for backwards compatibility of + genesis files. + default_send_enabled: + type: boolean + description: Params defines the parameters for the bank module. + cosmos.bank.v1beta1.QueryAllBalancesResponse: + type: object + properties: + balances: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: balances is the balances of all the coins. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllBalancesResponse is the response type for the Query/AllBalances + RPC + + method. + cosmos.bank.v1beta1.QueryBalanceResponse: + type: object + properties: + balance: + description: balance is the balance of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QueryBalanceResponse is the response type for the Query/Balance RPC + method. + cosmos.bank.v1beta1.QueryDenomMetadataResponse: + type: object + properties: + metadata: + description: >- + metadata describes and provides all the client information for the + requested token. + type: object + properties: + description: + type: string + denom_units: + type: array + items: + type: object + properties: + denom: + type: string + description: >- + denom represents the string name of the given denom unit + (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one must + + raise the base_denom to in order to equal the given + DenomUnit's denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a DenomUnit + of 'atom' with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: aliases is a list of string aliases for the given denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: denom_units represents the list of DenomUnit's for a given coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit with + exponent = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges (eg: ATOM). + This can + + be the same as the display. + + + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains additional + information. Optional. + + + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. It's used + to verify that + + the document didn't change. Optional. + + + Since: cosmos-sdk 0.46 + description: >- + QueryDenomMetadataResponse is the response type for the + Query/DenomMetadata RPC + + method. + cosmos.bank.v1beta1.QueryDenomOwnersResponse: + type: object + properties: + denom_owners: + type: array + items: + type: object + properties: + address: + type: string + description: address defines the address that owns a particular denomination. + balance: + description: balance is the balance of the denominated coin for an account. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DenomOwner defines structure representing an account that owns or + holds a + + particular denominated token. It contains the account address and + account + + balance of the denominated token. + + + Since: cosmos-sdk 0.46 + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC + query. + + + Since: cosmos-sdk 0.46 + cosmos.bank.v1beta1.QueryDenomsMetadataResponse: + type: object + properties: + metadatas: + type: array + items: + type: object + properties: + description: + type: string + denom_units: + type: array + items: + type: object + properties: + denom: + type: string + description: >- + denom represents the string name of the given denom unit + (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one must + + raise the base_denom to in order to equal the given + DenomUnit's denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a + DenomUnit of 'atom' with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: aliases is a list of string aliases for the given denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: denom_units represents the list of DenomUnit's for a given coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit with + exponent = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges (eg: + ATOM). This can + + be the same as the display. + + + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains additional + information. Optional. + + + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. It's used + to verify that + + the document didn't change. Optional. + + + Since: cosmos-sdk 0.46 + description: |- + Metadata represents a struct that describes + a basic token. + description: >- + metadata provides the client information for all the registered + tokens. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDenomsMetadataResponse is the response type for the + Query/DenomsMetadata RPC + + method. + cosmos.bank.v1beta1.QueryParamsResponse: + type: object + properties: + params: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status (whether a + denom is + + sendable). + description: >- + Deprecated: Use of SendEnabled in params is deprecated. + + For genesis, use the newly added send_enabled field in the genesis + object. + + Storage, lookup, and manipulation of this information is now in + the keeper. + + + As of cosmos-sdk 0.47, this only exists for backwards + compatibility of genesis files. + default_send_enabled: + type: boolean + description: Params defines the parameters for the bank module. + description: >- + QueryParamsResponse defines the response type for querying x/bank + parameters. + cosmos.bank.v1beta1.QuerySendEnabledResponse: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status (whether a + denom is + + sendable). + pagination: + description: |- + pagination defines the pagination in the response. This field is only + populated if the denoms field in the request is empty. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QuerySendEnabledResponse defines the RPC response of a SendEnable query. + + Since: cosmos-sdk 0.47 + cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse: + type: object + properties: + balance: + description: balance is the balance of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QuerySpendableBalanceByDenomResponse defines the gRPC response structure + for + + querying an account's spendable balance for a specific denom. + + + Since: cosmos-sdk 0.47 + cosmos.bank.v1beta1.QuerySpendableBalancesResponse: + type: object + properties: + balances: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: balances is the spendable balances of all the coins. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QuerySpendableBalancesResponse defines the gRPC response structure for + querying + + an account's spendable balances. + + + Since: cosmos-sdk 0.46 + cosmos.bank.v1beta1.QuerySupplyOfResponse: + type: object + properties: + amount: + description: amount is the supply of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC + method. + cosmos.bank.v1beta1.QueryTotalSupplyResponse: + type: object + properties: + supply: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: supply is the supply of the coins + pagination: + description: |- + pagination defines the pagination in the response. + + Since: cosmos-sdk 0.43 + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryTotalSupplyResponse is the response type for the Query/TotalSupply + RPC + + method + cosmos.bank.v1beta1.SendEnabled: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: |- + SendEnabled maps coin denom to a send_enabled status (whether a denom is + sendable). + cosmos.base.v1beta1.Coin: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + cosmos.base.node.v1beta1.ConfigResponse: + type: object + properties: + minimum_gas_price: + type: string + description: ConfigResponse defines the response structure for the Config gRPC query. + cosmos.base.tendermint.v1beta1.ABCIQueryResponse: + type: object + properties: + code: + type: integer + format: int64 + log: + type: string + title: nondeterministic + info: + type: string + title: nondeterministic + index: + type: string + format: int64 + key: + type: string + format: byte + value: + type: string + format: byte + proof_ops: + type: object + properties: + ops: + type: array + items: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + description: >- + ProofOp defines an operation used for calculating Merkle root. + The data could + + be arbitrary format, providing necessary data for example + neighbouring node + + hash. + + + Note: This type is a duplicate of the ProofOp proto type defined + in Tendermint. + description: >- + ProofOps is Merkle proof defined by the list of ProofOps. + + + Note: This type is a duplicate of the ProofOps proto type defined in + Tendermint. + height: + type: string + format: int64 + codespace: + type: string + description: >- + ABCIQueryResponse defines the response structure for the ABCIQuery gRPC + query. + + + Note: This type is a duplicate of the ResponseQuery proto type defined in + + Tendermint. + cosmos.base.tendermint.v1beta1.Block: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in + the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer address, formatted + as a Bech32 string. + + In Tendermint, this type is `bytes`, but in the SDK, we convert it + to a Bech32 string + + for better UX. + + + original proposer of the block + description: Header defines the structure of a Tendermint block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, + + including all blockchain data structures and + the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from + the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block was + committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set of + validators. + description: |- + Block is tendermint type Block, with the Header proposer address + field converted to bech32 string. + cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse: + type: object + properties: + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + block: + title: 'Deprecated: please use `sdk_block` instead' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block + was committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + sdk_block: + title: 'Since: cosmos-sdk 0.47' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer address, + formatted as a Bech32 string. + + In Tendermint, this type is `bytes`, but in the SDK, we + convert it to a Bech32 string + + for better UX. + + + original proposer of the block + description: Header defines the structure of a Tendermint block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block + was committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + description: |- + Block is tendermint type Block, with the Header proposer address + field converted to bech32 string. + description: >- + GetBlockByHeightResponse is the response type for the + Query/GetBlockByHeight RPC method. + cosmos.base.tendermint.v1beta1.GetLatestBlockResponse: + type: object + properties: + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + block: + title: 'Deprecated: please use `sdk_block` instead' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block + was committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + sdk_block: + title: 'Since: cosmos-sdk 0.47' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer address, + formatted as a Bech32 string. + + In Tendermint, this type is `bytes`, but in the SDK, we + convert it to a Bech32 string + + for better UX. + + + original proposer of the block + description: Header defines the structure of a Tendermint block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block + was committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + description: |- + Block is tendermint type Block, with the Header proposer address + field converted to bech32 string. + description: >- + GetLatestBlockResponse is the response type for the Query/GetLatestBlock + RPC method. + cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse: + type: object + properties: + block_height: + type: string + format: int64 + validators: + type: array + items: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + description: Validator is the type for the validator-set. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + GetLatestValidatorSetResponse is the response type for the + Query/GetValidatorSetByHeight RPC method. + cosmos.base.tendermint.v1beta1.GetNodeInfoResponse: + type: object + properties: + default_node_info: + type: object + properties: + protocol_version: + type: object + properties: + p2p: + type: string + format: uint64 + block: + type: string + format: uint64 + app: + type: string + format: uint64 + default_node_id: + type: string + listen_addr: + type: string + network: + type: string + version: + type: string + channels: + type: string + format: byte + moniker: + type: string + other: + type: object + properties: + tx_index: + type: string + rpc_address: + type: string + application_version: + type: object + properties: + name: + type: string + app_name: + type: string + version: + type: string + git_commit: + type: string + build_tags: + type: string + go_version: + type: string + build_deps: + type: array + items: + type: object + properties: + path: + type: string + title: module path + version: + type: string + title: module version + sum: + type: string + title: checksum + title: Module is the type for VersionInfo + cosmos_sdk_version: + type: string + title: 'Since: cosmos-sdk 0.43' + description: VersionInfo is the type for the GetNodeInfoResponse message. + description: >- + GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC + method. + cosmos.base.tendermint.v1beta1.GetSyncingResponse: + type: object + properties: + syncing: + type: boolean + description: >- + GetSyncingResponse is the response type for the Query/GetSyncing RPC + method. + cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse: + type: object + properties: + block_height: + type: string + format: int64 + validators: + type: array + items: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + description: Validator is the type for the validator-set. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + GetValidatorSetByHeightResponse is the response type for the + Query/GetValidatorSetByHeight RPC method. + cosmos.base.tendermint.v1beta1.Header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in the + blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer address, formatted as + a Bech32 string. + + In Tendermint, this type is `bytes`, but in the SDK, we convert it to + a Bech32 string + + for better UX. + + + original proposer of the block + description: Header defines the structure of a Tendermint block header. + cosmos.base.tendermint.v1beta1.Module: + type: object + properties: + path: + type: string + title: module path + version: + type: string + title: module version + sum: + type: string + title: checksum + title: Module is the type for VersionInfo + cosmos.base.tendermint.v1beta1.ProofOp: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + description: >- + ProofOp defines an operation used for calculating Merkle root. The data + could + + be arbitrary format, providing necessary data for example neighbouring + node + + hash. + + + Note: This type is a duplicate of the ProofOp proto type defined in + Tendermint. + cosmos.base.tendermint.v1beta1.ProofOps: + type: object + properties: + ops: + type: array + items: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + description: >- + ProofOp defines an operation used for calculating Merkle root. The + data could + + be arbitrary format, providing necessary data for example + neighbouring node + + hash. + + + Note: This type is a duplicate of the ProofOp proto type defined in + Tendermint. + description: >- + ProofOps is Merkle proof defined by the list of ProofOps. + + + Note: This type is a duplicate of the ProofOps proto type defined in + Tendermint. + cosmos.base.tendermint.v1beta1.Validator: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + description: Validator is the type for the validator-set. + cosmos.base.tendermint.v1beta1.VersionInfo: + type: object + properties: + name: + type: string + app_name: + type: string + version: + type: string + git_commit: + type: string + build_tags: + type: string + go_version: + type: string + build_deps: + type: array + items: + type: object + properties: + path: + type: string + title: module path + version: + type: string + title: module version + sum: + type: string + title: checksum + title: Module is the type for VersionInfo + cosmos_sdk_version: + type: string + title: 'Since: cosmos-sdk 0.43' + description: VersionInfo is the type for the GetNodeInfoResponse message. + tendermint.crypto.PublicKey: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + tendermint.p2p.DefaultNodeInfo: + type: object + properties: + protocol_version: + type: object + properties: + p2p: + type: string + format: uint64 + block: + type: string + format: uint64 + app: + type: string + format: uint64 + default_node_id: + type: string + listen_addr: + type: string + network: + type: string + version: + type: string + channels: + type: string + format: byte + moniker: + type: string + other: + type: object + properties: + tx_index: + type: string + rpc_address: + type: string + tendermint.p2p.DefaultNodeInfoOther: + type: object + properties: + tx_index: + type: string + rpc_address: + type: string + tendermint.p2p.ProtocolVersion: + type: object + properties: + p2p: + type: string + format: uint64 + block: + type: string + format: uint64 + app: + type: string + format: uint64 + tendermint.types.Block: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in + the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, + + including all blockchain data structures and + the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from + the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block was + committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set of + validators. + tendermint.types.BlockID: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + tendermint.types.BlockIDFlag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + tendermint.types.Commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set of + validators. + tendermint.types.CommitSig: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + tendermint.types.Data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the order + first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + tendermint.types.DuplicateVoteEvidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from validators + for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from validators + for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator signed two + conflicting votes. + tendermint.types.Evidence: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from + validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from + validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator signed two + conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was committed by + a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of validators + attempting to mislead a light client. + tendermint.types.EvidenceList: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from + validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from + validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator signed + two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, + + including all blockchain data structures and the + rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was + committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + tendermint.types.Header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in the + blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + tendermint.types.LightBlock: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + tendermint.types.LightClientAttackEvidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a + block in the blockchain, + + including all blockchain data structures and the rules of + the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the previous + block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the signature is + for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a + set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of validators + attempting to mislead a light client. + tendermint.types.PartSetHeader: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + tendermint.types.SignedHeader: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in + the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set of + validators. + tendermint.types.SignedMsgType: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + tendermint.types.Validator: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + tendermint.types.ValidatorSet: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + tendermint.types.Vote: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: |- + Vote represents a prevote, precommit, or commit vote from validators for + consensus. + tendermint.version.Consensus: + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in the + blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + cosmos.consensus.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + cosmos.consensus.v1.QueryParamsResponse: + type: object + properties: + params: + description: >- + params are the tendermint consensus params stored in the consensus + module. + + Please note that `params.version` is not populated in this response, + it is + + tracked separately in the x/upgrade module. + type: object + properties: + block: + type: object + properties: + max_bytes: + type: string + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: + type: string + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + evidence: + type: object + properties: + max_age_num_blocks: + type: string + format: int64 + description: >- + Max age of evidence, in blocks. + + + The basic formula for calculating this is: MaxAgeDuration / + {average block + + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. + + + It should correspond with an app's "unbonding period" or other + similar + + mechanism for handling [Nothing-At-Stake + + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes that can + be committed in a single block. + + and should fall comfortably under the max block bytes. + + Default is 1048576 or 1MB + description: EvidenceParams determine how we handle evidence of malfeasance. + validator: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: |- + ValidatorParams restrict the public key types validators can use. + NOTE: uses ABCI pubkey naming, not Amino names. + version: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. + description: >- + QueryParamsResponse defines the response type for querying x/consensus + parameters. + tendermint.types.BlockParams: + type: object + properties: + max_bytes: + type: string + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: + type: string + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + tendermint.types.ConsensusParams: + type: object + properties: + block: + type: object + properties: + max_bytes: + type: string + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: + type: string + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + evidence: + type: object + properties: + max_age_num_blocks: + type: string + format: int64 + description: >- + Max age of evidence, in blocks. + + + The basic formula for calculating this is: MaxAgeDuration / + {average block + + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. + + + It should correspond with an app's "unbonding period" or other + similar + + mechanism for handling [Nothing-At-Stake + + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes that can be + committed in a single block. + + and should fall comfortably under the max block bytes. + + Default is 1048576 or 1MB + description: EvidenceParams determine how we handle evidence of malfeasance. + validator: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: |- + ValidatorParams restrict the public key types validators can use. + NOTE: uses ABCI pubkey naming, not Amino names. + version: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. + description: |- + ConsensusParams contains consensus critical parameters that determine the + validity of blocks. + tendermint.types.EvidenceParams: + type: object + properties: + max_age_num_blocks: + type: string + format: int64 + description: >- + Max age of evidence, in blocks. + + + The basic formula for calculating this is: MaxAgeDuration / {average + block + + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. + + + It should correspond with an app's "unbonding period" or other similar + + mechanism for handling [Nothing-At-Stake + + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes that can be + committed in a single block. + + and should fall comfortably under the max block bytes. + + Default is 1048576 or 1MB + description: EvidenceParams determine how we handle evidence of malfeasance. + tendermint.types.ValidatorParams: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: |- + ValidatorParams restrict the public key types validators can use. + NOTE: uses ABCI pubkey naming, not Amino names. + tendermint.types.VersionParams: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. + cosmos.crisis.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.crisis.v1beta1.MsgVerifyInvariantResponse: + type: object + description: MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. + cosmos.base.v1beta1.DecCoin: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + cosmos.distribution.v1beta1.DelegationDelegatorReward: + type: object + properties: + validator_address: + type: string + reward: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: |- + DelegationDelegatorReward represents the properties + of a delegator's delegation reward. + cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse: + type: object + description: |- + MsgCommunityPoolSpendResponse defines the response to executing a + MsgCommunityPoolSpend message. + + Since: cosmos-sdk 0.47 + cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse: + type: object + description: >- + MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response + type. + cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse: + type: object + description: |- + MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + type. + cosmos.distribution.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse: + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: 'Since: cosmos-sdk 0.46' + description: |- + MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + response type. + cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse: + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: 'Since: cosmos-sdk 0.46' + description: |- + MsgWithdrawValidatorCommissionResponse defines the + Msg/WithdrawValidatorCommission response type. + cosmos.distribution.v1beta1.Params: + type: object + properties: + community_tax: + type: string + base_proposer_reward: + type: string + description: >- + Deprecated: The base_proposer_reward field is deprecated and is no + longer used + + in the x/distribution module's reward mechanism. + bonus_proposer_reward: + type: string + description: >- + Deprecated: The bonus_proposer_reward field is deprecated and is no + longer used + + in the x/distribution module's reward mechanism. + withdraw_addr_enabled: + type: boolean + description: Params defines the set of params for the distribution module. + cosmos.distribution.v1beta1.QueryCommunityPoolResponse: + type: object + properties: + pool: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: pool defines community pool's coins. + description: >- + QueryCommunityPoolResponse is the response type for the + Query/CommunityPool + + RPC method. + cosmos.distribution.v1beta1.QueryDelegationRewardsResponse: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: rewards defines the rewards accrued by a delegation. + description: |- + QueryDelegationRewardsResponse is the response type for the + Query/DelegationRewards RPC method. + cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + validator_address: + type: string + reward: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: |- + DelegationDelegatorReward represents the properties + of a delegator's delegation reward. + description: rewards defines all the rewards accrued by a delegator. + total: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: total defines the sum of all the rewards. + description: |- + QueryDelegationTotalRewardsResponse is the response type for the + Query/DelegationTotalRewards RPC method. + cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse: + type: object + properties: + validators: + type: array + items: + type: string + description: validators defines the validators a delegator is delegating for. + description: |- + QueryDelegatorValidatorsResponse is the response type for the + Query/DelegatorValidators RPC method. + cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse: + type: object + properties: + withdraw_address: + type: string + description: withdraw_address defines the delegator address to query for. + description: |- + QueryDelegatorWithdrawAddressResponse is the response type for the + Query/DelegatorWithdrawAddress RPC method. + cosmos.distribution.v1beta1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + community_tax: + type: string + base_proposer_reward: + type: string + description: >- + Deprecated: The base_proposer_reward field is deprecated and is no + longer used + + in the x/distribution module's reward mechanism. + bonus_proposer_reward: + type: string + description: >- + Deprecated: The bonus_proposer_reward field is deprecated and is + no longer used + + in the x/distribution module's reward mechanism. + withdraw_addr_enabled: + type: boolean + description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.distribution.v1beta1.QueryValidatorCommissionResponse: + type: object + properties: + commission: + description: commission defines the commission the validator received. + type: object + properties: + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + title: |- + QueryValidatorCommissionResponse is the response type for the + Query/ValidatorCommission RPC method + cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse: + type: object + properties: + operator_address: + type: string + description: operator_address defines the validator operator address. + self_bond_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: self_bond_rewards defines the self delegations rewards. + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: commission defines the commission the validator received. + description: >- + QueryValidatorDistributionInfoResponse is the response type for the + Query/ValidatorDistributionInfo RPC method. + cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse: + type: object + properties: + rewards: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: >- + ValidatorOutstandingRewards represents outstanding (un-withdrawn) + rewards + + for a validator inexpensive to track, allows simple sanity checks. + description: |- + QueryValidatorOutstandingRewardsResponse is the response type for the + Query/ValidatorOutstandingRewards RPC method. + cosmos.distribution.v1beta1.QueryValidatorSlashesResponse: + type: object + properties: + slashes: + type: array + items: + type: object + properties: + validator_period: + type: string + format: uint64 + fraction: + type: string + description: |- + ValidatorSlashEvent represents a validator slash event. + Height is implicit within the store key. + This is needed to calculate appropriate amount of staking tokens + for delegations which are withdrawn after a slash has occurred. + description: slashes defines the slashes the validator received. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryValidatorSlashesResponse is the response type for the + Query/ValidatorSlashes RPC method. + cosmos.distribution.v1beta1.ValidatorAccumulatedCommission: + type: object + properties: + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: |- + ValidatorAccumulatedCommission represents accumulated commission + for a validator kept as a running counter, can be withdrawn at any time. + cosmos.distribution.v1beta1.ValidatorOutstandingRewards: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: |- + ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + for a validator inexpensive to track, allows simple sanity checks. + cosmos.distribution.v1beta1.ValidatorSlashEvent: + type: object + properties: + validator_period: + type: string + format: uint64 + fraction: + type: string + description: |- + ValidatorSlashEvent represents a validator slash event. + Height is implicit within the store key. + This is needed to calculate appropriate amount of staking tokens + for delegations which are withdrawn after a slash has occurred. + cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse: + type: object + properties: + hash: + type: string + format: byte + description: hash defines the hash of the evidence. + description: MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. + cosmos.evidence.v1beta1.QueryAllEvidenceResponse: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: evidence returns all evidences. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllEvidenceResponse is the response type for the Query/AllEvidence + RPC + + method. + cosmos.evidence.v1beta1.QueryEvidenceResponse: + type: object + properties: + evidence: + description: evidence returns the requested evidence. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + QueryEvidenceResponse is the response type for the Query/Evidence RPC + method. + cosmos.feegrant.v1beta1.Grant: + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance of their + funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an allowance of + another user's funds. + allowance: + description: allowance can be any of basic, periodic, allowed fee allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + title: Grant is stored in the KVStore to record a grant with full context + cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse: + type: object + description: >- + MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response + type. + cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse: + type: object + description: >- + MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse + response type. + cosmos.feegrant.v1beta1.QueryAllowanceResponse: + type: object + properties: + allowance: + description: allowance is a allowance granted for grantee by granter. + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance of their + funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an allowance of + another user's funds. + allowance: + description: allowance can be any of basic, periodic, allowed fee allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + title: Grant is stored in the KVStore to record a grant with full context + description: >- + QueryAllowanceResponse is the response type for the Query/Allowance RPC + method. + cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse: + type: object + properties: + allowances: + type: array + items: + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance of + their funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an allowance of + another user's funds. + allowance: + description: allowance can be any of basic, periodic, allowed fee allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + title: Grant is stored in the KVStore to record a grant with full context + description: allowances that have been issued by the granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllowancesByGranterResponse is the response type for the + Query/AllowancesByGranter RPC method. + + + Since: cosmos-sdk 0.46 + cosmos.feegrant.v1beta1.QueryAllowancesResponse: + type: object + properties: + allowances: + type: array + items: + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance of + their funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an allowance of + another user's funds. + allowance: + description: allowance can be any of basic, periodic, allowed fee allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + title: Grant is stored in the KVStore to record a grant with full context + description: allowances are allowance's granted for grantee by granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllowancesResponse is the response type for the Query/Allowances RPC + method. + cosmos.gov.v1.Deposit: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: |- + Deposit defines an amount deposited by an account address to an active + proposal. + cosmos.gov.v1.DepositParams: + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + description: DepositParams defines the params for deposits on governance proposals. + cosmos.gov.v1.MsgDepositResponse: + type: object + description: MsgDepositResponse defines the Msg/Deposit response type. + cosmos.gov.v1.MsgExecLegacyContentResponse: + type: object + description: >- + MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response + type. + cosmos.gov.v1.MsgSubmitProposalResponse: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + description: MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. + cosmos.gov.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.gov.v1.MsgVoteResponse: + type: object + description: MsgVoteResponse defines the Msg/Vote response type. + cosmos.gov.v1.MsgVoteWeightedResponse: + type: object + description: MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + cosmos.gov.v1.Params: + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + voting_period: + type: string + description: Duration of the voting period. + quorum: + type: string + description: |- + Minimum percentage of total stake needed to vote for a result to be + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. Default value: + 0.5. + veto_threshold: + type: string + description: |- + Minimum value of Veto votes to Total votes ratio for proposal to be + vetoed. Default value: 1/3. + min_initial_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value that must + be paid at proposal submission. + burn_vote_quorum: + type: boolean + title: burn deposits if a proposal does not meet quorum + burn_proposal_deposit_prevote: + type: boolean + title: burn deposits if the proposal does not enter voting period + burn_vote_veto: + type: boolean + title: burn deposits if quorum with vote type no_veto is met + description: |- + Params defines the parameters for the x/gov module. + + Since: cosmos-sdk 0.47 + cosmos.gov.v1.Proposal: + type: object + properties: + id: + type: string + format: uint64 + description: id defines the unique id of the proposal. + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages are the arbitrary messages to be executed if the proposal + passes. + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: |- + final_tally_result is the final tally result of the proposal. When + querying a proposal via gRPC, this field is not populated until the + proposal's voting period has ended. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: abstain_count is the number of abstain votes on a proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + metadata: + type: string + description: metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter + description: Proposal defines the core field members of a governance proposal. + cosmos.gov.v1.ProposalStatus: + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + description: |- + ProposalStatus enumerates the valid statuses of a proposal. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + period. + - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + period. + - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + passed. + - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + been rejected. + - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + failed. + cosmos.gov.v1.QueryDepositResponse: + type: object + properties: + deposit: + description: deposit defines the requested deposit. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + QueryDepositResponse is the response type for the Query/Deposit RPC + method. + cosmos.gov.v1.QueryDepositsResponse: + type: object + properties: + deposits: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + Deposit defines an amount deposited by an account address to an + active + + proposal. + description: deposits defines the requested deposits. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDepositsResponse is the response type for the Query/Deposits RPC + method. + cosmos.gov.v1.QueryParamsResponse: + type: object + properties: + voting_params: + description: |- + Deprecated: Prefer to use `params` instead. + voting_params defines the parameters related to voting. + type: object + properties: + voting_period: + type: string + description: Duration of the voting period. + deposit_params: + description: |- + Deprecated: Prefer to use `params` instead. + deposit_params defines the parameters related to deposit. + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + tally_params: + description: |- + Deprecated: Prefer to use `params` instead. + tally_params defines the parameters related to tally. + type: object + properties: + quorum: + type: string + description: >- + Minimum percentage of total stake needed to vote for a result to + be + + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. Default + value: 0.5. + veto_threshold: + type: string + description: >- + Minimum value of Veto votes to Total votes ratio for proposal to + be + + vetoed. Default value: 1/3. + params: + description: |- + params defines all the paramaters of x/gov module. + + Since: cosmos-sdk 0.47 + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + voting_period: + type: string + description: Duration of the voting period. + quorum: + type: string + description: >- + Minimum percentage of total stake needed to vote for a result to + be + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. Default + value: 0.5. + veto_threshold: + type: string + description: >- + Minimum value of Veto votes to Total votes ratio for proposal to + be + vetoed. Default value: 1/3. + min_initial_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value that + must be paid at proposal submission. + burn_vote_quorum: + type: boolean + title: burn deposits if a proposal does not meet quorum + burn_proposal_deposit_prevote: + type: boolean + title: burn deposits if the proposal does not enter voting period + burn_vote_veto: + type: boolean + title: burn deposits if quorum with vote type no_veto is met + description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.gov.v1.QueryProposalResponse: + type: object + properties: + proposal: + description: proposal is the requested governance proposal. + type: object + properties: + id: + type: string + format: uint64 + description: id defines the unique id of the proposal. + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages are the arbitrary messages to be executed if the proposal + passes. + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the proposal. When + + querying a proposal via gRPC, this field is not populated until + the + + proposal's voting period has ended. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: abstain_count is the number of abstain votes on a proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + metadata: + type: string + description: metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter + description: >- + QueryProposalResponse is the response type for the Query/Proposal RPC + method. + cosmos.gov.v1.QueryProposalsResponse: + type: object + properties: + proposals: + type: array + items: + type: object + properties: + id: + type: string + format: uint64 + description: id defines the unique id of the proposal. + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages are the arbitrary messages to be executed if the + proposal passes. + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the proposal. + When + + querying a proposal via gRPC, this field is not populated until + the + + proposal's voting period has ended. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: abstain_count is the number of abstain votes on a proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + metadata: + type: string + description: metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter + description: Proposal defines the core field members of a governance proposal. + description: proposals defines all the requested governance proposals. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryProposalsResponse is the response type for the Query/Proposals RPC + method. + cosmos.gov.v1.QueryTallyResultResponse: + type: object + properties: + tally: + description: tally defines the requested tally. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: abstain_count is the number of abstain votes on a proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. + description: >- + QueryTallyResultResponse is the response type for the Query/Tally RPC + method. + cosmos.gov.v1.QueryVoteResponse: + type: object + properties: + vote: + description: vote defines the queried vote. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. + metadata: + type: string + description: metadata is any arbitrary metadata to attached to the vote. + description: QueryVoteResponse is the response type for the Query/Vote RPC method. + cosmos.gov.v1.QueryVotesResponse: + type: object + properties: + votes: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. + metadata: + type: string + description: metadata is any arbitrary metadata to attached to the vote. + description: |- + Vote defines a vote on a governance proposal. + A Vote consists of a proposal ID, the voter, and the vote option. + description: votes defines the queried votes. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: QueryVotesResponse is the response type for the Query/Votes RPC method. + cosmos.gov.v1.TallyParams: + type: object + properties: + quorum: + type: string + description: |- + Minimum percentage of total stake needed to vote for a result to be + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. Default value: + 0.5. + veto_threshold: + type: string + description: |- + Minimum value of Veto votes to Total votes ratio for proposal to be + vetoed. Default value: 1/3. + description: TallyParams defines the params for tallying votes on governance proposals. + cosmos.gov.v1.TallyResult: + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: abstain_count is the number of abstain votes on a proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: no_with_veto_count is the number of no with veto votes on a proposal. + description: TallyResult defines a standard tally for a governance proposal. + cosmos.gov.v1.Vote: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. + metadata: + type: string + description: metadata is any arbitrary metadata to attached to the vote. + description: |- + Vote defines a vote on a governance proposal. + A Vote consists of a proposal ID, the voter, and the vote option. + cosmos.gov.v1.VoteOption: + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + description: >- + VoteOption enumerates the valid vote options for a given governance + proposal. + + - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. + - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. + - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. + - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + cosmos.gov.v1.VotingParams: + type: object + properties: + voting_period: + type: string + description: Duration of the voting period. + description: VotingParams defines the params for voting on governance proposals. + cosmos.gov.v1.WeightedVoteOption: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain duplicate + vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: WeightedVoteOption defines a unit of vote for vote split. + cosmos.gov.v1beta1.Deposit: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: |- + Deposit defines an amount deposited by an account address to an active + proposal. + cosmos.gov.v1beta1.DepositParams: + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + description: DepositParams defines the params for deposits on governance proposals. + cosmos.gov.v1beta1.MsgDepositResponse: + type: object + description: MsgDepositResponse defines the Msg/Deposit response type. + cosmos.gov.v1beta1.MsgSubmitProposalResponse: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + description: MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. + cosmos.gov.v1beta1.MsgVoteResponse: + type: object + description: MsgVoteResponse defines the Msg/Vote response type. + cosmos.gov.v1beta1.MsgVoteWeightedResponse: + type: object + description: |- + MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + + Since: cosmos-sdk 0.43 + cosmos.gov.v1beta1.Proposal: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + content: + description: content is the proposal's content. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: |- + final_tally_result is the final tally result of the proposal. When + querying a proposal via gRPC, this field is not populated until the + proposal's voting period has ended. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: no_with_veto is the number of no with veto votes on a proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + description: Proposal defines the core field members of a governance proposal. + cosmos.gov.v1beta1.ProposalStatus: + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + description: |- + ProposalStatus enumerates the valid statuses of a proposal. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + period. + - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + period. + - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + passed. + - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + been rejected. + - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + failed. + cosmos.gov.v1beta1.QueryDepositResponse: + type: object + properties: + deposit: + description: deposit defines the requested deposit. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + QueryDepositResponse is the response type for the Query/Deposit RPC + method. + cosmos.gov.v1beta1.QueryDepositsResponse: + type: object + properties: + deposits: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + Deposit defines an amount deposited by an account address to an + active + + proposal. + description: deposits defines the requested deposits. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDepositsResponse is the response type for the Query/Deposits RPC + method. + cosmos.gov.v1beta1.QueryParamsResponse: + type: object + properties: + voting_params: + description: voting_params defines the parameters related to voting. + type: object + properties: + voting_period: + type: string + description: Duration of the voting period. + deposit_params: + description: deposit_params defines the parameters related to deposit. + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + tally_params: + description: tally_params defines the parameters related to tally. + type: object + properties: + quorum: + type: string + format: byte + description: >- + Minimum percentage of total stake needed to vote for a result to + be + + considered valid. + threshold: + type: string + format: byte + description: >- + Minimum proportion of Yes votes for proposal to pass. Default + value: 0.5. + veto_threshold: + type: string + format: byte + description: >- + Minimum value of Veto votes to Total votes ratio for proposal to + be + + vetoed. Default value: 1/3. + description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.gov.v1beta1.QueryProposalResponse: + type: object + properties: + proposal: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + content: + description: content is the proposal's content. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the proposal. When + + querying a proposal via gRPC, this field is not populated until + the + + proposal's voting period has ended. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + description: Proposal defines the core field members of a governance proposal. + description: >- + QueryProposalResponse is the response type for the Query/Proposal RPC + method. + cosmos.gov.v1beta1.QueryProposalsResponse: + type: object + properties: + proposals: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + content: + description: content is the proposal's content. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the proposal. + When + + querying a proposal via gRPC, this field is not populated until + the + + proposal's voting period has ended. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + description: Proposal defines the core field members of a governance proposal. + description: proposals defines all the requested governance proposals. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryProposalsResponse is the response type for the Query/Proposals RPC + method. + cosmos.gov.v1beta1.QueryTallyResultResponse: + type: object + properties: + tally: + description: tally defines the requested tally. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: no_with_veto is the number of no with veto votes on a proposal. + description: >- + QueryTallyResultResponse is the response type for the Query/Tally RPC + method. + cosmos.gov.v1beta1.QueryVoteResponse: + type: object + properties: + vote: + description: vote defines the queried vote. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + option: + description: >- + Deprecated: Prefer to use `options` instead. This field is set in + queries + + if and only if `len(options) == 1` and that option has weight 1. + In all + + other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: |- + WeightedVoteOption defines a unit of vote for vote split. + + Since: cosmos-sdk 0.43 + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 + description: QueryVoteResponse is the response type for the Query/Vote RPC method. + cosmos.gov.v1beta1.QueryVotesResponse: + type: object + properties: + votes: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + option: + description: >- + Deprecated: Prefer to use `options` instead. This field is set + in queries + + if and only if `len(options) == 1` and that option has weight 1. + In all + + other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: |- + WeightedVoteOption defines a unit of vote for vote split. + + Since: cosmos-sdk 0.43 + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 + description: |- + Vote defines a vote on a governance proposal. + A Vote consists of a proposal ID, the voter, and the vote option. + description: votes defines the queried votes. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: QueryVotesResponse is the response type for the Query/Votes RPC method. + cosmos.gov.v1beta1.TallyParams: + type: object + properties: + quorum: + type: string + format: byte + description: |- + Minimum percentage of total stake needed to vote for a result to be + considered valid. + threshold: + type: string + format: byte + description: >- + Minimum proportion of Yes votes for proposal to pass. Default value: + 0.5. + veto_threshold: + type: string + format: byte + description: |- + Minimum value of Veto votes to Total votes ratio for proposal to be + vetoed. Default value: 1/3. + description: TallyParams defines the params for tallying votes on governance proposals. + cosmos.gov.v1beta1.TallyResult: + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: no_with_veto is the number of no with veto votes on a proposal. + description: TallyResult defines a standard tally for a governance proposal. + cosmos.gov.v1beta1.Vote: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + option: + description: >- + Deprecated: Prefer to use `options` instead. This field is set in + queries + + if and only if `len(options) == 1` and that option has weight 1. In + all + + other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: |- + WeightedVoteOption defines a unit of vote for vote split. + + Since: cosmos-sdk 0.43 + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 + description: |- + Vote defines a vote on a governance proposal. + A Vote consists of a proposal ID, the voter, and the vote option. + cosmos.gov.v1beta1.VoteOption: + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + description: >- + VoteOption enumerates the valid vote options for a given governance + proposal. + + - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. + - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. + - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. + - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + cosmos.gov.v1beta1.VotingParams: + type: object + properties: + voting_period: + type: string + description: Duration of the voting period. + description: VotingParams defines the params for voting on governance proposals. + cosmos.gov.v1beta1.WeightedVoteOption: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain duplicate + vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: |- + WeightedVoteOption defines a unit of vote for vote split. + + Since: cosmos-sdk 0.43 + cosmos.mint.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.mint.v1beta1.Params: + type: object + properties: + mint_denom: + type: string + title: type of coin to mint + inflation_rate_change: + type: string + title: maximum annual change in inflation rate + inflation_max: + type: string + title: maximum inflation rate + inflation_min: + type: string + title: minimum inflation rate + goal_bonded: + type: string + title: goal of percent bonded atoms + blocks_per_year: + type: string + format: uint64 + title: expected blocks per year + description: Params defines the parameters for the x/mint module. + cosmos.mint.v1beta1.QueryAnnualProvisionsResponse: + type: object + properties: + annual_provisions: + type: string + format: byte + description: annual_provisions is the current minting annual provisions value. + description: |- + QueryAnnualProvisionsResponse is the response type for the + Query/AnnualProvisions RPC method. + cosmos.mint.v1beta1.QueryInflationResponse: + type: object + properties: + inflation: + type: string + format: byte + description: inflation is the current minting inflation value. + description: |- + QueryInflationResponse is the response type for the Query/Inflation RPC + method. + cosmos.mint.v1beta1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + mint_denom: + type: string + title: type of coin to mint + inflation_rate_change: + type: string + title: maximum annual change in inflation rate + inflation_max: + type: string + title: maximum inflation rate + inflation_min: + type: string + title: minimum inflation rate + goal_bonded: + type: string + title: goal of percent bonded atoms + blocks_per_year: + type: string + format: uint64 + title: expected blocks per year + description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.nft.v1beta1.Class: + type: object + properties: + id: + type: string + title: >- + id defines the unique identifier of the NFT classification, similar to + the contract address of ERC721 + name: + type: string + title: >- + name defines the human-readable name of the NFT classification. + Optional + symbol: + type: string + title: symbol is an abbreviated name for nft classification. Optional + description: + type: string + title: description is a brief description of nft classification. Optional + uri: + type: string + title: >- + uri for the class metadata stored off chain. It can define schema for + Class and NFT `Data` attributes. Optional + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri. Optional + data: + title: data is the app specific metadata of the NFT class. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: Class defines the class of the nft type. + cosmos.nft.v1beta1.MsgSendResponse: + type: object + description: MsgSendResponse defines the Msg/Send response type. + cosmos.nft.v1beta1.NFT: + type: object + properties: + class_id: + type: string + title: >- + class_id associated with the NFT, similar to the contract address of + ERC721 + id: + type: string + title: id is a unique identifier of the NFT + uri: + type: string + title: uri for the NFT metadata stored off chain + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri + data: + title: data is an app specific data of the NFT. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: NFT defines the NFT. + cosmos.nft.v1beta1.QueryBalanceResponse: + type: object + properties: + amount: + type: string + format: uint64 + title: amount is the number of all NFTs of a given class owned by the owner + title: QueryBalanceResponse is the response type for the Query/Balance RPC method + cosmos.nft.v1beta1.QueryClassResponse: + type: object + properties: + class: + description: class defines the class of the nft type. + type: object + properties: + id: + type: string + title: >- + id defines the unique identifier of the NFT classification, + similar to the contract address of ERC721 + name: + type: string + title: >- + name defines the human-readable name of the NFT classification. + Optional + symbol: + type: string + title: symbol is an abbreviated name for nft classification. Optional + description: + type: string + title: description is a brief description of nft classification. Optional + uri: + type: string + title: >- + uri for the class metadata stored off chain. It can define schema + for Class and NFT `Data` attributes. Optional + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri. Optional + data: + title: data is the app specific metadata of the NFT class. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: QueryClassResponse is the response type for the Query/Class RPC method + cosmos.nft.v1beta1.QueryClassesResponse: + type: object + properties: + classes: + type: array + items: + type: object + properties: + id: + type: string + title: >- + id defines the unique identifier of the NFT classification, + similar to the contract address of ERC721 + name: + type: string + title: >- + name defines the human-readable name of the NFT classification. + Optional + symbol: + type: string + title: symbol is an abbreviated name for nft classification. Optional + description: + type: string + title: >- + description is a brief description of nft classification. + Optional + uri: + type: string + title: >- + uri for the class metadata stored off chain. It can define + schema for Class and NFT `Data` attributes. Optional + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri. Optional + data: + title: data is the app specific metadata of the NFT class. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: Class defines the class of the nft type. + description: class defines the class of the nft type. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: QueryClassesResponse is the response type for the Query/Classes RPC method + cosmos.nft.v1beta1.QueryNFTResponse: + type: object + properties: + nft: + title: owner is the owner address of the nft + type: object + properties: + class_id: + type: string + title: >- + class_id associated with the NFT, similar to the contract address + of ERC721 + id: + type: string + title: id is a unique identifier of the NFT + uri: + type: string + title: uri for the NFT metadata stored off chain + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri + data: + title: data is an app specific data of the NFT. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: NFT defines the NFT. + title: QueryNFTResponse is the response type for the Query/NFT RPC method + cosmos.nft.v1beta1.QueryNFTsResponse: + type: object + properties: + nfts: + type: array + items: + type: object + properties: + class_id: + type: string + title: >- + class_id associated with the NFT, similar to the contract + address of ERC721 + id: + type: string + title: id is a unique identifier of the NFT + uri: + type: string + title: uri for the NFT metadata stored off chain + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri + data: + title: data is an app specific data of the NFT. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: NFT defines the NFT. + title: NFT defines the NFT + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: QueryNFTsResponse is the response type for the Query/NFTs RPC methods + cosmos.nft.v1beta1.QueryOwnerResponse: + type: object + properties: + owner: + type: string + title: owner is the owner address of the nft + title: QueryOwnerResponse is the response type for the Query/Owner RPC method + cosmos.nft.v1beta1.QuerySupplyResponse: + type: object + properties: + amount: + type: string + format: uint64 + title: amount is the number of all NFTs from the given class + title: QuerySupplyResponse is the response type for the Query/Supply RPC method + cosmos.params.v1beta1.ParamChange: + type: object + properties: + subspace: + type: string + key: + type: string + value: + type: string + description: |- + ParamChange defines an individual parameter change, for use in + ParameterChangeProposal. + cosmos.params.v1beta1.QueryParamsResponse: + type: object + properties: + param: + description: param defines the queried parameter. + type: object + properties: + subspace: + type: string + key: + type: string + value: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC method. + cosmos.params.v1beta1.QuerySubspacesResponse: + type: object + properties: + subspaces: + type: array + items: + type: object + properties: + subspace: + type: string + keys: + type: array + items: + type: string + description: >- + Subspace defines a parameter subspace name and all the keys that + exist for + + the subspace. + + + Since: cosmos-sdk 0.46 + description: |- + QuerySubspacesResponse defines the response types for querying for all + registered subspaces and all keys for a subspace. + + Since: cosmos-sdk 0.46 + cosmos.params.v1beta1.Subspace: + type: object + properties: + subspace: + type: string + keys: + type: array + items: + type: string + description: |- + Subspace defines a parameter subspace name and all the keys that exist for + the subspace. + + Since: cosmos-sdk 0.46 + cosmos.slashing.v1beta1.MsgUnjailResponse: + type: object + title: MsgUnjailResponse defines the Msg/Unjail response type + cosmos.slashing.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.slashing.v1beta1.Params: + type: object + properties: + signed_blocks_window: + type: string + format: int64 + min_signed_per_window: + type: string + format: byte + downtime_jail_duration: + type: string + slash_fraction_double_sign: + type: string + format: byte + slash_fraction_downtime: + type: string + format: byte + description: Params represents the parameters used for by the slashing module. + cosmos.slashing.v1beta1.QueryParamsResponse: + type: object + properties: + params: + type: object + properties: + signed_blocks_window: + type: string + format: int64 + min_signed_per_window: + type: string + format: byte + downtime_jail_duration: + type: string + slash_fraction_double_sign: + type: string + format: byte + slash_fraction_downtime: + type: string + format: byte + description: Params represents the parameters used for by the slashing module. + title: QueryParamsResponse is the response type for the Query/Params RPC method + cosmos.slashing.v1beta1.QuerySigningInfoResponse: + type: object + properties: + val_signing_info: + title: val_signing_info is the signing info of requested val cons address + type: object + properties: + address: + type: string + start_height: + type: string + format: int64 + title: Height at which validator was first a candidate OR was unjailed + index_offset: + type: string + format: int64 + description: >- + Index which is incremented each time the validator was a bonded + + in a block and may have signed a precommit or not. This in + conjunction with the + + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time + description: >- + Timestamp until which the validator is jailed due to liveness + downtime. + tombstoned: + type: boolean + description: >- + Whether or not a validator has been tombstoned (killed out of + validator set). It is set + + once the validator commits an equivocation or for any other + configured misbehiavor. + missed_blocks_counter: + type: string + format: int64 + description: >- + A counter kept to avoid unnecessary array reads. + + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. + description: >- + ValidatorSigningInfo defines a validator's signing info for monitoring + their + + liveness activity. + title: >- + QuerySigningInfoResponse is the response type for the Query/SigningInfo + RPC + + method + cosmos.slashing.v1beta1.QuerySigningInfosResponse: + type: object + properties: + info: + type: array + items: + type: object + properties: + address: + type: string + start_height: + type: string + format: int64 + title: Height at which validator was first a candidate OR was unjailed + index_offset: + type: string + format: int64 + description: >- + Index which is incremented each time the validator was a bonded + + in a block and may have signed a precommit or not. This in + conjunction with the + + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time + description: >- + Timestamp until which the validator is jailed due to liveness + downtime. + tombstoned: + type: boolean + description: >- + Whether or not a validator has been tombstoned (killed out of + validator set). It is set + + once the validator commits an equivocation or for any other + configured misbehiavor. + missed_blocks_counter: + type: string + format: int64 + description: >- + A counter kept to avoid unnecessary array reads. + + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. + description: >- + ValidatorSigningInfo defines a validator's signing info for + monitoring their + + liveness activity. + title: info is the signing info of all validators + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: >- + QuerySigningInfosResponse is the response type for the Query/SigningInfos + RPC + + method + cosmos.slashing.v1beta1.ValidatorSigningInfo: + type: object + properties: + address: + type: string + start_height: + type: string + format: int64 + title: Height at which validator was first a candidate OR was unjailed + index_offset: + type: string + format: int64 + description: >- + Index which is incremented each time the validator was a bonded + + in a block and may have signed a precommit or not. This in conjunction + with the + + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time + description: >- + Timestamp until which the validator is jailed due to liveness + downtime. + tombstoned: + type: boolean + description: >- + Whether or not a validator has been tombstoned (killed out of + validator set). It is set + + once the validator commits an equivocation or for any other configured + misbehiavor. + missed_blocks_counter: + type: string + format: int64 + description: >- + A counter kept to avoid unnecessary array reads. + + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. + description: >- + ValidatorSigningInfo defines a validator's signing info for monitoring + their + + liveness activity. + cosmos.staking.v1beta1.BondStatus: + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + description: |- + BondStatus is the status of a validator. + + - BOND_STATUS_UNSPECIFIED: UNSPECIFIED defines an invalid validator status. + - BOND_STATUS_UNBONDED: UNBONDED defines a validator that is not bonded. + - BOND_STATUS_UNBONDING: UNBONDING defines a validator that is unbonding. + - BOND_STATUS_BONDED: BONDED defines a validator that is bonded. + cosmos.staking.v1beta1.Commission: + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be used for + creating a validator. + type: object + properties: + rate: + type: string + description: rate is the commission rate charged to delegators, as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which validator can + ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of the + validator commission, as a fraction. + update_time: + type: string + format: date-time + description: update_time is the last time the commission rate was changed. + description: Commission defines commission parameters for a given validator. + cosmos.staking.v1beta1.CommissionRates: + type: object + properties: + rate: + type: string + description: rate is the commission rate charged to delegators, as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which validator can ever + charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of the validator + commission, as a fraction. + description: >- + CommissionRates defines the initial commission rates to be used for + creating + + a validator. + cosmos.staking.v1beta1.Delegation: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_address: + type: string + description: validator_address is the bech32-encoded address of the validator. + shares: + type: string + description: shares define the delegation shares received. + description: |- + Delegation represents the bond with tokens held by an account. It is + owned by one delegator, and is associated with the voting power of one + validator. + cosmos.staking.v1beta1.DelegationResponse: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_address: + type: string + description: validator_address is the bech32-encoded address of the validator. + shares: + type: string + description: shares define the delegation shares received. + description: |- + Delegation represents the bond with tokens held by an account. It is + owned by one delegator, and is associated with the voting power of one + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: |- + DelegationResponse is equivalent to Delegation except that it contains a + balance in addition to shares which is more suitable for client responses. + cosmos.staking.v1beta1.Description: + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort or + Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: security_contact defines an optional email for security contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + cosmos.staking.v1beta1.HistoricalInfo: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in + the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + valset: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort + or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be + used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of + the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum + self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator + description: >- + Validator defines a validator, together with the total amount of the + + Validator's bond shares and their exchange rate to coins. Slashing + results in + + a decrease in the exchange rate, allowing correct calculation of + future + + undelegations without iterating over delegators. When coins are + delegated to + + this validator, the validator is credited with a delegation whose + number of + + bond shares is based on the amount of coins delegated divided by the + current + + exchange rate. Voting power can be calculated as total bonded shares + + multiplied by exchange rate. + description: >- + HistoricalInfo contains header and validator information for a given + block. + + It is stored as part of staking module's state, which persists the `n` + most + + recent HistoricalInfo + + (`n` is set by the staking module's `historical_entries` parameter). + cosmos.staking.v1beta1.MsgBeginRedelegateResponse: + type: object + properties: + completion_time: + type: string + format: date-time + description: MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. + cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse: + type: object + description: 'Since: cosmos-sdk 0.46' + title: MsgCancelUnbondingDelegationResponse + cosmos.staking.v1beta1.MsgCreateValidatorResponse: + type: object + description: MsgCreateValidatorResponse defines the Msg/CreateValidator response type. + cosmos.staking.v1beta1.MsgDelegateResponse: + type: object + description: MsgDelegateResponse defines the Msg/Delegate response type. + cosmos.staking.v1beta1.MsgEditValidatorResponse: + type: object + description: MsgEditValidatorResponse defines the Msg/EditValidator response type. + cosmos.staking.v1beta1.MsgUndelegateResponse: + type: object + properties: + completion_time: + type: string + format: date-time + description: MsgUndelegateResponse defines the Msg/Undelegate response type. + cosmos.staking.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.staking.v1beta1.Params: + type: object + properties: + unbonding_time: + type: string + description: unbonding_time is the time duration of unbonding. + max_validators: + type: integer + format: int64 + description: max_validators is the maximum number of validators. + max_entries: + type: integer + format: int64 + description: >- + max_entries is the max entries for either unbonding delegation or + redelegation (per pair/trio). + historical_entries: + type: integer + format: int64 + description: historical_entries is the number of historical entries to persist. + bond_denom: + type: string + description: bond_denom defines the bondable coin denomination. + min_commission_rate: + type: string + title: >- + min_commission_rate is the chain-wide minimum commission rate that a + validator can charge their delegators + description: Params defines the parameters for the x/staking module. + cosmos.staking.v1beta1.Pool: + type: object + properties: + not_bonded_tokens: + type: string + bonded_tokens: + type: string + description: |- + Pool is used for tracking bonded and not-bonded token supply of the bond + denomination. + cosmos.staking.v1beta1.QueryDelegationResponse: + type: object + properties: + delegation_response: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an account. It + is + + owned by one delegator, and is associated with the voting power of + one + + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that it contains + a + + balance in addition to shares which is more suitable for client + responses. + description: >- + QueryDelegationResponse is response type for the Query/Delegation RPC + method. + cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse: + type: object + properties: + delegation_responses: + type: array + items: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an account. + It is + + owned by one delegator, and is associated with the voting power + of one + + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that it + contains a + + balance in addition to shares which is more suitable for client + responses. + description: delegation_responses defines all the delegations' info of a delegator. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryDelegatorDelegationsResponse is response type for the + Query/DelegatorDelegations RPC method. + cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse: + type: object + properties: + unbonding_responses: + type: array + items: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding took + place. + completion_time: + type: string + format: date-time + description: completion_time is the unix time for unbonding completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially scheduled to + receive at completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object with + relevant metadata. + description: entries are the unbonding delegation entries. + description: >- + UnbondingDelegation stores all of a single delegator's unbonding + bonds + + for a single validator in an time-ordered list. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryUnbondingDelegatorDelegationsResponse is response type for the + Query/UnbondingDelegatorDelegations RPC method. + cosmos.staking.v1beta1.QueryDelegatorValidatorResponse: + type: object + properties: + validator: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's operator; + bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort or + Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be + used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of the + validator commission, as a fraction. + update_time: + type: string + format: date-time + description: update_time is the last time the commission rate was changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum self + delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator + description: >- + Validator defines a validator, together with the total amount of the + + Validator's bond shares and their exchange rate to coins. Slashing + results in + + a decrease in the exchange rate, allowing correct calculation of + future + + undelegations without iterating over delegators. When coins are + delegated to + + this validator, the validator is credited with a delegation whose + number of + + bond shares is based on the amount of coins delegated divided by the + current + + exchange rate. Voting power can be calculated as total bonded shares + + multiplied by exchange rate. + description: |- + QueryDelegatorValidatorResponse response type for the + Query/DelegatorValidator RPC method. + cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse: + type: object + properties: + validators: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort + or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be + used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of + the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum + self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator + description: >- + Validator defines a validator, together with the total amount of the + + Validator's bond shares and their exchange rate to coins. Slashing + results in + + a decrease in the exchange rate, allowing correct calculation of + future + + undelegations without iterating over delegators. When coins are + delegated to + + this validator, the validator is credited with a delegation whose + number of + + bond shares is based on the amount of coins delegated divided by the + current + + exchange rate. Voting power can be calculated as total bonded shares + + multiplied by exchange rate. + description: validators defines the validators' info of a delegator. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryDelegatorValidatorsResponse is response type for the + Query/DelegatorValidators RPC method. + cosmos.staking.v1beta1.QueryHistoricalInfoResponse: + type: object + properties: + hist: + description: hist defines the historical info at the given height. + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + valset: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from + bonded status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which + this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to + be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, + as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase + of the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum + self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding + of this validator + description: >- + Validator defines a validator, together with the total amount of + the + + Validator's bond shares and their exchange rate to coins. + Slashing results in + + a decrease in the exchange rate, allowing correct calculation of + future + + undelegations without iterating over delegators. When coins are + delegated to + + this validator, the validator is credited with a delegation + whose number of + + bond shares is based on the amount of coins delegated divided by + the current + + exchange rate. Voting power can be calculated as total bonded + shares + + multiplied by exchange rate. + description: >- + QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo + RPC + + method. + cosmos.staking.v1beta1.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + unbonding_time: + type: string + description: unbonding_time is the time duration of unbonding. + max_validators: + type: integer + format: int64 + description: max_validators is the maximum number of validators. + max_entries: + type: integer + format: int64 + description: >- + max_entries is the max entries for either unbonding delegation or + redelegation (per pair/trio). + historical_entries: + type: integer + format: int64 + description: historical_entries is the number of historical entries to persist. + bond_denom: + type: string + description: bond_denom defines the bondable coin denomination. + min_commission_rate: + type: string + title: >- + min_commission_rate is the chain-wide minimum commission rate that + a validator can charge their delegators + description: QueryParamsResponse is response type for the Query/Params RPC method. + cosmos.staking.v1beta1.QueryPoolResponse: + type: object + properties: + pool: + description: pool defines the pool info. + type: object + properties: + not_bonded_tokens: + type: string + bonded_tokens: + type: string + description: QueryPoolResponse is response type for the Query/Pool RPC method. + cosmos.staking.v1beta1.QueryRedelegationsResponse: + type: object + properties: + redelegation_responses: + type: array + items: + type: object + properties: + redelegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_src_address: + type: string + description: >- + validator_src_address is the validator redelegation source + operator address. + validator_dst_address: + type: string + description: >- + validator_dst_address is the validator redelegation + destination operator address. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the + redelegation took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for redelegation + completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when + redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator + shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules + description: >- + RedelegationEntry defines a redelegation object with + relevant metadata. + description: entries are the redelegation entries. + description: >- + Redelegation contains the list of a particular delegator's + redelegating bonds + + from a particular source validator to a particular destination + validator. + entries: + type: array + items: + type: object + properties: + redelegation_entry: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the + redelegation took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for redelegation + completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when + redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator + shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules + description: >- + RedelegationEntry defines a redelegation object with + relevant metadata. + balance: + type: string + description: >- + RedelegationEntryResponse is equivalent to a RedelegationEntry + except that it + + contains a balance in addition to shares which is more + suitable for client + + responses. + description: >- + RedelegationResponse is equivalent to a Redelegation except that its + entries + + contain a balance in addition to shares which is more suitable for + client + + responses. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryRedelegationsResponse is response type for the Query/Redelegations + RPC + + method. + cosmos.staking.v1beta1.QueryUnbondingDelegationResponse: + type: object + properties: + unbond: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_address: + type: string + description: validator_address is the bech32-encoded address of the validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding took + place. + completion_time: + type: string + format: date-time + description: completion_time is the unix time for unbonding completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially scheduled to + receive at completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped + by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object with + relevant metadata. + description: entries are the unbonding delegation entries. + description: |- + UnbondingDelegation stores all of a single delegator's unbonding bonds + for a single validator in an time-ordered list. + description: |- + QueryDelegationResponse is response type for the Query/UnbondingDelegation + RPC method. + cosmos.staking.v1beta1.QueryValidatorDelegationsResponse: + type: object + properties: + delegation_responses: + type: array + items: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an account. + It is + + owned by one delegator, and is associated with the voting power + of one + + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that it + contains a + + balance in addition to shares which is more suitable for client + responses. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: |- + QueryValidatorDelegationsResponse is response type for the + Query/ValidatorDelegations RPC method + cosmos.staking.v1beta1.QueryValidatorResponse: + type: object + properties: + validator: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's operator; + bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort or + Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be + used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of the + validator commission, as a fraction. + update_time: + type: string + format: date-time + description: update_time is the last time the commission rate was changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum self + delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator + description: >- + Validator defines a validator, together with the total amount of the + + Validator's bond shares and their exchange rate to coins. Slashing + results in + + a decrease in the exchange rate, allowing correct calculation of + future + + undelegations without iterating over delegators. When coins are + delegated to + + this validator, the validator is credited with a delegation whose + number of + + bond shares is based on the amount of coins delegated divided by the + current + + exchange rate. Voting power can be calculated as total bonded shares + + multiplied by exchange rate. + title: QueryValidatorResponse is response type for the Query/Validator RPC method + cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse: + type: object + properties: + unbonding_responses: + type: array + items: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding took + place. + completion_time: + type: string + format: date-time + description: completion_time is the unix time for unbonding completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially scheduled to + receive at completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object with + relevant metadata. + description: entries are the unbonding delegation entries. + description: >- + UnbondingDelegation stores all of a single delegator's unbonding + bonds + + for a single validator in an time-ordered list. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryValidatorUnbondingDelegationsResponse is response type for the + Query/ValidatorUnbondingDelegations RPC method. + cosmos.staking.v1beta1.QueryValidatorsResponse: + type: object + properties: + validators: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort + or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be + used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of + the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum + self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator + description: >- + Validator defines a validator, together with the total amount of the + + Validator's bond shares and their exchange rate to coins. Slashing + results in + + a decrease in the exchange rate, allowing correct calculation of + future + + undelegations without iterating over delegators. When coins are + delegated to + + this validator, the validator is credited with a delegation whose + number of + + bond shares is based on the amount of coins delegated divided by the + current + + exchange rate. Voting power can be calculated as total bonded shares + + multiplied by exchange rate. + description: validators contains all the queried validators. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryValidatorsResponse is response type for the Query/Validators RPC + method + cosmos.staking.v1beta1.Redelegation: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_src_address: + type: string + description: >- + validator_src_address is the validator redelegation source operator + address. + validator_dst_address: + type: string + description: >- + validator_dst_address is the validator redelegation destination + operator address. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the redelegation took + place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for redelegation + completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when redelegation + started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator shares created + by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules + description: >- + RedelegationEntry defines a redelegation object with relevant + metadata. + description: entries are the redelegation entries. + description: >- + Redelegation contains the list of a particular delegator's redelegating + bonds + + from a particular source validator to a particular destination validator. + cosmos.staking.v1beta1.RedelegationEntry: + type: object + properties: + creation_height: + type: string + format: int64 + description: creation_height defines the height which the redelegation took place. + completion_time: + type: string + format: date-time + description: completion_time defines the unix time for redelegation completion. + initial_balance: + type: string + description: initial_balance defines the initial balance when redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator shares created by + redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules + description: RedelegationEntry defines a redelegation object with relevant metadata. + cosmos.staking.v1beta1.RedelegationEntryResponse: + type: object + properties: + redelegation_entry: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the redelegation took + place. + completion_time: + type: string + format: date-time + description: completion_time defines the unix time for redelegation completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when redelegation + started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator shares created + by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules + description: >- + RedelegationEntry defines a redelegation object with relevant + metadata. + balance: + type: string + description: >- + RedelegationEntryResponse is equivalent to a RedelegationEntry except that + it + + contains a balance in addition to shares which is more suitable for client + + responses. + cosmos.staking.v1beta1.RedelegationResponse: + type: object + properties: + redelegation: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_src_address: + type: string + description: >- + validator_src_address is the validator redelegation source + operator address. + validator_dst_address: + type: string + description: >- + validator_dst_address is the validator redelegation destination + operator address. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the redelegation + took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for redelegation + completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when + redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator shares + created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped + by external modules + description: >- + RedelegationEntry defines a redelegation object with relevant + metadata. + description: entries are the redelegation entries. + description: >- + Redelegation contains the list of a particular delegator's + redelegating bonds + + from a particular source validator to a particular destination + validator. + entries: + type: array + items: + type: object + properties: + redelegation_entry: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the redelegation + took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for redelegation + completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when + redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator shares + created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped + by external modules + description: >- + RedelegationEntry defines a redelegation object with relevant + metadata. + balance: + type: string + description: >- + RedelegationEntryResponse is equivalent to a RedelegationEntry + except that it + + contains a balance in addition to shares which is more suitable for + client + + responses. + description: >- + RedelegationResponse is equivalent to a Redelegation except that its + entries + + contain a balance in addition to shares which is more suitable for client + + responses. + cosmos.staking.v1beta1.UnbondingDelegation: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_address: + type: string + description: validator_address is the bech32-encoded address of the validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: creation_height is the height which the unbonding took place. + completion_time: + type: string + format: date-time + description: completion_time is the unix time for unbonding completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially scheduled to + receive at completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules + description: >- + UnbondingDelegationEntry defines an unbonding object with relevant + metadata. + description: entries are the unbonding delegation entries. + description: |- + UnbondingDelegation stores all of a single delegator's unbonding bonds + for a single validator in an time-ordered list. + cosmos.staking.v1beta1.UnbondingDelegationEntry: + type: object + properties: + creation_height: + type: string + format: int64 + description: creation_height is the height which the unbonding took place. + completion_time: + type: string + format: date-time + description: completion_time is the unix time for unbonding completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially scheduled to receive at + completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules + description: >- + UnbondingDelegationEntry defines an unbonding object with relevant + metadata. + cosmos.staking.v1beta1.Validator: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's operator; bech + encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort or + Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: security_contact defines an optional email for security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the validator + to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be used + for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which validator + can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of the + validator commission, as a fraction. + update_time: + type: string + format: date-time + description: update_time is the last time the commission rate was changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum self + delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped by + external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of this + validator + description: >- + Validator defines a validator, together with the total amount of the + + Validator's bond shares and their exchange rate to coins. Slashing results + in + + a decrease in the exchange rate, allowing correct calculation of future + + undelegations without iterating over delegators. When coins are delegated + to + + this validator, the validator is credited with a delegation whose number + of + + bond shares is based on the amount of coins delegated divided by the + current + + exchange rate. Voting power can be calculated as total bonded shares + + multiplied by exchange rate. + cosmos.base.abci.v1beta1.ABCIMessageLog: + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where the key and value + are + + strings instead of raw bytes. + description: |- + StringEvent defines en Event object wrapper where all the attributes + contain key/value pairs that are strings instead of raw bytes. + description: |- + Events contains a slice of Event objects that were emitted during some + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed tx ABCI message + log. + cosmos.base.abci.v1beta1.Attribute: + type: object + properties: + key: + type: string + value: + type: string + description: |- + Attribute defines an attribute wrapper where the key and value are + strings instead of raw bytes. + cosmos.base.abci.v1beta1.GasInfo: + type: object + properties: + gas_wanted: + type: string + format: uint64 + description: GasWanted is the maximum units of work we allow this tx to perform. + gas_used: + type: string + format: uint64 + description: GasUsed is the amount of gas actually consumed. + description: GasInfo defines tx execution gas context. + cosmos.base.abci.v1beta1.Result: + type: object + properties: + data: + type: string + format: byte + description: >- + Data is any data returned from message or handler execution. It MUST + be + + length prefixed in order to separate data from multiple message + executions. + + Deprecated. This field is still populated, but prefer msg_response + instead + + because it also contains the Msg response typeURL. + log: + type: string + description: Log contains the log information from message or handler execution. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated with an + event. + description: >- + Event allows application developers to attach additional information + to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events contains a slice of Event objects that were emitted during + message + + or handler execution. + msg_responses: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + msg_responses contains the Msg handler responses type packed in Anys. + + Since: cosmos-sdk 0.46 + description: Result is the union of ResponseFormat and ResponseCheckTx. + cosmos.base.abci.v1beta1.StringEvent: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: |- + Attribute defines an attribute wrapper where the key and value are + strings instead of raw bytes. + description: |- + StringEvent defines en Event object wrapper where all the attributes + contain key/value pairs that are strings instead of raw bytes. + cosmos.base.abci.v1beta1.TxResponse: + type: object + properties: + height: + type: string + format: int64 + title: The block height + txhash: + type: string + description: The transaction hash. + codespace: + type: string + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. + data: + type: string + description: Result bytes, if any. + raw_log: + type: string + description: |- + The output of the application's logger (raw string). May be + non-deterministic. + logs: + type: array + items: + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where the key and + value are + + strings instead of raw bytes. + description: >- + StringEvent defines en Event object wrapper where all the + attributes + + contain key/value pairs that are strings instead of raw bytes. + description: >- + Events contains a slice of Event objects that were emitted + during some + + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed tx ABCI + message log. + description: >- + The output of the application's logger (typed). May be + non-deterministic. + info: + type: string + description: Additional information. May be non-deterministic. + gas_wanted: + type: string + format: int64 + description: Amount of gas requested for transaction. + gas_used: + type: string + format: int64 + description: Amount of gas consumed by transaction. + tx: + description: The request transaction bytes. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + timestamp: + type: string + description: >- + Time of the previous block. For heights > 1, it's the weighted median + of + + the timestamps of the valid votes in the block.LastCommit. For height + == 1, + + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated with an + event. + description: >- + Event allows application developers to attach additional information + to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a transaction. + Note, + + these events include those emitted by processing all the messages and + those + + emitted from the ante. Whereas Logs contains the events, with + + additional metadata, emitted only by processing the messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: >- + TxResponse defines a structure containing relevant tx data and metadata. + The + + tags are stringified and the log is JSON decoded. + cosmos.crypto.multisig.v1beta1.CompactBitArray: + type: object + properties: + extra_bits_stored: + type: integer + format: int64 + elems: + type: string + format: byte + description: |- + CompactBitArray is an implementation of a space efficient bit array. + This is used to ensure that the encoded data takes up a minimal amount of + space after proto encoding. + This is not thread safe, and is not intended for concurrent usage. + cosmos.tx.signing.v1beta1.SignMode: + type: string + enum: + - SIGN_MODE_UNSPECIFIED + - SIGN_MODE_DIRECT + - SIGN_MODE_TEXTUAL + - SIGN_MODE_DIRECT_AUX + - SIGN_MODE_LEGACY_AMINO_JSON + - SIGN_MODE_EIP_191 + default: SIGN_MODE_UNSPECIFIED + description: |- + SignMode represents a signing mode with its own security guarantees. + + This enum should be considered a registry of all known sign modes + in the Cosmos ecosystem. Apps are not expected to support all known + sign modes. Apps that would like to support custom sign modes are + encouraged to open a small PR against this file to add a new case + to this SignMode enum describing their sign mode so that different + apps have a consistent version of this enum. + + - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + rejected. + - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + verified with raw bytes from Tx. + - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some + human-readable textual representation on top of the binary representation + from SIGN_MODE_DIRECT. It is currently not supported. + - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not + require signers signing over other signers' `signer_info`. It also allows + for adding Tips in transactions. + + Since: cosmos-sdk 0.46 + - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + Amino JSON and will be removed in the future. + - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + + Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + but is not implemented on the SDK by default. To enable EIP-191, you need + to pass a custom `TxConfig` that has an implementation of + `SignModeHandler` for EIP-191. The SDK may decide to fully support + EIP-191 in the future. + + Since: cosmos-sdk 0.45.2 + cosmos.tx.v1beta1.AuthInfo: + type: object + properties: + signer_infos: + type: array + items: + type: object + $ref: '#/definitions/cosmos.tx.v1beta1.SignerInfo' + description: >- + signer_infos defines the signing modes for the required signers. The + number + + and order of elements must match the required signers from TxBody's + + messages. The first element is the primary signer and the one which + pays + + the fee. + fee: + description: >- + Fee is the fee and gas limit for the transaction. The first signer is + the + + primary signer and the one which pays the fee. The fee can be + calculated + + based on the cost of evaluating the body and doing signature + verification + + of the signers. This can be estimated via simulation. + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: amount is the amount of coins to be paid as a fee + gas_limit: + type: string + format: uint64 + title: >- + gas_limit is the maximum gas that can be used in transaction + processing + + before an out of gas error occurs + payer: + type: string + description: >- + if unset, the first signer is responsible for paying the fees. If + set, the specified account must pay the fees. + + the payer must be a tx signer (and thus have signed this field in + AuthInfo). + + setting this field does *not* change the ordering of required + signers for the transaction. + granter: + type: string + title: >- + if set, the fee payer (either the first signer or the value of the + payer field) requests that a fee grant be used + + to pay fees instead of the fee payer's own balance. If an + appropriate fee grant does not exist or the chain does + + not support fee grants, this will fail + tip: + description: >- + Tip is the optional tip used for transactions fees paid in another + denom. + + + This field is ignored if the chain didn't enable tips, i.e. didn't add + the + + `TipDecorator` in its posthandler. + + + Since: cosmos-sdk 0.46 + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: amount is the amount of the tip + tipper: + type: string + title: tipper is the address of the account paying for the tip + description: |- + AuthInfo describes the fee and signer modes that are used to sign a + transaction. + cosmos.tx.v1beta1.BroadcastMode: + type: string + enum: + - BROADCAST_MODE_UNSPECIFIED + - BROADCAST_MODE_BLOCK + - BROADCAST_MODE_SYNC + - BROADCAST_MODE_ASYNC + default: BROADCAST_MODE_UNSPECIFIED + description: >- + BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC + method. + + - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. + - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + a CheckTx execution response only. + - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + immediately. + cosmos.tx.v1beta1.BroadcastTxRequest: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + mode: + type: string + enum: + - BROADCAST_MODE_UNSPECIFIED + - BROADCAST_MODE_BLOCK + - BROADCAST_MODE_SYNC + - BROADCAST_MODE_ASYNC + default: BROADCAST_MODE_UNSPECIFIED + description: >- + BroadcastMode specifies the broadcast mode for the TxService.Broadcast + RPC method. + + - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. + - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + a CheckTx execution response only. + - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + immediately. + description: |- + BroadcastTxRequest is the request type for the Service.BroadcastTxRequest + RPC method. + cosmos.tx.v1beta1.BroadcastTxResponse: + type: object + properties: + tx_response: + description: tx_response is the queried TxResponses. + type: object + properties: + height: + type: string + format: int64 + title: The block height + txhash: + type: string + description: The transaction hash. + codespace: + type: string + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. + data: + type: string + description: Result bytes, if any. + raw_log: + type: string + description: |- + The output of the application's logger (raw string). May be + non-deterministic. + logs: + type: array + items: + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where the key + and value are + + strings instead of raw bytes. + description: >- + StringEvent defines en Event object wrapper where all the + attributes + + contain key/value pairs that are strings instead of raw + bytes. + description: >- + Events contains a slice of Event objects that were emitted + during some + + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed tx ABCI + message log. + description: >- + The output of the application's logger (typed). May be + non-deterministic. + info: + type: string + description: Additional information. May be non-deterministic. + gas_wanted: + type: string + format: int64 + description: Amount of gas requested for transaction. + gas_used: + type: string + format: int64 + description: Amount of gas consumed by transaction. + tx: + description: The request transaction bytes. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + timestamp: + type: string + description: >- + Time of the previous block. For heights > 1, it's the weighted + median of + + the timestamps of the valid votes in the block.LastCommit. For + height == 1, + + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated with + an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a transaction. + Note, + + these events include those emitted by processing all the messages + and those + + emitted from the ante. Whereas Logs contains the events, with + + additional metadata, emitted only by processing the messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: |- + BroadcastTxResponse is the response type for the + Service.BroadcastTx method. + cosmos.tx.v1beta1.Fee: + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: amount is the amount of coins to be paid as a fee + gas_limit: + type: string + format: uint64 + title: >- + gas_limit is the maximum gas that can be used in transaction + processing + + before an out of gas error occurs + payer: + type: string + description: >- + if unset, the first signer is responsible for paying the fees. If set, + the specified account must pay the fees. + + the payer must be a tx signer (and thus have signed this field in + AuthInfo). + + setting this field does *not* change the ordering of required signers + for the transaction. + granter: + type: string + title: >- + if set, the fee payer (either the first signer or the value of the + payer field) requests that a fee grant be used + + to pay fees instead of the fee payer's own balance. If an appropriate + fee grant does not exist or the chain does + + not support fee grants, this will fail + description: >- + Fee includes the amount of coins paid in fees and the maximum + + gas to be used by the transaction. The ratio yields an effective + "gasprice", + + which must be above some miminum to be accepted into the mempool. + cosmos.tx.v1beta1.GetBlockWithTxsResponse: + type: object + properties: + txs: + type: array + items: + type: object + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: txs are the transactions in the block. + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + block: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block + was committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + pagination: + description: pagination defines a pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + GetBlockWithTxsResponse is the response type for the + Service.GetBlockWithTxs method. + + + Since: cosmos-sdk 0.45.2 + cosmos.tx.v1beta1.GetTxResponse: + type: object + properties: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: tx is the queried transaction. + tx_response: + description: tx_response is the queried TxResponses. + type: object + properties: + height: + type: string + format: int64 + title: The block height + txhash: + type: string + description: The transaction hash. + codespace: + type: string + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. + data: + type: string + description: Result bytes, if any. + raw_log: + type: string + description: |- + The output of the application's logger (raw string). May be + non-deterministic. + logs: + type: array + items: + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where the key + and value are + + strings instead of raw bytes. + description: >- + StringEvent defines en Event object wrapper where all the + attributes + + contain key/value pairs that are strings instead of raw + bytes. + description: >- + Events contains a slice of Event objects that were emitted + during some + + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed tx ABCI + message log. + description: >- + The output of the application's logger (typed). May be + non-deterministic. + info: + type: string + description: Additional information. May be non-deterministic. + gas_wanted: + type: string + format: int64 + description: Amount of gas requested for transaction. + gas_used: + type: string + format: int64 + description: Amount of gas consumed by transaction. + tx: + description: The request transaction bytes. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + timestamp: + type: string + description: >- + Time of the previous block. For heights > 1, it's the weighted + median of + + the timestamps of the valid votes in the block.LastCommit. For + height == 1, + + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated with + an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a transaction. + Note, + + these events include those emitted by processing all the messages + and those + + emitted from the ante. Whereas Logs contains the events, with + + additional metadata, emitted only by processing the messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: GetTxResponse is the response type for the Service.GetTx method. + cosmos.tx.v1beta1.GetTxsEventResponse: + type: object + properties: + txs: + type: array + items: + type: object + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: txs is the list of queried transactions. + tx_responses: + type: array + items: + type: object + properties: + height: + type: string + format: int64 + title: The block height + txhash: + type: string + description: The transaction hash. + codespace: + type: string + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. + data: + type: string + description: Result bytes, if any. + raw_log: + type: string + description: |- + The output of the application's logger (raw string). May be + non-deterministic. + logs: + type: array + items: + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where the + key and value are + + strings instead of raw bytes. + description: >- + StringEvent defines en Event object wrapper where all + the attributes + + contain key/value pairs that are strings instead of raw + bytes. + description: >- + Events contains a slice of Event objects that were emitted + during some + + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed tx + ABCI message log. + description: >- + The output of the application's logger (typed). May be + non-deterministic. + info: + type: string + description: Additional information. May be non-deterministic. + gas_wanted: + type: string + format: int64 + description: Amount of gas requested for transaction. + gas_used: + type: string + format: int64 + description: Amount of gas consumed by transaction. + tx: + description: The request transaction bytes. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + timestamp: + type: string + description: >- + Time of the previous block. For heights > 1, it's the weighted + median of + + the timestamps of the valid votes in the block.LastCommit. For + height == 1, + + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated + with an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a + transaction. Note, + + these events include those emitted by processing all the + messages and those + + emitted from the ante. Whereas Logs contains the events, with + + additional metadata, emitted only by processing the messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: >- + TxResponse defines a structure containing relevant tx data and + metadata. The + + tags are stringified and the log is JSON decoded. + description: tx_responses is the list of queried TxResponses. + pagination: + description: |- + pagination defines a pagination for the response. + Deprecated post v0.46.x: use total instead. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + total: + type: string + format: uint64 + title: total is total number of results available + description: |- + GetTxsEventResponse is the response type for the Service.TxsByEvents + RPC method. + cosmos.tx.v1beta1.ModeInfo: + type: object + properties: + single: + title: single represents a single signer + type: object + properties: + mode: + title: mode is the signing mode of the single signer + type: string + enum: + - SIGN_MODE_UNSPECIFIED + - SIGN_MODE_DIRECT + - SIGN_MODE_TEXTUAL + - SIGN_MODE_DIRECT_AUX + - SIGN_MODE_LEGACY_AMINO_JSON + - SIGN_MODE_EIP_191 + default: SIGN_MODE_UNSPECIFIED + description: >- + SignMode represents a signing mode with its own security + guarantees. + + + This enum should be considered a registry of all known sign modes + + in the Cosmos ecosystem. Apps are not expected to support all + known + + sign modes. Apps that would like to support custom sign modes are + + encouraged to open a small PR against this file to add a new case + + to this SignMode enum describing their sign mode so that different + + apps have a consistent version of this enum. + + - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + rejected. + - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + verified with raw bytes from Tx. + - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some + human-readable textual representation on top of the binary + representation + + from SIGN_MODE_DIRECT. It is currently not supported. + - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode + does not + + require signers signing over other signers' `signer_info`. It also + allows + + for adding Tips in transactions. + + + Since: cosmos-sdk 0.46 + - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + Amino JSON and will be removed in the future. + - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + + + Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum + variant, + + but is not implemented on the SDK by default. To enable EIP-191, + you need + + to pass a custom `TxConfig` that has an implementation of + + `SignModeHandler` for EIP-191. The SDK may decide to fully support + + EIP-191 in the future. + + + Since: cosmos-sdk 0.45.2 + multi: + $ref: '#/definitions/cosmos.tx.v1beta1.ModeInfo.Multi' + title: multi represents a nested multisig signer + description: ModeInfo describes the signing mode of a single or nested multisig signer. + cosmos.tx.v1beta1.ModeInfo.Multi: + type: object + properties: + bitarray: + title: bitarray specifies which keys within the multisig are signing + type: object + properties: + extra_bits_stored: + type: integer + format: int64 + elems: + type: string + format: byte + description: >- + CompactBitArray is an implementation of a space efficient bit array. + + This is used to ensure that the encoded data takes up a minimal amount + of + + space after proto encoding. + + This is not thread safe, and is not intended for concurrent usage. + mode_infos: + type: array + items: + type: object + $ref: '#/definitions/cosmos.tx.v1beta1.ModeInfo' + title: |- + mode_infos is the corresponding modes of the signers of the multisig + which could include nested multisig public keys + title: Multi is the mode info for a multisig public key + cosmos.tx.v1beta1.ModeInfo.Single: + type: object + properties: + mode: + title: mode is the signing mode of the single signer + type: string + enum: + - SIGN_MODE_UNSPECIFIED + - SIGN_MODE_DIRECT + - SIGN_MODE_TEXTUAL + - SIGN_MODE_DIRECT_AUX + - SIGN_MODE_LEGACY_AMINO_JSON + - SIGN_MODE_EIP_191 + default: SIGN_MODE_UNSPECIFIED + description: >- + SignMode represents a signing mode with its own security guarantees. + + + This enum should be considered a registry of all known sign modes + + in the Cosmos ecosystem. Apps are not expected to support all known + + sign modes. Apps that would like to support custom sign modes are + + encouraged to open a small PR against this file to add a new case + + to this SignMode enum describing their sign mode so that different + + apps have a consistent version of this enum. + + - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + rejected. + - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + verified with raw bytes from Tx. + - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some + human-readable textual representation on top of the binary + representation + + from SIGN_MODE_DIRECT. It is currently not supported. + - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does + not + + require signers signing over other signers' `signer_info`. It also + allows + + for adding Tips in transactions. + + + Since: cosmos-sdk 0.46 + - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + Amino JSON and will be removed in the future. + - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + + + Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + + but is not implemented on the SDK by default. To enable EIP-191, you + need + + to pass a custom `TxConfig` that has an implementation of + + `SignModeHandler` for EIP-191. The SDK may decide to fully support + + EIP-191 in the future. + + + Since: cosmos-sdk 0.45.2 + title: |- + Single is the mode info for a single signer. It is structured as a message + to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + future + cosmos.tx.v1beta1.OrderBy: + type: string + enum: + - ORDER_BY_UNSPECIFIED + - ORDER_BY_ASC + - ORDER_BY_DESC + default: ORDER_BY_UNSPECIFIED + description: >- + - ORDER_BY_UNSPECIFIED: ORDER_BY_UNSPECIFIED specifies an unknown sorting + order. OrderBy defaults to ASC in this case. + - ORDER_BY_ASC: ORDER_BY_ASC defines ascending order + - ORDER_BY_DESC: ORDER_BY_DESC defines descending order + title: OrderBy defines the sorting order + cosmos.tx.v1beta1.SignerInfo: + type: object + properties: + public_key: + description: >- + public_key is the public key of the signer. It is optional for + accounts + + that already exist in state. If unset, the verifier can use the + required \ + + signer address for this position and lookup the public key. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + mode_info: + $ref: '#/definitions/cosmos.tx.v1beta1.ModeInfo' + title: |- + mode_info describes the signing mode of the signer and is a nested + structure to support nested multisig pubkey's + sequence: + type: string + format: uint64 + description: >- + sequence is the sequence of the account, which describes the + + number of committed transactions signed by a given address. It is used + to + + prevent replay attacks. + description: |- + SignerInfo describes the public key and signing mode of a single top-level + signer. + cosmos.tx.v1beta1.SimulateRequest: + type: object + properties: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: |- + tx is the transaction to simulate. + Deprecated. Send raw tx bytes instead. + tx_bytes: + type: string + format: byte + description: |- + tx_bytes is the raw transaction. + + Since: cosmos-sdk 0.43 + description: |- + SimulateRequest is the request type for the Service.Simulate + RPC method. + cosmos.tx.v1beta1.SimulateResponse: + type: object + properties: + gas_info: + description: gas_info is the information about gas used in the simulation. + type: object + properties: + gas_wanted: + type: string + format: uint64 + description: >- + GasWanted is the maximum units of work we allow this tx to + perform. + gas_used: + type: string + format: uint64 + description: GasUsed is the amount of gas actually consumed. + result: + description: result is the result of the simulation. + type: object + properties: + data: + type: string + format: byte + description: >- + Data is any data returned from message or handler execution. It + MUST be + + length prefixed in order to separate data from multiple message + executions. + + Deprecated. This field is still populated, but prefer msg_response + instead + + because it also contains the Msg response typeURL. + log: + type: string + description: >- + Log contains the log information from message or handler + execution. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated with + an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events contains a slice of Event objects that were emitted during + message + + or handler execution. + msg_responses: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + msg_responses contains the Msg handler responses type packed in + Anys. + + + Since: cosmos-sdk 0.46 + description: |- + SimulateResponse is the response type for the + Service.SimulateRPC method. + cosmos.tx.v1beta1.Tip: + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: amount is the amount of the tip + tipper: + type: string + title: tipper is the address of the account paying for the tip + description: |- + Tip is the tip used for meta-transactions. + + Since: cosmos-sdk 0.46 + cosmos.tx.v1beta1.Tx: + type: object + properties: + body: + title: body is the processable content of the transaction + type: object + properties: + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages is a list of messages to be executed. The required + signers of + + those messages define the number and order of elements in + AuthInfo's + + signer_infos and Tx's signatures. Each required signer address is + added to + + the list only the first time it occurs. + + By convention, the first required signer (usually from the first + message) + + is referred to as the primary signer and pays the fee for the + whole + + transaction. + memo: + type: string + description: >- + memo is any arbitrary note/comment to be added to the transaction. + + WARNING: in clients, any publicly exposed text should not be + called memo, + + but should be called `note` instead (see + https://github.com/cosmos/cosmos-sdk/issues/9122). + timeout_height: + type: string + format: uint64 + title: |- + timeout is the block height after which this transaction will not + be processed by the chain + extension_options: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + extension_options are arbitrary options that can be added by + chains + + when the default options are not sufficient. If any of these are + present + + and can't be handled, the transaction will be rejected + non_critical_extension_options: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + extension_options are arbitrary options that can be added by + chains + + when the default options are not sufficient. If any of these are + present + + and can't be handled, they will be ignored + description: TxBody is the body of a transaction that all signers sign over. + auth_info: + $ref: '#/definitions/cosmos.tx.v1beta1.AuthInfo' + title: |- + auth_info is the authorization related content of the transaction, + specifically signers, signer modes and fee + signatures: + type: array + items: + type: string + format: byte + description: >- + signatures is a list of signatures that matches the length and order + of + + AuthInfo's signer_infos to allow connecting signature meta information + like + + public key and signing mode by position. + description: Tx is the standard type used for broadcasting transactions. + cosmos.tx.v1beta1.TxBody: + type: object + properties: + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages is a list of messages to be executed. The required signers of + + those messages define the number and order of elements in AuthInfo's + + signer_infos and Tx's signatures. Each required signer address is + added to + + the list only the first time it occurs. + + By convention, the first required signer (usually from the first + message) + + is referred to as the primary signer and pays the fee for the whole + + transaction. + memo: + type: string + description: >- + memo is any arbitrary note/comment to be added to the transaction. + + WARNING: in clients, any publicly exposed text should not be called + memo, + + but should be called `note` instead (see + https://github.com/cosmos/cosmos-sdk/issues/9122). + timeout_height: + type: string + format: uint64 + title: |- + timeout is the block height after which this transaction will not + be processed by the chain + extension_options: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + extension_options are arbitrary options that can be added by chains + + when the default options are not sufficient. If any of these are + present + + and can't be handled, the transaction will be rejected + non_critical_extension_options: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + extension_options are arbitrary options that can be added by chains + + when the default options are not sufficient. If any of these are + present + + and can't be handled, they will be ignored + description: TxBody is the body of a transaction that all signers sign over. + cosmos.tx.v1beta1.TxDecodeAminoRequest: + type: object + properties: + amino_binary: + type: string + format: byte + description: |- + TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxDecodeAminoResponse: + type: object + properties: + amino_json: + type: string + description: |- + TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxDecodeRequest: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + description: |- + TxDecodeRequest is the request type for the Service.TxDecode + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxDecodeResponse: + type: object + properties: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: tx is the decoded transaction. + description: |- + TxDecodeResponse is the response type for the + Service.TxDecode method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeAminoRequest: + type: object + properties: + amino_json: + type: string + description: |- + TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeAminoResponse: + type: object + properties: + amino_binary: + type: string + format: byte + description: |- + TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeRequest: + type: object + properties: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: tx is the transaction to encode. + description: |- + TxEncodeRequest is the request type for the Service.TxEncode + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeResponse: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the encoded transaction bytes. + description: |- + TxEncodeResponse is the response type for the + Service.TxEncode method. + + Since: cosmos-sdk 0.47 + tendermint.abci.Event: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: EventAttribute is a single key-value pair, associated with an event. + description: >- + Event allows application developers to attach additional information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + tendermint.abci.EventAttribute: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: EventAttribute is a single key-value pair, associated with an event. + cosmos.upgrade.v1beta1.ModuleVersion: + type: object + properties: + name: + type: string + title: name of the app module + version: + type: string + format: uint64 + title: consensus version of the app module + description: |- + ModuleVersion specifies a module and its consensus version. + + Since: cosmos-sdk 0.43 + cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse: + type: object + description: |- + MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + + Since: cosmos-sdk 0.46 + cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse: + type: object + description: |- + MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + + Since: cosmos-sdk 0.46 + cosmos.upgrade.v1beta1.Plan: + type: object + properties: + name: + type: string + description: >- + Sets the name for the upgrade. This name will be used by the upgraded + + version of the software to apply any special "on-upgrade" commands + during + + the first BeginBlock method after the upgrade is applied. It is also + used + + to detect whether a software version can handle a given upgrade. If no + + upgrade handler with this name has been set in the software, it will + be + + assumed that the software is out-of-date when the upgrade Time or + Height is + + reached and the software will exit. + time: + type: string + format: date-time + description: >- + Deprecated: Time based upgrades have been deprecated. Time based + upgrade logic + + has been removed from the SDK. + + If this field is not empty, an error will be thrown. + height: + type: string + format: int64 + description: The height at which the upgrade must be performed. + info: + type: string + title: |- + Any application specific upgrade info to be included on-chain + such as a git commit that validators could automatically upgrade to + upgraded_client_state: + description: >- + Deprecated: UpgradedClientState field has been deprecated. IBC upgrade + logic has been + + moved to the IBC module in the sub module 02-client. + + If this field is not empty, an error will be thrown. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + Plan specifies information about a planned upgrade and when it should + occur. + cosmos.upgrade.v1beta1.QueryAppliedPlanResponse: + type: object + properties: + height: + type: string + format: int64 + description: height is the block height at which the plan was applied. + description: >- + QueryAppliedPlanResponse is the response type for the Query/AppliedPlan + RPC + + method. + cosmos.upgrade.v1beta1.QueryAuthorityResponse: + type: object + properties: + address: + type: string + description: 'Since: cosmos-sdk 0.46' + title: QueryAuthorityResponse is the response type for Query/Authority + cosmos.upgrade.v1beta1.QueryCurrentPlanResponse: + type: object + properties: + plan: + description: plan is the current upgrade plan. + type: object + properties: + name: + type: string + description: >- + Sets the name for the upgrade. This name will be used by the + upgraded + + version of the software to apply any special "on-upgrade" commands + during + + the first BeginBlock method after the upgrade is applied. It is + also used + + to detect whether a software version can handle a given upgrade. + If no + + upgrade handler with this name has been set in the software, it + will be + + assumed that the software is out-of-date when the upgrade Time or + Height is + + reached and the software will exit. + time: + type: string + format: date-time + description: >- + Deprecated: Time based upgrades have been deprecated. Time based + upgrade logic + + has been removed from the SDK. + + If this field is not empty, an error will be thrown. + height: + type: string + format: int64 + description: The height at which the upgrade must be performed. + info: + type: string + title: >- + Any application specific upgrade info to be included on-chain + + such as a git commit that validators could automatically upgrade + to + upgraded_client_state: + description: >- + Deprecated: UpgradedClientState field has been deprecated. IBC + upgrade logic has been + + moved to the IBC module in the sub module 02-client. + + If this field is not empty, an error will be thrown. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + QueryCurrentPlanResponse is the response type for the Query/CurrentPlan + RPC + + method. + cosmos.upgrade.v1beta1.QueryModuleVersionsResponse: + type: object + properties: + module_versions: + type: array + items: + type: object + properties: + name: + type: string + title: name of the app module + version: + type: string + format: uint64 + title: consensus version of the app module + description: |- + ModuleVersion specifies a module and its consensus version. + + Since: cosmos-sdk 0.43 + description: >- + module_versions is a list of module names with their consensus + versions. + description: >- + QueryModuleVersionsResponse is the response type for the + Query/ModuleVersions + + RPC method. + + + Since: cosmos-sdk 0.43 + cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse: + type: object + properties: + upgraded_consensus_state: + type: string + format: byte + title: 'Since: cosmos-sdk 0.43' + description: >- + QueryUpgradedConsensusStateResponse is the response type for the + Query/UpgradedConsensusState + + RPC method. + cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse: + type: object + description: >- + MsgCreateVestingAccountResponse defines the + Msg/CreatePeriodicVestingAccount + + response type. + + + Since: cosmos-sdk 0.46 + cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse: + type: object + description: >- + MsgCreatePermanentLockedAccountResponse defines the + Msg/CreatePermanentLockedAccount response type. + + + Since: cosmos-sdk 0.46 + cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse: + type: object + description: >- + MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount + response type. + cosmos.vesting.v1beta1.Period: + type: object + properties: + length: + type: string + format: int64 + description: Period duration in seconds. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Period defines a length of time and amount of coins that will vest. + ethermint.feemarket.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + ethermint.feemarket.v1.Params: + type: object + properties: + no_base_fee: + type: boolean + title: >- + no_base_fee forces the EIP-1559 base fee to 0 (needed for 0 price + calls) + base_fee_change_denominator: + type: integer + format: int64 + description: |- + base_fee_change_denominator bounds the amount the base fee can change + between blocks. + elasticity_multiplier: + type: integer + format: int64 + description: >- + elasticity_multiplier bounds the maximum gas limit an EIP-1559 block + may + + have. + enable_height: + type: string + format: int64 + description: >- + enable_height defines at which block height the base fee calculation + is enabled. + base_fee: + type: string + description: base_fee for EIP-1559 blocks. + min_gas_price: + type: string + title: >- + min_gas_price defines the minimum gas price value for cosmos and eth + transactions + min_gas_multiplier: + type: string + title: |- + min_gas_multiplier bounds the minimum gas used to be charged + to senders based on gas limit + title: Params defines the EVM module parameters + ethermint.feemarket.v1.QueryBaseFeeResponse: + type: object + properties: + base_fee: + type: string + title: base_fee is the EIP1559 base fee + description: QueryBaseFeeResponse returns the EIP1559 base fee. + ethermint.feemarket.v1.QueryBlockGasResponse: + type: object + properties: + gas: + type: string + format: int64 + title: gas is the returned block gas + description: QueryBlockGasResponse returns block gas used for a given height. + ethermint.feemarket.v1.QueryParamsResponse: + type: object + properties: + params: + description: params define the evm module parameters. + type: object + properties: + no_base_fee: + type: boolean + title: >- + no_base_fee forces the EIP-1559 base fee to 0 (needed for 0 price + calls) + base_fee_change_denominator: + type: integer + format: int64 + description: >- + base_fee_change_denominator bounds the amount the base fee can + change + + between blocks. + elasticity_multiplier: + type: integer + format: int64 + description: >- + elasticity_multiplier bounds the maximum gas limit an EIP-1559 + block may + + have. + enable_height: + type: string + format: int64 + description: >- + enable_height defines at which block height the base fee + calculation is enabled. + base_fee: + type: string + description: base_fee for EIP-1559 blocks. + min_gas_price: + type: string + title: >- + min_gas_price defines the minimum gas price value for cosmos and + eth transactions + min_gas_multiplier: + type: string + title: |- + min_gas_multiplier bounds the minimum gas used to be charged + to senders based on gas limit + title: Params defines the EVM module parameters + description: >- + QueryParamsResponse defines the response type for querying x/evm + parameters. + evmos.claims.v1.Action: + type: string + enum: + - ACTION_UNSPECIFIED + - ACTION_VOTE + - ACTION_DELEGATE + - ACTION_EVM + - ACTION_IBC_TRANSFER + default: ACTION_UNSPECIFIED + description: |- + Action defines the list of available actions to claim the airdrop tokens. + + - ACTION_UNSPECIFIED: ACTION_UNSPECIFIED defines an invalid action. + - ACTION_VOTE: ACTION_VOTE defines a proposal vote. + - ACTION_DELEGATE: ACTION_DELEGATE defines an staking delegation. + - ACTION_EVM: ACTION_EVM defines an EVM transaction. + - ACTION_IBC_TRANSFER: ACTION_IBC_TRANSFER defines a fungible token transfer transaction via IBC. + evmos.claims.v1.Claim: + type: object + properties: + action: + title: action enum + type: string + enum: + - ACTION_UNSPECIFIED + - ACTION_VOTE + - ACTION_DELEGATE + - ACTION_EVM + - ACTION_IBC_TRANSFER + default: ACTION_UNSPECIFIED + description: >- + Action defines the list of available actions to claim the airdrop + tokens. + + - ACTION_UNSPECIFIED: ACTION_UNSPECIFIED defines an invalid action. + - ACTION_VOTE: ACTION_VOTE defines a proposal vote. + - ACTION_DELEGATE: ACTION_DELEGATE defines an staking delegation. + - ACTION_EVM: ACTION_EVM defines an EVM transaction. + - ACTION_IBC_TRANSFER: ACTION_IBC_TRANSFER defines a fungible token transfer transaction via IBC. + completed: + type: boolean + title: completed is true if the action has been completed + claimable_amount: + type: string + title: claimable_amount of tokens for the action. Zero if completed + description: >- + Claim defines the action, completed flag and the remaining claimable + amount + + for a given user. This is only used during client queries. + evmos.claims.v1.ClaimsRecordAddress: + type: object + properties: + address: + type: string + title: address of claiming user in either bech32 or hex format + initial_claimable_amount: + type: string + title: initial_claimable_amount for the user + actions_completed: + type: array + items: + type: boolean + title: >- + actions_completed is a slice that describes which actions were + completed + description: |- + ClaimsRecordAddress is the claims metadata per address that is used at + Genesis. + evmos.claims.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + evmos.claims.v1.Params: + type: object + properties: + enable_claims: + type: boolean + title: enable_claims is the parameter to enable the claiming process + airdrop_start_time: + type: string + format: date-time + title: airdrop_start_time defines the timestamp of the airdrop start + duration_until_decay: + type: string + title: duration_until_decay of claimable tokens begin + duration_of_decay: + type: string + title: duration_of_decay for token claim decay period + claims_denom: + type: string + title: claims_denom is the denomination of the claimable coin + authorized_channels: + type: array + items: + type: string + description: >- + authorized_channels is the list of authorized channel identifiers that + can perform address + + attestations via IBC. + evm_channels: + type: array + items: + type: string + title: >- + evm_channels is the list of channel identifiers from EVM compatible + chains + description: Params defines the claims module's parameters. + evmos.claims.v1.QueryClaimsRecordResponse: + type: object + properties: + initial_claimable_amount: + type: string + title: initial_claimable_amount of the user + claims: + type: array + items: + type: object + properties: + action: + title: action enum + type: string + enum: + - ACTION_UNSPECIFIED + - ACTION_VOTE + - ACTION_DELEGATE + - ACTION_EVM + - ACTION_IBC_TRANSFER + default: ACTION_UNSPECIFIED + description: >- + Action defines the list of available actions to claim the + airdrop tokens. + + - ACTION_UNSPECIFIED: ACTION_UNSPECIFIED defines an invalid action. + - ACTION_VOTE: ACTION_VOTE defines a proposal vote. + - ACTION_DELEGATE: ACTION_DELEGATE defines an staking delegation. + - ACTION_EVM: ACTION_EVM defines an EVM transaction. + - ACTION_IBC_TRANSFER: ACTION_IBC_TRANSFER defines a fungible token transfer transaction via IBC. + completed: + type: boolean + title: completed is true if the action has been completed + claimable_amount: + type: string + title: claimable_amount of tokens for the action. Zero if completed + description: >- + Claim defines the action, completed flag and the remaining claimable + amount + + for a given user. This is only used during client queries. + title: claims of the user + description: >- + QueryClaimsRecordResponse is the response type for the Query/ClaimsRecord + RPC + + method. + evmos.claims.v1.QueryClaimsRecordsResponse: + type: object + properties: + claims: + type: array + items: + type: object + properties: + address: + type: string + title: address of claiming user in either bech32 or hex format + initial_claimable_amount: + type: string + title: initial_claimable_amount for the user + actions_completed: + type: array + items: + type: boolean + title: >- + actions_completed is a slice that describes which actions were + completed + description: >- + ClaimsRecordAddress is the claims metadata per address that is used + at + + Genesis. + title: claims defines all claims records + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryClaimsRecordsResponse is the response type for the + Query/ClaimsRecords + + RPC method. + evmos.claims.v1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + enable_claims: + type: boolean + title: enable_claims is the parameter to enable the claiming process + airdrop_start_time: + type: string + format: date-time + title: airdrop_start_time defines the timestamp of the airdrop start + duration_until_decay: + type: string + title: duration_until_decay of claimable tokens begin + duration_of_decay: + type: string + title: duration_of_decay for token claim decay period + claims_denom: + type: string + title: claims_denom is the denomination of the claimable coin + authorized_channels: + type: array + items: + type: string + description: >- + authorized_channels is the list of authorized channel identifiers + that can perform address + + attestations via IBC. + evm_channels: + type: array + items: + type: string + title: >- + evm_channels is the list of channel identifiers from EVM + compatible chains + description: QueryParamsResponse is the response type for the Query/Params RPC method. + evmos.claims.v1.QueryTotalUnclaimedResponse: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: coins defines the unclaimed coins + description: >- + QueryTotalUnclaimedResponse is the response type for the + Query/TotalUnclaimed + + RPC method. + evmos.epochs.v1.EpochInfo: + type: object + properties: + identifier: + type: string + title: identifier of the epoch + start_time: + type: string + format: date-time + title: start_time of the epoch + duration: + type: string + title: duration of the epoch + current_epoch: + type: string + format: int64 + title: current_epoch is the integer identifier of the epoch + current_epoch_start_time: + type: string + format: date-time + title: >- + current_epoch_start_time defines the timestamp of the start of the + epoch + epoch_counting_started: + type: boolean + title: >- + epoch_counting_started reflects if the counting for the epoch has + started + current_epoch_start_height: + type: string + format: int64 + title: current_epoch_start_height of the epoch + description: >- + EpochInfo defines the message interface containing the relevant + informations about + + an epoch. + evmos.epochs.v1.QueryCurrentEpochResponse: + type: object + properties: + current_epoch: + type: string + format: int64 + title: current_epoch is the number of the current epoch + description: >- + QueryCurrentEpochResponse is the response type for the Query/EpochInfos + RPC + + method. + evmos.epochs.v1.QueryEpochsInfoResponse: + type: object + properties: + epochs: + type: array + items: + type: object + properties: + identifier: + type: string + title: identifier of the epoch + start_time: + type: string + format: date-time + title: start_time of the epoch + duration: + type: string + title: duration of the epoch + current_epoch: + type: string + format: int64 + title: current_epoch is the integer identifier of the epoch + current_epoch_start_time: + type: string + format: date-time + title: >- + current_epoch_start_time defines the timestamp of the start of + the epoch + epoch_counting_started: + type: boolean + title: >- + epoch_counting_started reflects if the counting for the epoch + has started + current_epoch_start_height: + type: string + format: int64 + title: current_epoch_start_height of the epoch + description: >- + EpochInfo defines the message interface containing the relevant + informations about + + an epoch. + title: epochs is a slice of all EpochInfos + pagination: + description: pagination defines an optional pagination for the request. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryEpochsInfoResponse is the response type for the Query/EpochInfos RPC + method. + evmos.erc20.v1.MsgConvertCoinResponse: + type: object + title: MsgConvertCoinResponse returns no fields + evmos.erc20.v1.MsgConvertERC20Response: + type: object + title: MsgConvertERC20Response returns no fields + evmos.erc20.v1.MsgUpdateParamsResponse: + type: object + title: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + Since: cosmos-sdk 0.47 + evmos.erc20.v1.Owner: + type: string + enum: + - OWNER_UNSPECIFIED + - OWNER_MODULE + - OWNER_EXTERNAL + default: OWNER_UNSPECIFIED + description: |- + Owner enumerates the ownership of a ERC20 contract. + + - OWNER_UNSPECIFIED: OWNER_UNSPECIFIED defines an invalid/undefined owner. + - OWNER_MODULE: OWNER_MODULE - erc20 is owned by the erc20 module account. + - OWNER_EXTERNAL: OWNER_EXTERNAL - erc20 is owned by an external account. + evmos.erc20.v1.Params: + type: object + properties: + enable_erc20: + type: boolean + description: >- + enable_erc20 is the parameter to enable the conversion of Cosmos coins + <--> ERC20 tokens. + enable_evm_hook: + type: boolean + description: >- + enable_evm_hook is the parameter to enable the EVM hook that converts + an ERC20 token to a Cosmos + + Coin by transferring the Tokens through a MsgEthereumTx to the + ModuleAddress Ethereum address. + title: Params defines the erc20 module params + evmos.erc20.v1.QueryParamsResponse: + type: object + properties: + params: + title: params are the erc20 module parameters + type: object + properties: + enable_erc20: + type: boolean + description: >- + enable_erc20 is the parameter to enable the conversion of Cosmos + coins <--> ERC20 tokens. + enable_evm_hook: + type: boolean + description: >- + enable_evm_hook is the parameter to enable the EVM hook that + converts an ERC20 token to a Cosmos + + Coin by transferring the Tokens through a MsgEthereumTx to the + ModuleAddress Ethereum address. + description: |- + QueryParamsResponse is the response type for the Query/Params RPC + method. + evmos.erc20.v1.QueryTokenPairResponse: + type: object + properties: + token_pair: + type: object + properties: + erc20_address: + type: string + title: erc20_address is the hex address of ERC20 contract token + denom: + type: string + title: denom defines the cosmos base denomination to be mapped to + enabled: + type: boolean + title: enabled defines the token mapping enable status + contract_owner: + title: >- + contract_owner is the an ENUM specifying the type of ERC20 owner + (0 invalid, 1 ModuleAccount, 2 external address) + type: string + enum: + - OWNER_UNSPECIFIED + - OWNER_MODULE + - OWNER_EXTERNAL + default: OWNER_UNSPECIFIED + description: |- + Owner enumerates the ownership of a ERC20 contract. + + - OWNER_UNSPECIFIED: OWNER_UNSPECIFIED defines an invalid/undefined owner. + - OWNER_MODULE: OWNER_MODULE - erc20 is owned by the erc20 module account. + - OWNER_EXTERNAL: OWNER_EXTERNAL - erc20 is owned by an external account. + description: >- + TokenPair defines an instance that records a pairing consisting of a + native + + Cosmos Coin and an ERC20 token address. + title: >- + token_pairs returns the info about a registered token pair for the + erc20 module + description: |- + QueryTokenPairResponse is the response type for the Query/TokenPair RPC + method. + evmos.erc20.v1.QueryTokenPairsResponse: + type: object + properties: + token_pairs: + type: array + items: + type: object + properties: + erc20_address: + type: string + title: erc20_address is the hex address of ERC20 contract token + denom: + type: string + title: denom defines the cosmos base denomination to be mapped to + enabled: + type: boolean + title: enabled defines the token mapping enable status + contract_owner: + title: >- + contract_owner is the an ENUM specifying the type of ERC20 owner + (0 invalid, 1 ModuleAccount, 2 external address) + type: string + enum: + - OWNER_UNSPECIFIED + - OWNER_MODULE + - OWNER_EXTERNAL + default: OWNER_UNSPECIFIED + description: |- + Owner enumerates the ownership of a ERC20 contract. + + - OWNER_UNSPECIFIED: OWNER_UNSPECIFIED defines an invalid/undefined owner. + - OWNER_MODULE: OWNER_MODULE - erc20 is owned by the erc20 module account. + - OWNER_EXTERNAL: OWNER_EXTERNAL - erc20 is owned by an external account. + description: >- + TokenPair defines an instance that records a pairing consisting of a + native + + Cosmos Coin and an ERC20 token address. + title: token_pairs is a slice of registered token pairs for the erc20 module + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryTokenPairsResponse is the response type for the Query/TokenPairs RPC + method. + evmos.erc20.v1.TokenPair: + type: object + properties: + erc20_address: + type: string + title: erc20_address is the hex address of ERC20 contract token + denom: + type: string + title: denom defines the cosmos base denomination to be mapped to + enabled: + type: boolean + title: enabled defines the token mapping enable status + contract_owner: + title: >- + contract_owner is the an ENUM specifying the type of ERC20 owner (0 + invalid, 1 ModuleAccount, 2 external address) + type: string + enum: + - OWNER_UNSPECIFIED + - OWNER_MODULE + - OWNER_EXTERNAL + default: OWNER_UNSPECIFIED + description: |- + Owner enumerates the ownership of a ERC20 contract. + + - OWNER_UNSPECIFIED: OWNER_UNSPECIFIED defines an invalid/undefined owner. + - OWNER_MODULE: OWNER_MODULE - erc20 is owned by the erc20 module account. + - OWNER_EXTERNAL: OWNER_EXTERNAL - erc20 is owned by an external account. + description: >- + TokenPair defines an instance that records a pairing consisting of a + native + + Cosmos Coin and an ERC20 token address. + evmos.incentives.v1.GasMeter: + type: object + properties: + contract: + type: string + title: contract is the hex address of the incentivized smart contract + participant: + type: string + title: participant address that interacts with the incentive + cumulative_gas: + type: string + format: uint64 + title: cumulative_gas spent during the epoch + title: GasMeter tracks the cumulative gas spent per participant in one epoch + evmos.incentives.v1.Incentive: + type: object + properties: + contract: + type: string + title: contract address of the smart contract to be incentivized + allocations: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + title: >- + allocations is a slice of denoms and percentages of rewards to be + allocated + epochs: + type: integer + format: int64 + title: epochs defines the number of remaining epochs for the incentive + start_time: + type: string + format: date-time + title: start_time of the incentive distribution + total_gas: + type: string + format: uint64 + title: >- + total_gas is the cumulative gas spent by all gas meters of the + incentive during the epoch + title: |- + Incentive defines an instance that organizes distribution conditions for a + given smart contract + evmos.incentives.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + evmos.incentives.v1.Params: + type: object + properties: + enable_incentives: + type: boolean + title: enable_incentives is the parameter to enable incentives + allocation_limit: + type: string + title: >- + allocation_limit is the maximum percentage an incentive can allocate + per denomination + incentives_epoch_identifier: + type: string + title: incentives_epoch_identifier for the epochs module hooks + reward_scaler: + type: string + title: reward_scaler is the scaling factor for capping rewards + title: Params defines the incentives module params + evmos.incentives.v1.QueryAllocationMeterResponse: + type: object + properties: + allocation_meter: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + title: allocation_meter defines the allocation of the queried denom + description: |- + QueryAllocationMeterResponse is the response type for the + Query/AllocationMeter RPC method. + evmos.incentives.v1.QueryAllocationMetersResponse: + type: object + properties: + allocation_meters: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + title: allocation_meters is a slice of all allocations + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryAllocationMetersResponse is the response type for the + Query/AllocationMeters RPC method. + evmos.incentives.v1.QueryGasMeterResponse: + type: object + properties: + gas_meter: + type: string + format: uint64 + title: >- + gas_meter is a gas meter for one participant on an incentivized smart + contract + description: |- + QueryGasMeterResponse is the response type for the Query/Incentive RPC + method. + evmos.incentives.v1.QueryGasMetersResponse: + type: object + properties: + gas_meters: + type: array + items: + type: object + properties: + contract: + type: string + title: contract is the hex address of the incentivized smart contract + participant: + type: string + title: participant address that interacts with the incentive + cumulative_gas: + type: string + format: uint64 + title: cumulative_gas spent during the epoch + title: >- + GasMeter tracks the cumulative gas spent per participant in one + epoch + title: >- + gas_meters is a slice of the gas meters for an incentivized smart + contract + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryGasMetersResponse is the response type for the Query/Incentives RPC + method. + evmos.incentives.v1.QueryIncentiveResponse: + type: object + properties: + incentive: + type: object + properties: + contract: + type: string + title: contract address of the smart contract to be incentivized + allocations: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + title: >- + allocations is a slice of denoms and percentages of rewards to be + allocated + epochs: + type: integer + format: int64 + title: epochs defines the number of remaining epochs for the incentive + start_time: + type: string + format: date-time + title: start_time of the incentive distribution + total_gas: + type: string + format: uint64 + title: >- + total_gas is the cumulative gas spent by all gas meters of the + incentive during the epoch + title: >- + Incentive defines an instance that organizes distribution conditions + for a + + given smart contract + description: |- + QueryIncentiveResponse is the response type for the Query/Incentive RPC + method. + evmos.incentives.v1.QueryIncentivesResponse: + type: object + properties: + incentives: + type: array + items: + type: object + properties: + contract: + type: string + title: contract address of the smart contract to be incentivized + allocations: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + title: >- + allocations is a slice of denoms and percentages of rewards to + be allocated + epochs: + type: integer + format: int64 + title: epochs defines the number of remaining epochs for the incentive + start_time: + type: string + format: date-time + title: start_time of the incentive distribution + total_gas: + type: string + format: uint64 + title: >- + total_gas is the cumulative gas spent by all gas meters of the + incentive during the epoch + title: >- + Incentive defines an instance that organizes distribution conditions + for a + + given smart contract + title: incentives is a slice of all incentives + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryIncentivesResponse is the response type for the Query/Incentives RPC + method. + evmos.incentives.v1.QueryParamsResponse: + type: object + properties: + params: + title: params are the incentives module parameters + type: object + properties: + enable_incentives: + type: boolean + title: enable_incentives is the parameter to enable incentives + allocation_limit: + type: string + title: >- + allocation_limit is the maximum percentage an incentive can + allocate per denomination + incentives_epoch_identifier: + type: string + title: incentives_epoch_identifier for the epochs module hooks + reward_scaler: + type: string + title: reward_scaler is the scaling factor for capping rewards + description: |- + QueryParamsResponse is the response type for the Query/Params RPC + method. + evmos.inflation.v1.ExponentialCalculation: + type: object + properties: + a: + type: string + title: a defines the initial value + r: + type: string + title: r defines the reduction factor + c: + type: string + title: c defines the parameter for long term inflation + bonding_target: + type: string + title: bonding_target + max_variance: + type: string + title: max_variance + title: >- + ExponentialCalculation holds factors to calculate exponential inflation on + + each period. Calculation reference: + + periodProvision = exponentialDecay * bondingIncentive + + f(x) = (a * (1 - r) ^ x + c) * (1 + max_variance - + bondedRatio * + + (max_variance / bonding_target)) + evmos.inflation.v1.InflationDistribution: + type: object + properties: + staking_rewards: + type: string + title: >- + staking_rewards defines the proportion of the minted minted_denom that + is + + to be allocated as staking rewards + usage_incentives: + type: string + title: >- + usage_incentives defines the proportion of the minted minted_denom + that is + + to be allocated to the incentives module address + community_pool: + type: string + title: >- + community_pool defines the proportion of the minted minted_denom that + is to + + be allocated to the community pool + title: >- + InflationDistribution defines the distribution in which inflation is + + allocated through minting on each epoch (staking, incentives, community). + It + + excludes the team vesting distribution, as this is minted once at genesis. + + The initial InflationDistribution can be calculated from the Evmos Token + + Model like this: + + mintDistribution1 = distribution1 / (1 - teamVestingDistribution) + + 0.5333333 = 40% / (1 - 25%) + evmos.inflation.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + evmos.inflation.v1.Params: + type: object + properties: + mint_denom: + type: string + title: mint_denom specifies the type of coin to mint + exponential_calculation: + title: >- + exponential_calculation takes in the variables to calculate + exponential inflation + type: object + properties: + a: + type: string + title: a defines the initial value + r: + type: string + title: r defines the reduction factor + c: + type: string + title: c defines the parameter for long term inflation + bonding_target: + type: string + title: bonding_target + max_variance: + type: string + title: max_variance + inflation_distribution: + title: inflation_distribution of the minted denom + type: object + properties: + staking_rewards: + type: string + title: >- + staking_rewards defines the proportion of the minted minted_denom + that is + + to be allocated as staking rewards + usage_incentives: + type: string + title: >- + usage_incentives defines the proportion of the minted minted_denom + that is + + to be allocated to the incentives module address + community_pool: + type: string + title: >- + community_pool defines the proportion of the minted minted_denom + that is to + + be allocated to the community pool + enable_inflation: + type: boolean + title: >- + enable_inflation is the parameter that enables inflation and halts + increasing the skipped_epochs + description: Params holds parameters for the inflation module. + evmos.inflation.v1.QueryCirculatingSupplyResponse: + type: object + properties: + circulating_supply: + title: circulating_supply is the total amount of coins in circulation + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: |- + QueryCirculatingSupplyResponse is the response type for the + Query/CirculatingSupply RPC method. + evmos.inflation.v1.QueryEpochMintProvisionResponse: + type: object + properties: + epoch_mint_provision: + description: epoch_mint_provision is the current minting per epoch provision value. + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + QueryEpochMintProvisionResponse is the response type for the + Query/EpochMintProvision RPC method. + evmos.inflation.v1.QueryInflationRateResponse: + type: object + properties: + inflation_rate: + type: string + title: inflation_rate by which the total supply increases within one period + description: >- + QueryInflationRateResponse is the response type for the + Query/InflationRate + + RPC method. + evmos.inflation.v1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + mint_denom: + type: string + title: mint_denom specifies the type of coin to mint + exponential_calculation: + title: >- + exponential_calculation takes in the variables to calculate + exponential inflation + type: object + properties: + a: + type: string + title: a defines the initial value + r: + type: string + title: r defines the reduction factor + c: + type: string + title: c defines the parameter for long term inflation + bonding_target: + type: string + title: bonding_target + max_variance: + type: string + title: max_variance + inflation_distribution: + title: inflation_distribution of the minted denom + type: object + properties: + staking_rewards: + type: string + title: >- + staking_rewards defines the proportion of the minted + minted_denom that is + + to be allocated as staking rewards + usage_incentives: + type: string + title: >- + usage_incentives defines the proportion of the minted + minted_denom that is + + to be allocated to the incentives module address + community_pool: + type: string + title: >- + community_pool defines the proportion of the minted + minted_denom that is to + + be allocated to the community pool + enable_inflation: + type: boolean + title: >- + enable_inflation is the parameter that enables inflation and halts + increasing the skipped_epochs + description: QueryParamsResponse is the response type for the Query/Params RPC method. + evmos.inflation.v1.QueryPeriodResponse: + type: object + properties: + period: + type: string + format: uint64 + description: period is the current minting per epoch provision value. + description: QueryPeriodResponse is the response type for the Query/Period RPC method. + evmos.inflation.v1.QuerySkippedEpochsResponse: + type: object + properties: + skipped_epochs: + type: string + format: uint64 + description: >- + skipped_epochs is the number of epochs that the inflation module has + been disabled. + description: >- + QuerySkippedEpochsResponse is the response type for the + Query/SkippedEpochs + + RPC method. + evmos.recovery.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + evmos.recovery.v1.Params: + type: object + properties: + enable_recovery: + type: boolean + title: enable_recovery IBC middleware + packet_timeout_duration: + type: string + title: >- + packet_timeout_duration is the duration added to timeout timestamp for + balances recovered via IBC packets + title: Params holds parameters for the recovery module + evmos.recovery.v1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + enable_recovery: + type: boolean + title: enable_recovery IBC middleware + packet_timeout_duration: + type: string + title: >- + packet_timeout_duration is the duration added to timeout timestamp + for balances recovered via IBC packets + title: Params holds parameters for the recovery module + description: QueryParamsResponse is the response type for the Query/Params RPC method. + evmos.vesting.v2.MsgClawbackResponse: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: coins is the slice of clawed back coins + description: MsgClawbackResponse defines the MsgClawback response type. + evmos.vesting.v2.MsgConvertVestingAccountResponse: + type: object + description: >- + MsgConvertVestingAccountResponse defines the MsgConvertVestingAccount + response type. + evmos.vesting.v2.MsgCreateClawbackVestingAccountResponse: + type: object + description: |- + MsgCreateClawbackVestingAccountResponse defines the + MsgCreateClawbackVestingAccount response type. + evmos.vesting.v2.MsgFundVestingAccountResponse: + type: object + description: |- + MsgFundVestingAccountResponse defines the + MsgFundVestingAccount response type. + evmos.vesting.v2.MsgUpdateVestingFunderResponse: + type: object + description: |- + MsgUpdateVestingFunderResponse defines the MsgUpdateVestingFunder response + type. + evmos.vesting.v2.QueryBalancesResponse: + type: object + properties: + locked: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: locked defines the current amount of locked tokens + unvested: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: unvested defines the current amount of unvested tokens + vested: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: vested defines the current amount of vested tokens + description: |- + QueryBalancesResponse is the response type for the Query/Balances RPC + method. + exocore.delegation.v1.DelegationAmounts: + type: object + properties: + CanUndelegationAmount: + type: string + WaitUndelegationAmount: + type: string + exocore.delegation.v1.DelegationApproveInfo: + type: object + properties: + signature: + type: string + salt: + type: string + exocore.delegation.v1.DelegationIncOrDecInfo: + type: object + properties: + fromAddress: + type: string + perOperatorAmounts: + type: object + additionalProperties: + type: object + properties: + Amount: + type: string + exocore.delegation.v1.DelegationResponse: + type: object + exocore.delegation.v1.OperatorInfo: + type: object + properties: + EarningsAddr: + type: string + ApproveAddr: + type: string + OperatorMetaInfo: + type: string + ClientChainEarningsAddr: + type: object + properties: + EarningInfoList: + type: array + items: + type: object + properties: + lzClientChainID: + type: string + format: uint64 + clientChainEarningAddr: + type: string + exocore.delegation.v1.QueryDelegationInfoResponse: + type: object + properties: + TotalDelegatedAmount: + type: string + delegationInfos: + type: object + additionalProperties: + type: object + properties: + CanUndelegationAmount: + type: string + WaitUndelegationAmount: + type: string + exocore.delegation.v1.RegisterOperatorResponse: + type: object + exocore.delegation.v1.UndelegationResponse: + type: object + exocore.delegation.v1.ValueField: + type: object + properties: + Amount: + type: string + exocore.delegation.v1.clientChainEarningAddrInfo: + type: object + properties: + lzClientChainID: + type: string + format: uint64 + clientChainEarningAddr: + type: string + exocore.delegation.v1.clientChainEarningAddrList: + type: object + properties: + EarningInfoList: + type: array + items: + type: object + properties: + lzClientChainID: + type: string + format: uint64 + clientChainEarningAddr: + type: string + exocore.deposit.v1.MsgUpdateParamsResponse: + type: object + title: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + Since: cosmos-sdk 0.47 + exocore.deposit.v1.Params: + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: GenesisState defines the restaking_assets_manage module's genesis state. + exocore.deposit.v1.QueryParamsResponse: + type: object + properties: + params: + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: >- + GenesisState defines the restaking_assets_manage module's genesis + state. + description: |- + QueryParamsResponse is the response type for the Query/Params RPC + method. + exocore.oracle.Params: + type: object + description: Params defines the parameters for the module. + exocore.oracle.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + description: QueryParamsResponse is response type for the Query/Params RPC method. + exocore.restaking_assets_manage.v1.AssetInfo: + type: object + properties: + Name: + type: string + Symbol: + type: string + Address: + type: string + Decimals: + type: integer + format: int64 + TotalSupply: + type: string + LayerZeroChainID: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + MetaInfo: + type: string + exocore.restaking_assets_manage.v1.ClientChainInfo: + type: object + properties: + Name: + type: string + MetaInfo: + type: string + ChainId: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + FinalizationBlocks: + type: string + format: uint64 + LayerZeroChainID: + type: string + format: uint64 + SignatureType: + type: string + AddressLength: + type: integer + format: int64 + exocore.restaking_assets_manage.v1.MsgSetExoCoreAddrResponse: + type: object + exocore.restaking_assets_manage.v1.OperatorSingleAssetOrChangeInfo: + type: object + properties: + TotalAmountOrWantChangeValue: + type: string + OperatorOwnAmountOrWantChangeValue: + type: string + title: >- + todo: the field is used to mark operator's own assets and is not + temporarily used now + WaitUndelegationAmountOrWantChangeValue: + type: string + exocore.restaking_assets_manage.v1.QueryAllClientChainInfoResponse: + type: object + properties: + allClientChainInfos: + type: object + additionalProperties: + type: object + properties: + Name: + type: string + MetaInfo: + type: string + ChainId: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + FinalizationBlocks: + type: string + format: uint64 + LayerZeroChainID: + type: string + format: uint64 + SignatureType: + type: string + AddressLength: + type: integer + format: int64 + exocore.restaking_assets_manage.v1.QueryAllStakingAssetsInfoResponse: + type: object + properties: + allStakingAssetsInfo: + type: object + additionalProperties: + type: object + properties: + AssetBasicInfo: + type: object + properties: + Name: + type: string + Symbol: + type: string + Address: + type: string + Decimals: + type: integer + format: int64 + TotalSupply: + type: string + LayerZeroChainID: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + MetaInfo: + type: string + StakingTotalAmount: + type: string + exocore.restaking_assets_manage.v1.QueryAssetInfoResponse: + type: object + properties: + assetInfos: + type: object + additionalProperties: + type: object + properties: + TotalDepositAmountOrWantChangeValue: + type: string + CanWithdrawAmountOrWantChangeValue: + type: string + WaitUndelegationAmountOrWantChangeValue: + type: string + exocore.restaking_assets_manage.v1.QueryOperatorAssetInfosResponse: + type: object + properties: + assetInfos: + type: object + additionalProperties: + type: object + properties: + TotalAmountOrWantChangeValue: + type: string + OperatorOwnAmountOrWantChangeValue: + type: string + title: >- + todo: the field is used to mark operator's own assets and is not + temporarily used now + WaitUndelegationAmountOrWantChangeValue: + type: string + exocore.restaking_assets_manage.v1.QueryStakerExCoreAddrResponse: + type: object + properties: + ExCoreAddr: + type: string + exocore.restaking_assets_manage.v1.RegisterAssetResponse: + type: object + exocore.restaking_assets_manage.v1.RegisterClientChainResponse: + type: object + exocore.restaking_assets_manage.v1.StakerSingleAssetOrChangeInfo: + type: object + properties: + TotalDepositAmountOrWantChangeValue: + type: string + CanWithdrawAmountOrWantChangeValue: + type: string + WaitUndelegationAmountOrWantChangeValue: + type: string + exocore.restaking_assets_manage.v1.StakingAssetInfo: + type: object + properties: + AssetBasicInfo: + type: object + properties: + Name: + type: string + Symbol: + type: string + Address: + type: string + Decimals: + type: integer + format: int64 + TotalSupply: + type: string + LayerZeroChainID: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + MetaInfo: + type: string + StakingTotalAmount: + type: string + exocore.reward.MsgUpdateParamsResponse: + type: object + title: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + Since: cosmos-sdk 0.47 + exocore.reward.Params: + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: Params defines the parameters for the module. + exocore.reward.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC method. + exocore.slash.MsgUpdateParamsResponse: + type: object + title: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + Since: cosmos-sdk 0.47 + exocore.slash.Params: + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: Params defines the parameters for the module. + exocore.slash.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC method. + exocore.withdraw.MsgUpdateParamsResponse: + type: object + title: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + Since: cosmos-sdk 0.47 + exocore.withdraw.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC method. + ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse: + type: object + properties: + channel_id: + type: string + port_id: + type: string + title: >- + MsgRegisterInterchainAccountResponse defines the response for + Msg/RegisterAccount + ibc.applications.interchain_accounts.controller.v1.MsgSendTxResponse: + type: object + properties: + sequence: + type: string + format: uint64 + title: MsgSendTxResponse defines the response for MsgSendTx + ibc.applications.interchain_accounts.controller.v1.Params: + type: object + properties: + controller_enabled: + type: boolean + description: controller_enabled enables or disables the controller submodule. + description: |- + Params defines the set of on-chain interchain accounts parameters. + The following parameters may be used to disable the controller submodule. + ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse: + type: object + properties: + address: + type: string + description: >- + QueryInterchainAccountResponse the response type for the + Query/InterchainAccount RPC method. + ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + controller_enabled: + type: boolean + description: controller_enabled enables or disables the controller submodule. + description: QueryParamsResponse is the response type for the Query/Params RPC method. + ibc.applications.interchain_accounts.v1.InterchainAccountPacketData: + type: object + properties: + type: + type: string + enum: + - TYPE_UNSPECIFIED + - TYPE_EXECUTE_TX + default: TYPE_UNSPECIFIED + description: |- + - TYPE_UNSPECIFIED: Default zero value enumeration + - TYPE_EXECUTE_TX: Execute a transaction on an interchain accounts host chain + title: >- + Type defines a classification of message issued from a controller + chain to its associated interchain accounts + + host + data: + type: string + format: byte + memo: + type: string + description: >- + InterchainAccountPacketData is comprised of a raw transaction, type of + transaction and optional memo field. + ibc.applications.interchain_accounts.v1.Type: + type: string + enum: + - TYPE_UNSPECIFIED + - TYPE_EXECUTE_TX + default: TYPE_UNSPECIFIED + description: |- + - TYPE_UNSPECIFIED: Default zero value enumeration + - TYPE_EXECUTE_TX: Execute a transaction on an interchain accounts host chain + title: >- + Type defines a classification of message issued from a controller chain to + its associated interchain accounts + + host + ibc.applications.interchain_accounts.host.v1.Params: + type: object + properties: + host_enabled: + type: boolean + description: host_enabled enables or disables the host submodule. + allow_messages: + type: array + items: + type: string + description: >- + allow_messages defines a list of sdk message typeURLs allowed to be + executed on a host chain. + description: |- + Params defines the set of on-chain interchain accounts parameters. + The following parameters may be used to disable the host submodule. + ibc.applications.interchain_accounts.host.v1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + host_enabled: + type: boolean + description: host_enabled enables or disables the host submodule. + allow_messages: + type: array + items: + type: string + description: >- + allow_messages defines a list of sdk message typeURLs allowed to + be executed on a host chain. + description: QueryParamsResponse is the response type for the Query/Params RPC method. + ibc.core.channel.v1.Channel: + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: |- + State defines if a channel is in one of the following states: + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: |- + - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other end of the + channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: |- + list of connection identifiers, in order, along which packets sent on + this channel will travel + version: + type: string + title: opaque channel version, which is agreed upon during the handshake + description: |- + Channel defines pipeline for exactly-once packet delivery between specific + modules on separate blockchains, which has at least one end capable of + sending packets and one end capable of receiving packets. + ibc.core.channel.v1.Counterparty: + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other end of the + channel. + channel_id: + type: string + title: channel end on the counterparty chain + title: Counterparty defines a channel end counterparty + ibc.core.channel.v1.IdentifiedChannel: + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: |- + State defines if a channel is in one of the following states: + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: |- + - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other end of the + channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: |- + list of connection identifiers, in order, along which packets sent on + this channel will travel + version: + type: string + title: opaque channel version, which is agreed upon during the handshake + port_id: + type: string + title: port identifier + channel_id: + type: string + title: channel identifier + description: |- + IdentifiedChannel defines a channel with additional port and channel + identifier fields. + ibc.core.channel.v1.MsgAcknowledgementResponse: + type: object + properties: + result: + type: string + enum: + - RESPONSE_RESULT_TYPE_UNSPECIFIED + - RESPONSE_RESULT_TYPE_NOOP + - RESPONSE_RESULT_TYPE_SUCCESS + default: RESPONSE_RESULT_TYPE_UNSPECIFIED + description: |- + - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration + - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully + title: >- + ResponseResultType defines the possible outcomes of the execution of a + message + description: MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. + ibc.core.channel.v1.MsgChannelCloseConfirmResponse: + type: object + description: >- + MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm + response + + type. + ibc.core.channel.v1.MsgChannelCloseInitResponse: + type: object + description: >- + MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response + type. + ibc.core.channel.v1.MsgChannelOpenAckResponse: + type: object + description: MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. + ibc.core.channel.v1.MsgChannelOpenConfirmResponse: + type: object + description: |- + MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response + type. + ibc.core.channel.v1.MsgChannelOpenInitResponse: + type: object + properties: + channel_id: + type: string + version: + type: string + description: MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. + ibc.core.channel.v1.MsgChannelOpenTryResponse: + type: object + properties: + version: + type: string + channel_id: + type: string + description: MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. + ibc.core.channel.v1.MsgRecvPacketResponse: + type: object + properties: + result: + type: string + enum: + - RESPONSE_RESULT_TYPE_UNSPECIFIED + - RESPONSE_RESULT_TYPE_NOOP + - RESPONSE_RESULT_TYPE_SUCCESS + default: RESPONSE_RESULT_TYPE_UNSPECIFIED + description: |- + - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration + - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully + title: >- + ResponseResultType defines the possible outcomes of the execution of a + message + description: MsgRecvPacketResponse defines the Msg/RecvPacket response type. + ibc.core.channel.v1.MsgTimeoutOnCloseResponse: + type: object + properties: + result: + type: string + enum: + - RESPONSE_RESULT_TYPE_UNSPECIFIED + - RESPONSE_RESULT_TYPE_NOOP + - RESPONSE_RESULT_TYPE_SUCCESS + default: RESPONSE_RESULT_TYPE_UNSPECIFIED + description: |- + - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration + - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully + title: >- + ResponseResultType defines the possible outcomes of the execution of a + message + description: MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. + ibc.core.channel.v1.MsgTimeoutResponse: + type: object + properties: + result: + type: string + enum: + - RESPONSE_RESULT_TYPE_UNSPECIFIED + - RESPONSE_RESULT_TYPE_NOOP + - RESPONSE_RESULT_TYPE_SUCCESS + default: RESPONSE_RESULT_TYPE_UNSPECIFIED + description: |- + - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration + - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully + title: >- + ResponseResultType defines the possible outcomes of the execution of a + message + description: MsgTimeoutResponse defines the Msg/Timeout response type. + ibc.core.channel.v1.Order: + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: |- + - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + title: Order defines if a channel is ORDERED or UNORDERED + ibc.core.channel.v1.Packet: + type: object + properties: + sequence: + type: string + format: uint64 + description: >- + number corresponds to the order of sends and receives, where a Packet + + with an earlier sequence number must be sent and received before a + Packet + + with a later sequence number. + source_port: + type: string + description: identifies the port on the sending chain. + source_channel: + type: string + description: identifies the channel end on the sending chain. + destination_port: + type: string + description: identifies the port on the receiving chain. + destination_channel: + type: string + description: identifies the channel end on the receiving chain. + data: + type: string + format: byte + title: actual opaque bytes transferred directly to the application module + timeout_height: + title: block height after which the packet times out + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + timeout_timestamp: + type: string + format: uint64 + title: block timestamp (in nanoseconds) after which the packet times out + title: >- + Packet defines a type that carries data across different chains through + IBC + ibc.core.channel.v1.PacketState: + type: object + properties: + port_id: + type: string + description: channel port identifier. + channel_id: + type: string + description: channel unique identifier. + sequence: + type: string + format: uint64 + description: packet sequence. + data: + type: string + format: byte + description: embedded data that represents packet state. + description: |- + PacketState defines the generic type necessary to retrieve and store + packet commitments, acknowledgements, and receipts. + Caller is responsible for knowing the context necessary to interpret this + state as a commitment, acknowledgement, or a receipt. + ibc.core.channel.v1.QueryChannelClientStateResponse: + type: object + properties: + identified_client_state: + title: client state associated with the channel + type: object + properties: + client_id: + type: string + title: client identifier + client_state: + title: client state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + IdentifiedClientState defines a client state with an additional client + identifier field. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryChannelClientStateResponse is the Response type for the + Query/QueryChannelClientState RPC method + ibc.core.channel.v1.QueryChannelConsensusStateResponse: + type: object + properties: + consensus_state: + title: consensus state associated with the channel + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + client_id: + type: string + title: client ID associated with the consensus state + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryChannelClientStateResponse is the Response type for the + Query/QueryChannelClientState RPC method + ibc.core.channel.v1.QueryChannelResponse: + type: object + properties: + channel: + title: channel associated with the request identifiers + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: |- + State defines if a channel is in one of the following states: + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: |- + - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other end of the + channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: >- + list of connection identifiers, in order, along which packets sent + on + + this channel will travel + version: + type: string + title: opaque channel version, which is agreed upon during the handshake + description: >- + Channel defines pipeline for exactly-once packet delivery between + specific + + modules on separate blockchains, which has at least one end capable of + + sending packets and one end capable of receiving packets. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryChannelResponse is the response type for the Query/Channel RPC + method. + + Besides the Channel end, it includes a proof and the height from which the + + proof was retrieved. + ibc.core.channel.v1.QueryChannelsResponse: + type: object + properties: + channels: + type: array + items: + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: |- + State defines if a channel is in one of the following states: + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: |- + - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other end of + the channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: >- + list of connection identifiers, in order, along which packets + sent on + + this channel will travel + version: + type: string + title: >- + opaque channel version, which is agreed upon during the + handshake + port_id: + type: string + title: port identifier + channel_id: + type: string + title: channel identifier + description: |- + IdentifiedChannel defines a channel with additional port and channel + identifier fields. + description: list of stored channels of the chain. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryChannelsResponse is the response type for the Query/Channels RPC + method. + ibc.core.channel.v1.QueryConnectionChannelsResponse: + type: object + properties: + channels: + type: array + items: + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: |- + State defines if a channel is in one of the following states: + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: |- + - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other end of + the channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: >- + list of connection identifiers, in order, along which packets + sent on + + this channel will travel + version: + type: string + title: >- + opaque channel version, which is agreed upon during the + handshake + port_id: + type: string + title: port identifier + channel_id: + type: string + title: channel identifier + description: |- + IdentifiedChannel defines a channel with additional port and channel + identifier fields. + description: list of channels associated with a connection. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryConnectionChannelsResponse is the Response type for the + Query/QueryConnectionChannels RPC method + ibc.core.channel.v1.QueryNextSequenceReceiveResponse: + type: object + properties: + next_sequence_receive: + type: string + format: uint64 + title: next sequence receive number + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QuerySequenceResponse is the request type for the + Query/QueryNextSequenceReceiveResponse RPC method + ibc.core.channel.v1.QueryPacketAcknowledgementResponse: + type: object + properties: + acknowledgement: + type: string + format: byte + title: packet associated with the request fields + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryPacketAcknowledgementResponse defines the client query response for a + packet which also includes a proof and the height from which the + proof was retrieved + ibc.core.channel.v1.QueryPacketAcknowledgementsResponse: + type: object + properties: + acknowledgements: + type: array + items: + type: object + properties: + port_id: + type: string + description: channel port identifier. + channel_id: + type: string + description: channel unique identifier. + sequence: + type: string + format: uint64 + description: packet sequence. + data: + type: string + format: byte + description: embedded data that represents packet state. + description: >- + PacketState defines the generic type necessary to retrieve and store + + packet commitments, acknowledgements, and receipts. + + Caller is responsible for knowing the context necessary to interpret + this + + state as a commitment, acknowledgement, or a receipt. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryPacketAcknowledgemetsResponse is the request type for the + Query/QueryPacketAcknowledgements RPC method + ibc.core.channel.v1.QueryPacketCommitmentResponse: + type: object + properties: + commitment: + type: string + format: byte + title: packet associated with the request fields + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + QueryPacketCommitmentResponse defines the client query response for a + packet + + which also includes a proof and the height from which the proof was + + retrieved + ibc.core.channel.v1.QueryPacketCommitmentsResponse: + type: object + properties: + commitments: + type: array + items: + type: object + properties: + port_id: + type: string + description: channel port identifier. + channel_id: + type: string + description: channel unique identifier. + sequence: + type: string + format: uint64 + description: packet sequence. + data: + type: string + format: byte + description: embedded data that represents packet state. + description: >- + PacketState defines the generic type necessary to retrieve and store + + packet commitments, acknowledgements, and receipts. + + Caller is responsible for knowing the context necessary to interpret + this + + state as a commitment, acknowledgement, or a receipt. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryPacketCommitmentsResponse is the request type for the + Query/QueryPacketCommitments RPC method + ibc.core.channel.v1.QueryPacketReceiptResponse: + type: object + properties: + received: + type: boolean + title: success flag for if receipt exists + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + QueryPacketReceiptResponse defines the client query response for a packet + + receipt which also includes a proof, and the height from which the proof + was + + retrieved + ibc.core.channel.v1.QueryUnreceivedAcksResponse: + type: object + properties: + sequences: + type: array + items: + type: string + format: uint64 + title: list of unreceived acknowledgement sequences + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryUnreceivedAcksResponse is the response type for the + Query/UnreceivedAcks RPC method + ibc.core.channel.v1.QueryUnreceivedPacketsResponse: + type: object + properties: + sequences: + type: array + items: + type: string + format: uint64 + title: list of unreceived packet sequences + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryUnreceivedPacketsResponse is the response type for the + Query/UnreceivedPacketCommitments RPC method + ibc.core.channel.v1.ResponseResultType: + type: string + enum: + - RESPONSE_RESULT_TYPE_UNSPECIFIED + - RESPONSE_RESULT_TYPE_NOOP + - RESPONSE_RESULT_TYPE_SUCCESS + default: RESPONSE_RESULT_TYPE_UNSPECIFIED + description: |- + - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration + - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully + title: >- + ResponseResultType defines the possible outcomes of the execution of a + message + ibc.core.channel.v1.State: + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: |- + State defines if a channel is in one of the following states: + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ibc.core.client.v1.Height: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: |- + Normally the RevisionHeight is incremented at each height while keeping + RevisionNumber the same. However some consensus algorithms may choose to + reset the height in certain conditions e.g. hard forks, state-machine + breaking changes In these cases, the RevisionNumber is incremented so that + height continues to be monitonically increasing even as the RevisionHeight + gets reset + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes of updating + and + + freezing clients + ibc.core.client.v1.IdentifiedClientState: + type: object + properties: + client_id: + type: string + title: client identifier + client_state: + title: client state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + IdentifiedClientState defines a client state with an additional client + identifier field. + ibc.core.client.v1.ConsensusStateWithHeight: + type: object + properties: + height: + title: consensus state height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + consensus_state: + title: consensus state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + ConsensusStateWithHeight defines a consensus state with an additional + height + + field. + ibc.core.client.v1.MsgCreateClientResponse: + type: object + description: MsgCreateClientResponse defines the Msg/CreateClient response type. + ibc.core.client.v1.MsgSubmitMisbehaviourResponse: + type: object + description: |- + MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + type. + ibc.core.client.v1.MsgUpdateClientResponse: + type: object + description: MsgUpdateClientResponse defines the Msg/UpdateClient response type. + ibc.core.client.v1.MsgUpgradeClientResponse: + type: object + description: MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. + ibc.core.client.v1.Params: + type: object + properties: + allowed_clients: + type: array + items: + type: string + description: >- + allowed_clients defines the list of allowed client state types which + can be created + + and interacted with. If a client type is removed from the allowed + clients list, usage + + of this client will be disabled until it is added again to the list. + description: Params defines the set of IBC light client parameters. + ibc.core.client.v1.QueryClientParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + allowed_clients: + type: array + items: + type: string + description: >- + allowed_clients defines the list of allowed client state types + which can be created + + and interacted with. If a client type is removed from the allowed + clients list, usage + + of this client will be disabled until it is added again to the + list. + description: >- + QueryClientParamsResponse is the response type for the Query/ClientParams + RPC + + method. + ibc.core.client.v1.QueryClientStateResponse: + type: object + properties: + client_state: + title: client state associated with the request identifier + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryClientStateResponse is the response type for the Query/ClientState + RPC + + method. Besides the client state, it includes a proof and the height from + + which the proof was retrieved. + ibc.core.client.v1.QueryClientStatesResponse: + type: object + properties: + client_states: + type: array + items: + type: object + properties: + client_id: + type: string + title: client identifier + client_state: + title: client state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + IdentifiedClientState defines a client state with an additional + client + + identifier field. + description: list of stored ClientStates of the chain. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + description: >- + QueryClientStatesResponse is the response type for the Query/ClientStates + RPC + + method. + ibc.core.client.v1.QueryClientStatusResponse: + type: object + properties: + status: + type: string + description: >- + QueryClientStatusResponse is the response type for the Query/ClientStatus + RPC + + method. It returns the current status of the IBC client. + ibc.core.client.v1.QueryConsensusStateHeightsResponse: + type: object + properties: + consensus_state_heights: + type: array + items: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is incremented + so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes of + updating and + + freezing clients + title: consensus state heights + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: |- + QueryConsensusStateHeightsResponse is the response type for the + Query/ConsensusStateHeights RPC method + ibc.core.client.v1.QueryConsensusStateResponse: + type: object + properties: + consensus_state: + title: >- + consensus state associated with the client identifier at the given + height + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + QueryConsensusStateResponse is the response type for the + Query/ConsensusState + + RPC method + ibc.core.client.v1.QueryConsensusStatesResponse: + type: object + properties: + consensus_states: + type: array + items: + type: object + properties: + height: + title: consensus state height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + consensus_state: + title: consensus state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + ConsensusStateWithHeight defines a consensus state with an + additional height + + field. + title: consensus states associated with the identifier + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: |- + QueryConsensusStatesResponse is the response type for the + Query/ConsensusStates RPC method + ibc.core.client.v1.QueryUpgradedClientStateResponse: + type: object + properties: + upgraded_client_state: + title: client state associated with the request identifier + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + QueryUpgradedClientStateResponse is the response type for the + Query/UpgradedClientState RPC method. + ibc.core.client.v1.QueryUpgradedConsensusStateResponse: + type: object + properties: + upgraded_consensus_state: + title: Consensus state associated with the request identifier + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + QueryUpgradedConsensusStateResponse is the response type for the + Query/UpgradedConsensusState RPC method. + ibc.core.commitment.v1.MerklePrefix: + type: object + properties: + key_prefix: + type: string + format: byte + title: |- + MerklePrefix is merkle path prefixed to the key. + The constructed key from the Path and the key will be append(Path.KeyPath, + append(Path.KeyPrefix, key...)) + ibc.core.connection.v1.ConnectionEnd: + type: object + properties: + client_id: + type: string + description: client associated with this connection. + versions: + type: array + items: + type: object + properties: + identifier: + type: string + title: unique version identifier + features: + type: array + items: + type: string + title: list of features compatible with the specified identifier + description: >- + Version defines the versioning scheme used to negotiate the IBC + verison in + + the connection handshake. + description: >- + IBC version which can be utilised to determine encodings or protocols + for + + channels or packets utilising this connection. + state: + description: current state of the connection end. + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + default: STATE_UNINITIALIZED_UNSPECIFIED + counterparty: + description: counterparty chain associated with this connection. + type: object + properties: + client_id: + type: string + description: >- + identifies the client on the counterparty chain associated with a + given + + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty chain associated + with a + + given connection. + prefix: + description: commitment merkle prefix of the counterparty chain. + type: object + properties: + key_prefix: + type: string + format: byte + title: >- + MerklePrefix is merkle path prefixed to the key. + + The constructed key from the Path and the key will be + append(Path.KeyPath, + + append(Path.KeyPrefix, key...)) + delay_period: + type: string + format: uint64 + description: >- + delay period that must pass before a consensus state can be used for + + packet-verification NOTE: delay period logic is only implemented by + some + + clients. + description: |- + ConnectionEnd defines a stateful object on a chain connected to another + separate one. + NOTE: there must only be 2 defined ConnectionEnds to establish + a connection between two chains. + ibc.core.connection.v1.Counterparty: + type: object + properties: + client_id: + type: string + description: >- + identifies the client on the counterparty chain associated with a + given + + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty chain associated + with a + + given connection. + prefix: + description: commitment merkle prefix of the counterparty chain. + type: object + properties: + key_prefix: + type: string + format: byte + title: >- + MerklePrefix is merkle path prefixed to the key. + + The constructed key from the Path and the key will be + append(Path.KeyPath, + + append(Path.KeyPrefix, key...)) + description: >- + Counterparty defines the counterparty chain associated with a connection + end. + ibc.core.connection.v1.IdentifiedConnection: + type: object + properties: + id: + type: string + description: connection identifier. + client_id: + type: string + description: client associated with this connection. + versions: + type: array + items: + type: object + properties: + identifier: + type: string + title: unique version identifier + features: + type: array + items: + type: string + title: list of features compatible with the specified identifier + description: >- + Version defines the versioning scheme used to negotiate the IBC + verison in + + the connection handshake. + title: >- + IBC version which can be utilised to determine encodings or protocols + for + + channels or packets utilising this connection + state: + description: current state of the connection end. + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + default: STATE_UNINITIALIZED_UNSPECIFIED + counterparty: + description: counterparty chain associated with this connection. + type: object + properties: + client_id: + type: string + description: >- + identifies the client on the counterparty chain associated with a + given + + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty chain associated + with a + + given connection. + prefix: + description: commitment merkle prefix of the counterparty chain. + type: object + properties: + key_prefix: + type: string + format: byte + title: >- + MerklePrefix is merkle path prefixed to the key. + + The constructed key from the Path and the key will be + append(Path.KeyPath, + + append(Path.KeyPrefix, key...)) + delay_period: + type: string + format: uint64 + description: delay period associated with this connection. + description: |- + IdentifiedConnection defines a connection with additional connection + identifier field. + ibc.core.connection.v1.MsgConnectionOpenAckResponse: + type: object + description: >- + MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response + type. + ibc.core.connection.v1.MsgConnectionOpenConfirmResponse: + type: object + description: |- + MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + response type. + ibc.core.connection.v1.MsgConnectionOpenInitResponse: + type: object + description: |- + MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + type. + ibc.core.connection.v1.MsgConnectionOpenTryResponse: + type: object + description: >- + MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response + type. + ibc.core.connection.v1.Params: + type: object + properties: + max_expected_time_per_block: + type: string + format: uint64 + description: >- + maximum expected time per block (in nanoseconds), used to enforce + block delay. This parameter should reflect the + + largest amount of time that the chain might reasonably take to produce + the next block under normal operating + + conditions. A safe choice is 3-5x the expected time per block. + description: Params defines the set of Connection parameters. + ibc.core.connection.v1.QueryClientConnectionsResponse: + type: object + properties: + connection_paths: + type: array + items: + type: string + description: slice of all the connection paths associated with a client. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was generated + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryClientConnectionsResponse is the response type for the + Query/ClientConnections RPC method + ibc.core.connection.v1.QueryConnectionClientStateResponse: + type: object + properties: + identified_client_state: + title: client state associated with the channel + type: object + properties: + client_id: + type: string + title: client identifier + client_state: + title: client state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + IdentifiedClientState defines a client state with an additional client + identifier field. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryConnectionClientStateResponse is the response type for the + Query/ConnectionClientState RPC method + ibc.core.connection.v1.QueryConnectionConsensusStateResponse: + type: object + properties: + consensus_state: + title: consensus state associated with the channel + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + client_id: + type: string + title: client ID associated with the consensus state + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryConnectionConsensusStateResponse is the response type for the + Query/ConnectionConsensusState RPC method + ibc.core.connection.v1.QueryConnectionParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + max_expected_time_per_block: + type: string + format: uint64 + description: >- + maximum expected time per block (in nanoseconds), used to enforce + block delay. This parameter should reflect the + + largest amount of time that the chain might reasonably take to + produce the next block under normal operating + + conditions. A safe choice is 3-5x the expected time per block. + description: >- + QueryConnectionParamsResponse is the response type for the + Query/ConnectionParams RPC method. + ibc.core.connection.v1.QueryConnectionResponse: + type: object + properties: + connection: + title: connection associated with the request identifier + type: object + properties: + client_id: + type: string + description: client associated with this connection. + versions: + type: array + items: + type: object + properties: + identifier: + type: string + title: unique version identifier + features: + type: array + items: + type: string + title: list of features compatible with the specified identifier + description: >- + Version defines the versioning scheme used to negotiate the IBC + verison in + + the connection handshake. + description: >- + IBC version which can be utilised to determine encodings or + protocols for + + channels or packets utilising this connection. + state: + description: current state of the connection end. + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + default: STATE_UNINITIALIZED_UNSPECIFIED + counterparty: + description: counterparty chain associated with this connection. + type: object + properties: + client_id: + type: string + description: >- + identifies the client on the counterparty chain associated + with a given + + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty chain + associated with a + + given connection. + prefix: + description: commitment merkle prefix of the counterparty chain. + type: object + properties: + key_prefix: + type: string + format: byte + title: >- + MerklePrefix is merkle path prefixed to the key. + + The constructed key from the Path and the key will be + append(Path.KeyPath, + + append(Path.KeyPrefix, key...)) + delay_period: + type: string + format: uint64 + description: >- + delay period that must pass before a consensus state can be used + for + + packet-verification NOTE: delay period logic is only implemented + by some + + clients. + description: >- + ConnectionEnd defines a stateful object on a chain connected to + another + + separate one. + + NOTE: there must only be 2 defined ConnectionEnds to establish + + a connection between two chains. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryConnectionResponse is the response type for the Query/Connection RPC + + method. Besides the connection end, it includes a proof and the height + from + + which the proof was retrieved. + ibc.core.connection.v1.QueryConnectionsResponse: + type: object + properties: + connections: + type: array + items: + type: object + properties: + id: + type: string + description: connection identifier. + client_id: + type: string + description: client associated with this connection. + versions: + type: array + items: + type: object + properties: + identifier: + type: string + title: unique version identifier + features: + type: array + items: + type: string + title: list of features compatible with the specified identifier + description: >- + Version defines the versioning scheme used to negotiate the + IBC verison in + + the connection handshake. + title: >- + IBC version which can be utilised to determine encodings or + protocols for + + channels or packets utilising this connection + state: + description: current state of the connection end. + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + default: STATE_UNINITIALIZED_UNSPECIFIED + counterparty: + description: counterparty chain associated with this connection. + type: object + properties: + client_id: + type: string + description: >- + identifies the client on the counterparty chain associated + with a given + + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty chain + associated with a + + given connection. + prefix: + description: commitment merkle prefix of the counterparty chain. + type: object + properties: + key_prefix: + type: string + format: byte + title: >- + MerklePrefix is merkle path prefixed to the key. + + The constructed key from the Path and the key will be + append(Path.KeyPath, + + append(Path.KeyPrefix, key...)) + delay_period: + type: string + format: uint64 + description: delay period associated with this connection. + description: |- + IdentifiedConnection defines a connection with additional connection + identifier field. + description: list of stored connections of the chain. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryConnectionsResponse is the response type for the Query/Connections + RPC + + method. + ibc.core.connection.v1.State: + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + default: STATE_UNINITIALIZED_UNSPECIFIED + description: |- + State defines if a connection is in one of the following states: + INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A connection end has just started the opening handshake. + - STATE_TRYOPEN: A connection end has acknowledged the handshake step on the counterparty + chain. + - STATE_OPEN: A connection end has completed the handshake. + ibc.core.connection.v1.Version: + type: object + properties: + identifier: + type: string + title: unique version identifier + features: + type: array + items: + type: string + title: list of features compatible with the specified identifier + description: |- + Version defines the versioning scheme used to negotiate the IBC verison in + the connection handshake. diff --git a/go.mod b/go.mod index ff463418a..5a1e3b659 100644 --- a/go.mod +++ b/go.mod @@ -20,6 +20,7 @@ require ( github.com/golang/protobuf v1.5.4 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 github.com/onsi/ginkgo/v2 v2.15.0 github.com/onsi/gomega v1.31.1 github.com/pkg/errors v0.9.1 @@ -105,6 +106,7 @@ require ( github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect + github.com/ghodss/yaml v1.0.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect diff --git a/go.sum b/go.sum index bb081e135..66ae7912b 100644 --- a/go.sum +++ b/go.sum @@ -835,6 +835,7 @@ github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= 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= @@ -1056,6 +1057,7 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t 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/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= 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= diff --git a/proto/exocore/oracle/genesis.proto b/proto/exocore/oracle/genesis.proto new file mode 100644 index 000000000..b4428d228 --- /dev/null +++ b/proto/exocore/oracle/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package exocore.oracle; + +import "gogoproto/gogo.proto"; +import "exocore/oracle/params.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +// GenesisState defines the oracle module's genesis state. +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/exocore/oracle/params.proto b/proto/exocore/oracle/params.proto new file mode 100644 index 000000000..1a30c46b3 --- /dev/null +++ b/proto/exocore/oracle/params.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package exocore.oracle; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +// Params defines the parameters for the module. +message Params { + option (gogoproto.goproto_stringer) = false; + +} diff --git a/proto/exocore/oracle/query.proto b/proto/exocore/oracle/query.proto new file mode 100644 index 000000000..25b87c611 --- /dev/null +++ b/proto/exocore/oracle/query.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package exocore.oracle; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "exocore/oracle/params.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/params"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/proto/exocore/oracle/tx.proto b/proto/exocore/oracle/tx.proto new file mode 100644 index 000000000..4d65462d9 --- /dev/null +++ b/proto/exocore/oracle/tx.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; +package exocore.oracle; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +// Msg defines the Msg service. +service Msg {} \ No newline at end of file diff --git a/testutil/keeper/oracle.go b/testutil/keeper/oracle.go new file mode 100644 index 000000000..3b9232420 --- /dev/null +++ b/testutil/keeper/oracle.go @@ -0,0 +1,52 @@ +package keeper + +import ( + "testing" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + tmdb "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/libs/log" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/store" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + typesparams "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/require" +) + +func OracleKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { + storeKey := sdk.NewKVStoreKey(types.StoreKey) + memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) + + db := tmdb.NewMemDB() + stateStore := store.NewCommitMultiStore(db) + stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) + stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) + require.NoError(t, stateStore.LoadLatestVersion()) + + registry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(registry) + + paramsSubspace := typesparams.NewSubspace(cdc, + types.Amino, + storeKey, + memStoreKey, + "OracleParams", + ) + k := keeper.NewKeeper( + cdc, + storeKey, + memStoreKey, + paramsSubspace, + ) + + ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) + + // Initialize params + k.SetParams(ctx, types.DefaultParams()) + + return k, ctx +} diff --git a/x/delegation/types/query.pb.gw.go b/x/delegation/types/query.pb.gw.go index cbf25a404..2574f2e56 100644 --- a/x/delegation/types/query.pb.gw.go +++ b/x/delegation/types/query.pb.gw.go @@ -244,7 +244,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie var ( pattern_Query_QueryDelegationInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "GetDelegationInfo"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QuerySingleDelegationInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "QuerySingleDelegationInfo"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QuerySingleDelegationInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "QuerySingleDelegationInfo"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( diff --git a/x/deposit/types/query.pb.gw.go b/x/deposit/types/query.pb.gw.go index 4e143091e..16bbe4775 100644 --- a/x/deposit/types/query.pb.gw.go +++ b/x/deposit/types/query.pb.gw.go @@ -145,7 +145,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "deposit", "v1", "Params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "deposit", "v1", "Params"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go new file mode 100644 index 000000000..bccb4d74b --- /dev/null +++ b/x/oracle/client/cli/query.go @@ -0,0 +1,31 @@ +package cli + +import ( + "fmt" + // "strings" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + // sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd(queryRoute string) *cobra.Command { + // Group oracle queries under a subcommand + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(CmdQueryParams()) + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/oracle/client/cli/query_params.go b/x/oracle/client/cli/query_params.go new file mode 100644 index 000000000..84bfc3da5 --- /dev/null +++ b/x/oracle/client/cli/query_params.go @@ -0,0 +1,36 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func CmdQueryParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "params", + Short: "shows the parameters of the 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) + + res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/tx.go b/x/oracle/client/cli/tx.go new file mode 100644 index 000000000..2c196cc2c --- /dev/null +++ b/x/oracle/client/cli/tx.go @@ -0,0 +1,36 @@ +package cli + +import ( + "fmt" + "time" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +var ( + DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) +) + +const ( + flagPacketTimeoutTimestamp = "packet-timeout-timestamp" + listSeparator = "," +) + +// GetTxCmd returns the transaction commands for this module +func GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/oracle/genesis.go b/x/oracle/genesis.go new file mode 100644 index 000000000..3aaf44b38 --- /dev/null +++ b/x/oracle/genesis.go @@ -0,0 +1,23 @@ +package oracle + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// InitGenesis initializes the module's state from a provided genesis state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + // this line is used by starport scaffolding # genesis/module/init + k.SetParams(ctx, genState.Params) +} + +// ExportGenesis returns the module's exported genesis +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + genesis := types.DefaultGenesis() + genesis.Params = k.GetParams(ctx) + + // this line is used by starport scaffolding # genesis/module/export + + return genesis +} diff --git a/x/oracle/genesis_test.go b/x/oracle/genesis_test.go new file mode 100644 index 000000000..10be00847 --- /dev/null +++ b/x/oracle/genesis_test.go @@ -0,0 +1,29 @@ +package oracle_test + +import ( + "testing" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/stretchr/testify/require" +) + +func TestGenesis(t *testing.T) { + genesisState := types.GenesisState{ + Params: types.DefaultParams(), + + // this line is used by starport scaffolding # genesis/test/state + } + + k, ctx := keepertest.OracleKeeper(t) + oracle.InitGenesis(ctx, *k, genesisState) + got := oracle.ExportGenesis(ctx, *k) + require.NotNil(t, got) + + nullify.Fill(&genesisState) + nullify.Fill(got) + + // this line is used by starport scaffolding # genesis/test/assert +} diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go new file mode 100644 index 000000000..2897c30d1 --- /dev/null +++ b/x/oracle/keeper/keeper.go @@ -0,0 +1,46 @@ +package keeper + +import ( + "fmt" + + "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +type ( + Keeper struct { + cdc codec.BinaryCodec + storeKey storetypes.StoreKey + memKey storetypes.StoreKey + paramstore paramtypes.Subspace + } +) + +func NewKeeper( + cdc codec.BinaryCodec, + storeKey, + memKey storetypes.StoreKey, + ps paramtypes.Subspace, + +) *Keeper { + // set KeyTable if it has not already been set + if !ps.HasKeyTable() { + ps = ps.WithKeyTable(types.ParamKeyTable()) + } + + return &Keeper{ + cdc: cdc, + storeKey: storeKey, + memKey: memKey, + paramstore: ps, + } +} + +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} diff --git a/x/oracle/keeper/msg_server.go b/x/oracle/keeper/msg_server.go new file mode 100644 index 000000000..c4a81b3f6 --- /dev/null +++ b/x/oracle/keeper/msg_server.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} diff --git a/x/oracle/keeper/msg_server_test.go b/x/oracle/keeper/msg_server_test.go new file mode 100644 index 000000000..6ebde0b24 --- /dev/null +++ b/x/oracle/keeper/msg_server_test.go @@ -0,0 +1,23 @@ +package keeper_test + +import ( + "context" + "testing" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { + k, ctx := keepertest.OracleKeeper(t) + return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) +} + +func TestMsgServer(t *testing.T) { + ms, ctx := setupMsgServer(t) + require.NotNil(t, ms) + require.NotNil(t, ctx) +} diff --git a/x/oracle/keeper/params.go b/x/oracle/keeper/params.go new file mode 100644 index 000000000..c0f27ef4e --- /dev/null +++ b/x/oracle/keeper/params.go @@ -0,0 +1,16 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// GetParams get all parameters as types.Params +func (k Keeper) GetParams(ctx sdk.Context) types.Params { + return types.NewParams() +} + +// SetParams set the params +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + k.paramstore.SetParamSet(ctx, ¶ms) +} diff --git a/x/oracle/keeper/params_test.go b/x/oracle/keeper/params_test.go new file mode 100644 index 000000000..3fb9269b8 --- /dev/null +++ b/x/oracle/keeper/params_test.go @@ -0,0 +1,18 @@ +package keeper_test + +import ( + "testing" + + testkeeper "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/stretchr/testify/require" +) + +func TestGetParams(t *testing.T) { + k, ctx := testkeeper.OracleKeeper(t) + params := types.DefaultParams() + + k.SetParams(ctx, params) + + require.EqualValues(t, params, k.GetParams(ctx)) +} diff --git a/x/oracle/keeper/query.go b/x/oracle/keeper/query.go new file mode 100644 index 000000000..f15058655 --- /dev/null +++ b/x/oracle/keeper/query.go @@ -0,0 +1,7 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +var _ types.QueryServer = Keeper{} diff --git a/x/oracle/keeper/query_params.go b/x/oracle/keeper/query_params.go new file mode 100644 index 000000000..9aa073c3c --- /dev/null +++ b/x/oracle/keeper/query_params.go @@ -0,0 +1,19 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil +} diff --git a/x/oracle/keeper/query_params_test.go b/x/oracle/keeper/query_params_test.go new file mode 100644 index 000000000..a587b37d5 --- /dev/null +++ b/x/oracle/keeper/query_params_test.go @@ -0,0 +1,21 @@ +package keeper_test + +import ( + "testing" + + testkeeper "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +func TestParamsQuery(t *testing.T) { + keeper, ctx := testkeeper.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + params := types.DefaultParams() + keeper.SetParams(ctx, params) + + response, err := keeper.Params(wctx, &types.QueryParamsRequest{}) + require.NoError(t, err) + require.Equal(t, &types.QueryParamsResponse{Params: params}, response) +} diff --git a/x/oracle/module.go b/x/oracle/module.go new file mode 100644 index 000000000..dbcbb25d8 --- /dev/null +++ b/x/oracle/module.go @@ -0,0 +1,148 @@ +package oracle + +import ( + "context" + "encoding/json" + "fmt" + // this line is used by starport scaffolding # 1 + + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/cometbft/cometbft/abci/types" + + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "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" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface that defines the independent methods a Cosmos SDK module needs to implement. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the name of the module as a string +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec registers the amino codec for the module, which is used to marshal and unmarshal structs to/from []byte in order to persist them in the module's KVStore +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +// RegisterInterfaces registers a module's interface types and their concrete implementations as proto.Message +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns a default GenesisState for the module, marshalled to json.RawMessage. The default GenesisState need to be defined by the module developer and is primarily used for testing +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis used to validate the GenesisState, given in its json.RawMessage form +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) +} + +// GetTxCmd returns the root Tx command for the module. The subcommands of this root command are used by end-users to generate new transactions containing messages defined in the module +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the root query command for the module. The subcommands of this root command are used by end-users to generate new queries to the subset of the state defined by the module +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd(types.StoreKey) +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface that defines the inter-dependent methods that modules need to implement +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper +} + +func NewAppModule( + cdc codec.Codec, + keeper keeper.Keeper, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + } +} + +// RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted) +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the module's genesis initialization. It returns no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, genState) + + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +// 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 (AppModule) ConsensusVersion() uint64 { return 1 } + +// BeginBlock contains the logic that is automatically triggered at the beginning of each block +func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} + +// EndBlock contains the logic that is automatically triggered at the end of each block +func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} diff --git a/x/oracle/module_simulation.go b/x/oracle/module_simulation.go new file mode 100644 index 000000000..4fa6787ed --- /dev/null +++ b/x/oracle/module_simulation.go @@ -0,0 +1,64 @@ +package oracle + +import ( + "math/rand" + + "github.com/ExocoreNetwork/exocore/testutil/sample" + oraclesimulation "github.com/ExocoreNetwork/exocore/x/oracle/simulation" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" +) + +// avoid unused import issue +var ( + _ = sample.AccAddress + _ = oraclesimulation.FindAccount + _ = simulation.MsgEntryKind + _ = baseapp.Paramspace + _ = rand.Rand{} +) + +const ( +// this line is used by starport scaffolding # simapp/module/const +) + +// GenerateGenesisState creates a randomized GenState of the module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + accs := make([]string, len(simState.Accounts)) + for i, acc := range simState.Accounts { + accs[i] = acc.Address.String() + } + oracleGenesis := types.GenesisState{ + Params: types.DefaultParams(), + // this line is used by starport scaffolding # simapp/module/genesisState + } + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&oracleGenesis) +} + +// RegisterStoreDecoder registers a decoder. +func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} + +// ProposalContents doesn't return any content functions for governance proposals. +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + operations := make([]simtypes.WeightedOperation, 0) + + // this line is used by starport scaffolding # simapp/module/operation + + return operations +} + +// ProposalMsgs returns msgs used for governance proposals for simulations. +func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { + return []simtypes.WeightedProposalMsg{ + // this line is used by starport scaffolding # simapp/module/OpMsg + } +} diff --git a/x/oracle/simulation/helpers.go b/x/oracle/simulation/helpers.go new file mode 100644 index 000000000..92c437c0d --- /dev/null +++ b/x/oracle/simulation/helpers.go @@ -0,0 +1,15 @@ +package simulation + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +// FindAccount find a specific address from an account list +func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { + creator, err := sdk.AccAddressFromBech32(address) + if err != nil { + panic(err) + } + return simtypes.FindAccount(accs, creator) +} diff --git a/x/oracle/types/codec.go b/x/oracle/types/codec.go new file mode 100644 index 000000000..844157a87 --- /dev/null +++ b/x/oracle/types/codec.go @@ -0,0 +1,23 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + // this line is used by starport scaffolding # 1 + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +func RegisterCodec(cdc *codec.LegacyAmino) { + // this line is used by starport scaffolding # 2 +} + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + // this line is used by starport scaffolding # 3 + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + Amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) +) diff --git a/x/oracle/types/errors.go b/x/oracle/types/errors.go new file mode 100644 index 000000000..6d57a417b --- /dev/null +++ b/x/oracle/types/errors.go @@ -0,0 +1,12 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// x/oracle module sentinel errors +var ( + ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") +) diff --git a/x/oracle/types/expected_keepers.go b/x/oracle/types/expected_keepers.go new file mode 100644 index 000000000..6aa6e9778 --- /dev/null +++ b/x/oracle/types/expected_keepers.go @@ -0,0 +1,18 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +// AccountKeeper defines the expected account keeper used for simulations (noalias) +type AccountKeeper interface { + GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + // Methods imported from account should be defined here +} + +// BankKeeper defines the expected interface needed to retrieve account balances. +type BankKeeper interface { + SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + // Methods imported from bank should be defined here +} diff --git a/x/oracle/types/genesis.go b/x/oracle/types/genesis.go new file mode 100644 index 000000000..0af9b4416 --- /dev/null +++ b/x/oracle/types/genesis.go @@ -0,0 +1,24 @@ +package types + +import ( +// this line is used by starport scaffolding # genesis/types/import +) + +// DefaultIndex is the default global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + // this line is used by starport scaffolding # genesis/types/default + Params: DefaultParams(), + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + // this line is used by starport scaffolding # genesis/types/validate + + return gs.Params.Validate() +} diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go new file mode 100644 index 000000000..90995bd32 --- /dev/null +++ b/x/oracle/types/genesis.pb.go @@ -0,0 +1,321 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the oracle module's genesis state. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_dbe067676c4dc0de, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "exocore.oracle.GenesisState") +} + +func init() { proto.RegisterFile("exocore/oracle/genesis.proto", fileDescriptor_dbe067676c4dc0de) } + +var fileDescriptor_dbe067676c4dc0de = []byte{ + // 195 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, + 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xca, 0xea, 0x41, 0x64, 0xa5, + 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x94, 0x34, 0x9a, 0x19, + 0x05, 0x89, 0x45, 0x89, 0xb9, 0x50, 0x23, 0x94, 0x5c, 0xb8, 0x78, 0xdc, 0x21, 0x66, 0x06, 0x97, + 0x24, 0x96, 0xa4, 0x0a, 0x99, 0x70, 0xb1, 0x41, 0xe4, 0x25, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, + 0xc4, 0xf4, 0x50, 0xed, 0xd0, 0x0b, 0x00, 0xcb, 0x3a, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x10, 0x04, + 0x55, 0xeb, 0xe4, 0x75, 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, 0x06, 0xe9, + 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xae, 0x10, 0x93, 0xfc, 0x52, 0x4b, + 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0x61, 0xce, 0xaa, 0x80, 0x39, 0xac, 0xa4, 0xb2, 0x20, 0xb5, 0x38, + 0x89, 0x0d, 0xec, 0x30, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x17, 0x3c, 0xd2, 0xcf, 0xfb, + 0x00, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/genesis_test.go b/x/oracle/types/genesis_test.go new file mode 100644 index 000000000..f74f88a64 --- /dev/null +++ b/x/oracle/types/genesis_test.go @@ -0,0 +1,41 @@ +package types_test + +import ( + "testing" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/stretchr/testify/require" +) + +func TestGenesisState_Validate(t *testing.T) { + tests := []struct { + desc string + genState *types.GenesisState + valid bool + }{ + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + + // this line is used by starport scaffolding # types/genesis/validField + }, + valid: true, + }, + // this line is used by starport scaffolding # types/genesis/testcase + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} diff --git a/x/oracle/types/keys.go b/x/oracle/types/keys.go new file mode 100644 index 000000000..4616d06a1 --- /dev/null +++ b/x/oracle/types/keys.go @@ -0,0 +1,19 @@ +package types + +const ( + // ModuleName defines the module name + ModuleName = "oracle" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // RouterKey defines the module's message routing key + RouterKey = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_oracle" +) + +func KeyPrefix(p string) []byte { + return []byte(p) +} diff --git a/x/oracle/types/params.go b/x/oracle/types/params.go new file mode 100644 index 000000000..357196ad6 --- /dev/null +++ b/x/oracle/types/params.go @@ -0,0 +1,39 @@ +package types + +import ( + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "gopkg.in/yaml.v2" +) + +var _ paramtypes.ParamSet = (*Params)(nil) + +// ParamKeyTable the param key table for launch module +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// NewParams creates a new Params instance +func NewParams() Params { + return Params{} +} + +// DefaultParams returns a default set of parameters +func DefaultParams() Params { + return NewParams() +} + +// ParamSetPairs get the params.ParamSet +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{} +} + +// Validate validates the set of params +func (p Params) Validate() error { + return nil +} + +// String implements the Stringer interface. +func (p Params) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} diff --git a/x/oracle/types/params.pb.go b/x/oracle/types/params.pb.go new file mode 100644 index 000000000..25a611fa7 --- /dev/null +++ b/x/oracle/types/params.pb.go @@ -0,0 +1,264 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the parameters for the module. +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_ba212ceb89f5e6b2, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "exocore.oracle.Params") +} + +func init() { proto.RegisterFile("exocore/oracle/params.proto", fileDescriptor_ba212ceb89f5e6b2) } + +var fileDescriptor_ba212ceb89f5e6b2 = []byte{ + // 153 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, + 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xea, 0x41, 0x24, 0xa5, 0x44, + 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x12, 0x1f, 0x17, 0x5b, 0x00, + 0x58, 0x97, 0x15, 0xcb, 0x8c, 0x05, 0xf2, 0x0c, 0x4e, 0x5e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, + 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, + 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x90, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, + 0xef, 0x0a, 0x31, 0xda, 0x2f, 0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x5b, 0x1f, 0xe6, 0x8c, 0x0a, 0x98, + 0x43, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x56, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, + 0xff, 0x55, 0x2f, 0xc3, 0xb4, 0xa7, 0x00, 0x00, 0x00, +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go new file mode 100644 index 000000000..9ea3909b6 --- /dev/null +++ b/x/oracle/types/query.pb.go @@ -0,0 +1,537 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "exocore.oracle.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "exocore.oracle.QueryParamsResponse") +} + +func init() { proto.RegisterFile("exocore/oracle/query.proto", fileDescriptor_f604621c8da1a6f3) } + +var fileDescriptor_f604621c8da1a6f3 = []byte{ + // 303 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0x3f, 0x4b, 0x03, 0x31, + 0x18, 0xc6, 0x2f, 0xa2, 0x1d, 0x22, 0x38, 0xc4, 0x22, 0x72, 0x4a, 0x94, 0x13, 0x51, 0x04, 0x2f, + 0xb6, 0xfa, 0x09, 0x0a, 0x2e, 0x0a, 0xa2, 0x1d, 0xdd, 0x72, 0x47, 0x88, 0x87, 0xed, 0xbd, 0x69, + 0x92, 0xd3, 0x76, 0x13, 0x47, 0x27, 0xc1, 0x2f, 0xd5, 0xb1, 0xe0, 0xe2, 0x24, 0x72, 0xe7, 0x07, + 0x91, 0x5e, 0xe2, 0xd0, 0xfa, 0x67, 0x0b, 0xef, 0xf3, 0x7b, 0x7f, 0x3c, 0x6f, 0x70, 0x28, 0x86, + 0x90, 0x82, 0x16, 0x0c, 0x34, 0x4f, 0x7b, 0x82, 0x0d, 0x0a, 0xa1, 0x47, 0xb1, 0xd2, 0x60, 0x81, + 0xac, 0xf8, 0x2c, 0x76, 0x59, 0xd8, 0x94, 0x20, 0xa1, 0x8e, 0xd8, 0xf4, 0xe5, 0xa8, 0x70, 0x53, + 0x02, 0xc8, 0x9e, 0x60, 0x5c, 0x65, 0x8c, 0xe7, 0x39, 0x58, 0x6e, 0x33, 0xc8, 0x8d, 0x4f, 0x0f, + 0x52, 0x30, 0x7d, 0x30, 0x2c, 0xe1, 0xc6, 0xcb, 0xd9, 0x5d, 0x2b, 0x11, 0x96, 0xb7, 0x98, 0xe2, + 0x32, 0xcb, 0x6b, 0xd8, 0xb3, 0x1b, 0x73, 0x5d, 0x14, 0xd7, 0xbc, 0xef, 0x45, 0x51, 0x13, 0x93, + 0xab, 0xe9, 0xfa, 0x65, 0x3d, 0xec, 0x8a, 0x41, 0x21, 0x8c, 0x8d, 0xce, 0xf1, 0xea, 0xcc, 0xd4, + 0x28, 0xc8, 0x8d, 0x20, 0x27, 0xb8, 0xe1, 0x96, 0xd7, 0xd1, 0x36, 0xda, 0x5f, 0x6e, 0xaf, 0xc5, + 0xb3, 0xa7, 0xc4, 0x8e, 0xef, 0x2c, 0x8e, 0xdf, 0xb7, 0x82, 0xae, 0x67, 0xdb, 0x4f, 0x08, 0x2f, + 0xd5, 0x36, 0xf2, 0x80, 0x70, 0xc3, 0x21, 0x24, 0x9a, 0x5f, 0xfd, 0xd9, 0x22, 0xdc, 0xf9, 0x97, + 0x71, 0x9d, 0xa2, 0xc3, 0xc7, 0xd7, 0xcf, 0x97, 0x85, 0x3d, 0xb2, 0xcb, 0x4e, 0x1d, 0x7c, 0x21, + 0xec, 0x3d, 0xe8, 0x5b, 0xf6, 0xeb, 0xd5, 0x9d, 0xb3, 0x71, 0x49, 0xd1, 0xa4, 0xa4, 0xe8, 0xa3, + 0xa4, 0xe8, 0xb9, 0xa2, 0xc1, 0xa4, 0xa2, 0xc1, 0x5b, 0x45, 0x83, 0xeb, 0x23, 0x99, 0xd9, 0x9b, + 0x22, 0x89, 0x53, 0xe8, 0xff, 0xa5, 0x1a, 0x7e, 0xcb, 0xec, 0x48, 0x09, 0x93, 0x34, 0xea, 0x2f, + 0x3c, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x46, 0xaf, 0x46, 0x65, 0xed, 0x01, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) 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, "/exocore.oracle.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} + +func RegisterQueryServer(s grpc1.Server, 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: "/exocore.oracle.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "exocore.oracle.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "exocore/oracle/query.proto", +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go new file mode 100644 index 000000000..2f78fe585 --- /dev/null +++ b/x/oracle/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: exocore/oracle/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "params"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go new file mode 100644 index 000000000..0fd4de9a9 --- /dev/null +++ b/x/oracle/types/tx.pb.go @@ -0,0 +1,81 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func init() { proto.RegisterFile("exocore/oracle/tx.proto", fileDescriptor_02cf64aff79d2288) } + +var fileDescriptor_02cf64aff79d2288 = []byte{ + // 129 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xe8, 0x41, 0x24, 0x8c, 0x58, 0xb9, 0x98, 0x7d, 0x8b, + 0xd3, 0x9d, 0xbc, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, + 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x20, 0x3d, + 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0xdf, 0x15, 0xa2, 0xd7, 0x2f, 0xb5, 0xa4, + 0x3c, 0xbf, 0x28, 0x5b, 0x1f, 0x66, 0x47, 0x05, 0xdc, 0x96, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, + 0xb0, 0x4d, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x31, 0x87, 0x85, 0xca, 0x84, 0x00, 0x00, + 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "exocore.oracle.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{}, + Metadata: "exocore/oracle/tx.proto", +} diff --git a/x/oracle/types/types.go b/x/oracle/types/types.go new file mode 100644 index 000000000..ab1254f4c --- /dev/null +++ b/x/oracle/types/types.go @@ -0,0 +1 @@ +package types diff --git a/x/reward/types/query.pb.gw.go b/x/reward/types/query.pb.gw.go index 67784ea28..e6f3b1375 100644 --- a/x/reward/types/query.pb.gw.go +++ b/x/reward/types/query.pb.gw.go @@ -145,7 +145,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"exocore", "reward", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"exocore", "reward", "params"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( diff --git a/x/slash/types/query.pb.gw.go b/x/slash/types/query.pb.gw.go index 82bdc46cb..9c59b5687 100644 --- a/x/slash/types/query.pb.gw.go +++ b/x/slash/types/query.pb.gw.go @@ -145,7 +145,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"exocore", "slash", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"exocore", "slash", "params"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( From f5cf83193d2f5e3391f4f7971a9eb88dfc0e6a3f Mon Sep 17 00:00:00 2001 From: leonz789 Date: Fri, 23 Feb 2024 12:11:57 +0800 Subject: [PATCH 03/37] feat(oracle-proto): add empty create-price message --- docs/static/openapi.yml | 2 + proto/exocore/oracle/tx.proto | 11 +- x/oracle/client/cli/tx.go | 1 + x/oracle/client/cli/tx_create_price.go | 40 ++ x/oracle/keeper/msg_server_create_price.go | 17 + x/oracle/module_simulation.go | 25 +- x/oracle/simulation/create_price.go | 29 ++ x/oracle/types/codec.go | 6 +- x/oracle/types/message_create_price.go | 45 ++ x/oracle/types/message_create_price_test.go | 40 ++ x/oracle/types/tx.pb.go | 462 +++++++++++++++++++- 11 files changed, 664 insertions(+), 14 deletions(-) create mode 100644 x/oracle/client/cli/tx_create_price.go create mode 100644 x/oracle/keeper/msg_server_create_price.go create mode 100644 x/oracle/simulation/create_price.go create mode 100644 x/oracle/types/message_create_price.go create mode 100644 x/oracle/types/message_create_price_test.go diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 51625bd7e..996fad9b0 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -69432,6 +69432,8 @@ definitions: description: |- QueryParamsResponse is the response type for the Query/Params RPC method. + exocore.oracle.MsgCreatePriceResponse: + type: object exocore.oracle.Params: type: object description: Params defines the parameters for the module. diff --git a/proto/exocore/oracle/tx.proto b/proto/exocore/oracle/tx.proto index 4d65462d9..60cda3476 100644 --- a/proto/exocore/oracle/tx.proto +++ b/proto/exocore/oracle/tx.proto @@ -1,7 +1,16 @@ syntax = "proto3"; + package exocore.oracle; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; // Msg defines the Msg service. -service Msg {} \ No newline at end of file +service Msg { + rpc CreatePrice (MsgCreatePrice) returns (MsgCreatePriceResponse); +} +message MsgCreatePrice { + string creator = 1; +} + +message MsgCreatePriceResponse {} + diff --git a/x/oracle/client/cli/tx.go b/x/oracle/client/cli/tx.go index 2c196cc2c..dbcac318e 100644 --- a/x/oracle/client/cli/tx.go +++ b/x/oracle/client/cli/tx.go @@ -30,6 +30,7 @@ func GetTxCmd() *cobra.Command { RunE: client.ValidateCmd, } + cmd.AddCommand(CmdCreatePrice()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/oracle/client/cli/tx_create_price.go b/x/oracle/client/cli/tx_create_price.go new file mode 100644 index 000000000..75b30e996 --- /dev/null +++ b/x/oracle/client/cli/tx_create_price.go @@ -0,0 +1,40 @@ +package cli + +import ( + "strconv" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdCreatePrice() *cobra.Command { + cmd := &cobra.Command{ + Use: "create-price", + Short: "Broadcast message create-price", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgCreatePrice( + clientCtx.GetFromAddress().String(), + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/keeper/msg_server_create_price.go b/x/oracle/keeper/msg_server_create_price.go new file mode 100644 index 000000000..fc1f7d545 --- /dev/null +++ b/x/oracle/keeper/msg_server_create_price.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) CreatePrice(goCtx context.Context, msg *types.MsgCreatePrice) (*types.MsgCreatePriceResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // TODO: Handling the message + _ = ctx + + return &types.MsgCreatePriceResponse{}, nil +} diff --git a/x/oracle/module_simulation.go b/x/oracle/module_simulation.go index 4fa6787ed..8301eba8f 100644 --- a/x/oracle/module_simulation.go +++ b/x/oracle/module_simulation.go @@ -23,7 +23,11 @@ var ( ) const ( -// this line is used by starport scaffolding # simapp/module/const + opWeightMsgCreatePrice = "op_weight_msg_create_price" + // TODO: Determine the simulation weight value + defaultWeightMsgCreatePrice int = 100 + + // this line is used by starport scaffolding # simapp/module/const ) // GenerateGenesisState creates a randomized GenState of the module. @@ -51,6 +55,17 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) + var weightMsgCreatePrice int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgCreatePrice, &weightMsgCreatePrice, nil, + func(_ *rand.Rand) { + weightMsgCreatePrice = defaultWeightMsgCreatePrice + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgCreatePrice, + oraclesimulation.SimulateMsgCreatePrice(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations @@ -59,6 +74,14 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp // ProposalMsgs returns msgs used for governance proposals for simulations. func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { return []simtypes.WeightedProposalMsg{ + simulation.NewWeightedProposalMsg( + opWeightMsgCreatePrice, + defaultWeightMsgCreatePrice, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + oraclesimulation.SimulateMsgCreatePrice(am.accountKeeper, am.bankKeeper, am.keeper) + return nil + }, + ), // this line is used by starport scaffolding # simapp/module/OpMsg } } diff --git a/x/oracle/simulation/create_price.go b/x/oracle/simulation/create_price.go new file mode 100644 index 000000000..55047e3ca --- /dev/null +++ b/x/oracle/simulation/create_price.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +func SimulateMsgCreatePrice( + ak types.AccountKeeper, + bk types.BankKeeper, + k 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) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgCreatePrice{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the CreatePrice simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "CreatePrice simulation not implemented"), nil, nil + } +} diff --git a/x/oracle/types/codec.go b/x/oracle/types/codec.go index 844157a87..0571d71fa 100644 --- a/x/oracle/types/codec.go +++ b/x/oracle/types/codec.go @@ -3,15 +3,19 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - // this line is used by starport scaffolding # 1 + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) func RegisterCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgCreatePrice{}, "oracle/CreatePrice", nil) // this line is used by starport scaffolding # 2 } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgCreatePrice{}, + ) // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/oracle/types/message_create_price.go b/x/oracle/types/message_create_price.go new file mode 100644 index 000000000..3a88484fe --- /dev/null +++ b/x/oracle/types/message_create_price.go @@ -0,0 +1,45 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgCreatePrice = "create_price" + +var _ sdk.Msg = &MsgCreatePrice{} + +func NewMsgCreatePrice(creator string) *MsgCreatePrice { + return &MsgCreatePrice{ + Creator: creator, + } +} + +func (msg *MsgCreatePrice) Route() string { + return RouterKey +} + +func (msg *MsgCreatePrice) Type() string { + return TypeMsgCreatePrice +} + +func (msg *MsgCreatePrice) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgCreatePrice) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgCreatePrice) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + return nil +} diff --git a/x/oracle/types/message_create_price_test.go b/x/oracle/types/message_create_price_test.go new file mode 100644 index 000000000..a4a804163 --- /dev/null +++ b/x/oracle/types/message_create_price_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + "github.com/ExocoreNetwork/exocore/testutil/sample" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgCreatePrice_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgCreatePrice + err error + }{ + { + name: "invalid address", + msg: MsgCreatePrice{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgCreatePrice{ + Creator: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go index 0fd4de9a9..440847720 100644 --- a/x/oracle/types/tx.pb.go +++ b/x/oracle/types/tx.pb.go @@ -9,7 +9,11 @@ import ( grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -23,19 +27,108 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type MsgCreatePrice struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` +} + +func (m *MsgCreatePrice) Reset() { *m = MsgCreatePrice{} } +func (m *MsgCreatePrice) String() string { return proto.CompactTextString(m) } +func (*MsgCreatePrice) ProtoMessage() {} +func (*MsgCreatePrice) Descriptor() ([]byte, []int) { + return fileDescriptor_02cf64aff79d2288, []int{0} +} +func (m *MsgCreatePrice) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreatePrice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreatePrice.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreatePrice) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreatePrice.Merge(m, src) +} +func (m *MsgCreatePrice) XXX_Size() int { + return m.Size() +} +func (m *MsgCreatePrice) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreatePrice.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreatePrice proto.InternalMessageInfo + +func (m *MsgCreatePrice) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +type MsgCreatePriceResponse struct { +} + +func (m *MsgCreatePriceResponse) Reset() { *m = MsgCreatePriceResponse{} } +func (m *MsgCreatePriceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreatePriceResponse) ProtoMessage() {} +func (*MsgCreatePriceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_02cf64aff79d2288, []int{1} +} +func (m *MsgCreatePriceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreatePriceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreatePriceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreatePriceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreatePriceResponse.Merge(m, src) +} +func (m *MsgCreatePriceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreatePriceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreatePriceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreatePriceResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgCreatePrice)(nil), "exocore.oracle.MsgCreatePrice") + proto.RegisterType((*MsgCreatePriceResponse)(nil), "exocore.oracle.MsgCreatePriceResponse") +} + func init() { proto.RegisterFile("exocore/oracle/tx.proto", fileDescriptor_02cf64aff79d2288) } var fileDescriptor_02cf64aff79d2288 = []byte{ - // 129 bytes of a gzipped FileDescriptorProto + // 199 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xad, 0xc8, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xe8, 0x41, 0x24, 0x8c, 0x58, 0xb9, 0x98, 0x7d, 0x8b, - 0xd3, 0x9d, 0xbc, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, - 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x20, 0x3d, - 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0xdf, 0x15, 0xa2, 0xd7, 0x2f, 0xb5, 0xa4, - 0x3c, 0xbf, 0x28, 0x5b, 0x1f, 0x66, 0x47, 0x05, 0xdc, 0x96, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, - 0xb0, 0x4d, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x31, 0x87, 0x85, 0xca, 0x84, 0x00, 0x00, - 0x00, + 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xe8, 0x41, 0x24, 0x94, 0xb4, 0xb8, 0xf8, 0x7c, 0x8b, + 0xd3, 0x9d, 0x8b, 0x52, 0x13, 0x4b, 0x52, 0x03, 0x8a, 0x32, 0x93, 0x53, 0x85, 0x24, 0xb8, 0xd8, + 0x93, 0x41, 0xdc, 0xfc, 0x22, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x18, 0x57, 0x49, 0x82, + 0x4b, 0x0c, 0x55, 0x6d, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x51, 0x0c, 0x17, 0xb3, + 0x6f, 0x71, 0xba, 0x50, 0x28, 0x17, 0x37, 0xb2, 0x49, 0x72, 0x7a, 0xa8, 0x96, 0xe9, 0xa1, 0xea, + 0x96, 0x52, 0xc3, 0x2f, 0x0f, 0x33, 0xdd, 0xc9, 0xeb, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, + 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, + 0xe5, 0x18, 0xa2, 0x0c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x5d, + 0x21, 0x66, 0xf9, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0xeb, 0xc3, 0x02, 0xa0, 0x02, 0x1e, 0x04, + 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0x60, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x09, + 0xcb, 0x8d, 0x2e, 0x21, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -50,6 +143,7 @@ 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 MsgClient interface { + CreatePrice(ctx context.Context, in *MsgCreatePrice, opts ...grpc.CallOption) (*MsgCreatePriceResponse, error) } type msgClient struct { @@ -60,22 +154,368 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } +func (c *msgClient) CreatePrice(ctx context.Context, in *MsgCreatePrice, opts ...grpc.CallOption) (*MsgCreatePriceResponse, error) { + out := new(MsgCreatePriceResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Msg/CreatePrice", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { + CreatePrice(context.Context, *MsgCreatePrice) (*MsgCreatePriceResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. type UnimplementedMsgServer struct { } +func (*UnimplementedMsgServer) CreatePrice(ctx context.Context, req *MsgCreatePrice) (*MsgCreatePriceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreatePrice not implemented") +} + func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +func _Msg_CreatePrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreatePrice) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreatePrice(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Msg/CreatePrice", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreatePrice(ctx, req.(*MsgCreatePrice)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "exocore.oracle.Msg", HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{}, - Metadata: "exocore/oracle/tx.proto", + Methods: []grpc.MethodDesc{ + { + MethodName: "CreatePrice", + Handler: _Msg_CreatePrice_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "exocore/oracle/tx.proto", +} + +func (m *MsgCreatePrice) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreatePrice) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreatePrice) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreatePriceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreatePriceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreatePriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreatePrice) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreatePriceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *MsgCreatePrice) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreatePrice: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreatePrice: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreatePriceResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreatePriceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreatePriceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) From 8d2d2acac3bed56372b6d217e17481393b3dc9f1 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Fri, 23 Feb 2024 13:07:41 +0800 Subject: [PATCH 04/37] feat(oracle-proto): add create-price definition --- proto/exocore/oracle/price.proto | 26 ++ proto/exocore/oracle/tx.proto | 9 +- x/oracle/types/price.pb.go | 734 +++++++++++++++++++++++++++++++ x/oracle/types/tx.pb.go | 166 ++++++- 4 files changed, 922 insertions(+), 13 deletions(-) create mode 100644 proto/exocore/oracle/price.proto create mode 100644 x/oracle/types/price.pb.go diff --git a/proto/exocore/oracle/price.proto b/proto/exocore/oracle/price.proto new file mode 100644 index 000000000..698a3f272 --- /dev/null +++ b/proto/exocore/oracle/price.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package exocore.oracle; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +//token price with timestamp fetched from source +//{price:"12345",decimal:"2"}->price: 123.45 usdt +message PriceWithTime { + string price = 1; + int32 decimal = 2; + string timestamp = 3; +} + +message PriceWithSource{ + //refer to id from Params.SourceList, where this price fetched from, 0 is reserved for custom usage + int32 source_id = 1; + //if source is deteministic like chainlink with roundID, set this value with which returned from source + string det_id = 2; + //up to 3 values in case of the async of network, to give more time for oracle nodes(validators) get into consensus + //eg.with deterministic source, this array will contian 3 continuous values up to latest + //for non-deterministic source, it's a choice by v2 rules. + repeated PriceWithTime prices = 3; + //used for 0-sourceID-customDefinedSource + string desc = 4; +} diff --git a/proto/exocore/oracle/tx.proto b/proto/exocore/oracle/tx.proto index 60cda3476..b7001f233 100644 --- a/proto/exocore/oracle/tx.proto +++ b/proto/exocore/oracle/tx.proto @@ -2,15 +2,22 @@ syntax = "proto3"; package exocore.oracle; +import "exocore/oracle/price.proto"; + option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; // Msg defines the Msg service. service Msg { +//create price for a new oracle round rpc CreatePrice (MsgCreatePrice) returns (MsgCreatePriceResponse); } message MsgCreatePrice { string creator = 1; + //refer to id from Params.TokenList, 0 is reserved, invalid to use + int32 token_id = 2; + repeated PriceWithSource prices = 3; + //on which block commit does this message be built on + uint64 based_block = 4; } message MsgCreatePriceResponse {} - diff --git a/x/oracle/types/price.pb.go b/x/oracle/types/price.pb.go new file mode 100644 index 000000000..9d3bcb3b7 --- /dev/null +++ b/x/oracle/types/price.pb.go @@ -0,0 +1,734 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/price.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// token price with timestamp fetched from source +// {price:"12345",decimal:"2"}->price: 123.45 usdt +type PriceWithTime struct { + Price string `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"` + Decimal int32 `protobuf:"varint,2,opt,name=decimal,proto3" json:"decimal,omitempty"` + Timestamp string `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (m *PriceWithTime) Reset() { *m = PriceWithTime{} } +func (m *PriceWithTime) String() string { return proto.CompactTextString(m) } +func (*PriceWithTime) ProtoMessage() {} +func (*PriceWithTime) Descriptor() ([]byte, []int) { + return fileDescriptor_6755466c800b64fc, []int{0} +} +func (m *PriceWithTime) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PriceWithTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PriceWithTime.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PriceWithTime) XXX_Merge(src proto.Message) { + xxx_messageInfo_PriceWithTime.Merge(m, src) +} +func (m *PriceWithTime) XXX_Size() int { + return m.Size() +} +func (m *PriceWithTime) XXX_DiscardUnknown() { + xxx_messageInfo_PriceWithTime.DiscardUnknown(m) +} + +var xxx_messageInfo_PriceWithTime proto.InternalMessageInfo + +func (m *PriceWithTime) GetPrice() string { + if m != nil { + return m.Price + } + return "" +} + +func (m *PriceWithTime) GetDecimal() int32 { + if m != nil { + return m.Decimal + } + return 0 +} + +func (m *PriceWithTime) GetTimestamp() string { + if m != nil { + return m.Timestamp + } + return "" +} + +type PriceWithSource struct { + // refer to id from Params.SourceList, where this price fetched from, 0 is reserved for custom usage + SourceId int32 `protobuf:"varint,1,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + // if source is deteministic like chainlink with roundID, set this value with which returned from source + DetId string `protobuf:"bytes,2,opt,name=det_id,json=detId,proto3" json:"det_id,omitempty"` + // up to 3 values in case of the async of network, to give more time for oracle nodes(validators) get into consensus + // eg.with deterministic source, this array will contian 3 continuous values up to latest + // for non-deterministic source, it's a choice by v2 rules. + Prices []*PriceWithTime `protobuf:"bytes,3,rep,name=prices,proto3" json:"prices,omitempty"` + // used for 0-sourceID-customDefinedSource + Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` +} + +func (m *PriceWithSource) Reset() { *m = PriceWithSource{} } +func (m *PriceWithSource) String() string { return proto.CompactTextString(m) } +func (*PriceWithSource) ProtoMessage() {} +func (*PriceWithSource) Descriptor() ([]byte, []int) { + return fileDescriptor_6755466c800b64fc, []int{1} +} +func (m *PriceWithSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PriceWithSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PriceWithSource.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PriceWithSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_PriceWithSource.Merge(m, src) +} +func (m *PriceWithSource) XXX_Size() int { + return m.Size() +} +func (m *PriceWithSource) XXX_DiscardUnknown() { + xxx_messageInfo_PriceWithSource.DiscardUnknown(m) +} + +var xxx_messageInfo_PriceWithSource proto.InternalMessageInfo + +func (m *PriceWithSource) GetSourceId() int32 { + if m != nil { + return m.SourceId + } + return 0 +} + +func (m *PriceWithSource) GetDetId() string { + if m != nil { + return m.DetId + } + return "" +} + +func (m *PriceWithSource) GetPrices() []*PriceWithTime { + if m != nil { + return m.Prices + } + return nil +} + +func (m *PriceWithSource) GetDesc() string { + if m != nil { + return m.Desc + } + return "" +} + +func init() { + proto.RegisterType((*PriceWithTime)(nil), "exocore.oracle.PriceWithTime") + proto.RegisterType((*PriceWithSource)(nil), "exocore.oracle.PriceWithSource") +} + +func init() { proto.RegisterFile("exocore/oracle/price.proto", fileDescriptor_6755466c800b64fc) } + +var fileDescriptor_6755466c800b64fc = []byte{ + // 283 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x4c, 0x4e, + 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xca, 0xe9, 0x41, 0xe4, 0x94, 0x62, 0xb9, + 0x78, 0x03, 0x40, 0xd2, 0xe1, 0x99, 0x25, 0x19, 0x21, 0x99, 0xb9, 0xa9, 0x42, 0x22, 0x5c, 0xac, + 0x60, 0xf5, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x10, 0x8e, 0x90, 0x04, 0x17, 0x7b, 0x4a, + 0x6a, 0x72, 0x66, 0x6e, 0x62, 0x8e, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x8c, 0x2b, 0x24, + 0xc3, 0xc5, 0x59, 0x92, 0x99, 0x9b, 0x5a, 0x5c, 0x92, 0x98, 0x5b, 0x20, 0xc1, 0x0c, 0xd6, 0x83, + 0x10, 0x50, 0x9a, 0xc0, 0xc8, 0xc5, 0x0f, 0x37, 0x3f, 0x38, 0xbf, 0xb4, 0x28, 0x39, 0x55, 0x48, + 0x9a, 0x8b, 0xb3, 0x18, 0xcc, 0x8a, 0xcf, 0x4c, 0x01, 0xdb, 0xc2, 0x1a, 0xc4, 0x01, 0x11, 0xf0, + 0x4c, 0x11, 0x12, 0xe5, 0x62, 0x4b, 0x49, 0x2d, 0x01, 0xc9, 0x30, 0x41, 0xec, 0x4f, 0x49, 0x2d, + 0xf1, 0x4c, 0x11, 0x32, 0xe5, 0x62, 0x03, 0x3b, 0xa4, 0x58, 0x82, 0x59, 0x81, 0x59, 0x83, 0xdb, + 0x48, 0x56, 0x0f, 0xd5, 0x1f, 0x7a, 0x28, 0x9e, 0x08, 0x82, 0x2a, 0x16, 0x12, 0xe2, 0x62, 0x49, + 0x49, 0x2d, 0x4e, 0x96, 0x60, 0x01, 0x9b, 0x05, 0x66, 0x3b, 0x79, 0x9d, 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, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, + 0xae, 0xbe, 0x2b, 0xc4, 0x78, 0xbf, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x58, 0x88, 0x56, + 0xc0, 0xc2, 0xb4, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0xa8, 0xc6, 0x80, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xfd, 0x5b, 0x62, 0xc4, 0x72, 0x01, 0x00, 0x00, +} + +func (m *PriceWithTime) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PriceWithTime) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PriceWithTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Timestamp) > 0 { + i -= len(m.Timestamp) + copy(dAtA[i:], m.Timestamp) + i = encodeVarintPrice(dAtA, i, uint64(len(m.Timestamp))) + i-- + dAtA[i] = 0x1a + } + if m.Decimal != 0 { + i = encodeVarintPrice(dAtA, i, uint64(m.Decimal)) + i-- + dAtA[i] = 0x10 + } + if len(m.Price) > 0 { + i -= len(m.Price) + copy(dAtA[i:], m.Price) + i = encodeVarintPrice(dAtA, i, uint64(len(m.Price))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PriceWithSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PriceWithSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PriceWithSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Desc) > 0 { + i -= len(m.Desc) + copy(dAtA[i:], m.Desc) + i = encodeVarintPrice(dAtA, i, uint64(len(m.Desc))) + i-- + dAtA[i] = 0x22 + } + if len(m.Prices) > 0 { + for iNdEx := len(m.Prices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Prices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPrice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.DetId) > 0 { + i -= len(m.DetId) + copy(dAtA[i:], m.DetId) + i = encodeVarintPrice(dAtA, i, uint64(len(m.DetId))) + i-- + dAtA[i] = 0x12 + } + if m.SourceId != 0 { + i = encodeVarintPrice(dAtA, i, uint64(m.SourceId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintPrice(dAtA []byte, offset int, v uint64) int { + offset -= sovPrice(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PriceWithTime) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Price) + if l > 0 { + n += 1 + l + sovPrice(uint64(l)) + } + if m.Decimal != 0 { + n += 1 + sovPrice(uint64(m.Decimal)) + } + l = len(m.Timestamp) + if l > 0 { + n += 1 + l + sovPrice(uint64(l)) + } + return n +} + +func (m *PriceWithSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SourceId != 0 { + n += 1 + sovPrice(uint64(m.SourceId)) + } + l = len(m.DetId) + if l > 0 { + n += 1 + l + sovPrice(uint64(l)) + } + if len(m.Prices) > 0 { + for _, e := range m.Prices { + l = e.Size() + n += 1 + l + sovPrice(uint64(l)) + } + } + l = len(m.Desc) + if l > 0 { + n += 1 + l + sovPrice(uint64(l)) + } + return n +} + +func sovPrice(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPrice(x uint64) (n int) { + return sovPrice(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PriceWithTime) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PriceWithTime: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PriceWithTime: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrice + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPrice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Price = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Decimal", wireType) + } + m.Decimal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Decimal |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrice + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPrice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Timestamp = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPrice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPrice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PriceWithSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PriceWithSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PriceWithSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceId", wireType) + } + m.SourceId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SourceId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DetId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrice + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPrice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DetId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPrice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPrice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prices = append(m.Prices, &PriceWithTime{}) + if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Desc", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrice + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPrice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Desc = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPrice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPrice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPrice(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPrice + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPrice + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPrice + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthPrice + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPrice + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPrice + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPrice = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPrice = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPrice = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go index 440847720..3ce1b0906 100644 --- a/x/oracle/types/tx.pb.go +++ b/x/oracle/types/tx.pb.go @@ -29,6 +29,11 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgCreatePrice struct { Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + //refer to id from Params.TokenList, 0 is reserved, invalid to use + TokenId int32 `protobuf:"varint,2,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` + Prices []*PriceWithSource `protobuf:"bytes,3,rep,name=prices,proto3" json:"prices,omitempty"` + //on which block commit does this message be built on + BasedBlock uint64 `protobuf:"varint,4,opt,name=based_block,json=basedBlock,proto3" json:"based_block,omitempty"` } func (m *MsgCreatePrice) Reset() { *m = MsgCreatePrice{} } @@ -71,6 +76,27 @@ func (m *MsgCreatePrice) GetCreator() string { return "" } +func (m *MsgCreatePrice) GetTokenId() int32 { + if m != nil { + return m.TokenId + } + return 0 +} + +func (m *MsgCreatePrice) GetPrices() []*PriceWithSource { + if m != nil { + return m.Prices + } + return nil +} + +func (m *MsgCreatePrice) GetBasedBlock() uint64 { + if m != nil { + return m.BasedBlock + } + return 0 +} + type MsgCreatePriceResponse struct { } @@ -115,20 +141,26 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/tx.proto", fileDescriptor_02cf64aff79d2288) } var fileDescriptor_02cf64aff79d2288 = []byte{ - // 199 bytes of a gzipped FileDescriptorProto + // 294 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xad, 0xc8, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xe8, 0x41, 0x24, 0x94, 0xb4, 0xb8, 0xf8, 0x7c, 0x8b, - 0xd3, 0x9d, 0x8b, 0x52, 0x13, 0x4b, 0x52, 0x03, 0x8a, 0x32, 0x93, 0x53, 0x85, 0x24, 0xb8, 0xd8, - 0x93, 0x41, 0xdc, 0xfc, 0x22, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x18, 0x57, 0x49, 0x82, - 0x4b, 0x0c, 0x55, 0x6d, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x51, 0x0c, 0x17, 0xb3, - 0x6f, 0x71, 0xba, 0x50, 0x28, 0x17, 0x37, 0xb2, 0x49, 0x72, 0x7a, 0xa8, 0x96, 0xe9, 0xa1, 0xea, - 0x96, 0x52, 0xc3, 0x2f, 0x0f, 0x33, 0xdd, 0xc9, 0xeb, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, - 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, - 0xe5, 0x18, 0xa2, 0x0c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x5d, - 0x21, 0x66, 0xf9, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0xeb, 0xc3, 0x02, 0xa0, 0x02, 0x1e, 0x04, - 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0x60, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x09, - 0xcb, 0x8d, 0x2e, 0x21, 0x01, 0x00, 0x00, + 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xe8, 0x41, 0x24, 0xa4, 0xa4, 0xd0, 0x14, 0x16, 0x14, + 0x65, 0x26, 0xa7, 0x42, 0xd4, 0x2a, 0xcd, 0x67, 0xe4, 0xe2, 0xf3, 0x2d, 0x4e, 0x77, 0x2e, 0x4a, + 0x4d, 0x2c, 0x49, 0x0d, 0x00, 0x49, 0x08, 0x49, 0x70, 0xb1, 0x27, 0x83, 0xb8, 0xf9, 0x45, 0x12, + 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x30, 0xae, 0x90, 0x24, 0x17, 0x47, 0x49, 0x7e, 0x76, 0x6a, + 0x5e, 0x7c, 0x66, 0x8a, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x3b, 0x98, 0xef, 0x99, 0x22, + 0x64, 0xce, 0xc5, 0x06, 0x36, 0xb6, 0x58, 0x82, 0x59, 0x81, 0x59, 0x83, 0xdb, 0x48, 0x5e, 0x0f, + 0xd5, 0x11, 0x7a, 0x60, 0xb3, 0xc3, 0x33, 0x4b, 0x32, 0x82, 0xf3, 0x4b, 0x8b, 0x92, 0x53, 0x83, + 0xa0, 0xca, 0x85, 0xe4, 0xb9, 0xb8, 0x93, 0x12, 0x8b, 0x53, 0x53, 0xe2, 0x93, 0x72, 0xf2, 0x93, + 0xb3, 0x25, 0x58, 0x14, 0x18, 0x35, 0x58, 0x82, 0xb8, 0xc0, 0x42, 0x4e, 0x20, 0x11, 0x25, 0x09, + 0x2e, 0x31, 0x54, 0x07, 0x06, 0xa5, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x1a, 0xc5, 0x70, 0x31, + 0xfb, 0x16, 0xa7, 0x0b, 0x85, 0x72, 0x71, 0x23, 0x3b, 0x5f, 0x0e, 0xdd, 0x66, 0x54, 0xdd, 0x52, + 0x6a, 0xf8, 0xe5, 0x61, 0xa6, 0x3b, 0x79, 0x9d, 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, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0xbe, 0x2b, 0xc4, + 0x2c, 0xbf, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x58, 0x48, 0x57, 0xc0, 0x23, 0xa5, 0xb2, + 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0xd8, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3c, 0xb1, + 0x60, 0x86, 0xb3, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -143,6 +175,7 @@ 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 MsgClient interface { + //create price for a new oracle round CreatePrice(ctx context.Context, in *MsgCreatePrice, opts ...grpc.CallOption) (*MsgCreatePriceResponse, error) } @@ -165,6 +198,7 @@ func (c *msgClient) CreatePrice(ctx context.Context, in *MsgCreatePrice, opts .. // MsgServer is the server API for Msg service. type MsgServer interface { + //create price for a new oracle round CreatePrice(context.Context, *MsgCreatePrice) (*MsgCreatePriceResponse, error) } @@ -231,6 +265,30 @@ func (m *MsgCreatePrice) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.BasedBlock != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.BasedBlock)) + i-- + dAtA[i] = 0x20 + } + if len(m.Prices) > 0 { + for iNdEx := len(m.Prices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Prices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.TokenId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TokenId)) + i-- + dAtA[i] = 0x10 + } if len(m.Creator) > 0 { i -= len(m.Creator) copy(dAtA[i:], m.Creator) @@ -285,6 +343,18 @@ func (m *MsgCreatePrice) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if m.TokenId != 0 { + n += 1 + sovTx(uint64(m.TokenId)) + } + if len(m.Prices) > 0 { + for _, e := range m.Prices { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if m.BasedBlock != 0 { + n += 1 + sovTx(uint64(m.BasedBlock)) + } return n } @@ -364,6 +434,78 @@ func (m *MsgCreatePrice) Unmarshal(dAtA []byte) error { } m.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + } + m.TokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TokenId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prices = append(m.Prices, &PriceWithSource{}) + if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BasedBlock", wireType) + } + m.BasedBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BasedBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From 42f0f6c7688da9cc755ae09117f59babba69acd5 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Sat, 24 Feb 2024 12:29:05 +0800 Subject: [PATCH 05/37] feat(oracle-proto): add params definition --- proto/exocore/oracle/info.proto | 41 + proto/exocore/oracle/params.proto | 8 +- proto/exocore/oracle/token_feeder.proto | 42 + x/oracle/types/info.pb.go | 1408 +++++++++++++++++++++++ x/oracle/types/params.pb.go | 335 +++++- x/oracle/types/price.pb.go | 12 +- x/oracle/types/token_feeder.pb.go | 1057 +++++++++++++++++ 7 files changed, 2888 insertions(+), 15 deletions(-) create mode 100644 proto/exocore/oracle/info.proto create mode 100644 proto/exocore/oracle/token_feeder.proto create mode 100644 x/oracle/types/info.pb.go create mode 100644 x/oracle/types/token_feeder.pb.go diff --git a/proto/exocore/oracle/info.proto b/proto/exocore/oracle/info.proto new file mode 100644 index 000000000..d3be094fd --- /dev/null +++ b/proto/exocore/oracle/info.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; +package exocore.oracle; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message Chain{ + //eg."bitcoin" + string name = 1; + //TODO: metadata + string desc = 2; +} + +message Token{ + string name = 1; + //id refer to chainList's index + int32 chain_id = 2; + //if any, like erc20 tokens + string contract_address = 3; + int32 decimal = 4; + //set false when we stop official price oracle service for a specified token + bool active = 5; +} + +message Endpoint{ + //url int refer to TokenList.ID, 0 reprents default for all (as fall back) + //key refer to tokenID, 1->"https://chainlink.../eth" + map offchain = 1; + //url int refer to TokenList.ID, 0 reprents default for all (as fall back) + //key refer to tokenID, 1->"eth://0xabc...def" + map onchain = 2; + +} + +message Source { + string name = 1; + Endpoint entry = 2; + //set false when the source is out of service or reject to accept this source for official service + bool valid = 3; +} diff --git a/proto/exocore/oracle/params.proto b/proto/exocore/oracle/params.proto index 1a30c46b3..eb7b2b747 100644 --- a/proto/exocore/oracle/params.proto +++ b/proto/exocore/oracle/params.proto @@ -2,11 +2,17 @@ syntax = "proto3"; package exocore.oracle; import "gogoproto/gogo.proto"; +import "exocore/oracle/info.proto"; +import "exocore/oracle/token_feeder.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; // Params defines the parameters for the module. message Params { option (gogoproto.goproto_stringer) = false; - + repeated Chain chains = 1; + repeated Token tokens = 2; + repeated Source sources = 3; + repeated RuleWithSource rules = 4; + repeated TokenFeeder TokenFeeders = 5; } diff --git a/proto/exocore/oracle/token_feeder.proto b/proto/exocore/oracle/token_feeder.proto new file mode 100644 index 000000000..818e3867f --- /dev/null +++ b/proto/exocore/oracle/token_feeder.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package exocore.oracle; + +import "gogoproto/gogo.proto"; +import "exocore/oracle/info.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +//n out of m required source +message NOMSource{ + //required source set, refer to params.sourceList, 1st set to 0 means all valid sources + repeated int32 source_ids = 1; + //minimum number from the required sources to be fullfiled + int32 minimum = 2; +} + +//specify data from which source is needed +//rule_1: specified sources +//rule_2: n out of total sources are required +message RuleWithSource{ + //refer to params.sourceList.ID, when length>0, ignore the other field, when 1st set to 0, means all valid sources, length==0->check next field:minimum + repeated int32 source_ids = 1; + //n out of total sources are required + NOMSource nom = 2; +} + +//Tokenfeeder represents a price oracle for one token +message TokenFeeder{ + //refer to params.tokenList, from 1 + int32 token_id = 1; + //refer to params.ruleList, 0 means no restriction, accept any source including customer defined + int32 rule_id = 2; + //include, from 1, when some token's feeder had been stop and then restart, the token_id will be continuous from previous one + int64 start_round_id = 3; + //include, first block which start_round_id can be settled is at least start_base_block+1 + int64 start_base_block = 4; + //set as count of blocks, for how many blocks interval the price will be update once + int64 interval = 5; + //tokenfeeder is initialized with forever live, update the End parameters by voting, and will off service by the end + //this is set by updateParams, and the EndRoundID will be update by related. excluded, will not work if current height >=EndBlock + int64 end_block = 6; +} diff --git a/x/oracle/types/info.pb.go b/x/oracle/types/info.pb.go new file mode 100644 index 000000000..fd2fa8dd5 --- /dev/null +++ b/x/oracle/types/info.pb.go @@ -0,0 +1,1408 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/info.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Chain struct { + // eg."bitcoin" + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // TODO: metadata + Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` +} + +func (m *Chain) Reset() { *m = Chain{} } +func (m *Chain) String() string { return proto.CompactTextString(m) } +func (*Chain) ProtoMessage() {} +func (*Chain) Descriptor() ([]byte, []int) { + return fileDescriptor_a9bbae837d8caf59, []int{0} +} +func (m *Chain) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Chain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Chain.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Chain) XXX_Merge(src proto.Message) { + xxx_messageInfo_Chain.Merge(m, src) +} +func (m *Chain) XXX_Size() int { + return m.Size() +} +func (m *Chain) XXX_DiscardUnknown() { + xxx_messageInfo_Chain.DiscardUnknown(m) +} + +var xxx_messageInfo_Chain proto.InternalMessageInfo + +func (m *Chain) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Chain) GetDesc() string { + if m != nil { + return m.Desc + } + return "" +} + +type Token struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // id refer to chainList's index + ChainId int32 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // if any, like erc20 tokens + ContractAddress string `protobuf:"bytes,3,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` + Decimal int32 `protobuf:"varint,4,opt,name=decimal,proto3" json:"decimal,omitempty"` + // set false when we stop official price oracle service for a specified token + Active bool `protobuf:"varint,5,opt,name=active,proto3" json:"active,omitempty"` +} + +func (m *Token) Reset() { *m = Token{} } +func (m *Token) String() string { return proto.CompactTextString(m) } +func (*Token) ProtoMessage() {} +func (*Token) Descriptor() ([]byte, []int) { + return fileDescriptor_a9bbae837d8caf59, []int{1} +} +func (m *Token) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Token.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Token) XXX_Merge(src proto.Message) { + xxx_messageInfo_Token.Merge(m, src) +} +func (m *Token) XXX_Size() int { + return m.Size() +} +func (m *Token) XXX_DiscardUnknown() { + xxx_messageInfo_Token.DiscardUnknown(m) +} + +var xxx_messageInfo_Token proto.InternalMessageInfo + +func (m *Token) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Token) GetChainId() int32 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *Token) GetContractAddress() string { + if m != nil { + return m.ContractAddress + } + return "" +} + +func (m *Token) GetDecimal() int32 { + if m != nil { + return m.Decimal + } + return 0 +} + +func (m *Token) GetActive() bool { + if m != nil { + return m.Active + } + return false +} + +type Endpoint struct { + // url int refer to TokenList.ID, 0 reprents default for all (as fall back) + // key refer to tokenID, 1->"https://chainlink.../eth" + Offchain map[int32]string `protobuf:"bytes,1,rep,name=offchain,proto3" json:"offchain,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // url int refer to TokenList.ID, 0 reprents default for all (as fall back) + // key refer to tokenID, 1->"eth://0xabc...def" + Onchain map[int32]string `protobuf:"bytes,2,rep,name=onchain,proto3" json:"onchain,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *Endpoint) Reset() { *m = Endpoint{} } +func (m *Endpoint) String() string { return proto.CompactTextString(m) } +func (*Endpoint) ProtoMessage() {} +func (*Endpoint) Descriptor() ([]byte, []int) { + return fileDescriptor_a9bbae837d8caf59, []int{2} +} +func (m *Endpoint) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Endpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Endpoint.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Endpoint) XXX_Merge(src proto.Message) { + xxx_messageInfo_Endpoint.Merge(m, src) +} +func (m *Endpoint) XXX_Size() int { + return m.Size() +} +func (m *Endpoint) XXX_DiscardUnknown() { + xxx_messageInfo_Endpoint.DiscardUnknown(m) +} + +var xxx_messageInfo_Endpoint proto.InternalMessageInfo + +func (m *Endpoint) GetOffchain() map[int32]string { + if m != nil { + return m.Offchain + } + return nil +} + +func (m *Endpoint) GetOnchain() map[int32]string { + if m != nil { + return m.Onchain + } + return nil +} + +type Source struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Entry *Endpoint `protobuf:"bytes,2,opt,name=entry,proto3" json:"entry,omitempty"` + // set false when the source is out of service or reject to accept this source for official service + Valid bool `protobuf:"varint,3,opt,name=valid,proto3" json:"valid,omitempty"` +} + +func (m *Source) Reset() { *m = Source{} } +func (m *Source) String() string { return proto.CompactTextString(m) } +func (*Source) ProtoMessage() {} +func (*Source) Descriptor() ([]byte, []int) { + return fileDescriptor_a9bbae837d8caf59, []int{3} +} +func (m *Source) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Source) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Source.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Source) XXX_Merge(src proto.Message) { + xxx_messageInfo_Source.Merge(m, src) +} +func (m *Source) XXX_Size() int { + return m.Size() +} +func (m *Source) XXX_DiscardUnknown() { + xxx_messageInfo_Source.DiscardUnknown(m) +} + +var xxx_messageInfo_Source proto.InternalMessageInfo + +func (m *Source) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Source) GetEntry() *Endpoint { + if m != nil { + return m.Entry + } + return nil +} + +func (m *Source) GetValid() bool { + if m != nil { + return m.Valid + } + return false +} + +func init() { + proto.RegisterType((*Chain)(nil), "exocore.oracle.Chain") + proto.RegisterType((*Token)(nil), "exocore.oracle.Token") + proto.RegisterType((*Endpoint)(nil), "exocore.oracle.Endpoint") + proto.RegisterMapType((map[int32]string)(nil), "exocore.oracle.Endpoint.OffchainEntry") + proto.RegisterMapType((map[int32]string)(nil), "exocore.oracle.Endpoint.OnchainEntry") + proto.RegisterType((*Source)(nil), "exocore.oracle.Source") +} + +func init() { proto.RegisterFile("exocore/oracle/info.proto", fileDescriptor_a9bbae837d8caf59) } + +var fileDescriptor_a9bbae837d8caf59 = []byte{ + // 411 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xcf, 0x6e, 0x13, 0x31, + 0x10, 0xc6, 0xe3, 0x4d, 0x37, 0x59, 0xa6, 0xfc, 0xa9, 0xac, 0x0a, 0xb9, 0x39, 0xac, 0xa2, 0x95, + 0x40, 0xe1, 0xb2, 0x8b, 0xca, 0x05, 0x95, 0x03, 0xa2, 0x28, 0x07, 0x38, 0x80, 0xb4, 0x70, 0xe2, + 0x52, 0x39, 0xb6, 0x93, 0x5a, 0x49, 0x3c, 0x91, 0xd7, 0x29, 0xcd, 0x1b, 0x70, 0x44, 0xe2, 0xa5, + 0x38, 0xf6, 0xc8, 0x11, 0x25, 0x2f, 0x82, 0xd6, 0xde, 0x45, 0xad, 0xd4, 0x1e, 0x7a, 0x9b, 0x6f, + 0x66, 0xbe, 0x9f, 0xe5, 0x99, 0x81, 0x23, 0x75, 0x89, 0x02, 0xad, 0x2a, 0xd0, 0x72, 0xb1, 0x50, + 0x85, 0x36, 0x53, 0xcc, 0x57, 0x16, 0x1d, 0xd2, 0xc7, 0x4d, 0x29, 0x0f, 0xa5, 0xc1, 0xe1, 0x0c, + 0x67, 0xe8, 0x4b, 0x45, 0x1d, 0x85, 0xae, 0xac, 0x80, 0xf8, 0xfd, 0x39, 0xd7, 0x86, 0x52, 0xd8, + 0x33, 0x7c, 0xa9, 0x18, 0x19, 0x92, 0xd1, 0x83, 0xd2, 0xc7, 0x75, 0x4e, 0xaa, 0x4a, 0xb0, 0x28, + 0xe4, 0xea, 0x38, 0xfb, 0x45, 0x20, 0xfe, 0x8a, 0x73, 0x75, 0xbb, 0xe3, 0x08, 0x12, 0x51, 0xe3, + 0xce, 0xb4, 0xf4, 0xae, 0xb8, 0xec, 0x7b, 0xfd, 0x41, 0xd2, 0x17, 0x70, 0x20, 0xd0, 0x38, 0xcb, + 0x85, 0x3b, 0xe3, 0x52, 0x5a, 0x55, 0x55, 0xac, 0xeb, 0xad, 0x4f, 0xda, 0xfc, 0xbb, 0x90, 0xa6, + 0x0c, 0xfa, 0x52, 0x09, 0xbd, 0xe4, 0x0b, 0xb6, 0x17, 0x20, 0x8d, 0xa4, 0x4f, 0xa1, 0xc7, 0x85, + 0xd3, 0x17, 0x8a, 0xc5, 0x43, 0x32, 0x4a, 0xca, 0x46, 0x65, 0x3f, 0x22, 0x48, 0xc6, 0x46, 0xae, + 0x50, 0x1b, 0x47, 0x4f, 0x21, 0xc1, 0xe9, 0xd4, 0xbf, 0xcb, 0xc8, 0xb0, 0x3b, 0xda, 0x3f, 0x7e, + 0x9e, 0xdf, 0x1c, 0x46, 0xde, 0xf6, 0xe6, 0x9f, 0x9b, 0xc6, 0xb1, 0x71, 0x76, 0x53, 0xfe, 0xf7, + 0xd1, 0xb7, 0xd0, 0x47, 0x13, 0x10, 0x91, 0x47, 0x3c, 0xbb, 0x1b, 0x61, 0xae, 0x11, 0x5a, 0xd7, + 0xe0, 0x0d, 0x3c, 0xba, 0xc1, 0xa6, 0x07, 0xd0, 0x9d, 0xab, 0x8d, 0x9f, 0x56, 0x5c, 0xd6, 0x21, + 0x3d, 0x84, 0xf8, 0x82, 0x2f, 0xd6, 0xaa, 0x99, 0x6f, 0x10, 0x27, 0xd1, 0x6b, 0x32, 0x38, 0x81, + 0x87, 0xd7, 0xa9, 0xf7, 0xf1, 0x66, 0x13, 0xe8, 0x7d, 0xc1, 0xb5, 0x15, 0xea, 0xd6, 0x05, 0xe5, + 0x10, 0xab, 0x1a, 0xe9, 0x7d, 0xfb, 0xc7, 0xec, 0xae, 0x5f, 0x95, 0xa1, 0xad, 0x79, 0x47, 0x4b, + 0xbf, 0xaa, 0xa4, 0x0c, 0xe2, 0xf4, 0xe3, 0xef, 0x6d, 0x4a, 0xae, 0xb6, 0x29, 0xf9, 0xbb, 0x4d, + 0xc9, 0xcf, 0x5d, 0xda, 0xb9, 0xda, 0xa5, 0x9d, 0x3f, 0xbb, 0xb4, 0xf3, 0xed, 0xe5, 0x4c, 0xbb, + 0xf3, 0xf5, 0x24, 0x17, 0xb8, 0x2c, 0xc6, 0x01, 0xfd, 0x49, 0xb9, 0xef, 0x68, 0xe7, 0x45, 0x7b, + 0xaa, 0x97, 0xed, 0xb1, 0xba, 0xcd, 0x4a, 0x55, 0x93, 0x9e, 0x3f, 0xc4, 0x57, 0xff, 0x02, 0x00, + 0x00, 0xff, 0xff, 0x44, 0x77, 0xfd, 0x8e, 0xcb, 0x02, 0x00, 0x00, +} + +func (m *Chain) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Chain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Chain) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Desc) > 0 { + i -= len(m.Desc) + copy(dAtA[i:], m.Desc) + i = encodeVarintInfo(dAtA, i, uint64(len(m.Desc))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintInfo(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Token) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Token) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Token) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Active { + i-- + if m.Active { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.Decimal != 0 { + i = encodeVarintInfo(dAtA, i, uint64(m.Decimal)) + i-- + dAtA[i] = 0x20 + } + if len(m.ContractAddress) > 0 { + i -= len(m.ContractAddress) + copy(dAtA[i:], m.ContractAddress) + i = encodeVarintInfo(dAtA, i, uint64(len(m.ContractAddress))) + i-- + dAtA[i] = 0x1a + } + if m.ChainId != 0 { + i = encodeVarintInfo(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintInfo(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Endpoint) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Endpoint) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Onchain) > 0 { + for k := range m.Onchain { + v := m.Onchain[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintInfo(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i = encodeVarintInfo(dAtA, i, uint64(k)) + i-- + dAtA[i] = 0x8 + i = encodeVarintInfo(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Offchain) > 0 { + for k := range m.Offchain { + v := m.Offchain[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintInfo(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i = encodeVarintInfo(dAtA, i, uint64(k)) + i-- + dAtA[i] = 0x8 + i = encodeVarintInfo(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Source) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Source) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Source) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Valid { + i-- + if m.Valid { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.Entry != nil { + { + size, err := m.Entry.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintInfo(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintInfo(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintInfo(dAtA []byte, offset int, v uint64) int { + offset -= sovInfo(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Chain) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovInfo(uint64(l)) + } + l = len(m.Desc) + if l > 0 { + n += 1 + l + sovInfo(uint64(l)) + } + return n +} + +func (m *Token) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovInfo(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovInfo(uint64(m.ChainId)) + } + l = len(m.ContractAddress) + if l > 0 { + n += 1 + l + sovInfo(uint64(l)) + } + if m.Decimal != 0 { + n += 1 + sovInfo(uint64(m.Decimal)) + } + if m.Active { + n += 2 + } + return n +} + +func (m *Endpoint) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Offchain) > 0 { + for k, v := range m.Offchain { + _ = k + _ = v + mapEntrySize := 1 + sovInfo(uint64(k)) + 1 + len(v) + sovInfo(uint64(len(v))) + n += mapEntrySize + 1 + sovInfo(uint64(mapEntrySize)) + } + } + if len(m.Onchain) > 0 { + for k, v := range m.Onchain { + _ = k + _ = v + mapEntrySize := 1 + sovInfo(uint64(k)) + 1 + len(v) + sovInfo(uint64(len(v))) + n += mapEntrySize + 1 + sovInfo(uint64(mapEntrySize)) + } + } + return n +} + +func (m *Source) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovInfo(uint64(l)) + } + if m.Entry != nil { + l = m.Entry.Size() + n += 1 + l + sovInfo(uint64(l)) + } + if m.Valid { + n += 2 + } + return n +} + +func sovInfo(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozInfo(x uint64) (n int) { + return sovInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Chain) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Chain: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Chain: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Desc", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Desc = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Token) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Token: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Token: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Decimal", wireType) + } + m.Decimal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Decimal |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Active", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Active = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Endpoint) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Endpoint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Endpoint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Offchain", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Offchain == nil { + m.Offchain = make(map[int32]string) + } + var mapkey int32 + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapkey |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthInfo + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthInfo + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthInfo + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Offchain[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Onchain", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Onchain == nil { + m.Onchain = make(map[int32]string) + } + var mapkey int32 + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapkey |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthInfo + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthInfo + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthInfo + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Onchain[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Source) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Source: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Source: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entry", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Entry == nil { + m.Entry = &Endpoint{} + } + if err := m.Entry.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Valid", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Valid = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipInfo(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthInfo + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupInfo + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthInfo + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthInfo = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowInfo = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupInfo = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/params.pb.go b/x/oracle/types/params.pb.go index 25a611fa7..0c7e24347 100644 --- a/x/oracle/types/params.pb.go +++ b/x/oracle/types/params.pb.go @@ -25,6 +25,11 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. type Params struct { + Chains []*Chain `protobuf:"bytes,1,rep,name=chains,proto3" json:"chains,omitempty"` + Tokens []*Token `protobuf:"bytes,2,rep,name=tokens,proto3" json:"tokens,omitempty"` + Sources []*Source `protobuf:"bytes,3,rep,name=sources,proto3" json:"sources,omitempty"` + Rules []*RuleWithSource `protobuf:"bytes,4,rep,name=rules,proto3" json:"rules,omitempty"` + TokenFeeders []*TokenFeeder `protobuf:"bytes,5,rep,name=TokenFeeders,proto3" json:"TokenFeeders,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -59,6 +64,41 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo +func (m *Params) GetChains() []*Chain { + if m != nil { + return m.Chains + } + return nil +} + +func (m *Params) GetTokens() []*Token { + if m != nil { + return m.Tokens + } + return nil +} + +func (m *Params) GetSources() []*Source { + if m != nil { + return m.Sources + } + return nil +} + +func (m *Params) GetRules() []*RuleWithSource { + if m != nil { + return m.Rules + } + return nil +} + +func (m *Params) GetTokenFeeders() []*TokenFeeder { + if m != nil { + return m.TokenFeeders + } + return nil +} + func init() { proto.RegisterType((*Params)(nil), "exocore.oracle.Params") } @@ -66,17 +106,26 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/params.proto", fileDescriptor_ba212ceb89f5e6b2) } var fileDescriptor_ba212ceb89f5e6b2 = []byte{ - // 153 bytes of a gzipped FileDescriptorProto + // 298 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xad, 0xc8, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xea, 0x41, 0x24, 0xa5, 0x44, - 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x12, 0x1f, 0x17, 0x5b, 0x00, - 0x58, 0x97, 0x15, 0xcb, 0x8c, 0x05, 0xf2, 0x0c, 0x4e, 0x5e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, - 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, - 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x90, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, - 0xef, 0x0a, 0x31, 0xda, 0x2f, 0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x5b, 0x1f, 0xe6, 0x8c, 0x0a, 0x98, - 0x43, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x56, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, - 0xff, 0x55, 0x2f, 0xc3, 0xb4, 0xa7, 0x00, 0x00, 0x00, + 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x94, 0x24, 0x9a, 0x11, 0x99, + 0x79, 0x69, 0x30, 0x29, 0x45, 0x34, 0xa9, 0x92, 0xfc, 0xec, 0xd4, 0xbc, 0xf8, 0xb4, 0xd4, 0xd4, + 0x94, 0xd4, 0x22, 0x88, 0x12, 0xa5, 0xa9, 0x4c, 0x5c, 0x6c, 0x01, 0x60, 0x4b, 0x85, 0x74, 0xb9, + 0xd8, 0x92, 0x33, 0x12, 0x33, 0xf3, 0x8a, 0x25, 0x18, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0x44, 0xf5, + 0x50, 0xed, 0xd7, 0x73, 0x06, 0xc9, 0x06, 0x41, 0x15, 0x81, 0x94, 0x83, 0xcd, 0x2b, 0x96, 0x60, + 0xc2, 0xae, 0x3c, 0x04, 0x24, 0x1b, 0x04, 0x55, 0x24, 0x64, 0xc0, 0xc5, 0x5e, 0x9c, 0x5f, 0x5a, + 0x94, 0x9c, 0x5a, 0x2c, 0xc1, 0x0c, 0x56, 0x2f, 0x86, 0xae, 0x3e, 0x18, 0x2c, 0x1d, 0x04, 0x53, + 0x26, 0x64, 0xc2, 0xc5, 0x5a, 0x54, 0x9a, 0x93, 0x5a, 0x2c, 0xc1, 0x02, 0x56, 0x2f, 0x87, 0xae, + 0x3e, 0xa8, 0x34, 0x27, 0x35, 0x3c, 0xb3, 0x24, 0x03, 0xaa, 0x0f, 0xa2, 0x58, 0xc8, 0x9e, 0x8b, + 0x07, 0x6c, 0xb1, 0x1b, 0xd8, 0x97, 0xc5, 0x12, 0xac, 0x60, 0xcd, 0xd2, 0x58, 0x1d, 0x07, 0x51, + 0x13, 0x84, 0xa2, 0xc1, 0x8a, 0x65, 0xc6, 0x02, 0x79, 0x06, 0x27, 0xaf, 0x13, 0x8f, 0xe4, 0x18, + 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, + 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x32, 0x48, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, + 0xcf, 0xd5, 0x77, 0x85, 0x18, 0xea, 0x97, 0x5a, 0x52, 0x9e, 0x5f, 0x94, 0xad, 0x0f, 0x0b, 0xee, + 0x0a, 0x78, 0x80, 0x57, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x83, 0xda, 0x18, 0x10, 0x00, 0x00, + 0xff, 0xff, 0x84, 0xc4, 0x4f, 0xd9, 0xed, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -99,6 +148,76 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.TokenFeeders) > 0 { + for iNdEx := len(m.TokenFeeders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TokenFeeders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.Rules) > 0 { + for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Sources) > 0 { + for iNdEx := len(m.Sources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Sources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Tokens) > 0 { + for iNdEx := len(m.Tokens) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tokens[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Chains) > 0 { + for iNdEx := len(m.Chains) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Chains[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } return len(dAtA) - i, nil } @@ -119,6 +238,36 @@ func (m *Params) Size() (n int) { } var l int _ = l + if len(m.Chains) > 0 { + for _, e := range m.Chains { + l = e.Size() + n += 1 + l + sovParams(uint64(l)) + } + } + if len(m.Tokens) > 0 { + for _, e := range m.Tokens { + l = e.Size() + n += 1 + l + sovParams(uint64(l)) + } + } + if len(m.Sources) > 0 { + for _, e := range m.Sources { + l = e.Size() + n += 1 + l + sovParams(uint64(l)) + } + } + if len(m.Rules) > 0 { + for _, e := range m.Rules { + l = e.Size() + n += 1 + l + sovParams(uint64(l)) + } + } + if len(m.TokenFeeders) > 0 { + for _, e := range m.TokenFeeders { + l = e.Size() + n += 1 + l + sovParams(uint64(l)) + } + } return n } @@ -157,6 +306,176 @@ func (m *Params) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chains", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Chains = append(m.Chains, &Chain{}) + if err := m.Chains[len(m.Chains)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tokens", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tokens = append(m.Tokens, &Token{}) + if err := m.Tokens[len(m.Tokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sources = append(m.Sources, &Source{}) + if err := m.Sources[len(m.Sources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rules = append(m.Rules, &RuleWithSource{}) + if err := m.Rules[len(m.Rules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenFeeders", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokenFeeders = append(m.TokenFeeders, &TokenFeeder{}) + if err := m.TokenFeeders[len(m.TokenFeeders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/oracle/types/price.pb.go b/x/oracle/types/price.pb.go index 9d3bcb3b7..e9a22fe69 100644 --- a/x/oracle/types/price.pb.go +++ b/x/oracle/types/price.pb.go @@ -85,15 +85,15 @@ func (m *PriceWithTime) GetTimestamp() string { } type PriceWithSource struct { - // refer to id from Params.SourceList, where this price fetched from, 0 is reserved for custom usage + //refer to id from Params.SourceList, where this price fetched from, 0 is reserved for custom usage SourceId int32 `protobuf:"varint,1,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` - // if source is deteministic like chainlink with roundID, set this value with which returned from source + //if source is deteministic like chainlink with roundID, set this value with which returned from source DetId string `protobuf:"bytes,2,opt,name=det_id,json=detId,proto3" json:"det_id,omitempty"` - // up to 3 values in case of the async of network, to give more time for oracle nodes(validators) get into consensus - // eg.with deterministic source, this array will contian 3 continuous values up to latest - // for non-deterministic source, it's a choice by v2 rules. + //up to 3 values in case of the async of network, to give more time for oracle nodes(validators) get into consensus + //eg.with deterministic source, this array will contian 3 continuous values up to latest + //for non-deterministic source, it's a choice by v2 rules. Prices []*PriceWithTime `protobuf:"bytes,3,rep,name=prices,proto3" json:"prices,omitempty"` - // used for 0-sourceID-customDefinedSource + //used for 0-sourceID-customDefinedSource Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` } diff --git a/x/oracle/types/token_feeder.pb.go b/x/oracle/types/token_feeder.pb.go new file mode 100644 index 000000000..1d9152292 --- /dev/null +++ b/x/oracle/types/token_feeder.pb.go @@ -0,0 +1,1057 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/token_feeder.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// n out of m required source +type NOMSource struct { + //required source set, refer to params.sourceList, 1st set to 0 means all valid sources + SourceIds []int32 `protobuf:"varint,1,rep,packed,name=source_ids,json=sourceIds,proto3" json:"source_ids,omitempty"` + //minimum number from the required sources to be fullfiled + Minimum int32 `protobuf:"varint,2,opt,name=minimum,proto3" json:"minimum,omitempty"` +} + +func (m *NOMSource) Reset() { *m = NOMSource{} } +func (m *NOMSource) String() string { return proto.CompactTextString(m) } +func (*NOMSource) ProtoMessage() {} +func (*NOMSource) Descriptor() ([]byte, []int) { + return fileDescriptor_1cc86055064704d5, []int{0} +} +func (m *NOMSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NOMSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NOMSource.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NOMSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_NOMSource.Merge(m, src) +} +func (m *NOMSource) XXX_Size() int { + return m.Size() +} +func (m *NOMSource) XXX_DiscardUnknown() { + xxx_messageInfo_NOMSource.DiscardUnknown(m) +} + +var xxx_messageInfo_NOMSource proto.InternalMessageInfo + +func (m *NOMSource) GetSourceIds() []int32 { + if m != nil { + return m.SourceIds + } + return nil +} + +func (m *NOMSource) GetMinimum() int32 { + if m != nil { + return m.Minimum + } + return 0 +} + +// specify data from which source is needed +// rule_1: specified sources +// rule_2: n out of total sources are required +type RuleWithSource struct { + //refer to params.sourceList.ID, when length>0, ignore the other field, when 1st set to 0, means all valid sources, length==0->check next field:minimum + SourceIds []int32 `protobuf:"varint,1,rep,packed,name=source_ids,json=sourceIds,proto3" json:"source_ids,omitempty"` + //n out of total sources are required + Nom *NOMSource `protobuf:"bytes,2,opt,name=nom,proto3" json:"nom,omitempty"` +} + +func (m *RuleWithSource) Reset() { *m = RuleWithSource{} } +func (m *RuleWithSource) String() string { return proto.CompactTextString(m) } +func (*RuleWithSource) ProtoMessage() {} +func (*RuleWithSource) Descriptor() ([]byte, []int) { + return fileDescriptor_1cc86055064704d5, []int{1} +} +func (m *RuleWithSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RuleWithSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RuleWithSource.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RuleWithSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_RuleWithSource.Merge(m, src) +} +func (m *RuleWithSource) XXX_Size() int { + return m.Size() +} +func (m *RuleWithSource) XXX_DiscardUnknown() { + xxx_messageInfo_RuleWithSource.DiscardUnknown(m) +} + +var xxx_messageInfo_RuleWithSource proto.InternalMessageInfo + +func (m *RuleWithSource) GetSourceIds() []int32 { + if m != nil { + return m.SourceIds + } + return nil +} + +func (m *RuleWithSource) GetNom() *NOMSource { + if m != nil { + return m.Nom + } + return nil +} + +// Tokenfeeder represents a price oracle for one token +type TokenFeeder struct { + //refer to params.tokenList, from 1 + TokenId int32 `protobuf:"varint,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` + //refer to params.ruleList, 0 means no restriction, accept any source including customer defined + RuleId int32 `protobuf:"varint,2,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"` + //include, from 1, when some token's feeder had been stop and then restart, the token_id will be continuous from previous one + StartRoundId int64 `protobuf:"varint,3,opt,name=start_round_id,json=startRoundId,proto3" json:"start_round_id,omitempty"` + //include, first block which start_round_id can be settled is at least start_base_block+1 + StartBaseBlock int64 `protobuf:"varint,4,opt,name=start_base_block,json=startBaseBlock,proto3" json:"start_base_block,omitempty"` + //set as count of blocks, for how many blocks interval the price will be update once + Interval int64 `protobuf:"varint,5,opt,name=interval,proto3" json:"interval,omitempty"` + //tokenfeeder is initialized with forever live, update the End parameters by voting, and will off service by the end + //this is set by updateParams, and the EndRoundID will be update by related. excluded, will not work if current height >=EndBlock + EndBlock int64 `protobuf:"varint,6,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` +} + +func (m *TokenFeeder) Reset() { *m = TokenFeeder{} } +func (m *TokenFeeder) String() string { return proto.CompactTextString(m) } +func (*TokenFeeder) ProtoMessage() {} +func (*TokenFeeder) Descriptor() ([]byte, []int) { + return fileDescriptor_1cc86055064704d5, []int{2} +} +func (m *TokenFeeder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TokenFeeder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TokenFeeder.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TokenFeeder) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenFeeder.Merge(m, src) +} +func (m *TokenFeeder) XXX_Size() int { + return m.Size() +} +func (m *TokenFeeder) XXX_DiscardUnknown() { + xxx_messageInfo_TokenFeeder.DiscardUnknown(m) +} + +var xxx_messageInfo_TokenFeeder proto.InternalMessageInfo + +func (m *TokenFeeder) GetTokenId() int32 { + if m != nil { + return m.TokenId + } + return 0 +} + +func (m *TokenFeeder) GetRuleId() int32 { + if m != nil { + return m.RuleId + } + return 0 +} + +func (m *TokenFeeder) GetStartRoundId() int64 { + if m != nil { + return m.StartRoundId + } + return 0 +} + +func (m *TokenFeeder) GetStartBaseBlock() int64 { + if m != nil { + return m.StartBaseBlock + } + return 0 +} + +func (m *TokenFeeder) GetInterval() int64 { + if m != nil { + return m.Interval + } + return 0 +} + +func (m *TokenFeeder) GetEndBlock() int64 { + if m != nil { + return m.EndBlock + } + return 0 +} + +func init() { + proto.RegisterType((*NOMSource)(nil), "exocore.oracle.NOMSource") + proto.RegisterType((*RuleWithSource)(nil), "exocore.oracle.RuleWithSource") + proto.RegisterType((*TokenFeeder)(nil), "exocore.oracle.TokenFeeder") +} + +func init() { proto.RegisterFile("exocore/oracle/token_feeder.proto", fileDescriptor_1cc86055064704d5) } + +var fileDescriptor_1cc86055064704d5 = []byte{ + // 371 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xdd, 0x6a, 0xdb, 0x30, + 0x14, 0x8e, 0xe6, 0xe5, 0x4f, 0x19, 0x61, 0x88, 0xc1, 0x9c, 0x8c, 0x99, 0x2c, 0xec, 0xc2, 0x30, + 0xb0, 0xc7, 0xf6, 0x06, 0x61, 0x1b, 0x78, 0xb0, 0x0c, 0xbc, 0x41, 0xa1, 0x14, 0x8c, 0x6d, 0x9d, + 0x24, 0x22, 0xb6, 0x14, 0x64, 0xb9, 0x4d, 0xdf, 0xa2, 0x8f, 0x55, 0x7a, 0x95, 0xcb, 0x5e, 0x96, + 0xe4, 0x45, 0x8a, 0x24, 0x27, 0xd0, 0x5e, 0xf5, 0xee, 0x7c, 0x3f, 0xe7, 0xe8, 0xfc, 0x08, 0x7f, + 0x82, 0xad, 0xc8, 0x85, 0x84, 0x50, 0xc8, 0x34, 0x2f, 0x20, 0x54, 0x62, 0x0d, 0x3c, 0x59, 0x00, + 0x50, 0x90, 0xc1, 0x46, 0x0a, 0x25, 0xc8, 0xb0, 0xb1, 0x04, 0xd6, 0x32, 0x7e, 0xb7, 0x14, 0x4b, + 0x61, 0xa4, 0x50, 0x47, 0xd6, 0x35, 0x1e, 0x3d, 0x2b, 0xc4, 0xf8, 0xa2, 0x91, 0xa6, 0x3f, 0x70, + 0x7f, 0xfe, 0xf7, 0xcf, 0x3f, 0x51, 0xcb, 0x1c, 0xc8, 0x47, 0x8c, 0x2b, 0x13, 0x25, 0x8c, 0x56, + 0x2e, 0x9a, 0x38, 0x7e, 0x3b, 0xee, 0x5b, 0x26, 0xa2, 0x15, 0x71, 0x71, 0xb7, 0x64, 0x9c, 0x95, + 0x75, 0xe9, 0xbe, 0x9a, 0x20, 0xbf, 0x1d, 0x1f, 0xe1, 0xf4, 0x02, 0x0f, 0xe3, 0xba, 0x80, 0x33, + 0xa6, 0x56, 0x2f, 0x2b, 0xf5, 0x05, 0x3b, 0x5c, 0xd8, 0x32, 0x83, 0x6f, 0xa3, 0xe0, 0xe9, 0x14, + 0xc1, 0xa9, 0xa3, 0x58, 0xbb, 0xa6, 0x77, 0x08, 0x0f, 0xfe, 0xeb, 0xd9, 0x7f, 0x99, 0xd1, 0xc9, + 0x08, 0xf7, 0xec, 0x2a, 0x18, 0x75, 0x91, 0x6d, 0xc4, 0xe0, 0x88, 0x92, 0xf7, 0xb8, 0x2b, 0xeb, + 0x42, 0x3f, 0xda, 0xb4, 0xd8, 0xd1, 0x30, 0xa2, 0xe4, 0x33, 0x1e, 0x56, 0x2a, 0x95, 0x2a, 0x91, + 0xa2, 0xe6, 0x54, 0xeb, 0xce, 0x04, 0xf9, 0x4e, 0xfc, 0xc6, 0xb0, 0xb1, 0x26, 0x23, 0x4a, 0x7c, + 0xfc, 0xd6, 0xba, 0xb2, 0xb4, 0x82, 0x24, 0x2b, 0x44, 0xbe, 0x76, 0x5f, 0x1b, 0x9f, 0xcd, 0x9e, + 0xa5, 0x15, 0xcc, 0x34, 0x4b, 0xc6, 0xb8, 0xc7, 0xb8, 0x02, 0x79, 0x99, 0x16, 0x6e, 0xdb, 0x38, + 0x4e, 0x98, 0x7c, 0xc0, 0x7d, 0xe0, 0xb4, 0x49, 0xef, 0x58, 0x11, 0x38, 0x35, 0x89, 0xb3, 0xdf, + 0xb7, 0x7b, 0x0f, 0xed, 0xf6, 0x1e, 0x7a, 0xd8, 0x7b, 0xe8, 0xe6, 0xe0, 0xb5, 0x76, 0x07, 0xaf, + 0x75, 0x7f, 0xf0, 0x5a, 0xe7, 0x5f, 0x97, 0x4c, 0xad, 0xea, 0x2c, 0xc8, 0x45, 0x19, 0xfe, 0xb4, + 0x0b, 0x99, 0x83, 0xba, 0x12, 0x72, 0x1d, 0x1e, 0xef, 0xb7, 0x3d, 0x7d, 0x85, 0xeb, 0x0d, 0x54, + 0x59, 0xc7, 0xdc, 0xf0, 0xfb, 0x63, 0x00, 0x00, 0x00, 0xff, 0xff, 0x05, 0xf1, 0x12, 0xb2, 0x29, + 0x02, 0x00, 0x00, +} + +func (m *NOMSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NOMSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NOMSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Minimum != 0 { + i = encodeVarintTokenFeeder(dAtA, i, uint64(m.Minimum)) + i-- + dAtA[i] = 0x10 + } + if len(m.SourceIds) > 0 { + dAtA2 := make([]byte, len(m.SourceIds)*10) + var j1 int + for _, num1 := range m.SourceIds { + num := uint64(num1) + for num >= 1<<7 { + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA2[j1] = uint8(num) + j1++ + } + i -= j1 + copy(dAtA[i:], dAtA2[:j1]) + i = encodeVarintTokenFeeder(dAtA, i, uint64(j1)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RuleWithSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RuleWithSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RuleWithSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Nom != nil { + { + size, err := m.Nom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTokenFeeder(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.SourceIds) > 0 { + dAtA5 := make([]byte, len(m.SourceIds)*10) + var j4 int + for _, num1 := range m.SourceIds { + num := uint64(num1) + for num >= 1<<7 { + dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j4++ + } + dAtA5[j4] = uint8(num) + j4++ + } + i -= j4 + copy(dAtA[i:], dAtA5[:j4]) + i = encodeVarintTokenFeeder(dAtA, i, uint64(j4)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TokenFeeder) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TokenFeeder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TokenFeeder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EndBlock != 0 { + i = encodeVarintTokenFeeder(dAtA, i, uint64(m.EndBlock)) + i-- + dAtA[i] = 0x30 + } + if m.Interval != 0 { + i = encodeVarintTokenFeeder(dAtA, i, uint64(m.Interval)) + i-- + dAtA[i] = 0x28 + } + if m.StartBaseBlock != 0 { + i = encodeVarintTokenFeeder(dAtA, i, uint64(m.StartBaseBlock)) + i-- + dAtA[i] = 0x20 + } + if m.StartRoundId != 0 { + i = encodeVarintTokenFeeder(dAtA, i, uint64(m.StartRoundId)) + i-- + dAtA[i] = 0x18 + } + if m.RuleId != 0 { + i = encodeVarintTokenFeeder(dAtA, i, uint64(m.RuleId)) + i-- + dAtA[i] = 0x10 + } + if m.TokenId != 0 { + i = encodeVarintTokenFeeder(dAtA, i, uint64(m.TokenId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintTokenFeeder(dAtA []byte, offset int, v uint64) int { + offset -= sovTokenFeeder(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *NOMSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SourceIds) > 0 { + l = 0 + for _, e := range m.SourceIds { + l += sovTokenFeeder(uint64(e)) + } + n += 1 + sovTokenFeeder(uint64(l)) + l + } + if m.Minimum != 0 { + n += 1 + sovTokenFeeder(uint64(m.Minimum)) + } + return n +} + +func (m *RuleWithSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SourceIds) > 0 { + l = 0 + for _, e := range m.SourceIds { + l += sovTokenFeeder(uint64(e)) + } + n += 1 + sovTokenFeeder(uint64(l)) + l + } + if m.Nom != nil { + l = m.Nom.Size() + n += 1 + l + sovTokenFeeder(uint64(l)) + } + return n +} + +func (m *TokenFeeder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovTokenFeeder(uint64(m.TokenId)) + } + if m.RuleId != 0 { + n += 1 + sovTokenFeeder(uint64(m.RuleId)) + } + if m.StartRoundId != 0 { + n += 1 + sovTokenFeeder(uint64(m.StartRoundId)) + } + if m.StartBaseBlock != 0 { + n += 1 + sovTokenFeeder(uint64(m.StartBaseBlock)) + } + if m.Interval != 0 { + n += 1 + sovTokenFeeder(uint64(m.Interval)) + } + if m.EndBlock != 0 { + n += 1 + sovTokenFeeder(uint64(m.EndBlock)) + } + return n +} + +func sovTokenFeeder(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTokenFeeder(x uint64) (n int) { + return sovTokenFeeder(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *NOMSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NOMSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NOMSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SourceIds = append(m.SourceIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthTokenFeeder + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthTokenFeeder + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.SourceIds) == 0 { + m.SourceIds = make([]int32, 0, elementCount) + } + for iNdEx < postIndex { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SourceIds = append(m.SourceIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field SourceIds", wireType) + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Minimum", wireType) + } + m.Minimum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Minimum |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTokenFeeder(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTokenFeeder + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RuleWithSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RuleWithSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RuleWithSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SourceIds = append(m.SourceIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthTokenFeeder + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthTokenFeeder + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.SourceIds) == 0 { + m.SourceIds = make([]int32, 0, elementCount) + } + for iNdEx < postIndex { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SourceIds = append(m.SourceIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field SourceIds", wireType) + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTokenFeeder + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTokenFeeder + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nom == nil { + m.Nom = &NOMSource{} + } + if err := m.Nom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTokenFeeder(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTokenFeeder + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TokenFeeder) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TokenFeeder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TokenFeeder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + } + m.TokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TokenId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RuleId", wireType) + } + m.RuleId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RuleId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartRoundId", wireType) + } + m.StartRoundId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartRoundId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartBaseBlock", wireType) + } + m.StartBaseBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartBaseBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + } + m.Interval = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Interval |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) + } + m.EndBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EndBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTokenFeeder(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTokenFeeder + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTokenFeeder(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTokenFeeder + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTokenFeeder + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTokenFeeder + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTokenFeeder = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTokenFeeder = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTokenFeeder = fmt.Errorf("proto: unexpected end of group") +) From 30f2d251fbeb2bd8a8710bb0a13c29bb67f43228 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Sat, 24 Feb 2024 14:08:21 +0800 Subject: [PATCH 06/37] feat(oracle-proto): add price storage for oracle price store --- proto/exocore/oracle/genesis.proto | 7 +- proto/exocore/oracle/prices.proto | 12 + proto/exocore/oracle/query.proto | 38 +- x/oracle/client/cli/query.go | 2 + x/oracle/client/cli/query_prices.go | 82 +++ x/oracle/client/cli/query_prices_test.go | 160 +++++ x/oracle/genesis.go | 5 + x/oracle/genesis_test.go | 9 + x/oracle/keeper/prices.go | 63 ++ x/oracle/keeper/prices_test.go | 63 ++ x/oracle/keeper/query_prices.go | 57 ++ x/oracle/keeper/query_prices_test.go | 127 ++++ x/oracle/types/genesis.go | 13 +- x/oracle/types/genesis.pb.go | 86 ++- x/oracle/types/genesis_test.go | 24 +- x/oracle/types/key_prices.go | 24 + x/oracle/types/prices.pb.go | 466 ++++++++++++ x/oracle/types/query.pb.go | 876 ++++++++++++++++++++++- x/oracle/types/query.pb.gw.go | 184 +++++ x/oracle/types/tx.pb.go | 4 +- 20 files changed, 2261 insertions(+), 41 deletions(-) create mode 100644 proto/exocore/oracle/prices.proto create mode 100644 x/oracle/client/cli/query_prices.go create mode 100644 x/oracle/client/cli/query_prices_test.go create mode 100644 x/oracle/keeper/prices.go create mode 100644 x/oracle/keeper/prices_test.go create mode 100644 x/oracle/keeper/query_prices.go create mode 100644 x/oracle/keeper/query_prices_test.go create mode 100644 x/oracle/types/key_prices.go create mode 100644 x/oracle/types/prices.pb.go diff --git a/proto/exocore/oracle/genesis.proto b/proto/exocore/oracle/genesis.proto index b4428d228..f66ef07a8 100644 --- a/proto/exocore/oracle/genesis.proto +++ b/proto/exocore/oracle/genesis.proto @@ -1,12 +1,17 @@ syntax = "proto3"; + package exocore.oracle; import "gogoproto/gogo.proto"; import "exocore/oracle/params.proto"; +import "exocore/oracle/prices.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; // GenesisState defines the oracle module's genesis state. message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; + Params params = 1 [(gogoproto.nullable) = false]; + repeated Prices pricesList = 2 [(gogoproto.nullable) = false]; + //TODO: userDefinedTokenFeeder } + diff --git a/proto/exocore/oracle/prices.proto b/proto/exocore/oracle/prices.proto new file mode 100644 index 000000000..96347b8a5 --- /dev/null +++ b/proto/exocore/oracle/prices.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package exocore.oracle; + +import "exocore/oracle/price.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message Prices { + int32 token_id = 1; + map price_with_round = 2; +} + diff --git a/proto/exocore/oracle/query.proto b/proto/exocore/oracle/query.proto index 25b87c611..0a0f1fd78 100644 --- a/proto/exocore/oracle/query.proto +++ b/proto/exocore/oracle/query.proto @@ -1,26 +1,58 @@ syntax = "proto3"; + package exocore.oracle; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "exocore/oracle/params.proto"; +import "exocore/oracle/prices.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; // Query defines the gRPC querier service. service Query { + // Parameters queries the parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + rpc Params (QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/params"; + + } + + // Queries a list of Prices items. + rpc Prices (QueryGetPricesRequest) returns (QueryGetPricesResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/prices/{tokenId}"; + + } + rpc PricesAll (QueryAllPricesRequest) returns (QueryAllPricesResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/prices"; + } } - // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { + // params holds all the parameters of this module. Params params = 1 [(gogoproto.nullable) = false]; -} \ No newline at end of file +} + +message QueryGetPricesRequest { + int32 tokenId = 1; +} + +message QueryGetPricesResponse { + Prices prices = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllPricesRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllPricesResponse { + repeated Prices prices = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go index bccb4d74b..8b27813af 100644 --- a/x/oracle/client/cli/query.go +++ b/x/oracle/client/cli/query.go @@ -25,6 +25,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command { } cmd.AddCommand(CmdQueryParams()) + cmd.AddCommand(CmdListPrices()) + cmd.AddCommand(CmdShowPrices()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/oracle/client/cli/query_prices.go b/x/oracle/client/cli/query_prices.go new file mode 100644 index 000000000..352f1947a --- /dev/null +++ b/x/oracle/client/cli/query_prices.go @@ -0,0 +1,82 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/spf13/cast" +) + +func CmdListPrices() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-prices", + Short: "list all prices", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllPricesRequest{ + Pagination: pageReq, + } + + res, err := queryClient.PricesAll(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowPrices() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-prices [token-id]", + Short: "shows a prices", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + argTokenId, err := cast.ToInt32E(args[0]) + if err != nil { + return err + } + + params := &types.QueryGetPricesRequest{ + TokenId: argTokenId, + } + + res, err := queryClient.Prices(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_prices_test.go b/x/oracle/client/cli/query_prices_test.go new file mode 100644 index 000000000..34ce7d8bc --- /dev/null +++ b/x/oracle/client/cli/query_prices_test.go @@ -0,0 +1,160 @@ +package cli_test + +import ( + "fmt" + "strconv" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func networkWithPricesObjects(t *testing.T, n int) (*network.Network, []types.Prices) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + for i := 0; i < n; i++ { + prices := types.Prices{ + TokenId: int32(i), + } + nullify.Fill(&prices) + state.PricesList = append(state.PricesList, prices) + } + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.PricesList +} + +func TestShowPrices(t *testing.T) { + net, objs := networkWithPricesObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + idTokenId int32 + + args []string + err error + obj types.Prices + }{ + { + desc: "found", + idTokenId: objs[0].TokenId, + + args: common, + obj: objs[0], + }, + { + desc: "not found", + idTokenId: 100000, + + args: common, + err: status.Error(codes.NotFound, "not found"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + args := []string{ + strconv.Itoa(int(tc.idTokenId)), + } + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowPrices(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetPricesResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.Prices) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.Prices), + ) + } + }) + } +} + +func TestListPrices(t *testing.T) { + net, objs := networkWithPricesObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(objs); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListPrices(), args) + require.NoError(t, err) + var resp types.QueryAllPricesResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.Prices), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.Prices), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListPrices(), args) + require.NoError(t, err) + var resp types.QueryAllPricesResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.Prices), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.Prices), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(objs)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListPrices(), args) + require.NoError(t, err) + var resp types.QueryAllPricesResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(objs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(objs), + nullify.Fill(resp.Prices), + ) + }) +} diff --git a/x/oracle/genesis.go b/x/oracle/genesis.go index 3aaf44b38..4da2af620 100644 --- a/x/oracle/genesis.go +++ b/x/oracle/genesis.go @@ -8,6 +8,10 @@ import ( // InitGenesis initializes the module's state from a provided genesis state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + // Set all the prices + for _, elem := range genState.PricesList { + k.SetPrices(ctx, elem) + } // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, genState.Params) } @@ -17,6 +21,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) + genesis.PricesList = k.GetAllPrices(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/oracle/genesis_test.go b/x/oracle/genesis_test.go index 10be00847..442d83398 100644 --- a/x/oracle/genesis_test.go +++ b/x/oracle/genesis_test.go @@ -14,6 +14,14 @@ func TestGenesis(t *testing.T) { genesisState := types.GenesisState{ Params: types.DefaultParams(), + PricesList: []types.Prices{ + { + TokenId: 0, + }, + { + TokenId: 1, + }, + }, // this line is used by starport scaffolding # genesis/test/state } @@ -25,5 +33,6 @@ func TestGenesis(t *testing.T) { nullify.Fill(&genesisState) nullify.Fill(got) + require.ElementsMatch(t, genesisState.PricesList, got.PricesList) // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/oracle/keeper/prices.go b/x/oracle/keeper/prices.go new file mode 100644 index 000000000..ed69a3ab2 --- /dev/null +++ b/x/oracle/keeper/prices.go @@ -0,0 +1,63 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetPrices set a specific prices in the store from its index +func (k Keeper) SetPrices(ctx sdk.Context, prices types.Prices) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) + b := k.cdc.MustMarshal(&prices) + store.Set(types.PricesKey( + prices.TokenId, + ), b) +} + +// GetPrices returns a prices from its index +func (k Keeper) GetPrices( + ctx sdk.Context, + tokenId int32, + +) (val types.Prices, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) + + b := store.Get(types.PricesKey( + tokenId, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemovePrices removes a prices from the store +func (k Keeper) RemovePrices( + ctx sdk.Context, + tokenId int32, + +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) + store.Delete(types.PricesKey( + tokenId, + )) +} + +// GetAllPrices returns all prices +func (k Keeper) GetAllPrices(ctx sdk.Context) (list []types.Prices) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Prices + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/oracle/keeper/prices_test.go b/x/oracle/keeper/prices_test.go new file mode 100644 index 000000000..f5ca786f3 --- /dev/null +++ b/x/oracle/keeper/prices_test.go @@ -0,0 +1,63 @@ +package keeper_test + +import ( + "strconv" + "testing" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNPrices(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.Prices { + items := make([]types.Prices, n) + for i := range items { + items[i].TokenId = int32(i) + + keeper.SetPrices(ctx, items[i]) + } + return items +} + +func TestPricesGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNPrices(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetPrices(ctx, + item.TokenId, + ) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) + } +} +func TestPricesRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNPrices(keeper, ctx, 10) + for _, item := range items { + keeper.RemovePrices(ctx, + item.TokenId, + ) + _, found := keeper.GetPrices(ctx, + item.TokenId, + ) + require.False(t, found) + } +} + +func TestPricesGetAll(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNPrices(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllPrices(ctx)), + ) +} diff --git a/x/oracle/keeper/query_prices.go b/x/oracle/keeper/query_prices.go new file mode 100644 index 000000000..a51effb04 --- /dev/null +++ b/x/oracle/keeper/query_prices.go @@ -0,0 +1,57 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) PricesAll(goCtx context.Context, req *types.QueryAllPricesRequest) (*types.QueryAllPricesResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var pricess []types.Prices + ctx := sdk.UnwrapSDKContext(goCtx) + + store := ctx.KVStore(k.storeKey) + pricesStore := prefix.NewStore(store, types.KeyPrefix(types.PricesKeyPrefix)) + + pageRes, err := query.Paginate(pricesStore, req.Pagination, func(key []byte, value []byte) error { + var prices types.Prices + if err := k.cdc.Unmarshal(value, &prices); err != nil { + return err + } + + pricess = append(pricess, prices) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllPricesResponse{Prices: pricess, Pagination: pageRes}, nil +} + +func (k Keeper) Prices(goCtx context.Context, req *types.QueryGetPricesRequest) (*types.QueryGetPricesResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetPrices( + ctx, + req.TokenId, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetPricesResponse{Prices: val}, nil +} diff --git a/x/oracle/keeper/query_prices_test.go b/x/oracle/keeper/query_prices_test.go new file mode 100644 index 000000000..cf4ba6eca --- /dev/null +++ b/x/oracle/keeper/query_prices_test.go @@ -0,0 +1,127 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestPricesQuerySingle(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNPrices(keeper, ctx, 2) + tests := []struct { + desc string + request *types.QueryGetPricesRequest + response *types.QueryGetPricesResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetPricesRequest{ + TokenId: msgs[0].TokenId, + }, + response: &types.QueryGetPricesResponse{Prices: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetPricesRequest{ + TokenId: msgs[1].TokenId, + }, + response: &types.QueryGetPricesResponse{Prices: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetPricesRequest{ + TokenId: 100000, + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.Prices(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} + +func TestPricesQueryPaginated(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNPrices(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllPricesRequest { + return &types.QueryAllPricesRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := keeper.PricesAll(wctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.Prices), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.Prices), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.PricesAll(wctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.Prices), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.Prices), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.PricesAll(wctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(msgs), + nullify.Fill(resp.Prices), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.PricesAll(wctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/oracle/types/genesis.go b/x/oracle/types/genesis.go index 0af9b4416..325628b43 100644 --- a/x/oracle/types/genesis.go +++ b/x/oracle/types/genesis.go @@ -1,7 +1,7 @@ package types import ( -// this line is used by starport scaffolding # genesis/types/import + "fmt" ) // DefaultIndex is the default global index @@ -10,6 +10,7 @@ const DefaultIndex uint64 = 1 // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ + PricesList: []Prices{}, // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } @@ -18,6 +19,16 @@ func DefaultGenesis() *GenesisState { // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { + // Check for duplicated index in prices + pricesIndexMap := make(map[string]struct{}) + + for _, elem := range gs.PricesList { + index := string(PricesKey(elem.TokenId)) + if _, ok := pricesIndexMap[index]; ok { + return fmt.Errorf("duplicated index for prices") + } + pricesIndexMap[index] = struct{}{} + } // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go index 90995bd32..d98939b2d 100644 --- a/x/oracle/types/genesis.pb.go +++ b/x/oracle/types/genesis.pb.go @@ -25,7 +25,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the oracle module's genesis state. type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + PricesList []Prices `protobuf:"bytes,2,rep,name=pricesList,proto3" json:"pricesList"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -68,6 +69,13 @@ func (m *GenesisState) GetParams() Params { return Params{} } +func (m *GenesisState) GetPricesList() []Prices { + if m != nil { + return m.PricesList + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "exocore.oracle.GenesisState") } @@ -75,20 +83,22 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/genesis.proto", fileDescriptor_dbe067676c4dc0de) } var fileDescriptor_dbe067676c4dc0de = []byte{ - // 195 bytes of a gzipped FileDescriptorProto + // 225 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xad, 0xc8, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xca, 0xea, 0x41, 0x64, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x94, 0x34, 0x9a, 0x19, - 0x05, 0x89, 0x45, 0x89, 0xb9, 0x50, 0x23, 0x94, 0x5c, 0xb8, 0x78, 0xdc, 0x21, 0x66, 0x06, 0x97, - 0x24, 0x96, 0xa4, 0x0a, 0x99, 0x70, 0xb1, 0x41, 0xe4, 0x25, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, - 0xc4, 0xf4, 0x50, 0xed, 0xd0, 0x0b, 0x00, 0xcb, 0x3a, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x10, 0x04, - 0x55, 0xeb, 0xe4, 0x75, 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, 0x06, 0xe9, - 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xae, 0x10, 0x93, 0xfc, 0x52, 0x4b, - 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0x61, 0xce, 0xaa, 0x80, 0x39, 0xac, 0xa4, 0xb2, 0x20, 0xb5, 0x38, - 0x89, 0x0d, 0xec, 0x30, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x17, 0x3c, 0xd2, 0xcf, 0xfb, - 0x00, 0x00, 0x00, + 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0xb8, 0x24, 0x8b, 0x32, 0x93, 0x53, 0xa1, 0x92, 0x4a, 0x4d, + 0x8c, 0x5c, 0x3c, 0xee, 0x10, 0x1b, 0x83, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0x4c, 0xb8, 0xd8, 0x20, + 0xba, 0x25, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0xc4, 0xf4, 0x50, 0x5d, 0xa0, 0x17, 0x00, 0x96, + 0x75, 0x62, 0x39, 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xaa, 0x56, 0xc8, 0x86, 0x8b, 0x0b, 0x62, 0xac, + 0x4f, 0x66, 0x71, 0x89, 0x04, 0x93, 0x02, 0x33, 0x56, 0x9d, 0x60, 0x15, 0x50, 0x9d, 0x48, 0xea, + 0x9d, 0xbc, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, + 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x20, 0x3d, 0xb3, + 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0xdf, 0x15, 0x62, 0x9a, 0x5f, 0x6a, 0x49, 0x79, + 0x7e, 0x51, 0xb6, 0x3e, 0xcc, 0x57, 0x15, 0x30, 0x7f, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, + 0x81, 0xfd, 0x65, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x65, 0xb2, 0x58, 0x9a, 0x57, 0x01, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -111,6 +121,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.PricesList) > 0 { + for iNdEx := len(m.PricesList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PricesList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } { size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -143,6 +167,12 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) + if len(m.PricesList) > 0 { + for _, e := range m.PricesList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -214,6 +244,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PricesList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PricesList = append(m.PricesList, Prices{}) + if err := m.PricesList[len(m.PricesList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/oracle/types/genesis_test.go b/x/oracle/types/genesis_test.go index f74f88a64..0fe5bfe87 100644 --- a/x/oracle/types/genesis_test.go +++ b/x/oracle/types/genesis_test.go @@ -19,13 +19,35 @@ func TestGenesisState_Validate(t *testing.T) { valid: true, }, { - desc: "valid genesis state", + desc: "valid genesis state", genState: &types.GenesisState{ + PricesList: []types.Prices{ + { + TokenId: 0, + }, + { + TokenId: 1, + }, + }, // this line is used by starport scaffolding # types/genesis/validField }, valid: true, }, + { + desc: "duplicated prices", + genState: &types.GenesisState{ + PricesList: []types.Prices{ + { + TokenId: 0, + }, + { + TokenId: 0, + }, + }, + }, + valid: false, + }, // this line is used by starport scaffolding # types/genesis/testcase } for _, tc := range tests { diff --git a/x/oracle/types/key_prices.go b/x/oracle/types/key_prices.go new file mode 100644 index 000000000..33e03b493 --- /dev/null +++ b/x/oracle/types/key_prices.go @@ -0,0 +1,24 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // PricesKeyPrefix is the prefix to retrieve all Prices + PricesKeyPrefix = "Prices/value/" +) + +// PricesKey returns the store key to retrieve a Prices from the index fields +func PricesKey( + tokenId int32, +) []byte { + var key []byte + + tokenIdBytes := make([]byte, 4) + binary.BigEndian.PutUint32(tokenIdBytes, uint32(tokenId)) + key = append(key, tokenIdBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/oracle/types/prices.pb.go b/x/oracle/types/prices.pb.go new file mode 100644 index 000000000..bf1067a30 --- /dev/null +++ b/x/oracle/types/prices.pb.go @@ -0,0 +1,466 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/prices.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Prices struct { + TokenId int32 `protobuf:"varint,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` + PriceWithRound map[int64]*PriceWithTime `protobuf:"bytes,2,rep,name=price_with_round,json=priceWithRound,proto3" json:"price_with_round,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *Prices) Reset() { *m = Prices{} } +func (m *Prices) String() string { return proto.CompactTextString(m) } +func (*Prices) ProtoMessage() {} +func (*Prices) Descriptor() ([]byte, []int) { + return fileDescriptor_50cc9ccc8f92b87a, []int{0} +} +func (m *Prices) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Prices) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Prices.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Prices) XXX_Merge(src proto.Message) { + xxx_messageInfo_Prices.Merge(m, src) +} +func (m *Prices) XXX_Size() int { + return m.Size() +} +func (m *Prices) XXX_DiscardUnknown() { + xxx_messageInfo_Prices.DiscardUnknown(m) +} + +var xxx_messageInfo_Prices proto.InternalMessageInfo + +func (m *Prices) GetTokenId() int32 { + if m != nil { + return m.TokenId + } + return 0 +} + +func (m *Prices) GetPriceWithRound() map[int64]*PriceWithTime { + if m != nil { + return m.PriceWithRound + } + return nil +} + +func init() { + proto.RegisterType((*Prices)(nil), "exocore.oracle.Prices") + proto.RegisterMapType((map[int64]*PriceWithTime)(nil), "exocore.oracle.Prices.PriceWithRoundEntry") +} + +func init() { proto.RegisterFile("exocore/oracle/prices.proto", fileDescriptor_50cc9ccc8f92b87a) } + +var fileDescriptor_50cc9ccc8f92b87a = []byte{ + // 267 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x4c, 0x4e, + 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xea, 0x41, 0x24, 0xa5, 0xa4, + 0xb0, 0x29, 0x86, 0xa8, 0x55, 0xba, 0xcd, 0xc8, 0xc5, 0x16, 0x00, 0xd6, 0x2c, 0x24, 0xc9, 0xc5, + 0x51, 0x92, 0x9f, 0x9d, 0x9a, 0x17, 0x9f, 0x99, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x1a, 0xc4, + 0x0e, 0xe6, 0x7b, 0xa6, 0x08, 0x85, 0x70, 0x09, 0x80, 0x35, 0xc5, 0x97, 0x67, 0x96, 0x64, 0xc4, + 0x17, 0xe5, 0x97, 0xe6, 0xa5, 0x48, 0x30, 0x29, 0x30, 0x6b, 0x70, 0x1b, 0x69, 0xe9, 0xa1, 0x5a, + 0xa6, 0x07, 0x31, 0x0c, 0x42, 0x85, 0x67, 0x96, 0x64, 0x04, 0x81, 0x14, 0xbb, 0xe6, 0x95, 0x14, + 0x55, 0x06, 0xf1, 0x15, 0xa0, 0x08, 0x4a, 0x25, 0x70, 0x09, 0x63, 0x51, 0x26, 0x24, 0xc0, 0xc5, + 0x9c, 0x9d, 0x5a, 0x09, 0x76, 0x02, 0x73, 0x10, 0x88, 0x29, 0x64, 0xcc, 0xc5, 0x5a, 0x96, 0x98, + 0x53, 0x9a, 0x2a, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0x8b, 0xd5, 0x4e, 0x90, 0x29, 0x21, + 0x99, 0xb9, 0xa9, 0x41, 0x10, 0xb5, 0x56, 0x4c, 0x16, 0x8c, 0x4e, 0x5e, 0x27, 0x1e, 0xc9, 0x31, + 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, + 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x90, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, + 0x9f, 0xab, 0xef, 0x0a, 0x31, 0xcd, 0x2f, 0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x5b, 0x1f, 0x16, 0x5a, + 0x15, 0xb0, 0xf0, 0x2a, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x07, 0x98, 0x31, 0x20, 0x00, + 0x00, 0xff, 0xff, 0xfe, 0x6e, 0xea, 0x7d, 0x7b, 0x01, 0x00, 0x00, +} + +func (m *Prices) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Prices) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Prices) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PriceWithRound) > 0 { + for k := range m.PriceWithRound { + v := m.PriceWithRound[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPrices(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i = encodeVarintPrices(dAtA, i, uint64(k)) + i-- + dAtA[i] = 0x8 + i = encodeVarintPrices(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.TokenId != 0 { + i = encodeVarintPrices(dAtA, i, uint64(m.TokenId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintPrices(dAtA []byte, offset int, v uint64) int { + offset -= sovPrices(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Prices) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovPrices(uint64(m.TokenId)) + } + if len(m.PriceWithRound) > 0 { + for k, v := range m.PriceWithRound { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovPrices(uint64(l)) + } + mapEntrySize := 1 + sovPrices(uint64(k)) + l + n += mapEntrySize + 1 + sovPrices(uint64(mapEntrySize)) + } + } + return n +} + +func sovPrices(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPrices(x uint64) (n int) { + return sovPrices(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Prices) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Prices: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Prices: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + } + m.TokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TokenId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriceWithRound", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPrices + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPrices + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PriceWithRound == nil { + m.PriceWithRound = make(map[int64]*PriceWithTime) + } + var mapkey int64 + var mapvalue *PriceWithTime + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapkey |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthPrices + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthPrices + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &PriceWithTime{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipPrices(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPrices + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.PriceWithRound[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPrices(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPrices + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPrices(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPrices + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPrices + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPrices + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthPrices + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPrices + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPrices + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPrices = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPrices = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPrices = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index 9ea3909b6..3b3f9c090 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -6,7 +6,7 @@ package types import ( context "context" fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/query" + query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -113,34 +113,234 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } +type QueryGetPricesRequest struct { + TokenId int32 `protobuf:"varint,1,opt,name=tokenId,proto3" json:"tokenId,omitempty"` +} + +func (m *QueryGetPricesRequest) Reset() { *m = QueryGetPricesRequest{} } +func (m *QueryGetPricesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetPricesRequest) ProtoMessage() {} +func (*QueryGetPricesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{2} +} +func (m *QueryGetPricesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetPricesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetPricesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetPricesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetPricesRequest.Merge(m, src) +} +func (m *QueryGetPricesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetPricesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetPricesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetPricesRequest proto.InternalMessageInfo + +func (m *QueryGetPricesRequest) GetTokenId() int32 { + if m != nil { + return m.TokenId + } + return 0 +} + +type QueryGetPricesResponse struct { + Prices Prices `protobuf:"bytes,1,opt,name=prices,proto3" json:"prices"` +} + +func (m *QueryGetPricesResponse) Reset() { *m = QueryGetPricesResponse{} } +func (m *QueryGetPricesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetPricesResponse) ProtoMessage() {} +func (*QueryGetPricesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{3} +} +func (m *QueryGetPricesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetPricesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetPricesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetPricesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetPricesResponse.Merge(m, src) +} +func (m *QueryGetPricesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetPricesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetPricesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetPricesResponse proto.InternalMessageInfo + +func (m *QueryGetPricesResponse) GetPrices() Prices { + if m != nil { + return m.Prices + } + return Prices{} +} + +type QueryAllPricesRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllPricesRequest) Reset() { *m = QueryAllPricesRequest{} } +func (m *QueryAllPricesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllPricesRequest) ProtoMessage() {} +func (*QueryAllPricesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{4} +} +func (m *QueryAllPricesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllPricesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllPricesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllPricesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllPricesRequest.Merge(m, src) +} +func (m *QueryAllPricesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllPricesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllPricesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllPricesRequest proto.InternalMessageInfo + +func (m *QueryAllPricesRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllPricesResponse struct { + Prices []Prices `protobuf:"bytes,1,rep,name=prices,proto3" json:"prices"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllPricesResponse) Reset() { *m = QueryAllPricesResponse{} } +func (m *QueryAllPricesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllPricesResponse) ProtoMessage() {} +func (*QueryAllPricesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{5} +} +func (m *QueryAllPricesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllPricesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllPricesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllPricesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllPricesResponse.Merge(m, src) +} +func (m *QueryAllPricesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllPricesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllPricesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllPricesResponse proto.InternalMessageInfo + +func (m *QueryAllPricesResponse) GetPrices() []Prices { + if m != nil { + return m.Prices + } + return nil +} + +func (m *QueryAllPricesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "exocore.oracle.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "exocore.oracle.QueryParamsResponse") + proto.RegisterType((*QueryGetPricesRequest)(nil), "exocore.oracle.QueryGetPricesRequest") + proto.RegisterType((*QueryGetPricesResponse)(nil), "exocore.oracle.QueryGetPricesResponse") + proto.RegisterType((*QueryAllPricesRequest)(nil), "exocore.oracle.QueryAllPricesRequest") + proto.RegisterType((*QueryAllPricesResponse)(nil), "exocore.oracle.QueryAllPricesResponse") } func init() { proto.RegisterFile("exocore/oracle/query.proto", fileDescriptor_f604621c8da1a6f3) } var fileDescriptor_f604621c8da1a6f3 = []byte{ - // 303 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0x3f, 0x4b, 0x03, 0x31, - 0x18, 0xc6, 0x2f, 0xa2, 0x1d, 0x22, 0x38, 0xc4, 0x22, 0x72, 0x4a, 0x94, 0x13, 0x51, 0x04, 0x2f, - 0xb6, 0xfa, 0x09, 0x0a, 0x2e, 0x0a, 0xa2, 0x1d, 0xdd, 0x72, 0x47, 0x88, 0x87, 0xed, 0xbd, 0x69, - 0x92, 0xd3, 0x76, 0x13, 0x47, 0x27, 0xc1, 0x2f, 0xd5, 0xb1, 0xe0, 0xe2, 0x24, 0x72, 0xe7, 0x07, - 0x91, 0x5e, 0xe2, 0xd0, 0xfa, 0x67, 0x0b, 0xef, 0xf3, 0x7b, 0x7f, 0x3c, 0x6f, 0x70, 0x28, 0x86, - 0x90, 0x82, 0x16, 0x0c, 0x34, 0x4f, 0x7b, 0x82, 0x0d, 0x0a, 0xa1, 0x47, 0xb1, 0xd2, 0x60, 0x81, - 0xac, 0xf8, 0x2c, 0x76, 0x59, 0xd8, 0x94, 0x20, 0xa1, 0x8e, 0xd8, 0xf4, 0xe5, 0xa8, 0x70, 0x53, - 0x02, 0xc8, 0x9e, 0x60, 0x5c, 0x65, 0x8c, 0xe7, 0x39, 0x58, 0x6e, 0x33, 0xc8, 0x8d, 0x4f, 0x0f, - 0x52, 0x30, 0x7d, 0x30, 0x2c, 0xe1, 0xc6, 0xcb, 0xd9, 0x5d, 0x2b, 0x11, 0x96, 0xb7, 0x98, 0xe2, - 0x32, 0xcb, 0x6b, 0xd8, 0xb3, 0x1b, 0x73, 0x5d, 0x14, 0xd7, 0xbc, 0xef, 0x45, 0x51, 0x13, 0x93, - 0xab, 0xe9, 0xfa, 0x65, 0x3d, 0xec, 0x8a, 0x41, 0x21, 0x8c, 0x8d, 0xce, 0xf1, 0xea, 0xcc, 0xd4, - 0x28, 0xc8, 0x8d, 0x20, 0x27, 0xb8, 0xe1, 0x96, 0xd7, 0xd1, 0x36, 0xda, 0x5f, 0x6e, 0xaf, 0xc5, - 0xb3, 0xa7, 0xc4, 0x8e, 0xef, 0x2c, 0x8e, 0xdf, 0xb7, 0x82, 0xae, 0x67, 0xdb, 0x4f, 0x08, 0x2f, - 0xd5, 0x36, 0xf2, 0x80, 0x70, 0xc3, 0x21, 0x24, 0x9a, 0x5f, 0xfd, 0xd9, 0x22, 0xdc, 0xf9, 0x97, - 0x71, 0x9d, 0xa2, 0xc3, 0xc7, 0xd7, 0xcf, 0x97, 0x85, 0x3d, 0xb2, 0xcb, 0x4e, 0x1d, 0x7c, 0x21, - 0xec, 0x3d, 0xe8, 0x5b, 0xf6, 0xeb, 0xd5, 0x9d, 0xb3, 0x71, 0x49, 0xd1, 0xa4, 0xa4, 0xe8, 0xa3, - 0xa4, 0xe8, 0xb9, 0xa2, 0xc1, 0xa4, 0xa2, 0xc1, 0x5b, 0x45, 0x83, 0xeb, 0x23, 0x99, 0xd9, 0x9b, - 0x22, 0x89, 0x53, 0xe8, 0xff, 0xa5, 0x1a, 0x7e, 0xcb, 0xec, 0x48, 0x09, 0x93, 0x34, 0xea, 0x2f, - 0x3c, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x46, 0xaf, 0x46, 0x65, 0xed, 0x01, 0x00, 0x00, + // 481 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x41, 0x6b, 0xd4, 0x40, + 0x14, 0xc7, 0x33, 0xad, 0x5d, 0x71, 0x04, 0x0f, 0x63, 0x2d, 0x25, 0x4a, 0x94, 0x91, 0xb6, 0x22, + 0x38, 0x63, 0xaa, 0xe0, 0xb9, 0x82, 0x16, 0x15, 0xca, 0x9a, 0xa3, 0x17, 0x99, 0xc4, 0x21, 0x86, + 0x66, 0xf3, 0xd2, 0xcc, 0xac, 0xb6, 0x88, 0x20, 0xde, 0xbc, 0x15, 0x3c, 0xf8, 0x19, 0xfc, 0x26, + 0x3d, 0x16, 0xbc, 0x78, 0x12, 0xd9, 0xf5, 0x83, 0x48, 0x66, 0xa6, 0x9a, 0xa4, 0x9b, 0x6e, 0x6f, + 0x9b, 0xf9, 0xff, 0xdf, 0xff, 0xfd, 0xe6, 0xcd, 0x5b, 0xec, 0xcb, 0x7d, 0x48, 0xa0, 0x92, 0x1c, + 0x2a, 0x91, 0xe4, 0x92, 0xef, 0x8d, 0x65, 0x75, 0xc0, 0xca, 0x0a, 0x34, 0x90, 0x2b, 0x4e, 0x63, + 0x56, 0xf3, 0x97, 0x53, 0x48, 0xc1, 0x48, 0xbc, 0xfe, 0x65, 0x5d, 0xfe, 0x8d, 0x14, 0x20, 0xcd, + 0x25, 0x17, 0x65, 0xc6, 0x45, 0x51, 0x80, 0x16, 0x3a, 0x83, 0x42, 0x39, 0xf5, 0x6e, 0x02, 0x6a, + 0x04, 0x8a, 0xc7, 0x42, 0xb9, 0x70, 0xfe, 0x2e, 0x8c, 0xa5, 0x16, 0x21, 0x2f, 0x45, 0x9a, 0x15, + 0xc6, 0xec, 0xbc, 0xd7, 0x3b, 0x2c, 0xa5, 0xa8, 0xc4, 0x48, 0xf5, 0x89, 0x55, 0x96, 0x48, 0x27, + 0xd2, 0x65, 0x4c, 0x5e, 0xd6, 0xd9, 0x43, 0x53, 0x11, 0xc9, 0xbd, 0xb1, 0x54, 0x9a, 0xbe, 0xc0, + 0x57, 0x5b, 0xa7, 0xaa, 0x84, 0x42, 0x49, 0xf2, 0x10, 0x0f, 0x6c, 0xf2, 0x2a, 0xba, 0x85, 0xee, + 0x5c, 0xde, 0x5c, 0x61, 0xed, 0x7b, 0x32, 0xeb, 0x7f, 0x7c, 0xe1, 0xe8, 0xd7, 0x4d, 0x2f, 0x72, + 0x5e, 0x1a, 0xe2, 0x6b, 0x26, 0x6c, 0x5b, 0xea, 0xa1, 0x69, 0xed, 0xba, 0x90, 0x55, 0x7c, 0x51, + 0xc3, 0xae, 0x2c, 0x9e, 0xbd, 0x31, 0x79, 0x4b, 0xd1, 0xc9, 0x27, 0xdd, 0xc1, 0x2b, 0xdd, 0x92, + 0x06, 0x82, 0x39, 0xe9, 0x45, 0x30, 0xea, 0x3f, 0x04, 0xf3, 0x45, 0x5f, 0x3b, 0x84, 0xad, 0x3c, + 0x6f, 0x23, 0x3c, 0xc5, 0xf8, 0xff, 0x30, 0x5d, 0xe4, 0x3a, 0xb3, 0x93, 0x67, 0xf5, 0xe4, 0x99, + 0x7d, 0x56, 0x37, 0x79, 0x36, 0x14, 0xa9, 0x74, 0xb5, 0x51, 0xa3, 0x92, 0x7e, 0x43, 0x8e, 0xb8, + 0xd1, 0x61, 0x06, 0xf1, 0xe2, 0x79, 0x89, 0xc9, 0x76, 0x0b, 0x6c, 0xc1, 0x80, 0x6d, 0xcc, 0x05, + 0xb3, 0x2d, 0x9b, 0x64, 0x9b, 0xdf, 0x17, 0xf1, 0x92, 0x21, 0x23, 0x9f, 0x10, 0x1e, 0xd8, 0x07, + 0x22, 0xb4, 0xcb, 0x70, 0x7a, 0x07, 0xfc, 0xdb, 0x67, 0x7a, 0x6c, 0x27, 0x7a, 0xef, 0xf3, 0x8f, + 0x3f, 0x5f, 0x17, 0x36, 0xc8, 0x1a, 0x7f, 0x62, 0xcd, 0x3b, 0x52, 0xbf, 0x87, 0x6a, 0x97, 0xcf, + 0x5c, 0x48, 0x72, 0x58, 0x23, 0xd8, 0x0b, 0xae, 0xcd, 0x8c, 0xef, 0xee, 0x88, 0xbf, 0x3e, 0xcf, + 0xe6, 0x40, 0x1e, 0x19, 0x90, 0x90, 0xf0, 0x79, 0x20, 0xa6, 0x8c, 0x7f, 0x70, 0x9b, 0xf6, 0x91, + 0x7c, 0x41, 0xf8, 0x92, 0xcd, 0xda, 0xca, 0xf3, 0x1e, 0xaa, 0xee, 0xda, 0xf4, 0x50, 0x9d, 0x7a, + 0xfb, 0xf3, 0x8f, 0xc7, 0xae, 0xc0, 0xf3, 0xa3, 0x49, 0x80, 0x8e, 0x27, 0x01, 0xfa, 0x3d, 0x09, + 0xd0, 0xe1, 0x34, 0xf0, 0x8e, 0xa7, 0x81, 0xf7, 0x73, 0x1a, 0x78, 0xaf, 0xee, 0xa7, 0x99, 0x7e, + 0x3b, 0x8e, 0x59, 0x02, 0xa3, 0xbe, 0xa8, 0xfd, 0x93, 0x30, 0x7d, 0x50, 0x4a, 0x15, 0x0f, 0xcc, + 0xff, 0xfb, 0xc1, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x80, 0x04, 0x70, 0x59, 0xa7, 0x04, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -157,6 +357,9 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Queries a list of Prices items. + Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) + PricesAll(ctx context.Context, in *QueryAllPricesRequest, opts ...grpc.CallOption) (*QueryAllPricesResponse, error) } type queryClient struct { @@ -176,10 +379,31 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } +func (c *queryClient) Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) { + out := new(QueryGetPricesResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/Prices", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) PricesAll(ctx context.Context, in *QueryAllPricesRequest, opts ...grpc.CallOption) (*QueryAllPricesResponse, error) { + out := new(QueryAllPricesResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/PricesAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a list of Prices items. + Prices(context.Context, *QueryGetPricesRequest) (*QueryGetPricesResponse, error) + PricesAll(context.Context, *QueryAllPricesRequest) (*QueryAllPricesResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -189,6 +413,12 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } +func (*UnimplementedQueryServer) Prices(ctx context.Context, req *QueryGetPricesRequest) (*QueryGetPricesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Prices not implemented") +} +func (*UnimplementedQueryServer) PricesAll(ctx context.Context, req *QueryAllPricesRequest) (*QueryAllPricesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PricesAll not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -212,6 +442,42 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Query_Prices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetPricesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Prices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/Prices", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Prices(ctx, req.(*QueryGetPricesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_PricesAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllPricesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).PricesAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/PricesAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PricesAll(ctx, req.(*QueryAllPricesRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "exocore.oracle.Query", HandlerType: (*QueryServer)(nil), @@ -220,6 +486,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, + { + MethodName: "Prices", + Handler: _Query_Prices_Handler, + }, + { + MethodName: "PricesAll", + Handler: _Query_PricesAll_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "exocore/oracle/query.proto", @@ -281,6 +555,151 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryGetPricesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetPricesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TokenId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.TokenId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryGetPricesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetPricesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Prices.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAllPricesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllPricesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllPricesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllPricesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Prices) > 0 { + for iNdEx := len(m.Prices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Prices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -312,7 +731,62 @@ func (m *QueryParamsResponse) Size() (n int) { return n } -func sovQuery(x uint64) (n int) { +func (m *QueryGetPricesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovQuery(uint64(m.TokenId)) + } + return n +} + +func (m *QueryGetPricesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Prices.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllPricesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllPricesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Prices) > 0 { + for _, e := range m.Prices { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozQuery(x uint64) (n int) { @@ -451,6 +925,364 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetPricesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + } + m.TokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TokenId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetPricesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Prices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllPricesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllPricesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prices = append(m.Prices, Prices{}) + if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index 2f78fe585..872eb9da9 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -51,6 +51,96 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } +func request_Query_Prices_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetPricesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tokenId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tokenId") + } + + protoReq.TokenId, err = runtime.Int32(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tokenId", err) + } + + msg, err := client.Prices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Prices_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetPricesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tokenId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tokenId") + } + + protoReq.TokenId, err = runtime.Int32(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tokenId", err) + } + + msg, err := server.Prices(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_PricesAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_PricesAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllPricesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_PricesAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.PricesAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_PricesAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllPricesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_PricesAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.PricesAll(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -80,6 +170,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_Prices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Prices_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Prices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_PricesAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_PricesAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_PricesAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -141,13 +277,61 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_Prices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Prices_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Prices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_PricesAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_PricesAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_PricesAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "params"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Prices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "prices", "tokenId"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_PricesAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "prices"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_Prices_0 = runtime.ForwardResponseMessage + + forward_Query_PricesAll_0 = runtime.ForwardResponseMessage ) diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go index 3ce1b0906..29756d822 100644 --- a/x/oracle/types/tx.pb.go +++ b/x/oracle/types/tx.pb.go @@ -175,7 +175,7 @@ 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 MsgClient interface { - //create price for a new oracle round + // create price for a new oracle round CreatePrice(ctx context.Context, in *MsgCreatePrice, opts ...grpc.CallOption) (*MsgCreatePriceResponse, error) } @@ -198,7 +198,7 @@ func (c *msgClient) CreatePrice(ctx context.Context, in *MsgCreatePrice, opts .. // MsgServer is the server API for Msg service. type MsgServer interface { - //create price for a new oracle round + // create price for a new oracle round CreatePrice(context.Context, *MsgCreatePrice) (*MsgCreatePriceResponse, error) } From 4a3cd7d9586b67d78732fe6316c9462de7057c4f Mon Sep 17 00:00:00 2001 From: leonz789 Date: Sat, 24 Feb 2024 14:13:55 +0800 Subject: [PATCH 07/37] feat(oracle-proto):update create price message field --- proto/exocore/oracle/price.proto | 8 ++++ proto/exocore/oracle/prices.proto | 4 +- proto/exocore/oracle/tx.proto | 4 +- x/oracle/types/prices.pb.go | 73 ++++++++++++++++++++++++------- x/oracle/types/tx.pb.go | 56 ++++++++++++------------ 5 files changed, 96 insertions(+), 49 deletions(-) diff --git a/proto/exocore/oracle/price.proto b/proto/exocore/oracle/price.proto index 698a3f272..58268af87 100644 --- a/proto/exocore/oracle/price.proto +++ b/proto/exocore/oracle/price.proto @@ -24,3 +24,11 @@ message PriceWithSource{ //used for 0-sourceID-customDefinedSource string desc = 4; } + +message PriceWithTimeAndRound { + string price = 1; + int32 decimal = 2; + string timestamp = 3; + uint64 round_id = 4; +} + diff --git a/proto/exocore/oracle/prices.proto b/proto/exocore/oracle/prices.proto index 96347b8a5..6dff1754a 100644 --- a/proto/exocore/oracle/prices.proto +++ b/proto/exocore/oracle/prices.proto @@ -7,6 +7,6 @@ option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; message Prices { int32 token_id = 1; - map price_with_round = 2; + int64 next_rount_id = 2; + repeated PriceWithTimeAndRound price = 3; } - diff --git a/proto/exocore/oracle/tx.proto b/proto/exocore/oracle/tx.proto index b7001f233..22cb208ee 100644 --- a/proto/exocore/oracle/tx.proto +++ b/proto/exocore/oracle/tx.proto @@ -13,8 +13,8 @@ service Msg { } message MsgCreatePrice { string creator = 1; - //refer to id from Params.TokenList, 0 is reserved, invalid to use - int32 token_id = 2; + //refer to id from Params.TokenFeeders, 0 is reserved, invalid to use + int32 feeder_id = 2; repeated PriceWithSource prices = 3; //on which block commit does this message be built on uint64 based_block = 4; diff --git a/x/oracle/types/prices.pb.go b/x/oracle/types/prices.pb.go index bf1067a30..5b60f9813 100644 --- a/x/oracle/types/prices.pb.go +++ b/x/oracle/types/prices.pb.go @@ -23,8 +23,11 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Prices struct { - TokenId int32 `protobuf:"varint,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` - PriceWithRound map[int64]*PriceWithTime `protobuf:"bytes,2,rep,name=price_with_round,json=priceWithRound,proto3" json:"price_with_round,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + TokenId int32 `protobuf:"varint,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` + NextRountId int64 `protobuf:"varint,2,opt,name=next_rount_id,json=nextRountId,proto3" json:"next_rount_id,omitempty"` + //arrays's index corresponds to the roundID, start from 1 + // repeated PriceWithTime price_with_round = 3; + PriceWithRound map[int64]*PriceWithTime `protobuf:"bytes,3,rep,name=price_with_round,json=priceWithRound,proto3" json:"price_with_round,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *Prices) Reset() { *m = Prices{} } @@ -67,6 +70,13 @@ func (m *Prices) GetTokenId() int32 { return 0 } +func (m *Prices) GetNextRountId() int64 { + if m != nil { + return m.NextRountId + } + return 0 +} + func (m *Prices) GetPriceWithRound() map[int64]*PriceWithTime { if m != nil { return m.PriceWithRound @@ -82,24 +92,26 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/prices.proto", fileDescriptor_50cc9ccc8f92b87a) } var fileDescriptor_50cc9ccc8f92b87a = []byte{ - // 267 bytes of a gzipped FileDescriptorProto + // 292 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xad, 0xc8, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x4c, 0x4e, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xea, 0x41, 0x24, 0xa5, 0xa4, - 0xb0, 0x29, 0x86, 0xa8, 0x55, 0xba, 0xcd, 0xc8, 0xc5, 0x16, 0x00, 0xd6, 0x2c, 0x24, 0xc9, 0xc5, + 0xb0, 0x29, 0x86, 0xa8, 0x55, 0xfa, 0xcf, 0xc8, 0xc5, 0x16, 0x00, 0xd6, 0x2c, 0x24, 0xc9, 0xc5, 0x51, 0x92, 0x9f, 0x9d, 0x9a, 0x17, 0x9f, 0x99, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x1a, 0xc4, - 0x0e, 0xe6, 0x7b, 0xa6, 0x08, 0x85, 0x70, 0x09, 0x80, 0x35, 0xc5, 0x97, 0x67, 0x96, 0x64, 0xc4, - 0x17, 0xe5, 0x97, 0xe6, 0xa5, 0x48, 0x30, 0x29, 0x30, 0x6b, 0x70, 0x1b, 0x69, 0xe9, 0xa1, 0x5a, - 0xa6, 0x07, 0x31, 0x0c, 0x42, 0x85, 0x67, 0x96, 0x64, 0x04, 0x81, 0x14, 0xbb, 0xe6, 0x95, 0x14, - 0x55, 0x06, 0xf1, 0x15, 0xa0, 0x08, 0x4a, 0x25, 0x70, 0x09, 0x63, 0x51, 0x26, 0x24, 0xc0, 0xc5, - 0x9c, 0x9d, 0x5a, 0x09, 0x76, 0x02, 0x73, 0x10, 0x88, 0x29, 0x64, 0xcc, 0xc5, 0x5a, 0x96, 0x98, - 0x53, 0x9a, 0x2a, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0x8b, 0xd5, 0x4e, 0x90, 0x29, 0x21, - 0x99, 0xb9, 0xa9, 0x41, 0x10, 0xb5, 0x56, 0x4c, 0x16, 0x8c, 0x4e, 0x5e, 0x27, 0x1e, 0xc9, 0x31, - 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, - 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x90, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, - 0x9f, 0xab, 0xef, 0x0a, 0x31, 0xcd, 0x2f, 0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x5b, 0x1f, 0x16, 0x5a, - 0x15, 0xb0, 0xf0, 0x2a, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x07, 0x98, 0x31, 0x20, 0x00, - 0x00, 0xff, 0xff, 0xfe, 0x6e, 0xea, 0x7d, 0x7b, 0x01, 0x00, 0x00, + 0x0e, 0xe6, 0x7b, 0xa6, 0x08, 0x29, 0x71, 0xf1, 0xe6, 0xa5, 0x56, 0x94, 0xc4, 0x17, 0xe5, 0x97, + 0xe6, 0x95, 0x80, 0xe4, 0x99, 0x14, 0x18, 0x35, 0x98, 0x83, 0xb8, 0x41, 0x82, 0x41, 0x20, 0x31, + 0xcf, 0x14, 0xa1, 0x10, 0x2e, 0x01, 0xb0, 0xc1, 0xf1, 0xe5, 0x99, 0x25, 0x19, 0x60, 0x95, 0x29, + 0x12, 0xcc, 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0x5a, 0x7a, 0xa8, 0x0e, 0xd2, 0x83, 0x58, 0x08, 0xa1, + 0xc2, 0x33, 0x4b, 0x32, 0x40, 0x46, 0xa4, 0xb8, 0xe6, 0x95, 0x14, 0x55, 0x06, 0xf1, 0x15, 0xa0, + 0x08, 0x4a, 0x25, 0x70, 0x09, 0x63, 0x51, 0x26, 0x24, 0xc0, 0xc5, 0x9c, 0x9d, 0x5a, 0x09, 0x76, + 0x26, 0x73, 0x10, 0x88, 0x29, 0x64, 0xcc, 0xc5, 0x5a, 0x96, 0x98, 0x53, 0x9a, 0x0a, 0x76, 0x1a, + 0xb7, 0x91, 0x2c, 0x56, 0x3b, 0x41, 0xa6, 0x84, 0x64, 0xe6, 0xa6, 0x06, 0x41, 0xd4, 0x5a, 0x31, + 0x59, 0x30, 0x3a, 0x79, 0x9d, 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, 0x41, + 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0xbe, 0x2b, 0xc4, 0x34, 0xbf, 0xd4, + 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x58, 0x88, 0x56, 0xc0, 0xc2, 0xb4, 0xa4, 0xb2, 0x20, 0xb5, + 0x38, 0x89, 0x0d, 0x1c, 0xa8, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbf, 0x97, 0x96, 0xfd, + 0x9f, 0x01, 0x00, 0x00, } func (m *Prices) Marshal() (dAtA []byte, err error) { @@ -143,9 +155,14 @@ func (m *Prices) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x8 i = encodeVarintPrices(dAtA, i, uint64(baseI-i)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } } + if m.NextRountId != 0 { + i = encodeVarintPrices(dAtA, i, uint64(m.NextRountId)) + i-- + dAtA[i] = 0x10 + } if m.TokenId != 0 { i = encodeVarintPrices(dAtA, i, uint64(m.TokenId)) i-- @@ -174,6 +191,9 @@ func (m *Prices) Size() (n int) { if m.TokenId != 0 { n += 1 + sovPrices(uint64(m.TokenId)) } + if m.NextRountId != 0 { + n += 1 + sovPrices(uint64(m.NextRountId)) + } if len(m.PriceWithRound) > 0 { for k, v := range m.PriceWithRound { _ = k @@ -245,6 +265,25 @@ func (m *Prices) Unmarshal(dAtA []byte) error { } } case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextRountId", wireType) + } + m.NextRountId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextRountId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PriceWithRound", wireType) } diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go index 29756d822..982c60051 100644 --- a/x/oracle/types/tx.pb.go +++ b/x/oracle/types/tx.pb.go @@ -29,9 +29,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgCreatePrice struct { Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - //refer to id from Params.TokenList, 0 is reserved, invalid to use - TokenId int32 `protobuf:"varint,2,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` - Prices []*PriceWithSource `protobuf:"bytes,3,rep,name=prices,proto3" json:"prices,omitempty"` + //refer to id from Params.TokenFeeders, 0 is reserved, invalid to use + FeederId int32 `protobuf:"varint,2,opt,name=feeder_id,json=feederId,proto3" json:"feeder_id,omitempty"` + Prices []*PriceWithSource `protobuf:"bytes,3,rep,name=prices,proto3" json:"prices,omitempty"` //on which block commit does this message be built on BasedBlock uint64 `protobuf:"varint,4,opt,name=based_block,json=basedBlock,proto3" json:"based_block,omitempty"` } @@ -76,9 +76,9 @@ func (m *MsgCreatePrice) GetCreator() string { return "" } -func (m *MsgCreatePrice) GetTokenId() int32 { +func (m *MsgCreatePrice) GetFeederId() int32 { if m != nil { - return m.TokenId + return m.FeederId } return 0 } @@ -141,26 +141,26 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/tx.proto", fileDescriptor_02cf64aff79d2288) } var fileDescriptor_02cf64aff79d2288 = []byte{ - // 294 bytes of a gzipped FileDescriptorProto + // 295 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xad, 0xc8, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xe8, 0x41, 0x24, 0xa4, 0xa4, 0xd0, 0x14, 0x16, 0x14, - 0x65, 0x26, 0xa7, 0x42, 0xd4, 0x2a, 0xcd, 0x67, 0xe4, 0xe2, 0xf3, 0x2d, 0x4e, 0x77, 0x2e, 0x4a, + 0x65, 0x26, 0xa7, 0x42, 0xd4, 0x2a, 0x2d, 0x64, 0xe4, 0xe2, 0xf3, 0x2d, 0x4e, 0x77, 0x2e, 0x4a, 0x4d, 0x2c, 0x49, 0x0d, 0x00, 0x49, 0x08, 0x49, 0x70, 0xb1, 0x27, 0x83, 0xb8, 0xf9, 0x45, 0x12, - 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x30, 0xae, 0x90, 0x24, 0x17, 0x47, 0x49, 0x7e, 0x76, 0x6a, - 0x5e, 0x7c, 0x66, 0x8a, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x3b, 0x98, 0xef, 0x99, 0x22, - 0x64, 0xce, 0xc5, 0x06, 0x36, 0xb6, 0x58, 0x82, 0x59, 0x81, 0x59, 0x83, 0xdb, 0x48, 0x5e, 0x0f, - 0xd5, 0x11, 0x7a, 0x60, 0xb3, 0xc3, 0x33, 0x4b, 0x32, 0x82, 0xf3, 0x4b, 0x8b, 0x92, 0x53, 0x83, - 0xa0, 0xca, 0x85, 0xe4, 0xb9, 0xb8, 0x93, 0x12, 0x8b, 0x53, 0x53, 0xe2, 0x93, 0x72, 0xf2, 0x93, - 0xb3, 0x25, 0x58, 0x14, 0x18, 0x35, 0x58, 0x82, 0xb8, 0xc0, 0x42, 0x4e, 0x20, 0x11, 0x25, 0x09, - 0x2e, 0x31, 0x54, 0x07, 0x06, 0xa5, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x1a, 0xc5, 0x70, 0x31, - 0xfb, 0x16, 0xa7, 0x0b, 0x85, 0x72, 0x71, 0x23, 0x3b, 0x5f, 0x0e, 0xdd, 0x66, 0x54, 0xdd, 0x52, - 0x6a, 0xf8, 0xe5, 0x61, 0xa6, 0x3b, 0x79, 0x9d, 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, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0xbe, 0x2b, 0xc4, - 0x2c, 0xbf, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x58, 0x48, 0x57, 0xc0, 0x23, 0xa5, 0xb2, - 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0xd8, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3c, 0xb1, - 0x60, 0x86, 0xb3, 0x01, 0x00, 0x00, + 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x30, 0xae, 0x90, 0x34, 0x17, 0x67, 0x5a, 0x6a, 0x6a, 0x4a, + 0x6a, 0x51, 0x7c, 0x66, 0x8a, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x07, 0x44, 0xc0, 0x33, + 0x45, 0xc8, 0x9c, 0x8b, 0x0d, 0x6c, 0x70, 0xb1, 0x04, 0xb3, 0x02, 0xb3, 0x06, 0xb7, 0x91, 0xbc, + 0x1e, 0xaa, 0x33, 0xf4, 0xc0, 0xa6, 0x87, 0x67, 0x96, 0x64, 0x04, 0xe7, 0x97, 0x16, 0x25, 0xa7, + 0x06, 0x41, 0x95, 0x0b, 0xc9, 0x73, 0x71, 0x27, 0x25, 0x16, 0xa7, 0xa6, 0xc4, 0x27, 0xe5, 0xe4, + 0x27, 0x67, 0x4b, 0xb0, 0x28, 0x30, 0x6a, 0xb0, 0x04, 0x71, 0x81, 0x85, 0x9c, 0x40, 0x22, 0x4a, + 0x12, 0x5c, 0x62, 0xa8, 0x4e, 0x0c, 0x4a, 0x2d, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0x35, 0x8a, 0xe1, + 0x62, 0xf6, 0x2d, 0x4e, 0x17, 0x0a, 0xe5, 0xe2, 0x46, 0xf6, 0x80, 0x1c, 0xba, 0xcd, 0xa8, 0xba, + 0xa5, 0xd4, 0xf0, 0xcb, 0xc3, 0x4c, 0x77, 0xf2, 0x3a, 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, 0x83, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x57, + 0x88, 0x59, 0x7e, 0xa9, 0x25, 0xe5, 0xf9, 0x45, 0xd9, 0xfa, 0xb0, 0xb0, 0xae, 0x80, 0x47, 0x4b, + 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0xb8, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe1, + 0x2b, 0x61, 0x19, 0xb5, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -284,8 +284,8 @@ func (m *MsgCreatePrice) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x1a } } - if m.TokenId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.TokenId)) + if m.FeederId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.FeederId)) i-- dAtA[i] = 0x10 } @@ -343,8 +343,8 @@ func (m *MsgCreatePrice) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.TokenId != 0 { - n += 1 + sovTx(uint64(m.TokenId)) + if m.FeederId != 0 { + n += 1 + sovTx(uint64(m.FeederId)) } if len(m.Prices) > 0 { for _, e := range m.Prices { @@ -436,9 +436,9 @@ func (m *MsgCreatePrice) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeederId", wireType) } - m.TokenId = 0 + m.FeederId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -448,7 +448,7 @@ func (m *MsgCreatePrice) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TokenId |= int32(b&0x7F) << shift + m.FeederId |= int32(b&0x7F) << shift if b < 0x80 { break } From 1ae5769f9623cbc7d4b5a3a6be3796eb271d5120 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Sat, 24 Feb 2024 16:43:15 +0800 Subject: [PATCH 08/37] feat(oracle-proto): update prices field --- proto/exocore/oracle/prices.proto | 2 +- x/oracle/types/price.pb.go | 331 ++++++++++++++++++++++++++++-- x/oracle/types/prices.pb.go | 174 ++++------------ 3 files changed, 348 insertions(+), 159 deletions(-) diff --git a/proto/exocore/oracle/prices.proto b/proto/exocore/oracle/prices.proto index 6dff1754a..81ffaa3ce 100644 --- a/proto/exocore/oracle/prices.proto +++ b/proto/exocore/oracle/prices.proto @@ -8,5 +8,5 @@ option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; message Prices { int32 token_id = 1; int64 next_rount_id = 2; - repeated PriceWithTimeAndRound price = 3; + repeated PriceWithTimeAndRound price_list = 3; } diff --git a/x/oracle/types/price.pb.go b/x/oracle/types/price.pb.go index e9a22fe69..1b7c67beb 100644 --- a/x/oracle/types/price.pb.go +++ b/x/oracle/types/price.pb.go @@ -158,33 +158,104 @@ func (m *PriceWithSource) GetDesc() string { return "" } +type PriceWithTimeAndRound struct { + Price string `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"` + Decimal int32 `protobuf:"varint,2,opt,name=decimal,proto3" json:"decimal,omitempty"` + Timestamp string `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + RoundId uint64 `protobuf:"varint,4,opt,name=round_id,json=roundId,proto3" json:"round_id,omitempty"` +} + +func (m *PriceWithTimeAndRound) Reset() { *m = PriceWithTimeAndRound{} } +func (m *PriceWithTimeAndRound) String() string { return proto.CompactTextString(m) } +func (*PriceWithTimeAndRound) ProtoMessage() {} +func (*PriceWithTimeAndRound) Descriptor() ([]byte, []int) { + return fileDescriptor_6755466c800b64fc, []int{2} +} +func (m *PriceWithTimeAndRound) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PriceWithTimeAndRound) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PriceWithTimeAndRound.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PriceWithTimeAndRound) XXX_Merge(src proto.Message) { + xxx_messageInfo_PriceWithTimeAndRound.Merge(m, src) +} +func (m *PriceWithTimeAndRound) XXX_Size() int { + return m.Size() +} +func (m *PriceWithTimeAndRound) XXX_DiscardUnknown() { + xxx_messageInfo_PriceWithTimeAndRound.DiscardUnknown(m) +} + +var xxx_messageInfo_PriceWithTimeAndRound proto.InternalMessageInfo + +func (m *PriceWithTimeAndRound) GetPrice() string { + if m != nil { + return m.Price + } + return "" +} + +func (m *PriceWithTimeAndRound) GetDecimal() int32 { + if m != nil { + return m.Decimal + } + return 0 +} + +func (m *PriceWithTimeAndRound) GetTimestamp() string { + if m != nil { + return m.Timestamp + } + return "" +} + +func (m *PriceWithTimeAndRound) GetRoundId() uint64 { + if m != nil { + return m.RoundId + } + return 0 +} + func init() { proto.RegisterType((*PriceWithTime)(nil), "exocore.oracle.PriceWithTime") proto.RegisterType((*PriceWithSource)(nil), "exocore.oracle.PriceWithSource") + proto.RegisterType((*PriceWithTimeAndRound)(nil), "exocore.oracle.PriceWithTimeAndRound") } func init() { proto.RegisterFile("exocore/oracle/price.proto", fileDescriptor_6755466c800b64fc) } var fileDescriptor_6755466c800b64fc = []byte{ - // 283 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0xad, 0xc8, 0x4f, - 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x4c, 0x4e, - 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xca, 0xe9, 0x41, 0xe4, 0x94, 0x62, 0xb9, - 0x78, 0x03, 0x40, 0xd2, 0xe1, 0x99, 0x25, 0x19, 0x21, 0x99, 0xb9, 0xa9, 0x42, 0x22, 0x5c, 0xac, - 0x60, 0xf5, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x10, 0x8e, 0x90, 0x04, 0x17, 0x7b, 0x4a, - 0x6a, 0x72, 0x66, 0x6e, 0x62, 0x8e, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x8c, 0x2b, 0x24, - 0xc3, 0xc5, 0x59, 0x92, 0x99, 0x9b, 0x5a, 0x5c, 0x92, 0x98, 0x5b, 0x20, 0xc1, 0x0c, 0xd6, 0x83, - 0x10, 0x50, 0x9a, 0xc0, 0xc8, 0xc5, 0x0f, 0x37, 0x3f, 0x38, 0xbf, 0xb4, 0x28, 0x39, 0x55, 0x48, - 0x9a, 0x8b, 0xb3, 0x18, 0xcc, 0x8a, 0xcf, 0x4c, 0x01, 0xdb, 0xc2, 0x1a, 0xc4, 0x01, 0x11, 0xf0, - 0x4c, 0x11, 0x12, 0xe5, 0x62, 0x4b, 0x49, 0x2d, 0x01, 0xc9, 0x30, 0x41, 0xec, 0x4f, 0x49, 0x2d, - 0xf1, 0x4c, 0x11, 0x32, 0xe5, 0x62, 0x03, 0x3b, 0xa4, 0x58, 0x82, 0x59, 0x81, 0x59, 0x83, 0xdb, - 0x48, 0x56, 0x0f, 0xd5, 0x1f, 0x7a, 0x28, 0x9e, 0x08, 0x82, 0x2a, 0x16, 0x12, 0xe2, 0x62, 0x49, - 0x49, 0x2d, 0x4e, 0x96, 0x60, 0x01, 0x9b, 0x05, 0x66, 0x3b, 0x79, 0x9d, 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, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, - 0xae, 0xbe, 0x2b, 0xc4, 0x78, 0xbf, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x58, 0x88, 0x56, - 0xc0, 0xc2, 0xb4, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0xa8, 0xc6, 0x80, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xfd, 0x5b, 0x62, 0xc4, 0x72, 0x01, 0x00, 0x00, + // 313 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x51, 0x4d, 0x4b, 0x03, 0x31, + 0x14, 0x6c, 0xfa, 0xdd, 0x27, 0x2a, 0x04, 0x0b, 0xf1, 0x2b, 0x94, 0x9e, 0x7a, 0xda, 0x15, 0xc5, + 0x1f, 0xa0, 0xe0, 0xa1, 0x1e, 0x44, 0xa2, 0x20, 0x08, 0x22, 0x6d, 0xf2, 0xb0, 0xc1, 0x6e, 0xb3, + 0x64, 0x53, 0xac, 0x37, 0x7f, 0x42, 0x7f, 0x96, 0xc7, 0x1e, 0x3d, 0x4a, 0xf7, 0x8f, 0xc8, 0x66, + 0xbb, 0xca, 0xde, 0xbd, 0xbd, 0xf7, 0x66, 0x32, 0x93, 0x61, 0xe0, 0x00, 0x17, 0x46, 0x1a, 0x8b, + 0xa1, 0xb1, 0x23, 0x39, 0xc5, 0x30, 0xb6, 0x5a, 0x62, 0x10, 0x5b, 0xe3, 0x0c, 0xdd, 0xd9, 0x60, + 0x41, 0x8e, 0xf5, 0x9f, 0x60, 0xfb, 0x36, 0x83, 0x1f, 0xb4, 0x9b, 0xdc, 0xeb, 0x08, 0xe9, 0x1e, + 0x34, 0x3c, 0x9f, 0x91, 0x1e, 0x19, 0x74, 0x44, 0xbe, 0x50, 0x06, 0x2d, 0x85, 0x52, 0x47, 0xa3, + 0x29, 0xab, 0xf6, 0xc8, 0xa0, 0x21, 0x8a, 0x95, 0x1e, 0x41, 0xc7, 0xe9, 0x08, 0x13, 0x37, 0x8a, + 0x62, 0x56, 0xf3, 0x6f, 0xfe, 0x0e, 0xfd, 0x25, 0x81, 0xdd, 0x5f, 0xfd, 0x3b, 0x33, 0xb7, 0x12, + 0xe9, 0x21, 0x74, 0x12, 0x3f, 0x3d, 0x6b, 0xe5, 0x5d, 0x1a, 0xa2, 0x9d, 0x1f, 0x86, 0x8a, 0x76, + 0xa1, 0xa9, 0xd0, 0x65, 0x48, 0x35, 0xf7, 0x57, 0xe8, 0x86, 0x8a, 0x9e, 0x43, 0xd3, 0x7f, 0x24, + 0x61, 0xb5, 0x5e, 0x6d, 0xb0, 0x75, 0x7a, 0x1c, 0x94, 0x73, 0x04, 0xa5, 0x10, 0x62, 0x43, 0xa6, + 0x14, 0xea, 0x0a, 0x13, 0xc9, 0xea, 0x5e, 0xcb, 0xcf, 0xfd, 0x0f, 0x02, 0xdd, 0x12, 0xfb, 0x62, + 0xa6, 0x84, 0x99, 0xcf, 0xd4, 0xff, 0x46, 0xa7, 0xfb, 0xd0, 0xb6, 0x99, 0x6c, 0x96, 0x25, 0xf3, + 0xaf, 0x8b, 0x96, 0xdf, 0x87, 0xea, 0xf2, 0xfa, 0x73, 0xcd, 0xc9, 0x6a, 0xcd, 0xc9, 0xf7, 0x9a, + 0x93, 0x65, 0xca, 0x2b, 0xab, 0x94, 0x57, 0xbe, 0x52, 0x5e, 0x79, 0x3c, 0x79, 0xd1, 0x6e, 0x32, + 0x1f, 0x07, 0xd2, 0x44, 0xe1, 0x55, 0x9e, 0xf0, 0x06, 0xdd, 0x9b, 0xb1, 0xaf, 0x61, 0x51, 0xea, + 0xa2, 0xa8, 0xd5, 0xbd, 0xc7, 0x98, 0x8c, 0x9b, 0xbe, 0xd7, 0xb3, 0x9f, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x72, 0x2f, 0x17, 0x64, 0xf5, 0x01, 0x00, 0x00, } func (m *PriceWithTime) Marshal() (dAtA []byte, err error) { @@ -285,6 +356,53 @@ func (m *PriceWithSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *PriceWithTimeAndRound) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PriceWithTimeAndRound) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PriceWithTimeAndRound) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RoundId != 0 { + i = encodeVarintPrice(dAtA, i, uint64(m.RoundId)) + i-- + dAtA[i] = 0x20 + } + if len(m.Timestamp) > 0 { + i -= len(m.Timestamp) + copy(dAtA[i:], m.Timestamp) + i = encodeVarintPrice(dAtA, i, uint64(len(m.Timestamp))) + i-- + dAtA[i] = 0x1a + } + if m.Decimal != 0 { + i = encodeVarintPrice(dAtA, i, uint64(m.Decimal)) + i-- + dAtA[i] = 0x10 + } + if len(m.Price) > 0 { + i -= len(m.Price) + copy(dAtA[i:], m.Price) + i = encodeVarintPrice(dAtA, i, uint64(len(m.Price))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintPrice(dAtA []byte, offset int, v uint64) int { offset -= sovPrice(v) base := offset @@ -342,6 +460,29 @@ func (m *PriceWithSource) Size() (n int) { return n } +func (m *PriceWithTimeAndRound) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Price) + if l > 0 { + n += 1 + l + sovPrice(uint64(l)) + } + if m.Decimal != 0 { + n += 1 + sovPrice(uint64(m.Decimal)) + } + l = len(m.Timestamp) + if l > 0 { + n += 1 + l + sovPrice(uint64(l)) + } + if m.RoundId != 0 { + n += 1 + sovPrice(uint64(m.RoundId)) + } + return n +} + func sovPrice(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -648,6 +789,158 @@ func (m *PriceWithSource) Unmarshal(dAtA []byte) error { } return nil } +func (m *PriceWithTimeAndRound) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PriceWithTimeAndRound: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PriceWithTimeAndRound: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrice + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPrice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Price = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Decimal", wireType) + } + m.Decimal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Decimal |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrice + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPrice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Timestamp = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RoundId", wireType) + } + m.RoundId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RoundId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipPrice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPrice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipPrice(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/oracle/types/prices.pb.go b/x/oracle/types/prices.pb.go index 5b60f9813..90a31939b 100644 --- a/x/oracle/types/prices.pb.go +++ b/x/oracle/types/prices.pb.go @@ -23,11 +23,9 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Prices struct { - TokenId int32 `protobuf:"varint,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` - NextRountId int64 `protobuf:"varint,2,opt,name=next_rount_id,json=nextRountId,proto3" json:"next_rount_id,omitempty"` - //arrays's index corresponds to the roundID, start from 1 - // repeated PriceWithTime price_with_round = 3; - PriceWithRound map[int64]*PriceWithTime `protobuf:"bytes,3,rep,name=price_with_round,json=priceWithRound,proto3" json:"price_with_round,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + TokenId int32 `protobuf:"varint,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` + NextRountId int64 `protobuf:"varint,2,opt,name=next_rount_id,json=nextRountId,proto3" json:"next_rount_id,omitempty"` + PriceList []*PriceWithTimeAndRound `protobuf:"bytes,3,rep,name=price_list,json=priceList,proto3" json:"price_list,omitempty"` } func (m *Prices) Reset() { *m = Prices{} } @@ -77,41 +75,37 @@ func (m *Prices) GetNextRountId() int64 { return 0 } -func (m *Prices) GetPriceWithRound() map[int64]*PriceWithTime { +func (m *Prices) GetPriceList() []*PriceWithTimeAndRound { if m != nil { - return m.PriceWithRound + return m.PriceList } return nil } func init() { proto.RegisterType((*Prices)(nil), "exocore.oracle.Prices") - proto.RegisterMapType((map[int64]*PriceWithTime)(nil), "exocore.oracle.Prices.PriceWithRoundEntry") } func init() { proto.RegisterFile("exocore/oracle/prices.proto", fileDescriptor_50cc9ccc8f92b87a) } var fileDescriptor_50cc9ccc8f92b87a = []byte{ - // 292 bytes of a gzipped FileDescriptorProto + // 242 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xad, 0xc8, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x4c, 0x4e, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xea, 0x41, 0x24, 0xa5, 0xa4, - 0xb0, 0x29, 0x86, 0xa8, 0x55, 0xfa, 0xcf, 0xc8, 0xc5, 0x16, 0x00, 0xd6, 0x2c, 0x24, 0xc9, 0xc5, - 0x51, 0x92, 0x9f, 0x9d, 0x9a, 0x17, 0x9f, 0x99, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x1a, 0xc4, - 0x0e, 0xe6, 0x7b, 0xa6, 0x08, 0x29, 0x71, 0xf1, 0xe6, 0xa5, 0x56, 0x94, 0xc4, 0x17, 0xe5, 0x97, - 0xe6, 0x95, 0x80, 0xe4, 0x99, 0x14, 0x18, 0x35, 0x98, 0x83, 0xb8, 0x41, 0x82, 0x41, 0x20, 0x31, - 0xcf, 0x14, 0xa1, 0x10, 0x2e, 0x01, 0xb0, 0xc1, 0xf1, 0xe5, 0x99, 0x25, 0x19, 0x60, 0x95, 0x29, - 0x12, 0xcc, 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0x5a, 0x7a, 0xa8, 0x0e, 0xd2, 0x83, 0x58, 0x08, 0xa1, - 0xc2, 0x33, 0x4b, 0x32, 0x40, 0x46, 0xa4, 0xb8, 0xe6, 0x95, 0x14, 0x55, 0x06, 0xf1, 0x15, 0xa0, - 0x08, 0x4a, 0x25, 0x70, 0x09, 0x63, 0x51, 0x26, 0x24, 0xc0, 0xc5, 0x9c, 0x9d, 0x5a, 0x09, 0x76, - 0x26, 0x73, 0x10, 0x88, 0x29, 0x64, 0xcc, 0xc5, 0x5a, 0x96, 0x98, 0x53, 0x9a, 0x0a, 0x76, 0x1a, - 0xb7, 0x91, 0x2c, 0x56, 0x3b, 0x41, 0xa6, 0x84, 0x64, 0xe6, 0xa6, 0x06, 0x41, 0xd4, 0x5a, 0x31, - 0x59, 0x30, 0x3a, 0x79, 0x9d, 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, 0x41, - 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0xbe, 0x2b, 0xc4, 0x34, 0xbf, 0xd4, - 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x58, 0x88, 0x56, 0xc0, 0xc2, 0xb4, 0xa4, 0xb2, 0x20, 0xb5, - 0x38, 0x89, 0x0d, 0x1c, 0xa8, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbf, 0x97, 0x96, 0xfd, - 0x9f, 0x01, 0x00, 0x00, + 0xb0, 0x29, 0x86, 0xa8, 0x55, 0xea, 0x65, 0xe4, 0x62, 0x0b, 0x00, 0x6b, 0x16, 0x92, 0xe4, 0xe2, + 0x28, 0xc9, 0xcf, 0x4e, 0xcd, 0x8b, 0xcf, 0x4c, 0x91, 0x60, 0x54, 0x60, 0xd4, 0x60, 0x0d, 0x62, + 0x07, 0xf3, 0x3d, 0x53, 0x84, 0x94, 0xb8, 0x78, 0xf3, 0x52, 0x2b, 0x4a, 0xe2, 0x8b, 0xf2, 0x4b, + 0xf3, 0x4a, 0x40, 0xf2, 0x4c, 0x0a, 0x8c, 0x1a, 0xcc, 0x41, 0xdc, 0x20, 0xc1, 0x20, 0x90, 0x98, + 0x67, 0x8a, 0x90, 0x0b, 0x17, 0x17, 0xd8, 0xe0, 0xf8, 0x9c, 0xcc, 0xe2, 0x12, 0x09, 0x66, 0x05, + 0x66, 0x0d, 0x6e, 0x23, 0x55, 0x3d, 0x54, 0xa7, 0xe8, 0x81, 0xad, 0x0a, 0xcf, 0x2c, 0xc9, 0x08, + 0xc9, 0xcc, 0x4d, 0x75, 0xcc, 0x4b, 0x01, 0x69, 0x4e, 0x09, 0xe2, 0x04, 0x6b, 0xf4, 0xc9, 0x2c, + 0x2e, 0x71, 0xf2, 0x3a, 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, 0x83, 0xf4, + 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x57, 0x88, 0xa9, 0x7e, 0xa9, 0x25, + 0xe5, 0xf9, 0x45, 0xd9, 0xfa, 0x30, 0xff, 0x55, 0xc0, 0x7c, 0x58, 0x52, 0x59, 0x90, 0x5a, 0x9c, + 0xc4, 0x06, 0xf6, 0xa2, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x79, 0xc5, 0x26, 0xec, 0x2d, 0x01, + 0x00, 0x00, } func (m *Prices) Marshal() (dAtA []byte, err error) { @@ -134,26 +128,16 @@ func (m *Prices) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.PriceWithRound) > 0 { - for k := range m.PriceWithRound { - v := m.PriceWithRound[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPrices(dAtA, i, uint64(size)) + if len(m.PriceList) > 0 { + for iNdEx := len(m.PriceList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PriceList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintPrices(dAtA, i, uint64(size)) } - i = encodeVarintPrices(dAtA, i, uint64(k)) - i-- - dAtA[i] = 0x8 - i = encodeVarintPrices(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x1a } @@ -194,17 +178,10 @@ func (m *Prices) Size() (n int) { if m.NextRountId != 0 { n += 1 + sovPrices(uint64(m.NextRountId)) } - if len(m.PriceWithRound) > 0 { - for k, v := range m.PriceWithRound { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovPrices(uint64(l)) - } - mapEntrySize := 1 + sovPrices(uint64(k)) + l - n += mapEntrySize + 1 + sovPrices(uint64(mapEntrySize)) + if len(m.PriceList) > 0 { + for _, e := range m.PriceList { + l = e.Size() + n += 1 + l + sovPrices(uint64(l)) } } return n @@ -285,7 +262,7 @@ func (m *Prices) Unmarshal(dAtA []byte) error { } case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceWithRound", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PriceList", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -312,91 +289,10 @@ func (m *Prices) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.PriceWithRound == nil { - m.PriceWithRound = make(map[int64]*PriceWithTime) - } - var mapkey int64 - var mapvalue *PriceWithTime - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrices - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrices - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapkey |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrices - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthPrices - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthPrices - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &PriceWithTime{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipPrices(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPrices - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + m.PriceList = append(m.PriceList, &PriceWithTimeAndRound{}) + if err := m.PriceList[len(m.PriceList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.PriceWithRound[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex From 28bd930513b54bbd38389444376cb991f9fbc436 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Sun, 25 Feb 2024 00:33:49 +0800 Subject: [PATCH 09/37] feat(oracle-keeper):add prices curd for embeded field --- proto/exocore/oracle/prices.proto | 2 +- x/oracle/keeper/prices.go | 108 ++++++++++++++++++++++++++---- x/oracle/types/key_prices.go | 11 +++ x/oracle/types/prices.pb.go | 10 +-- x/oracle/types/types.go | 8 +++ 5 files changed, 121 insertions(+), 18 deletions(-) diff --git a/proto/exocore/oracle/prices.proto b/proto/exocore/oracle/prices.proto index 81ffaa3ce..798493742 100644 --- a/proto/exocore/oracle/prices.proto +++ b/proto/exocore/oracle/prices.proto @@ -7,6 +7,6 @@ option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; message Prices { int32 token_id = 1; - int64 next_rount_id = 2; + uint64 next_rount_id = 2; repeated PriceWithTimeAndRound price_list = 3; } diff --git a/x/oracle/keeper/prices.go b/x/oracle/keeper/prices.go index ed69a3ab2..4f6c108ae 100644 --- a/x/oracle/keeper/prices.go +++ b/x/oracle/keeper/prices.go @@ -1,18 +1,23 @@ package keeper import ( + "encoding/binary" + "github.com/ExocoreNetwork/exocore/x/oracle/types" "github.com/cosmos/cosmos-sdk/store/prefix" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" ) // SetPrices set a specific prices in the store from its index func (k Keeper) SetPrices(ctx sdk.Context, prices types.Prices) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) - b := k.cdc.MustMarshal(&prices) - store.Set(types.PricesKey( - prices.TokenId, - ), b) + store = prefix.NewStore(store, types.PricesKey(prices.TokenId)) + for _, v := range prices.PriceList { + b := k.cdc.MustMarshal(v) + store.Set(types.PricesRoundKey(v.RoundId), b) + } + store.Set(types.PricesNextRountIdKey, types.Uint64Bytes(uint64(prices.NextRountId))) } // GetPrices returns a prices from its index @@ -22,15 +27,29 @@ func (k Keeper) GetPrices( ) (val types.Prices, found bool) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) + store = prefix.NewStore(store, types.PricesKey(tokenId)) - b := store.Get(types.PricesKey( - tokenId, - )) - if b == nil { + nextRoundIdB := store.Get(types.PricesNextRountIdKey) + if nextRoundIdB == nil { return val, false } - k.cdc.MustUnmarshal(b, &val) + nextRoundId := binary.BigEndian.Uint64(nextRoundIdB) + + val.TokenId = tokenId + val.NextRountId = nextRoundId + val.PriceList = make([]*types.PriceWithTimeAndRound, nextRoundId) + //0 roundId is reserved + val.PriceList[0] = &types.PriceWithTimeAndRound{} + for i := uint64(1); i < nextRoundId; i++ { + b := store.Get(types.PricesRoundKey(i)) + val.PriceList[i] = &types.PriceWithTimeAndRound{} + if b != nil { + //should alwyas be true since we don't delete prices from history round + k.cdc.MustUnmarshal(b, val.PriceList[i]) + } + } + return val, true } @@ -41,9 +60,13 @@ func (k Keeper) RemovePrices( ) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) - store.Delete(types.PricesKey( - tokenId, - )) + store = prefix.NewStore(store, types.PricesKey(tokenId)) + // iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := store.Iterator(nil, nil) + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + store.Delete(iterator.Key()) + } } // GetAllPrices returns all prices @@ -61,3 +84,64 @@ func (k Keeper) GetAllPrices(ctx sdk.Context) (list []types.Prices) { return } + +func (k Keeper) AppendPriceTR(ctx sdk.Context, tokenId int32, priceTR types.PriceWithTimeAndRound) { + nextRoundId := k.GetNextRoundId(ctx, tokenId) + if nextRoundId != priceTR.RoundId { + return + } + store := getPriceTRStore(ctx, k.storeKey, tokenId) + b := k.cdc.MustMarshal(&priceTR) + store.Set(types.PricesRoundKey(nextRoundId), b) +} + +//func(k Keeper) SetPriceTR(ctx sdk.Context, tokenId int32, priceTR){} + +func (k Keeper) GetPriceTRRoundId(ctx sdk.Context, tokenId int32, roundId uint64) (price types.PriceWithTimeAndRound, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) + store = prefix.NewStore(store, types.PricesKey(tokenId)) + + b := store.Get(types.PricesRoundKey(roundId)) + if b == nil { + return + } + + k.cdc.Unmarshal(b, &price) + found = true + return +} + +func (k Keeper) GetPriceTRLatest(ctx sdk.Context, tokenId int32) (price types.PriceWithTimeAndRound, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) + store = prefix.NewStore(store, types.PricesKey(tokenId)) + + nextRoundIdB := store.Get(types.PricesNextRountIdKey) + if nextRoundIdB == nil { + return + } + nextRoundId := binary.BigEndian.Uint64(nextRoundIdB) + b := store.Get(types.PricesRoundKey(nextRoundId - 1)) + if b != nil { + //should always be true + k.cdc.Unmarshal(b, &price) + found = true + } + return +} + +func (k Keeper) GetNextRoundId(ctx sdk.Context, tokenId int32) (nextRoundId uint64) { + nextRoundId = 1 + store := getPriceTRStore(ctx, k.storeKey, tokenId) + nextRoundIdB := store.Get(types.PricesNextRountIdKey) + if nextRoundIdB != nil { + nextRoundId = binary.BigEndian.Uint64(nextRoundIdB) + } + return +} + +func getPriceTRStore(ctx sdk.Context, storeKey storetypes.StoreKey, tokenId int32) prefix.Store { + store := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(types.PricesKeyPrefix)) + return prefix.NewStore(store, types.PricesKey(tokenId)) +} + +//TODO: Get(tokenId, roundId), GetLatestRound(tokenId), remove is not cared for now diff --git a/x/oracle/types/key_prices.go b/x/oracle/types/key_prices.go index 33e03b493..dc4f37718 100644 --- a/x/oracle/types/key_prices.go +++ b/x/oracle/types/key_prices.go @@ -9,7 +9,11 @@ const ( PricesKeyPrefix = "Prices/value/" ) +// PricesNextRoundIdKey is the key set for each tokenId storeKV to store the next round id +var PricesNextRountIdKey = []byte("tokenId/") + // PricesKey returns the store key to retrieve a Prices from the index fields +// this key is actually used as the prefix for kvsotre, TODO: refactor to PriceTokenPrefix func PricesKey( tokenId int32, ) []byte { @@ -22,3 +26,10 @@ func PricesKey( return key } + +// PricesRoundKey returns the store key to retrieve a PriceWithTimeAndRound from the index fields +func PricesRoundKey( + roundId uint64, +) []byte { + return append(Uint64Bytes(roundId), []byte("/")...) +} diff --git a/x/oracle/types/prices.pb.go b/x/oracle/types/prices.pb.go index 90a31939b..ee1256037 100644 --- a/x/oracle/types/prices.pb.go +++ b/x/oracle/types/prices.pb.go @@ -24,7 +24,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Prices struct { TokenId int32 `protobuf:"varint,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` - NextRountId int64 `protobuf:"varint,2,opt,name=next_rount_id,json=nextRountId,proto3" json:"next_rount_id,omitempty"` + NextRountId uint64 `protobuf:"varint,2,opt,name=next_rount_id,json=nextRountId,proto3" json:"next_rount_id,omitempty"` PriceList []*PriceWithTimeAndRound `protobuf:"bytes,3,rep,name=price_list,json=priceList,proto3" json:"price_list,omitempty"` } @@ -68,7 +68,7 @@ func (m *Prices) GetTokenId() int32 { return 0 } -func (m *Prices) GetNextRountId() int64 { +func (m *Prices) GetNextRountId() uint64 { if m != nil { return m.NextRountId } @@ -96,7 +96,7 @@ var fileDescriptor_50cc9ccc8f92b87a = []byte{ 0xb0, 0x29, 0x86, 0xa8, 0x55, 0xea, 0x65, 0xe4, 0x62, 0x0b, 0x00, 0x6b, 0x16, 0x92, 0xe4, 0xe2, 0x28, 0xc9, 0xcf, 0x4e, 0xcd, 0x8b, 0xcf, 0x4c, 0x91, 0x60, 0x54, 0x60, 0xd4, 0x60, 0x0d, 0x62, 0x07, 0xf3, 0x3d, 0x53, 0x84, 0x94, 0xb8, 0x78, 0xf3, 0x52, 0x2b, 0x4a, 0xe2, 0x8b, 0xf2, 0x4b, - 0xf3, 0x4a, 0x40, 0xf2, 0x4c, 0x0a, 0x8c, 0x1a, 0xcc, 0x41, 0xdc, 0x20, 0xc1, 0x20, 0x90, 0x98, + 0xf3, 0x4a, 0x40, 0xf2, 0x4c, 0x0a, 0x8c, 0x1a, 0x2c, 0x41, 0xdc, 0x20, 0xc1, 0x20, 0x90, 0x98, 0x67, 0x8a, 0x90, 0x0b, 0x17, 0x17, 0xd8, 0xe0, 0xf8, 0x9c, 0xcc, 0xe2, 0x12, 0x09, 0x66, 0x05, 0x66, 0x0d, 0x6e, 0x23, 0x55, 0x3d, 0x54, 0xa7, 0xe8, 0x81, 0xad, 0x0a, 0xcf, 0x2c, 0xc9, 0x08, 0xc9, 0xcc, 0x4d, 0x75, 0xcc, 0x4b, 0x01, 0x69, 0x4e, 0x09, 0xe2, 0x04, 0x6b, 0xf4, 0xc9, 0x2c, @@ -104,7 +104,7 @@ var fileDescriptor_50cc9ccc8f92b87a = []byte{ 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x83, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x57, 0x88, 0xa9, 0x7e, 0xa9, 0x25, 0xe5, 0xf9, 0x45, 0xd9, 0xfa, 0x30, 0xff, 0x55, 0xc0, 0x7c, 0x58, 0x52, 0x59, 0x90, 0x5a, 0x9c, - 0xc4, 0x06, 0xf6, 0xa2, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x79, 0xc5, 0x26, 0xec, 0x2d, 0x01, + 0xc4, 0x06, 0xf6, 0xa2, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x4f, 0x26, 0xa8, 0xb4, 0x2d, 0x01, 0x00, 0x00, } @@ -255,7 +255,7 @@ func (m *Prices) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NextRountId |= int64(b&0x7F) << shift + m.NextRountId |= uint64(b&0x7F) << shift if b < 0x80 { break } diff --git a/x/oracle/types/types.go b/x/oracle/types/types.go index ab1254f4c..a99349471 100644 --- a/x/oracle/types/types.go +++ b/x/oracle/types/types.go @@ -1 +1,9 @@ package types + +import "encoding/binary" + +func Uint64Bytes(value uint64) []byte { + valueBytes := make([]byte, 8) + binary.BigEndian.PutUint64(valueBytes, value) + return valueBytes +} From cba6cb1163afb8748571ce00a654c48b8dcbfcca Mon Sep 17 00:00:00 2001 From: leonz789 Date: Mon, 26 Feb 2024 08:32:22 +0800 Subject: [PATCH 10/37] feat(oracle-proto):add roundInfo state for aggregator --- proto/exocore/oracle/genesis.proto | 3 + proto/exocore/oracle/query.proto | 28 + proto/exocore/oracle/round_info.proto | 14 + x/oracle/client/cli/query.go | 2 + x/oracle/client/cli/query_round_info.go | 82 ++ x/oracle/client/cli/query_round_info_test.go | 160 +++ x/oracle/genesis.go | 5 + x/oracle/genesis_test.go | 9 + x/oracle/keeper/query_round_info.go | 57 + x/oracle/keeper/query_round_info_test.go | 127 +++ x/oracle/keeper/round_info.go | 63 + x/oracle/keeper/round_info_test.go | 63 + x/oracle/types/genesis.go | 13 +- x/oracle/types/genesis.pb.go | 89 +- x/oracle/types/genesis_test.go | 22 + x/oracle/types/key_round_info.go | 24 + x/oracle/types/query.pb.go | 1076 ++++++++++++++++-- x/oracle/types/query.pb.gw.go | 184 +++ x/oracle/types/round_info.pb.go | 444 ++++++++ 19 files changed, 2328 insertions(+), 137 deletions(-) create mode 100644 proto/exocore/oracle/round_info.proto create mode 100644 x/oracle/client/cli/query_round_info.go create mode 100644 x/oracle/client/cli/query_round_info_test.go create mode 100644 x/oracle/keeper/query_round_info.go create mode 100644 x/oracle/keeper/query_round_info_test.go create mode 100644 x/oracle/keeper/round_info.go create mode 100644 x/oracle/keeper/round_info_test.go create mode 100644 x/oracle/types/key_round_info.go create mode 100644 x/oracle/types/round_info.pb.go diff --git a/proto/exocore/oracle/genesis.proto b/proto/exocore/oracle/genesis.proto index f66ef07a8..3fda782d9 100644 --- a/proto/exocore/oracle/genesis.proto +++ b/proto/exocore/oracle/genesis.proto @@ -5,6 +5,7 @@ package exocore.oracle; import "gogoproto/gogo.proto"; import "exocore/oracle/params.proto"; import "exocore/oracle/prices.proto"; +import "exocore/oracle/round_info.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; @@ -12,6 +13,8 @@ option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; repeated Prices pricesList = 2 [(gogoproto.nullable) = false]; + //TODO: userDefinedTokenFeeder + repeated RoundInfo roundInfoList = 3 [(gogoproto.nullable) = false]; } diff --git a/proto/exocore/oracle/query.proto b/proto/exocore/oracle/query.proto index 0a0f1fd78..c2e36e1dd 100644 --- a/proto/exocore/oracle/query.proto +++ b/proto/exocore/oracle/query.proto @@ -7,6 +7,7 @@ import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "exocore/oracle/params.proto"; import "exocore/oracle/prices.proto"; +import "exocore/oracle/round_info.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; @@ -28,6 +29,16 @@ service Query { option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/prices"; } + + // Queries a list of RoundInfo items. + rpc RoundInfo (QueryGetRoundInfoRequest) returns (QueryGetRoundInfoResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/round_info/{tokenId}"; + + } + rpc RoundInfoAll (QueryAllRoundInfoRequest) returns (QueryAllRoundInfoResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/round_info"; + + } } // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} @@ -56,3 +67,20 @@ message QueryAllPricesResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +message QueryGetRoundInfoRequest { + int32 tokenId = 1; +} + +message QueryGetRoundInfoResponse { + RoundInfo roundInfo = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllRoundInfoRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllRoundInfoResponse { + repeated RoundInfo roundInfo = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + diff --git a/proto/exocore/oracle/round_info.proto b/proto/exocore/oracle/round_info.proto new file mode 100644 index 000000000..1307d9cb1 --- /dev/null +++ b/proto/exocore/oracle/round_info.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package exocore.oracle; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message RoundInfo { + int32 token_id = 1; + uint64 based_block = 2; + uint64 nexit_roundId = 3; + int32 feeder_id = 4; + int32 status = 5; + +} + diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go index 8b27813af..64bfa6a68 100644 --- a/x/oracle/client/cli/query.go +++ b/x/oracle/client/cli/query.go @@ -27,6 +27,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryParams()) cmd.AddCommand(CmdListPrices()) cmd.AddCommand(CmdShowPrices()) + cmd.AddCommand(CmdListRoundInfo()) + cmd.AddCommand(CmdShowRoundInfo()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/oracle/client/cli/query_round_info.go b/x/oracle/client/cli/query_round_info.go new file mode 100644 index 000000000..9c4e223e8 --- /dev/null +++ b/x/oracle/client/cli/query_round_info.go @@ -0,0 +1,82 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/spf13/cast" +) + +func CmdListRoundInfo() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-round-info", + Short: "list all round-info", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllRoundInfoRequest{ + Pagination: pageReq, + } + + res, err := queryClient.RoundInfoAll(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowRoundInfo() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-round-info [token-id]", + Short: "shows a round-info", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + argTokenId, err := cast.ToInt32E(args[0]) + if err != nil { + return err + } + + params := &types.QueryGetRoundInfoRequest{ + TokenId: argTokenId, + } + + res, err := queryClient.RoundInfo(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_round_info_test.go b/x/oracle/client/cli/query_round_info_test.go new file mode 100644 index 000000000..df27b1262 --- /dev/null +++ b/x/oracle/client/cli/query_round_info_test.go @@ -0,0 +1,160 @@ +package cli_test + +import ( + "fmt" + "strconv" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func networkWithRoundInfoObjects(t *testing.T, n int) (*network.Network, []types.RoundInfo) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + for i := 0; i < n; i++ { + roundInfo := types.RoundInfo{ + TokenId: int32(i), + } + nullify.Fill(&roundInfo) + state.RoundInfoList = append(state.RoundInfoList, roundInfo) + } + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.RoundInfoList +} + +func TestShowRoundInfo(t *testing.T) { + net, objs := networkWithRoundInfoObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + idTokenId int32 + + args []string + err error + obj types.RoundInfo + }{ + { + desc: "found", + idTokenId: objs[0].TokenId, + + args: common, + obj: objs[0], + }, + { + desc: "not found", + idTokenId: 100000, + + args: common, + err: status.Error(codes.NotFound, "not found"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + args := []string{ + strconv.Itoa(int(tc.idTokenId)), + } + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowRoundInfo(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetRoundInfoResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.RoundInfo) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.RoundInfo), + ) + } + }) + } +} + +func TestListRoundInfo(t *testing.T) { + net, objs := networkWithRoundInfoObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(objs); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRoundInfo(), args) + require.NoError(t, err) + var resp types.QueryAllRoundInfoResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.RoundInfo), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.RoundInfo), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRoundInfo(), args) + require.NoError(t, err) + var resp types.QueryAllRoundInfoResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.RoundInfo), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.RoundInfo), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(objs)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRoundInfo(), args) + require.NoError(t, err) + var resp types.QueryAllRoundInfoResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(objs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(objs), + nullify.Fill(resp.RoundInfo), + ) + }) +} diff --git a/x/oracle/genesis.go b/x/oracle/genesis.go index 4da2af620..64b3aff2d 100644 --- a/x/oracle/genesis.go +++ b/x/oracle/genesis.go @@ -12,6 +12,10 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) for _, elem := range genState.PricesList { k.SetPrices(ctx, elem) } + // Set all the roundInfo + for _, elem := range genState.RoundInfoList { + k.SetRoundInfo(ctx, elem) + } // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, genState.Params) } @@ -22,6 +26,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.Params = k.GetParams(ctx) genesis.PricesList = k.GetAllPrices(ctx) + genesis.RoundInfoList = k.GetAllRoundInfo(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/oracle/genesis_test.go b/x/oracle/genesis_test.go index 442d83398..8e4a8e0e5 100644 --- a/x/oracle/genesis_test.go +++ b/x/oracle/genesis_test.go @@ -22,6 +22,14 @@ func TestGenesis(t *testing.T) { TokenId: 1, }, }, + RoundInfoList: []types.RoundInfo{ + { + TokenId: 0, + }, + { + TokenId: 1, + }, + }, // this line is used by starport scaffolding # genesis/test/state } @@ -34,5 +42,6 @@ func TestGenesis(t *testing.T) { nullify.Fill(got) require.ElementsMatch(t, genesisState.PricesList, got.PricesList) + require.ElementsMatch(t, genesisState.RoundInfoList, got.RoundInfoList) // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/oracle/keeper/query_round_info.go b/x/oracle/keeper/query_round_info.go new file mode 100644 index 000000000..4d8f6bdb0 --- /dev/null +++ b/x/oracle/keeper/query_round_info.go @@ -0,0 +1,57 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) RoundInfoAll(goCtx context.Context, req *types.QueryAllRoundInfoRequest) (*types.QueryAllRoundInfoResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var roundInfos []types.RoundInfo + ctx := sdk.UnwrapSDKContext(goCtx) + + store := ctx.KVStore(k.storeKey) + roundInfoStore := prefix.NewStore(store, types.KeyPrefix(types.RoundInfoKeyPrefix)) + + pageRes, err := query.Paginate(roundInfoStore, req.Pagination, func(key []byte, value []byte) error { + var roundInfo types.RoundInfo + if err := k.cdc.Unmarshal(value, &roundInfo); err != nil { + return err + } + + roundInfos = append(roundInfos, roundInfo) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllRoundInfoResponse{RoundInfo: roundInfos, Pagination: pageRes}, nil +} + +func (k Keeper) RoundInfo(goCtx context.Context, req *types.QueryGetRoundInfoRequest) (*types.QueryGetRoundInfoResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetRoundInfo( + ctx, + req.TokenId, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetRoundInfoResponse{RoundInfo: val}, nil +} diff --git a/x/oracle/keeper/query_round_info_test.go b/x/oracle/keeper/query_round_info_test.go new file mode 100644 index 000000000..58c14a6b5 --- /dev/null +++ b/x/oracle/keeper/query_round_info_test.go @@ -0,0 +1,127 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestRoundInfoQuerySingle(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNRoundInfo(keeper, ctx, 2) + tests := []struct { + desc string + request *types.QueryGetRoundInfoRequest + response *types.QueryGetRoundInfoResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetRoundInfoRequest{ + TokenId: msgs[0].TokenId, + }, + response: &types.QueryGetRoundInfoResponse{RoundInfo: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetRoundInfoRequest{ + TokenId: msgs[1].TokenId, + }, + response: &types.QueryGetRoundInfoResponse{RoundInfo: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetRoundInfoRequest{ + TokenId: 100000, + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.RoundInfo(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} + +func TestRoundInfoQueryPaginated(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNRoundInfo(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllRoundInfoRequest { + return &types.QueryAllRoundInfoRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := keeper.RoundInfoAll(wctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.RoundInfo), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.RoundInfo), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.RoundInfoAll(wctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.RoundInfo), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.RoundInfo), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.RoundInfoAll(wctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(msgs), + nullify.Fill(resp.RoundInfo), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.RoundInfoAll(wctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/oracle/keeper/round_info.go b/x/oracle/keeper/round_info.go new file mode 100644 index 000000000..ca9dc27da --- /dev/null +++ b/x/oracle/keeper/round_info.go @@ -0,0 +1,63 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetRoundInfo set a specific roundInfo in the store from its index +func (k Keeper) SetRoundInfo(ctx sdk.Context, roundInfo types.RoundInfo) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundInfoKeyPrefix)) + b := k.cdc.MustMarshal(&roundInfo) + store.Set(types.RoundInfoKey( + roundInfo.TokenId, + ), b) +} + +// GetRoundInfo returns a roundInfo from its index +func (k Keeper) GetRoundInfo( + ctx sdk.Context, + tokenId int32, + +) (val types.RoundInfo, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundInfoKeyPrefix)) + + b := store.Get(types.RoundInfoKey( + tokenId, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveRoundInfo removes a roundInfo from the store +func (k Keeper) RemoveRoundInfo( + ctx sdk.Context, + tokenId int32, + +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundInfoKeyPrefix)) + store.Delete(types.RoundInfoKey( + tokenId, + )) +} + +// GetAllRoundInfo returns all roundInfo +func (k Keeper) GetAllRoundInfo(ctx sdk.Context) (list []types.RoundInfo) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundInfoKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.RoundInfo + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/oracle/keeper/round_info_test.go b/x/oracle/keeper/round_info_test.go new file mode 100644 index 000000000..7df55edc9 --- /dev/null +++ b/x/oracle/keeper/round_info_test.go @@ -0,0 +1,63 @@ +package keeper_test + +import ( + "strconv" + "testing" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNRoundInfo(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.RoundInfo { + items := make([]types.RoundInfo, n) + for i := range items { + items[i].TokenId = int32(i) + + keeper.SetRoundInfo(ctx, items[i]) + } + return items +} + +func TestRoundInfoGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRoundInfo(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetRoundInfo(ctx, + item.TokenId, + ) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) + } +} +func TestRoundInfoRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRoundInfo(keeper, ctx, 10) + for _, item := range items { + keeper.RemoveRoundInfo(ctx, + item.TokenId, + ) + _, found := keeper.GetRoundInfo(ctx, + item.TokenId, + ) + require.False(t, found) + } +} + +func TestRoundInfoGetAll(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRoundInfo(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllRoundInfo(ctx)), + ) +} diff --git a/x/oracle/types/genesis.go b/x/oracle/types/genesis.go index 325628b43..60e4cc550 100644 --- a/x/oracle/types/genesis.go +++ b/x/oracle/types/genesis.go @@ -10,7 +10,8 @@ const DefaultIndex uint64 = 1 // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - PricesList: []Prices{}, + PricesList: []Prices{}, + RoundInfoList: []RoundInfo{}, // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } @@ -29,6 +30,16 @@ func (gs GenesisState) Validate() error { } pricesIndexMap[index] = struct{}{} } + // Check for duplicated index in roundInfo + roundInfoIndexMap := make(map[string]struct{}) + + for _, elem := range gs.RoundInfoList { + index := string(RoundInfoKey(elem.TokenId)) + if _, ok := roundInfoIndexMap[index]; ok { + return fmt.Errorf("duplicated index for roundInfo") + } + roundInfoIndexMap[index] = struct{}{} + } // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go index d98939b2d..3e76b6522 100644 --- a/x/oracle/types/genesis.pb.go +++ b/x/oracle/types/genesis.pb.go @@ -27,6 +27,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` PricesList []Prices `protobuf:"bytes,2,rep,name=pricesList,proto3" json:"pricesList"` + //TODO: userDefinedTokenFeeder + RoundInfoList []RoundInfo `protobuf:"bytes,3,rep,name=roundInfoList,proto3" json:"roundInfoList"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -76,6 +78,13 @@ func (m *GenesisState) GetPricesList() []Prices { return nil } +func (m *GenesisState) GetRoundInfoList() []RoundInfo { + if m != nil { + return m.RoundInfoList + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "exocore.oracle.GenesisState") } @@ -83,22 +92,24 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/genesis.proto", fileDescriptor_dbe067676c4dc0de) } var fileDescriptor_dbe067676c4dc0de = []byte{ - // 225 bytes of a gzipped FileDescriptorProto + // 266 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xad, 0xc8, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xca, 0xea, 0x41, 0x64, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x94, 0x34, 0x9a, 0x19, - 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0xb8, 0x24, 0x8b, 0x32, 0x93, 0x53, 0xa1, 0x92, 0x4a, 0x4d, - 0x8c, 0x5c, 0x3c, 0xee, 0x10, 0x1b, 0x83, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0x4c, 0xb8, 0xd8, 0x20, - 0xba, 0x25, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0xc4, 0xf4, 0x50, 0x5d, 0xa0, 0x17, 0x00, 0x96, - 0x75, 0x62, 0x39, 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xaa, 0x56, 0xc8, 0x86, 0x8b, 0x0b, 0x62, 0xac, - 0x4f, 0x66, 0x71, 0x89, 0x04, 0x93, 0x02, 0x33, 0x56, 0x9d, 0x60, 0x15, 0x50, 0x9d, 0x48, 0xea, - 0x9d, 0xbc, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, - 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x20, 0x3d, 0xb3, - 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0xdf, 0x15, 0x62, 0x9a, 0x5f, 0x6a, 0x49, 0x79, - 0x7e, 0x51, 0xb6, 0x3e, 0xcc, 0x57, 0x15, 0x30, 0x7f, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, - 0x81, 0xfd, 0x65, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x65, 0xb2, 0x58, 0x9a, 0x57, 0x01, 0x00, - 0x00, + 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0xb8, 0x24, 0x8b, 0x32, 0x93, 0x53, 0x61, 0x92, 0xf2, 0x68, + 0x92, 0x45, 0xf9, 0xa5, 0x79, 0x29, 0xf1, 0x99, 0x79, 0x69, 0x50, 0xa3, 0x95, 0x4e, 0x32, 0x72, + 0xf1, 0xb8, 0x43, 0x9c, 0x14, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xc2, 0xc5, 0x06, 0x31, 0x5e, + 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x4c, 0x0f, 0xd5, 0x89, 0x7a, 0x01, 0x60, 0x59, 0x27, + 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xa0, 0x6a, 0x85, 0x6c, 0xb8, 0xb8, 0x20, 0xf6, 0xfa, 0x64, + 0x16, 0x97, 0x48, 0x30, 0x29, 0x30, 0x63, 0xd5, 0x09, 0x56, 0x01, 0xd5, 0x89, 0xa4, 0x5e, 0xc8, + 0x95, 0x8b, 0x17, 0xec, 0x30, 0xcf, 0xbc, 0xb4, 0x7c, 0xb0, 0x01, 0xcc, 0x60, 0x03, 0x24, 0xd1, + 0x0d, 0x08, 0x82, 0x29, 0x82, 0x9a, 0x81, 0xaa, 0xcb, 0xc9, 0xeb, 0xc4, 0x23, 0x39, 0xc6, 0x0b, + 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, + 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x0c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, + 0xf5, 0x5d, 0x21, 0x66, 0xfa, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0xeb, 0xc3, 0x02, 0xa8, 0x02, + 0x16, 0x44, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0xe0, 0x31, 0x06, 0x04, 0x00, 0x00, + 0xff, 0xff, 0xf0, 0xfc, 0xeb, 0xa7, 0xbf, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -121,6 +132,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.RoundInfoList) > 0 { + for iNdEx := len(m.RoundInfoList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RoundInfoList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } if len(m.PricesList) > 0 { for iNdEx := len(m.PricesList) - 1; iNdEx >= 0; iNdEx-- { { @@ -173,6 +198,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.RoundInfoList) > 0 { + for _, e := range m.RoundInfoList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -278,6 +309,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RoundInfoList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RoundInfoList = append(m.RoundInfoList, RoundInfo{}) + if err := m.RoundInfoList[len(m.RoundInfoList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/oracle/types/genesis_test.go b/x/oracle/types/genesis_test.go index 0fe5bfe87..8f87fff52 100644 --- a/x/oracle/types/genesis_test.go +++ b/x/oracle/types/genesis_test.go @@ -30,6 +30,14 @@ func TestGenesisState_Validate(t *testing.T) { TokenId: 1, }, }, + RoundInfoList: []types.RoundInfo{ + { + TokenId: 0, + }, + { + TokenId: 1, + }, + }, // this line is used by starport scaffolding # types/genesis/validField }, valid: true, @@ -48,6 +56,20 @@ func TestGenesisState_Validate(t *testing.T) { }, valid: false, }, + { + desc: "duplicated roundInfo", + genState: &types.GenesisState{ + RoundInfoList: []types.RoundInfo{ + { + TokenId: 0, + }, + { + TokenId: 0, + }, + }, + }, + valid: false, + }, // this line is used by starport scaffolding # types/genesis/testcase } for _, tc := range tests { diff --git a/x/oracle/types/key_round_info.go b/x/oracle/types/key_round_info.go new file mode 100644 index 000000000..a2c85055d --- /dev/null +++ b/x/oracle/types/key_round_info.go @@ -0,0 +1,24 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // RoundInfoKeyPrefix is the prefix to retrieve all RoundInfo + RoundInfoKeyPrefix = "RoundInfo/value/" +) + +// RoundInfoKey returns the store key to retrieve a RoundInfo from the index fields +func RoundInfoKey( + tokenId int32, +) []byte { + var key []byte + + tokenIdBytes := make([]byte, 4) + binary.BigEndian.PutUint32(tokenIdBytes, uint32(tokenId)) + key = append(key, tokenIdBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index 3b3f9c090..1d96e7876 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -297,6 +297,190 @@ func (m *QueryAllPricesResponse) GetPagination() *query.PageResponse { return nil } +type QueryGetRoundInfoRequest struct { + TokenId int32 `protobuf:"varint,1,opt,name=tokenId,proto3" json:"tokenId,omitempty"` +} + +func (m *QueryGetRoundInfoRequest) Reset() { *m = QueryGetRoundInfoRequest{} } +func (m *QueryGetRoundInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetRoundInfoRequest) ProtoMessage() {} +func (*QueryGetRoundInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{6} +} +func (m *QueryGetRoundInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRoundInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRoundInfoRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetRoundInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRoundInfoRequest.Merge(m, src) +} +func (m *QueryGetRoundInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRoundInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRoundInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRoundInfoRequest proto.InternalMessageInfo + +func (m *QueryGetRoundInfoRequest) GetTokenId() int32 { + if m != nil { + return m.TokenId + } + return 0 +} + +type QueryGetRoundInfoResponse struct { + RoundInfo RoundInfo `protobuf:"bytes,1,opt,name=roundInfo,proto3" json:"roundInfo"` +} + +func (m *QueryGetRoundInfoResponse) Reset() { *m = QueryGetRoundInfoResponse{} } +func (m *QueryGetRoundInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetRoundInfoResponse) ProtoMessage() {} +func (*QueryGetRoundInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{7} +} +func (m *QueryGetRoundInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRoundInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRoundInfoResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetRoundInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRoundInfoResponse.Merge(m, src) +} +func (m *QueryGetRoundInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRoundInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRoundInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRoundInfoResponse proto.InternalMessageInfo + +func (m *QueryGetRoundInfoResponse) GetRoundInfo() RoundInfo { + if m != nil { + return m.RoundInfo + } + return RoundInfo{} +} + +type QueryAllRoundInfoRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRoundInfoRequest) Reset() { *m = QueryAllRoundInfoRequest{} } +func (m *QueryAllRoundInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllRoundInfoRequest) ProtoMessage() {} +func (*QueryAllRoundInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{8} +} +func (m *QueryAllRoundInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRoundInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRoundInfoRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllRoundInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRoundInfoRequest.Merge(m, src) +} +func (m *QueryAllRoundInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRoundInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRoundInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRoundInfoRequest proto.InternalMessageInfo + +func (m *QueryAllRoundInfoRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllRoundInfoResponse struct { + RoundInfo []RoundInfo `protobuf:"bytes,1,rep,name=roundInfo,proto3" json:"roundInfo"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRoundInfoResponse) Reset() { *m = QueryAllRoundInfoResponse{} } +func (m *QueryAllRoundInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllRoundInfoResponse) ProtoMessage() {} +func (*QueryAllRoundInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{9} +} +func (m *QueryAllRoundInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRoundInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRoundInfoResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllRoundInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRoundInfoResponse.Merge(m, src) +} +func (m *QueryAllRoundInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRoundInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRoundInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRoundInfoResponse proto.InternalMessageInfo + +func (m *QueryAllRoundInfoResponse) GetRoundInfo() []RoundInfo { + if m != nil { + return m.RoundInfo + } + return nil +} + +func (m *QueryAllRoundInfoResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "exocore.oracle.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "exocore.oracle.QueryParamsResponse") @@ -304,43 +488,55 @@ func init() { proto.RegisterType((*QueryGetPricesResponse)(nil), "exocore.oracle.QueryGetPricesResponse") proto.RegisterType((*QueryAllPricesRequest)(nil), "exocore.oracle.QueryAllPricesRequest") proto.RegisterType((*QueryAllPricesResponse)(nil), "exocore.oracle.QueryAllPricesResponse") + proto.RegisterType((*QueryGetRoundInfoRequest)(nil), "exocore.oracle.QueryGetRoundInfoRequest") + proto.RegisterType((*QueryGetRoundInfoResponse)(nil), "exocore.oracle.QueryGetRoundInfoResponse") + proto.RegisterType((*QueryAllRoundInfoRequest)(nil), "exocore.oracle.QueryAllRoundInfoRequest") + proto.RegisterType((*QueryAllRoundInfoResponse)(nil), "exocore.oracle.QueryAllRoundInfoResponse") } func init() { proto.RegisterFile("exocore/oracle/query.proto", fileDescriptor_f604621c8da1a6f3) } var fileDescriptor_f604621c8da1a6f3 = []byte{ - // 481 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x41, 0x6b, 0xd4, 0x40, - 0x14, 0xc7, 0x33, 0xad, 0x5d, 0x71, 0x04, 0x0f, 0x63, 0x2d, 0x25, 0x4a, 0x94, 0x91, 0xb6, 0x22, - 0x38, 0x63, 0xaa, 0xe0, 0xb9, 0x82, 0x16, 0x15, 0xca, 0x9a, 0xa3, 0x17, 0x99, 0xc4, 0x21, 0x86, - 0x66, 0xf3, 0xd2, 0xcc, 0xac, 0xb6, 0x88, 0x20, 0xde, 0xbc, 0x15, 0x3c, 0xf8, 0x19, 0xfc, 0x26, - 0x3d, 0x16, 0xbc, 0x78, 0x12, 0xd9, 0xf5, 0x83, 0x48, 0x66, 0xa6, 0x9a, 0xa4, 0x9b, 0x6e, 0x6f, - 0x9b, 0xf9, 0xff, 0xdf, 0xff, 0xfd, 0xe6, 0xcd, 0x5b, 0xec, 0xcb, 0x7d, 0x48, 0xa0, 0x92, 0x1c, - 0x2a, 0x91, 0xe4, 0x92, 0xef, 0x8d, 0x65, 0x75, 0xc0, 0xca, 0x0a, 0x34, 0x90, 0x2b, 0x4e, 0x63, - 0x56, 0xf3, 0x97, 0x53, 0x48, 0xc1, 0x48, 0xbc, 0xfe, 0x65, 0x5d, 0xfe, 0x8d, 0x14, 0x20, 0xcd, - 0x25, 0x17, 0x65, 0xc6, 0x45, 0x51, 0x80, 0x16, 0x3a, 0x83, 0x42, 0x39, 0xf5, 0x6e, 0x02, 0x6a, - 0x04, 0x8a, 0xc7, 0x42, 0xb9, 0x70, 0xfe, 0x2e, 0x8c, 0xa5, 0x16, 0x21, 0x2f, 0x45, 0x9a, 0x15, - 0xc6, 0xec, 0xbc, 0xd7, 0x3b, 0x2c, 0xa5, 0xa8, 0xc4, 0x48, 0xf5, 0x89, 0x55, 0x96, 0x48, 0x27, - 0xd2, 0x65, 0x4c, 0x5e, 0xd6, 0xd9, 0x43, 0x53, 0x11, 0xc9, 0xbd, 0xb1, 0x54, 0x9a, 0xbe, 0xc0, - 0x57, 0x5b, 0xa7, 0xaa, 0x84, 0x42, 0x49, 0xf2, 0x10, 0x0f, 0x6c, 0xf2, 0x2a, 0xba, 0x85, 0xee, - 0x5c, 0xde, 0x5c, 0x61, 0xed, 0x7b, 0x32, 0xeb, 0x7f, 0x7c, 0xe1, 0xe8, 0xd7, 0x4d, 0x2f, 0x72, - 0x5e, 0x1a, 0xe2, 0x6b, 0x26, 0x6c, 0x5b, 0xea, 0xa1, 0x69, 0xed, 0xba, 0x90, 0x55, 0x7c, 0x51, - 0xc3, 0xae, 0x2c, 0x9e, 0xbd, 0x31, 0x79, 0x4b, 0xd1, 0xc9, 0x27, 0xdd, 0xc1, 0x2b, 0xdd, 0x92, - 0x06, 0x82, 0x39, 0xe9, 0x45, 0x30, 0xea, 0x3f, 0x04, 0xf3, 0x45, 0x5f, 0x3b, 0x84, 0xad, 0x3c, - 0x6f, 0x23, 0x3c, 0xc5, 0xf8, 0xff, 0x30, 0x5d, 0xe4, 0x3a, 0xb3, 0x93, 0x67, 0xf5, 0xe4, 0x99, - 0x7d, 0x56, 0x37, 0x79, 0x36, 0x14, 0xa9, 0x74, 0xb5, 0x51, 0xa3, 0x92, 0x7e, 0x43, 0x8e, 0xb8, - 0xd1, 0x61, 0x06, 0xf1, 0xe2, 0x79, 0x89, 0xc9, 0x76, 0x0b, 0x6c, 0xc1, 0x80, 0x6d, 0xcc, 0x05, - 0xb3, 0x2d, 0x9b, 0x64, 0x9b, 0xdf, 0x17, 0xf1, 0x92, 0x21, 0x23, 0x9f, 0x10, 0x1e, 0xd8, 0x07, - 0x22, 0xb4, 0xcb, 0x70, 0x7a, 0x07, 0xfc, 0xdb, 0x67, 0x7a, 0x6c, 0x27, 0x7a, 0xef, 0xf3, 0x8f, - 0x3f, 0x5f, 0x17, 0x36, 0xc8, 0x1a, 0x7f, 0x62, 0xcd, 0x3b, 0x52, 0xbf, 0x87, 0x6a, 0x97, 0xcf, - 0x5c, 0x48, 0x72, 0x58, 0x23, 0xd8, 0x0b, 0xae, 0xcd, 0x8c, 0xef, 0xee, 0x88, 0xbf, 0x3e, 0xcf, - 0xe6, 0x40, 0x1e, 0x19, 0x90, 0x90, 0xf0, 0x79, 0x20, 0xa6, 0x8c, 0x7f, 0x70, 0x9b, 0xf6, 0x91, - 0x7c, 0x41, 0xf8, 0x92, 0xcd, 0xda, 0xca, 0xf3, 0x1e, 0xaa, 0xee, 0xda, 0xf4, 0x50, 0x9d, 0x7a, - 0xfb, 0xf3, 0x8f, 0xc7, 0xae, 0xc0, 0xf3, 0xa3, 0x49, 0x80, 0x8e, 0x27, 0x01, 0xfa, 0x3d, 0x09, - 0xd0, 0xe1, 0x34, 0xf0, 0x8e, 0xa7, 0x81, 0xf7, 0x73, 0x1a, 0x78, 0xaf, 0xee, 0xa7, 0x99, 0x7e, - 0x3b, 0x8e, 0x59, 0x02, 0xa3, 0xbe, 0xa8, 0xfd, 0x93, 0x30, 0x7d, 0x50, 0x4a, 0x15, 0x0f, 0xcc, - 0xff, 0xfb, 0xc1, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x80, 0x04, 0x70, 0x59, 0xa7, 0x04, 0x00, - 0x00, + // 620 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xcf, 0x6b, 0x13, 0x41, + 0x14, 0xc7, 0x33, 0xad, 0x89, 0x64, 0x14, 0x0f, 0x63, 0x2d, 0xe9, 0x2a, 0x5b, 0x59, 0x69, 0x9b, + 0x2a, 0xee, 0x98, 0xb6, 0xe2, 0x41, 0x3c, 0xa4, 0xa0, 0xa5, 0x0a, 0x25, 0xe6, 0xd8, 0x4b, 0xd9, + 0xa4, 0xd3, 0x75, 0xe9, 0x66, 0x67, 0xbb, 0x3b, 0xd1, 0x16, 0x11, 0xc4, 0x9b, 0xb7, 0x82, 0xa0, + 0x27, 0x4f, 0xfe, 0x33, 0x3d, 0x16, 0xbc, 0x78, 0x12, 0x49, 0xfc, 0x43, 0x64, 0x67, 0x5e, 0x7e, + 0xec, 0x66, 0xd7, 0x6c, 0xa1, 0xb7, 0xec, 0xbc, 0xf7, 0xbe, 0xef, 0xf3, 0xde, 0x9b, 0x37, 0xc1, + 0x1a, 0x3b, 0xe6, 0x6d, 0x1e, 0x30, 0xca, 0x03, 0xab, 0xed, 0x32, 0x7a, 0xd4, 0x65, 0xc1, 0x89, + 0xe9, 0x07, 0x5c, 0x70, 0x72, 0x03, 0x6c, 0xa6, 0xb2, 0x69, 0x73, 0x36, 0xb7, 0xb9, 0x34, 0xd1, + 0xe8, 0x97, 0xf2, 0xd2, 0xee, 0xd8, 0x9c, 0xdb, 0x2e, 0xa3, 0x96, 0xef, 0x50, 0xcb, 0xf3, 0xb8, + 0xb0, 0x84, 0xc3, 0xbd, 0x10, 0xac, 0xf7, 0xdb, 0x3c, 0xec, 0xf0, 0x90, 0xb6, 0xac, 0x10, 0xc4, + 0xe9, 0xdb, 0x5a, 0x8b, 0x09, 0xab, 0x46, 0x7d, 0xcb, 0x76, 0x3c, 0xe9, 0x0c, 0xbe, 0xb7, 0x13, + 0x2c, 0xbe, 0x15, 0x58, 0x9d, 0x30, 0xcb, 0x18, 0x38, 0x6d, 0x36, 0x30, 0x2e, 0x26, 0x8c, 0x01, + 0xef, 0x7a, 0xfb, 0x7b, 0x8e, 0x77, 0x00, 0x90, 0xc6, 0x1c, 0x26, 0xaf, 0xa3, 0xe4, 0x0d, 0x29, + 0xd9, 0x64, 0x47, 0x5d, 0x16, 0x0a, 0xe3, 0x15, 0xbe, 0x19, 0x3b, 0x0d, 0x7d, 0xee, 0x85, 0x8c, + 0x6c, 0xe0, 0x92, 0x4a, 0x5d, 0x41, 0x77, 0x51, 0xf5, 0xda, 0xda, 0xbc, 0x19, 0x6f, 0x84, 0xa9, + 0xfc, 0x37, 0xaf, 0x9c, 0xfd, 0x5e, 0x2c, 0x34, 0xc1, 0xd7, 0xa8, 0xe1, 0x5b, 0x52, 0x6c, 0x8b, + 0x89, 0x86, 0x64, 0x83, 0x2c, 0xa4, 0x82, 0xaf, 0x0a, 0x7e, 0xc8, 0xbc, 0xed, 0x7d, 0xa9, 0x57, + 0x6c, 0x0e, 0x3e, 0x8d, 0x1d, 0x3c, 0x9f, 0x0c, 0x19, 0x43, 0x90, 0x27, 0x99, 0x08, 0xd2, 0x3a, + 0x44, 0x90, 0x5f, 0xc6, 0x1e, 0x20, 0xd4, 0x5d, 0x37, 0x8e, 0xf0, 0x02, 0xe3, 0x51, 0xb7, 0x41, + 0x72, 0xd9, 0x54, 0xa3, 0x31, 0xa3, 0xd1, 0x98, 0x6a, 0xee, 0x30, 0x1a, 0xb3, 0x61, 0xd9, 0x0c, + 0x62, 0x9b, 0x63, 0x91, 0xc6, 0x37, 0x04, 0xc4, 0x63, 0x19, 0x52, 0x88, 0x67, 0xf3, 0x12, 0x93, + 0xad, 0x18, 0xd8, 0x8c, 0x04, 0x5b, 0x99, 0x0a, 0xa6, 0x52, 0xc6, 0xc8, 0x36, 0x70, 0x65, 0xd0, + 0xca, 0x66, 0x34, 0xfc, 0x6d, 0xef, 0x80, 0x4f, 0x1f, 0xc0, 0x2e, 0x5e, 0x48, 0x89, 0x82, 0x8a, + 0x9e, 0xe1, 0x72, 0x30, 0x38, 0x84, 0x9e, 0x2d, 0x24, 0x8b, 0x1a, 0x46, 0x41, 0x5d, 0xa3, 0x08, + 0xa3, 0x05, 0x44, 0x75, 0xd7, 0x9d, 0x20, 0xba, 0xac, 0x79, 0xfc, 0x40, 0x50, 0x40, 0x3c, 0x49, + 0x7a, 0x01, 0xb3, 0x17, 0x2b, 0xe0, 0xd2, 0x66, 0xb3, 0xd6, 0x2b, 0xe2, 0xa2, 0xa4, 0x24, 0x1f, + 0x11, 0x2e, 0xa9, 0xe5, 0x21, 0x46, 0x92, 0x64, 0x72, 0x3f, 0xb5, 0x7b, 0xff, 0xf5, 0x51, 0x99, + 0x8c, 0x87, 0x9f, 0x7e, 0xfe, 0xfd, 0x32, 0xb3, 0x42, 0x96, 0xe8, 0x73, 0xe5, 0xbc, 0xc3, 0xc4, + 0x3b, 0x1e, 0x1c, 0xd2, 0xd4, 0xd7, 0x84, 0x9c, 0x46, 0x08, 0xea, 0xf2, 0x2d, 0xa5, 0xca, 0x27, + 0xf7, 0x57, 0x5b, 0x9e, 0xe6, 0x06, 0x20, 0x4f, 0x24, 0x48, 0x8d, 0xd0, 0x69, 0x20, 0x32, 0x8c, + 0xbe, 0x87, 0x4b, 0xf8, 0x81, 0x7c, 0x46, 0xb8, 0xac, 0xb4, 0xea, 0xae, 0x9b, 0x41, 0x95, 0x5c, + 0xe9, 0x0c, 0xaa, 0x89, 0xbd, 0xcc, 0xdf, 0x1e, 0xd5, 0x93, 0xef, 0x08, 0x97, 0x87, 0x77, 0x82, + 0x54, 0xb3, 0x4a, 0x4f, 0xde, 0x68, 0x6d, 0x35, 0x87, 0x27, 0x10, 0x3d, 0x95, 0x44, 0x8f, 0xc9, + 0xfa, 0x14, 0xa2, 0xd1, 0x23, 0x3e, 0xd6, 0xab, 0xaf, 0x08, 0x5f, 0x1f, 0x4a, 0x46, 0xed, 0xaa, + 0x66, 0xf5, 0x21, 0x27, 0x62, 0xda, 0xe6, 0x18, 0x35, 0x89, 0xf8, 0x80, 0xac, 0xe6, 0x46, 0xdc, + 0x7c, 0x79, 0xd6, 0xd3, 0xd1, 0x79, 0x4f, 0x47, 0x7f, 0x7a, 0x3a, 0x3a, 0xed, 0xeb, 0x85, 0xf3, + 0xbe, 0x5e, 0xf8, 0xd5, 0xd7, 0x0b, 0xbb, 0x8f, 0x6c, 0x47, 0xbc, 0xe9, 0xb6, 0xcc, 0x36, 0xef, + 0x64, 0xc9, 0x1d, 0x0f, 0x04, 0xc5, 0x89, 0xcf, 0xc2, 0x56, 0x49, 0xfe, 0x69, 0xad, 0xff, 0x0b, + 0x00, 0x00, 0xff, 0xff, 0xb9, 0xf1, 0x73, 0x69, 0x9d, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -360,6 +556,9 @@ type QueryClient interface { // Queries a list of Prices items. Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) PricesAll(ctx context.Context, in *QueryAllPricesRequest, opts ...grpc.CallOption) (*QueryAllPricesResponse, error) + // Queries a list of RoundInfo items. + RoundInfo(ctx context.Context, in *QueryGetRoundInfoRequest, opts ...grpc.CallOption) (*QueryGetRoundInfoResponse, error) + RoundInfoAll(ctx context.Context, in *QueryAllRoundInfoRequest, opts ...grpc.CallOption) (*QueryAllRoundInfoResponse, error) } type queryClient struct { @@ -397,6 +596,24 @@ func (c *queryClient) PricesAll(ctx context.Context, in *QueryAllPricesRequest, return out, nil } +func (c *queryClient) RoundInfo(ctx context.Context, in *QueryGetRoundInfoRequest, opts ...grpc.CallOption) (*QueryGetRoundInfoResponse, error) { + out := new(QueryGetRoundInfoResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RoundInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RoundInfoAll(ctx context.Context, in *QueryAllRoundInfoRequest, opts ...grpc.CallOption) (*QueryAllRoundInfoResponse, error) { + out := new(QueryAllRoundInfoResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RoundInfoAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -404,6 +621,9 @@ type QueryServer interface { // Queries a list of Prices items. Prices(context.Context, *QueryGetPricesRequest) (*QueryGetPricesResponse, error) PricesAll(context.Context, *QueryAllPricesRequest) (*QueryAllPricesResponse, error) + // Queries a list of RoundInfo items. + RoundInfo(context.Context, *QueryGetRoundInfoRequest) (*QueryGetRoundInfoResponse, error) + RoundInfoAll(context.Context, *QueryAllRoundInfoRequest) (*QueryAllRoundInfoResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -419,6 +639,12 @@ func (*UnimplementedQueryServer) Prices(ctx context.Context, req *QueryGetPrices func (*UnimplementedQueryServer) PricesAll(ctx context.Context, req *QueryAllPricesRequest) (*QueryAllPricesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PricesAll not implemented") } +func (*UnimplementedQueryServer) RoundInfo(ctx context.Context, req *QueryGetRoundInfoRequest) (*QueryGetRoundInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RoundInfo not implemented") +} +func (*UnimplementedQueryServer) RoundInfoAll(ctx context.Context, req *QueryAllRoundInfoRequest) (*QueryAllRoundInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RoundInfoAll not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -478,6 +704,42 @@ func _Query_PricesAll_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Query_RoundInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetRoundInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RoundInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/RoundInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RoundInfo(ctx, req.(*QueryGetRoundInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RoundInfoAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllRoundInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RoundInfoAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/RoundInfoAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RoundInfoAll(ctx, req.(*QueryAllRoundInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "exocore.oracle.Query", HandlerType: (*QueryServer)(nil), @@ -494,6 +756,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "PricesAll", Handler: _Query_PricesAll_Handler, }, + { + MethodName: "RoundInfo", + Handler: _Query_RoundInfo_Handler, + }, + { + MethodName: "RoundInfoAll", + Handler: _Query_RoundInfoAll_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "exocore/oracle/query.proto", @@ -700,99 +970,584 @@ func (m *QueryAllPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *QueryGetRoundInfoRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } + +func (m *QueryGetRoundInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRoundInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + if m.TokenId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.TokenId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryGetRoundInfoResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *QueryGetRoundInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRoundInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n + { + size, err := m.RoundInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *QueryGetPricesRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryAllRoundInfoRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *QueryAllRoundInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRoundInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.TokenId != 0 { - n += 1 + sovQuery(uint64(m.TokenId)) + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryGetPricesResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryAllRoundInfoResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllRoundInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRoundInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.RoundInfo) > 0 { + for iNdEx := len(m.RoundInfo) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RoundInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetPricesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovQuery(uint64(m.TokenId)) + } + return n +} + +func (m *QueryGetPricesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Prices.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllPricesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllPricesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Prices) > 0 { + for _, e := range m.Prices { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetRoundInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovQuery(uint64(m.TokenId)) + } + return n +} + +func (m *QueryGetRoundInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.RoundInfo.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllRoundInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllRoundInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RoundInfo) > 0 { + for _, e := range m.RoundInfo { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetPricesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + } + m.TokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TokenId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } - var l int - _ = l - l = m.Prices.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} -func (m *QueryAllPricesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if iNdEx > l { + return io.ErrUnexpectedEOF } - return n + return nil } - -func (m *QueryAllPricesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Prices) > 0 { - for _, e := range m.Prices { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) +func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetPricesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Prices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -815,12 +1570,48 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllPricesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -842,7 +1633,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -865,15 +1656,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllPricesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -900,7 +1691,44 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Prices = append(m.Prices, Prices{}) + if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -925,7 +1753,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetRoundInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -948,10 +1776,10 @@ func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetPricesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRoundInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRoundInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -994,7 +1822,7 @@ func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetRoundInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1017,15 +1845,15 @@ func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetPricesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRoundInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRoundInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RoundInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1052,7 +1880,7 @@ func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Prices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RoundInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1077,7 +1905,7 @@ func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllRoundInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1100,10 +1928,10 @@ func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllPricesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllRoundInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllRoundInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1163,7 +1991,7 @@ func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllRoundInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1186,15 +2014,15 @@ func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllPricesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllRoundInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllRoundInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RoundInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1221,8 +2049,8 @@ func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Prices = append(m.Prices, Prices{}) - if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.RoundInfo = append(m.RoundInfo, RoundInfo{}) + if err := m.RoundInfo[len(m.RoundInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index 872eb9da9..6820dfc5b 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -141,6 +141,96 @@ func local_request_Query_PricesAll_0(ctx context.Context, marshaler runtime.Mars } +func request_Query_RoundInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRoundInfoRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tokenId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tokenId") + } + + protoReq.TokenId, err = runtime.Int32(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tokenId", err) + } + + msg, err := client.RoundInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RoundInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRoundInfoRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tokenId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tokenId") + } + + protoReq.TokenId, err = runtime.Int32(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tokenId", err) + } + + msg, err := server.RoundInfo(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_RoundInfoAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_RoundInfoAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRoundInfoRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RoundInfoAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RoundInfoAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RoundInfoAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRoundInfoRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RoundInfoAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RoundInfoAll(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -216,6 +306,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_RoundInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RoundInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RoundInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RoundInfoAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RoundInfoAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RoundInfoAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -317,6 +453,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_RoundInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RoundInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RoundInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RoundInfoAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RoundInfoAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RoundInfoAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -326,6 +502,10 @@ var ( pattern_Query_Prices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "prices", "tokenId"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_PricesAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "prices"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RoundInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "round_info", "tokenId"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RoundInfoAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "round_info"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -334,4 +514,8 @@ var ( forward_Query_Prices_0 = runtime.ForwardResponseMessage forward_Query_PricesAll_0 = runtime.ForwardResponseMessage + + forward_Query_RoundInfo_0 = runtime.ForwardResponseMessage + + forward_Query_RoundInfoAll_0 = runtime.ForwardResponseMessage ) diff --git a/x/oracle/types/round_info.pb.go b/x/oracle/types/round_info.pb.go new file mode 100644 index 000000000..239722e5b --- /dev/null +++ b/x/oracle/types/round_info.pb.go @@ -0,0 +1,444 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/round_info.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type RoundInfo struct { + TokenId int32 `protobuf:"varint,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` + BasedBlock uint64 `protobuf:"varint,2,opt,name=based_block,json=basedBlock,proto3" json:"based_block,omitempty"` + NexitRoundId uint64 `protobuf:"varint,3,opt,name=nexit_roundId,json=nexitRoundId,proto3" json:"nexit_roundId,omitempty"` + FeederId int32 `protobuf:"varint,4,opt,name=feeder_id,json=feederId,proto3" json:"feeder_id,omitempty"` + Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` +} + +func (m *RoundInfo) Reset() { *m = RoundInfo{} } +func (m *RoundInfo) String() string { return proto.CompactTextString(m) } +func (*RoundInfo) ProtoMessage() {} +func (*RoundInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_1bbd3567e4c61954, []int{0} +} +func (m *RoundInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RoundInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RoundInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RoundInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_RoundInfo.Merge(m, src) +} +func (m *RoundInfo) XXX_Size() int { + return m.Size() +} +func (m *RoundInfo) XXX_DiscardUnknown() { + xxx_messageInfo_RoundInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_RoundInfo proto.InternalMessageInfo + +func (m *RoundInfo) GetTokenId() int32 { + if m != nil { + return m.TokenId + } + return 0 +} + +func (m *RoundInfo) GetBasedBlock() uint64 { + if m != nil { + return m.BasedBlock + } + return 0 +} + +func (m *RoundInfo) GetNexitRoundId() uint64 { + if m != nil { + return m.NexitRoundId + } + return 0 +} + +func (m *RoundInfo) GetFeederId() int32 { + if m != nil { + return m.FeederId + } + return 0 +} + +func (m *RoundInfo) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + +func init() { + proto.RegisterType((*RoundInfo)(nil), "exocore.oracle.RoundInfo") +} + +func init() { proto.RegisterFile("exocore/oracle/round_info.proto", fileDescriptor_1bbd3567e4c61954) } + +var fileDescriptor_1bbd3567e4c61954 = []byte{ + // 254 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x90, 0x3f, 0x4e, 0xc3, 0x30, + 0x14, 0x87, 0x63, 0x68, 0x4b, 0x6b, 0xfe, 0x0c, 0x1e, 0x50, 0x10, 0x92, 0x5b, 0xc1, 0xd2, 0x29, + 0x41, 0xe2, 0x06, 0x95, 0x18, 0xc2, 0xc0, 0x90, 0x91, 0x25, 0x4a, 0xe2, 0x17, 0x88, 0x52, 0xfc, + 0x2a, 0xc7, 0x11, 0xe1, 0x16, 0x5c, 0x81, 0xdb, 0x30, 0x76, 0x64, 0x44, 0xc9, 0x45, 0xaa, 0x3c, + 0x37, 0xe3, 0xfb, 0xfc, 0x49, 0x9f, 0xfc, 0xe3, 0x4b, 0x68, 0x31, 0x47, 0x03, 0x21, 0x9a, 0x34, + 0xdf, 0x42, 0x68, 0xb0, 0xd1, 0x2a, 0x29, 0x75, 0x81, 0xc1, 0xce, 0xa0, 0x45, 0x71, 0x75, 0x14, + 0x02, 0x27, 0xdc, 0xfd, 0x30, 0xbe, 0x88, 0x07, 0x29, 0xd2, 0x05, 0x8a, 0x1b, 0x3e, 0xb7, 0x58, + 0x81, 0x4e, 0x4a, 0xe5, 0xb3, 0x15, 0x5b, 0x4f, 0xe3, 0x33, 0xba, 0x23, 0x25, 0x96, 0xfc, 0x3c, + 0x4b, 0x6b, 0x50, 0x49, 0xb6, 0xc5, 0xbc, 0xf2, 0x4f, 0x56, 0x6c, 0x3d, 0x89, 0x39, 0xa1, 0xcd, + 0x40, 0xc4, 0x3d, 0xbf, 0xd4, 0xd0, 0x96, 0x36, 0xa1, 0x66, 0xa4, 0xfc, 0x53, 0x52, 0x2e, 0x08, + 0xba, 0x84, 0x12, 0xb7, 0x7c, 0x51, 0x00, 0x28, 0x30, 0x43, 0x61, 0x42, 0x85, 0xb9, 0x03, 0x91, + 0x12, 0xd7, 0x7c, 0x56, 0xdb, 0xd4, 0x36, 0xb5, 0x3f, 0xa5, 0x97, 0xe3, 0xb5, 0x79, 0xfe, 0xed, + 0x24, 0xdb, 0x77, 0x92, 0xfd, 0x77, 0x92, 0x7d, 0xf7, 0xd2, 0xdb, 0xf7, 0xd2, 0xfb, 0xeb, 0xa5, + 0xf7, 0xfa, 0xf0, 0x56, 0xda, 0xf7, 0x26, 0x0b, 0x72, 0xfc, 0x08, 0x9f, 0xdc, 0xc7, 0x5e, 0xc0, + 0x7e, 0xa2, 0xa9, 0xc2, 0x71, 0x88, 0x76, 0x9c, 0xc2, 0x7e, 0xed, 0xa0, 0xce, 0x66, 0x34, 0xc3, + 0xe3, 0x21, 0x00, 0x00, 0xff, 0xff, 0x66, 0xb4, 0x0d, 0xef, 0x29, 0x01, 0x00, 0x00, +} + +func (m *RoundInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RoundInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RoundInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != 0 { + i = encodeVarintRoundInfo(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x28 + } + if m.FeederId != 0 { + i = encodeVarintRoundInfo(dAtA, i, uint64(m.FeederId)) + i-- + dAtA[i] = 0x20 + } + if m.NexitRoundId != 0 { + i = encodeVarintRoundInfo(dAtA, i, uint64(m.NexitRoundId)) + i-- + dAtA[i] = 0x18 + } + if m.BasedBlock != 0 { + i = encodeVarintRoundInfo(dAtA, i, uint64(m.BasedBlock)) + i-- + dAtA[i] = 0x10 + } + if m.TokenId != 0 { + i = encodeVarintRoundInfo(dAtA, i, uint64(m.TokenId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintRoundInfo(dAtA []byte, offset int, v uint64) int { + offset -= sovRoundInfo(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RoundInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovRoundInfo(uint64(m.TokenId)) + } + if m.BasedBlock != 0 { + n += 1 + sovRoundInfo(uint64(m.BasedBlock)) + } + if m.NexitRoundId != 0 { + n += 1 + sovRoundInfo(uint64(m.NexitRoundId)) + } + if m.FeederId != 0 { + n += 1 + sovRoundInfo(uint64(m.FeederId)) + } + if m.Status != 0 { + n += 1 + sovRoundInfo(uint64(m.Status)) + } + return n +} + +func sovRoundInfo(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRoundInfo(x uint64) (n int) { + return sovRoundInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RoundInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRoundInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RoundInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RoundInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + } + m.TokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRoundInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TokenId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BasedBlock", wireType) + } + m.BasedBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRoundInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BasedBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NexitRoundId", wireType) + } + m.NexitRoundId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRoundInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NexitRoundId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FeederId", wireType) + } + m.FeederId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRoundInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FeederId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRoundInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipRoundInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRoundInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRoundInfo(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRoundInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRoundInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRoundInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthRoundInfo + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRoundInfo + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRoundInfo + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRoundInfo = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRoundInfo = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRoundInfo = fmt.Errorf("proto: unexpected end of group") +) From 58cc010212cc90936d88ea1012051530915f6673 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Mon, 26 Feb 2024 10:29:25 +0800 Subject: [PATCH 11/37] feat(oracle-proto): add round-data state for aggregator --- proto/exocore/oracle/genesis.proto | 4 +- proto/exocore/oracle/query.proto | 28 + proto/exocore/oracle/round_data.proto | 17 + x/oracle/client/cli/query.go | 2 + x/oracle/client/cli/query_round_data.go | 82 ++ x/oracle/client/cli/query_round_data_test.go | 160 +++ x/oracle/genesis.go | 5 + x/oracle/genesis_test.go | 9 + x/oracle/keeper/query_round_data.go | 57 + x/oracle/keeper/query_round_data_test.go | 127 ++ x/oracle/keeper/round_data.go | 63 + x/oracle/keeper/round_data_test.go | 63 + x/oracle/types/genesis.go | 11 + x/oracle/types/genesis.pb.go | 90 +- x/oracle/types/genesis_test.go | 22 + x/oracle/types/key_round_data.go | 24 + x/oracle/types/query.pb.go | 1165 +++++++++++++++--- x/oracle/types/query.pb.gw.go | 184 +++ x/oracle/types/round_data.pb.go | 584 +++++++++ 19 files changed, 2513 insertions(+), 184 deletions(-) create mode 100644 proto/exocore/oracle/round_data.proto create mode 100644 x/oracle/client/cli/query_round_data.go create mode 100644 x/oracle/client/cli/query_round_data_test.go create mode 100644 x/oracle/keeper/query_round_data.go create mode 100644 x/oracle/keeper/query_round_data_test.go create mode 100644 x/oracle/keeper/round_data.go create mode 100644 x/oracle/keeper/round_data_test.go create mode 100644 x/oracle/types/key_round_data.go create mode 100644 x/oracle/types/round_data.pb.go diff --git a/proto/exocore/oracle/genesis.proto b/proto/exocore/oracle/genesis.proto index 3fda782d9..29fd96ea7 100644 --- a/proto/exocore/oracle/genesis.proto +++ b/proto/exocore/oracle/genesis.proto @@ -6,6 +6,7 @@ import "gogoproto/gogo.proto"; import "exocore/oracle/params.proto"; import "exocore/oracle/prices.proto"; import "exocore/oracle/round_info.proto"; +import "exocore/oracle/round_data.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; @@ -13,8 +14,9 @@ option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; repeated Prices pricesList = 2 [(gogoproto.nullable) = false]; - + //TODO: userDefinedTokenFeeder repeated RoundInfo roundInfoList = 3 [(gogoproto.nullable) = false]; + repeated RoundData roundDataList = 4 [(gogoproto.nullable) = false]; } diff --git a/proto/exocore/oracle/query.proto b/proto/exocore/oracle/query.proto index c2e36e1dd..cbe742275 100644 --- a/proto/exocore/oracle/query.proto +++ b/proto/exocore/oracle/query.proto @@ -8,6 +8,7 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "exocore/oracle/params.proto"; import "exocore/oracle/prices.proto"; import "exocore/oracle/round_info.proto"; +import "exocore/oracle/round_data.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; @@ -39,6 +40,16 @@ service Query { option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/round_info"; } + + // Queries a list of RoundData items. + rpc RoundData (QueryGetRoundDataRequest) returns (QueryGetRoundDataResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/round_data/{tokenId}"; + + } + rpc RoundDataAll (QueryAllRoundDataRequest) returns (QueryAllRoundDataResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/round_data"; + + } } // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} @@ -84,3 +95,20 @@ message QueryAllRoundInfoResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +message QueryGetRoundDataRequest { + int32 tokenId = 1; +} + +message QueryGetRoundDataResponse { + RoundData roundData = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllRoundDataRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllRoundDataResponse { + repeated RoundData roundData = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + diff --git a/proto/exocore/oracle/round_data.proto b/proto/exocore/oracle/round_data.proto new file mode 100644 index 000000000..da2dde169 --- /dev/null +++ b/proto/exocore/oracle/round_data.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package exocore.oracle; + +import "exocore/oracle/price.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message RoundData { + int32 tokenId = 1; + repeated PricesWithSource prices_source = 2; +} + +message PricesWithSource { + int32 source_id = 1; + repeated PriceWithTimeAndRound prices_time_round = 2; +} + diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go index 64bfa6a68..5c9ad4e71 100644 --- a/x/oracle/client/cli/query.go +++ b/x/oracle/client/cli/query.go @@ -29,6 +29,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdShowPrices()) cmd.AddCommand(CmdListRoundInfo()) cmd.AddCommand(CmdShowRoundInfo()) + cmd.AddCommand(CmdListRoundData()) + cmd.AddCommand(CmdShowRoundData()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/oracle/client/cli/query_round_data.go b/x/oracle/client/cli/query_round_data.go new file mode 100644 index 000000000..08a3a2933 --- /dev/null +++ b/x/oracle/client/cli/query_round_data.go @@ -0,0 +1,82 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/spf13/cast" +) + +func CmdListRoundData() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-round-data", + Short: "list all round-data", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllRoundDataRequest{ + Pagination: pageReq, + } + + res, err := queryClient.RoundDataAll(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowRoundData() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-round-data [token-id]", + Short: "shows a round-data", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + argTokenId, err := cast.ToInt32E(args[0]) + if err != nil { + return err + } + + params := &types.QueryGetRoundDataRequest{ + TokenId: argTokenId, + } + + res, err := queryClient.RoundData(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_round_data_test.go b/x/oracle/client/cli/query_round_data_test.go new file mode 100644 index 000000000..97126553e --- /dev/null +++ b/x/oracle/client/cli/query_round_data_test.go @@ -0,0 +1,160 @@ +package cli_test + +import ( + "fmt" + "strconv" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func networkWithRoundDataObjects(t *testing.T, n int) (*network.Network, []types.RoundData) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + for i := 0; i < n; i++ { + roundData := types.RoundData{ + TokenId: int32(i), + } + nullify.Fill(&roundData) + state.RoundDataList = append(state.RoundDataList, roundData) + } + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.RoundDataList +} + +func TestShowRoundData(t *testing.T) { + net, objs := networkWithRoundDataObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + idTokenId int32 + + args []string + err error + obj types.RoundData + }{ + { + desc: "found", + idTokenId: objs[0].TokenId, + + args: common, + obj: objs[0], + }, + { + desc: "not found", + idTokenId: 100000, + + args: common, + err: status.Error(codes.NotFound, "not found"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + args := []string{ + strconv.Itoa(int(tc.idTokenId)), + } + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowRoundData(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetRoundDataResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.RoundData) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.RoundData), + ) + } + }) + } +} + +func TestListRoundData(t *testing.T) { + net, objs := networkWithRoundDataObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(objs); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRoundData(), args) + require.NoError(t, err) + var resp types.QueryAllRoundDataResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.RoundData), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.RoundData), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRoundData(), args) + require.NoError(t, err) + var resp types.QueryAllRoundDataResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.RoundData), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.RoundData), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(objs)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRoundData(), args) + require.NoError(t, err) + var resp types.QueryAllRoundDataResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(objs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(objs), + nullify.Fill(resp.RoundData), + ) + }) +} diff --git a/x/oracle/genesis.go b/x/oracle/genesis.go index 64b3aff2d..b0c7a547b 100644 --- a/x/oracle/genesis.go +++ b/x/oracle/genesis.go @@ -16,6 +16,10 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) for _, elem := range genState.RoundInfoList { k.SetRoundInfo(ctx, elem) } + // Set all the roundData + for _, elem := range genState.RoundDataList { + k.SetRoundData(ctx, elem) + } // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, genState.Params) } @@ -27,6 +31,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.PricesList = k.GetAllPrices(ctx) genesis.RoundInfoList = k.GetAllRoundInfo(ctx) + genesis.RoundDataList = k.GetAllRoundData(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/oracle/genesis_test.go b/x/oracle/genesis_test.go index 8e4a8e0e5..69a68109e 100644 --- a/x/oracle/genesis_test.go +++ b/x/oracle/genesis_test.go @@ -30,6 +30,14 @@ func TestGenesis(t *testing.T) { TokenId: 1, }, }, + RoundDataList: []types.RoundData{ + { + TokenId: 0, + }, + { + TokenId: 1, + }, + }, // this line is used by starport scaffolding # genesis/test/state } @@ -43,5 +51,6 @@ func TestGenesis(t *testing.T) { require.ElementsMatch(t, genesisState.PricesList, got.PricesList) require.ElementsMatch(t, genesisState.RoundInfoList, got.RoundInfoList) + require.ElementsMatch(t, genesisState.RoundDataList, got.RoundDataList) // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/oracle/keeper/query_round_data.go b/x/oracle/keeper/query_round_data.go new file mode 100644 index 000000000..011dfc612 --- /dev/null +++ b/x/oracle/keeper/query_round_data.go @@ -0,0 +1,57 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) RoundDataAll(goCtx context.Context, req *types.QueryAllRoundDataRequest) (*types.QueryAllRoundDataResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var roundDatas []types.RoundData + ctx := sdk.UnwrapSDKContext(goCtx) + + store := ctx.KVStore(k.storeKey) + roundDataStore := prefix.NewStore(store, types.KeyPrefix(types.RoundDataKeyPrefix)) + + pageRes, err := query.Paginate(roundDataStore, req.Pagination, func(key []byte, value []byte) error { + var roundData types.RoundData + if err := k.cdc.Unmarshal(value, &roundData); err != nil { + return err + } + + roundDatas = append(roundDatas, roundData) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllRoundDataResponse{RoundData: roundDatas, Pagination: pageRes}, nil +} + +func (k Keeper) RoundData(goCtx context.Context, req *types.QueryGetRoundDataRequest) (*types.QueryGetRoundDataResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetRoundData( + ctx, + req.TokenId, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetRoundDataResponse{RoundData: val}, nil +} diff --git a/x/oracle/keeper/query_round_data_test.go b/x/oracle/keeper/query_round_data_test.go new file mode 100644 index 000000000..a7b33eb2d --- /dev/null +++ b/x/oracle/keeper/query_round_data_test.go @@ -0,0 +1,127 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestRoundDataQuerySingle(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNRoundData(keeper, ctx, 2) + tests := []struct { + desc string + request *types.QueryGetRoundDataRequest + response *types.QueryGetRoundDataResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetRoundDataRequest{ + TokenId: msgs[0].TokenId, + }, + response: &types.QueryGetRoundDataResponse{RoundData: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetRoundDataRequest{ + TokenId: msgs[1].TokenId, + }, + response: &types.QueryGetRoundDataResponse{RoundData: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetRoundDataRequest{ + TokenId: 100000, + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.RoundData(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} + +func TestRoundDataQueryPaginated(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNRoundData(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllRoundDataRequest { + return &types.QueryAllRoundDataRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := keeper.RoundDataAll(wctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.RoundData), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.RoundData), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.RoundDataAll(wctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.RoundData), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.RoundData), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.RoundDataAll(wctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(msgs), + nullify.Fill(resp.RoundData), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.RoundDataAll(wctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/oracle/keeper/round_data.go b/x/oracle/keeper/round_data.go new file mode 100644 index 000000000..d513da1ef --- /dev/null +++ b/x/oracle/keeper/round_data.go @@ -0,0 +1,63 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetRoundData set a specific roundData in the store from its index +func (k Keeper) SetRoundData(ctx sdk.Context, roundData types.RoundData) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundDataKeyPrefix)) + b := k.cdc.MustMarshal(&roundData) + store.Set(types.RoundDataKey( + roundData.TokenId, + ), b) +} + +// GetRoundData returns a roundData from its index +func (k Keeper) GetRoundData( + ctx sdk.Context, + tokenId int32, + +) (val types.RoundData, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundDataKeyPrefix)) + + b := store.Get(types.RoundDataKey( + tokenId, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveRoundData removes a roundData from the store +func (k Keeper) RemoveRoundData( + ctx sdk.Context, + tokenId int32, + +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundDataKeyPrefix)) + store.Delete(types.RoundDataKey( + tokenId, + )) +} + +// GetAllRoundData returns all roundData +func (k Keeper) GetAllRoundData(ctx sdk.Context) (list []types.RoundData) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundDataKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.RoundData + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/oracle/keeper/round_data_test.go b/x/oracle/keeper/round_data_test.go new file mode 100644 index 000000000..97774f4b5 --- /dev/null +++ b/x/oracle/keeper/round_data_test.go @@ -0,0 +1,63 @@ +package keeper_test + +import ( + "strconv" + "testing" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNRoundData(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.RoundData { + items := make([]types.RoundData, n) + for i := range items { + items[i].TokenId = int32(i) + + keeper.SetRoundData(ctx, items[i]) + } + return items +} + +func TestRoundDataGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRoundData(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetRoundData(ctx, + item.TokenId, + ) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) + } +} +func TestRoundDataRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRoundData(keeper, ctx, 10) + for _, item := range items { + keeper.RemoveRoundData(ctx, + item.TokenId, + ) + _, found := keeper.GetRoundData(ctx, + item.TokenId, + ) + require.False(t, found) + } +} + +func TestRoundDataGetAll(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRoundData(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllRoundData(ctx)), + ) +} diff --git a/x/oracle/types/genesis.go b/x/oracle/types/genesis.go index 60e4cc550..e12985704 100644 --- a/x/oracle/types/genesis.go +++ b/x/oracle/types/genesis.go @@ -12,6 +12,7 @@ func DefaultGenesis() *GenesisState { return &GenesisState{ PricesList: []Prices{}, RoundInfoList: []RoundInfo{}, + RoundDataList: []RoundData{}, // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } @@ -40,6 +41,16 @@ func (gs GenesisState) Validate() error { } roundInfoIndexMap[index] = struct{}{} } + // Check for duplicated index in roundData + roundDataIndexMap := make(map[string]struct{}) + + for _, elem := range gs.RoundDataList { + index := string(RoundDataKey(elem.TokenId)) + if _, ok := roundDataIndexMap[index]; ok { + return fmt.Errorf("duplicated index for roundData") + } + roundDataIndexMap[index] = struct{}{} + } // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go index 3e76b6522..3b99cb272 100644 --- a/x/oracle/types/genesis.pb.go +++ b/x/oracle/types/genesis.pb.go @@ -29,6 +29,7 @@ type GenesisState struct { PricesList []Prices `protobuf:"bytes,2,rep,name=pricesList,proto3" json:"pricesList"` //TODO: userDefinedTokenFeeder RoundInfoList []RoundInfo `protobuf:"bytes,3,rep,name=roundInfoList,proto3" json:"roundInfoList"` + RoundDataList []RoundData `protobuf:"bytes,4,rep,name=roundDataList,proto3" json:"roundDataList"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -85,6 +86,13 @@ func (m *GenesisState) GetRoundInfoList() []RoundInfo { return nil } +func (m *GenesisState) GetRoundDataList() []RoundData { + if m != nil { + return m.RoundDataList + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "exocore.oracle.GenesisState") } @@ -92,24 +100,26 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/genesis.proto", fileDescriptor_dbe067676c4dc0de) } var fileDescriptor_dbe067676c4dc0de = []byte{ - // 266 bytes of a gzipped FileDescriptorProto + // 291 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xad, 0xc8, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xca, 0xea, 0x41, 0x64, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x94, 0x34, 0x9a, 0x19, 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0xb8, 0x24, 0x8b, 0x32, 0x93, 0x53, 0x61, 0x92, 0xf2, 0x68, - 0x92, 0x45, 0xf9, 0xa5, 0x79, 0x29, 0xf1, 0x99, 0x79, 0x69, 0x50, 0xa3, 0x95, 0x4e, 0x32, 0x72, - 0xf1, 0xb8, 0x43, 0x9c, 0x14, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xc2, 0xc5, 0x06, 0x31, 0x5e, - 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x4c, 0x0f, 0xd5, 0x89, 0x7a, 0x01, 0x60, 0x59, 0x27, - 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xa0, 0x6a, 0x85, 0x6c, 0xb8, 0xb8, 0x20, 0xf6, 0xfa, 0x64, - 0x16, 0x97, 0x48, 0x30, 0x29, 0x30, 0x63, 0xd5, 0x09, 0x56, 0x01, 0xd5, 0x89, 0xa4, 0x5e, 0xc8, - 0x95, 0x8b, 0x17, 0xec, 0x30, 0xcf, 0xbc, 0xb4, 0x7c, 0xb0, 0x01, 0xcc, 0x60, 0x03, 0x24, 0xd1, - 0x0d, 0x08, 0x82, 0x29, 0x82, 0x9a, 0x81, 0xaa, 0xcb, 0xc9, 0xeb, 0xc4, 0x23, 0x39, 0xc6, 0x0b, - 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, - 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x0c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, - 0xf5, 0x5d, 0x21, 0x66, 0xfa, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0xeb, 0xc3, 0x02, 0xa8, 0x02, - 0x16, 0x44, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0xe0, 0x31, 0x06, 0x04, 0x00, 0x00, - 0xff, 0xff, 0xf0, 0xfc, 0xeb, 0xa7, 0xbf, 0x01, 0x00, 0x00, + 0x92, 0x45, 0xf9, 0xa5, 0x79, 0x29, 0xf1, 0x99, 0x79, 0x69, 0xf9, 0x78, 0x15, 0xa4, 0x24, 0x96, + 0x24, 0x42, 0x14, 0x28, 0x4d, 0x60, 0xe2, 0xe2, 0x71, 0x87, 0xb8, 0x39, 0xb8, 0x24, 0xb1, 0x24, + 0x55, 0xc8, 0x84, 0x8b, 0x0d, 0x62, 0xbf, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x98, 0x1e, + 0xaa, 0x1f, 0xf4, 0x02, 0xc0, 0xb2, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xd5, 0x0a, + 0xd9, 0x70, 0x71, 0x41, 0x1c, 0xe6, 0x93, 0x59, 0x5c, 0x22, 0xc1, 0xa4, 0xc0, 0x8c, 0x55, 0x27, + 0x58, 0x05, 0x54, 0x27, 0x92, 0x7a, 0x21, 0x57, 0x2e, 0x5e, 0xb0, 0xc3, 0x3c, 0xf3, 0xd2, 0xf2, + 0xc1, 0x06, 0x30, 0x83, 0x0d, 0x90, 0x44, 0x37, 0x20, 0x08, 0xa6, 0x08, 0x6a, 0x06, 0xaa, 0x2e, + 0xb8, 0x31, 0x2e, 0x89, 0x25, 0x89, 0x60, 0x63, 0x58, 0xf0, 0x18, 0x03, 0x52, 0x84, 0x62, 0x0c, + 0x4c, 0x97, 0x93, 0xd7, 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, 0xa4, + 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xbb, 0x42, 0xcc, 0xf4, 0x4b, 0x2d, + 0x29, 0xcf, 0x2f, 0xca, 0xd6, 0x87, 0x85, 0x73, 0x05, 0x2c, 0xa4, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, + 0x93, 0xd8, 0xc0, 0xa1, 0x6c, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x9b, 0x76, 0xba, 0xab, 0x27, + 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -132,6 +142,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.RoundDataList) > 0 { + for iNdEx := len(m.RoundDataList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RoundDataList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } if len(m.RoundInfoList) > 0 { for iNdEx := len(m.RoundInfoList) - 1; iNdEx >= 0; iNdEx-- { { @@ -204,6 +228,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.RoundDataList) > 0 { + for _, e := range m.RoundDataList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -343,6 +373,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RoundDataList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RoundDataList = append(m.RoundDataList, RoundData{}) + if err := m.RoundDataList[len(m.RoundDataList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/oracle/types/genesis_test.go b/x/oracle/types/genesis_test.go index 8f87fff52..78db07cb9 100644 --- a/x/oracle/types/genesis_test.go +++ b/x/oracle/types/genesis_test.go @@ -38,6 +38,14 @@ func TestGenesisState_Validate(t *testing.T) { TokenId: 1, }, }, + RoundDataList: []types.RoundData{ + { + TokenId: 0, + }, + { + TokenId: 1, + }, + }, // this line is used by starport scaffolding # types/genesis/validField }, valid: true, @@ -70,6 +78,20 @@ func TestGenesisState_Validate(t *testing.T) { }, valid: false, }, + { + desc: "duplicated roundData", + genState: &types.GenesisState{ + RoundDataList: []types.RoundData{ + { + TokenId: 0, + }, + { + TokenId: 0, + }, + }, + }, + valid: false, + }, // this line is used by starport scaffolding # types/genesis/testcase } for _, tc := range tests { diff --git a/x/oracle/types/key_round_data.go b/x/oracle/types/key_round_data.go new file mode 100644 index 000000000..1f9e41a98 --- /dev/null +++ b/x/oracle/types/key_round_data.go @@ -0,0 +1,24 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // RoundDataKeyPrefix is the prefix to retrieve all RoundData + RoundDataKeyPrefix = "RoundData/value/" +) + +// RoundDataKey returns the store key to retrieve a RoundData from the index fields +func RoundDataKey( + tokenId int32, +) []byte { + var key []byte + + tokenIdBytes := make([]byte, 4) + binary.BigEndian.PutUint32(tokenIdBytes, uint32(tokenId)) + key = append(key, tokenIdBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index 1d96e7876..c3cd3292c 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -481,6 +481,190 @@ func (m *QueryAllRoundInfoResponse) GetPagination() *query.PageResponse { return nil } +type QueryGetRoundDataRequest struct { + TokenId int32 `protobuf:"varint,1,opt,name=tokenId,proto3" json:"tokenId,omitempty"` +} + +func (m *QueryGetRoundDataRequest) Reset() { *m = QueryGetRoundDataRequest{} } +func (m *QueryGetRoundDataRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetRoundDataRequest) ProtoMessage() {} +func (*QueryGetRoundDataRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{10} +} +func (m *QueryGetRoundDataRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRoundDataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRoundDataRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetRoundDataRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRoundDataRequest.Merge(m, src) +} +func (m *QueryGetRoundDataRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRoundDataRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRoundDataRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRoundDataRequest proto.InternalMessageInfo + +func (m *QueryGetRoundDataRequest) GetTokenId() int32 { + if m != nil { + return m.TokenId + } + return 0 +} + +type QueryGetRoundDataResponse struct { + RoundData RoundData `protobuf:"bytes,1,opt,name=roundData,proto3" json:"roundData"` +} + +func (m *QueryGetRoundDataResponse) Reset() { *m = QueryGetRoundDataResponse{} } +func (m *QueryGetRoundDataResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetRoundDataResponse) ProtoMessage() {} +func (*QueryGetRoundDataResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{11} +} +func (m *QueryGetRoundDataResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRoundDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRoundDataResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetRoundDataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRoundDataResponse.Merge(m, src) +} +func (m *QueryGetRoundDataResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRoundDataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRoundDataResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRoundDataResponse proto.InternalMessageInfo + +func (m *QueryGetRoundDataResponse) GetRoundData() RoundData { + if m != nil { + return m.RoundData + } + return RoundData{} +} + +type QueryAllRoundDataRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRoundDataRequest) Reset() { *m = QueryAllRoundDataRequest{} } +func (m *QueryAllRoundDataRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllRoundDataRequest) ProtoMessage() {} +func (*QueryAllRoundDataRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{12} +} +func (m *QueryAllRoundDataRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRoundDataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRoundDataRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllRoundDataRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRoundDataRequest.Merge(m, src) +} +func (m *QueryAllRoundDataRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRoundDataRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRoundDataRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRoundDataRequest proto.InternalMessageInfo + +func (m *QueryAllRoundDataRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllRoundDataResponse struct { + RoundData []RoundData `protobuf:"bytes,1,rep,name=roundData,proto3" json:"roundData"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRoundDataResponse) Reset() { *m = QueryAllRoundDataResponse{} } +func (m *QueryAllRoundDataResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllRoundDataResponse) ProtoMessage() {} +func (*QueryAllRoundDataResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{13} +} +func (m *QueryAllRoundDataResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRoundDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRoundDataResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllRoundDataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRoundDataResponse.Merge(m, src) +} +func (m *QueryAllRoundDataResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRoundDataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRoundDataResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRoundDataResponse proto.InternalMessageInfo + +func (m *QueryAllRoundDataResponse) GetRoundData() []RoundData { + if m != nil { + return m.RoundData + } + return nil +} + +func (m *QueryAllRoundDataResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "exocore.oracle.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "exocore.oracle.QueryParamsResponse") @@ -492,51 +676,60 @@ func init() { proto.RegisterType((*QueryGetRoundInfoResponse)(nil), "exocore.oracle.QueryGetRoundInfoResponse") proto.RegisterType((*QueryAllRoundInfoRequest)(nil), "exocore.oracle.QueryAllRoundInfoRequest") proto.RegisterType((*QueryAllRoundInfoResponse)(nil), "exocore.oracle.QueryAllRoundInfoResponse") + proto.RegisterType((*QueryGetRoundDataRequest)(nil), "exocore.oracle.QueryGetRoundDataRequest") + proto.RegisterType((*QueryGetRoundDataResponse)(nil), "exocore.oracle.QueryGetRoundDataResponse") + proto.RegisterType((*QueryAllRoundDataRequest)(nil), "exocore.oracle.QueryAllRoundDataRequest") + proto.RegisterType((*QueryAllRoundDataResponse)(nil), "exocore.oracle.QueryAllRoundDataResponse") } func init() { proto.RegisterFile("exocore/oracle/query.proto", fileDescriptor_f604621c8da1a6f3) } var fileDescriptor_f604621c8da1a6f3 = []byte{ - // 620 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xcf, 0x6b, 0x13, 0x41, - 0x14, 0xc7, 0x33, 0xad, 0x89, 0x64, 0x14, 0x0f, 0x63, 0x2d, 0xe9, 0x2a, 0x5b, 0x59, 0x69, 0x9b, - 0x2a, 0xee, 0x98, 0xb6, 0xe2, 0x41, 0x3c, 0xa4, 0xa0, 0xa5, 0x0a, 0x25, 0xe6, 0xd8, 0x4b, 0xd9, - 0xa4, 0xd3, 0x75, 0xe9, 0x66, 0x67, 0xbb, 0x3b, 0xd1, 0x16, 0x11, 0xc4, 0x9b, 0xb7, 0x82, 0xa0, - 0x27, 0x4f, 0xfe, 0x33, 0x3d, 0x16, 0xbc, 0x78, 0x12, 0x49, 0xfc, 0x43, 0x64, 0x67, 0x5e, 0x7e, - 0xec, 0x66, 0xd7, 0x6c, 0xa1, 0xb7, 0xec, 0xbc, 0xf7, 0xbe, 0xef, 0xf3, 0xde, 0x9b, 0x37, 0xc1, - 0x1a, 0x3b, 0xe6, 0x6d, 0x1e, 0x30, 0xca, 0x03, 0xab, 0xed, 0x32, 0x7a, 0xd4, 0x65, 0xc1, 0x89, - 0xe9, 0x07, 0x5c, 0x70, 0x72, 0x03, 0x6c, 0xa6, 0xb2, 0x69, 0x73, 0x36, 0xb7, 0xb9, 0x34, 0xd1, - 0xe8, 0x97, 0xf2, 0xd2, 0xee, 0xd8, 0x9c, 0xdb, 0x2e, 0xa3, 0x96, 0xef, 0x50, 0xcb, 0xf3, 0xb8, - 0xb0, 0x84, 0xc3, 0xbd, 0x10, 0xac, 0xf7, 0xdb, 0x3c, 0xec, 0xf0, 0x90, 0xb6, 0xac, 0x10, 0xc4, - 0xe9, 0xdb, 0x5a, 0x8b, 0x09, 0xab, 0x46, 0x7d, 0xcb, 0x76, 0x3c, 0xe9, 0x0c, 0xbe, 0xb7, 0x13, - 0x2c, 0xbe, 0x15, 0x58, 0x9d, 0x30, 0xcb, 0x18, 0x38, 0x6d, 0x36, 0x30, 0x2e, 0x26, 0x8c, 0x01, - 0xef, 0x7a, 0xfb, 0x7b, 0x8e, 0x77, 0x00, 0x90, 0xc6, 0x1c, 0x26, 0xaf, 0xa3, 0xe4, 0x0d, 0x29, - 0xd9, 0x64, 0x47, 0x5d, 0x16, 0x0a, 0xe3, 0x15, 0xbe, 0x19, 0x3b, 0x0d, 0x7d, 0xee, 0x85, 0x8c, - 0x6c, 0xe0, 0x92, 0x4a, 0x5d, 0x41, 0x77, 0x51, 0xf5, 0xda, 0xda, 0xbc, 0x19, 0x6f, 0x84, 0xa9, - 0xfc, 0x37, 0xaf, 0x9c, 0xfd, 0x5e, 0x2c, 0x34, 0xc1, 0xd7, 0xa8, 0xe1, 0x5b, 0x52, 0x6c, 0x8b, - 0x89, 0x86, 0x64, 0x83, 0x2c, 0xa4, 0x82, 0xaf, 0x0a, 0x7e, 0xc8, 0xbc, 0xed, 0x7d, 0xa9, 0x57, - 0x6c, 0x0e, 0x3e, 0x8d, 0x1d, 0x3c, 0x9f, 0x0c, 0x19, 0x43, 0x90, 0x27, 0x99, 0x08, 0xd2, 0x3a, - 0x44, 0x90, 0x5f, 0xc6, 0x1e, 0x20, 0xd4, 0x5d, 0x37, 0x8e, 0xf0, 0x02, 0xe3, 0x51, 0xb7, 0x41, - 0x72, 0xd9, 0x54, 0xa3, 0x31, 0xa3, 0xd1, 0x98, 0x6a, 0xee, 0x30, 0x1a, 0xb3, 0x61, 0xd9, 0x0c, - 0x62, 0x9b, 0x63, 0x91, 0xc6, 0x37, 0x04, 0xc4, 0x63, 0x19, 0x52, 0x88, 0x67, 0xf3, 0x12, 0x93, - 0xad, 0x18, 0xd8, 0x8c, 0x04, 0x5b, 0x99, 0x0a, 0xa6, 0x52, 0xc6, 0xc8, 0x36, 0x70, 0x65, 0xd0, - 0xca, 0x66, 0x34, 0xfc, 0x6d, 0xef, 0x80, 0x4f, 0x1f, 0xc0, 0x2e, 0x5e, 0x48, 0x89, 0x82, 0x8a, - 0x9e, 0xe1, 0x72, 0x30, 0x38, 0x84, 0x9e, 0x2d, 0x24, 0x8b, 0x1a, 0x46, 0x41, 0x5d, 0xa3, 0x08, - 0xa3, 0x05, 0x44, 0x75, 0xd7, 0x9d, 0x20, 0xba, 0xac, 0x79, 0xfc, 0x40, 0x50, 0x40, 0x3c, 0x49, - 0x7a, 0x01, 0xb3, 0x17, 0x2b, 0xe0, 0xd2, 0x66, 0xb3, 0xd6, 0x2b, 0xe2, 0xa2, 0xa4, 0x24, 0x1f, - 0x11, 0x2e, 0xa9, 0xe5, 0x21, 0x46, 0x92, 0x64, 0x72, 0x3f, 0xb5, 0x7b, 0xff, 0xf5, 0x51, 0x99, - 0x8c, 0x87, 0x9f, 0x7e, 0xfe, 0xfd, 0x32, 0xb3, 0x42, 0x96, 0xe8, 0x73, 0xe5, 0xbc, 0xc3, 0xc4, - 0x3b, 0x1e, 0x1c, 0xd2, 0xd4, 0xd7, 0x84, 0x9c, 0x46, 0x08, 0xea, 0xf2, 0x2d, 0xa5, 0xca, 0x27, - 0xf7, 0x57, 0x5b, 0x9e, 0xe6, 0x06, 0x20, 0x4f, 0x24, 0x48, 0x8d, 0xd0, 0x69, 0x20, 0x32, 0x8c, - 0xbe, 0x87, 0x4b, 0xf8, 0x81, 0x7c, 0x46, 0xb8, 0xac, 0xb4, 0xea, 0xae, 0x9b, 0x41, 0x95, 0x5c, - 0xe9, 0x0c, 0xaa, 0x89, 0xbd, 0xcc, 0xdf, 0x1e, 0xd5, 0x93, 0xef, 0x08, 0x97, 0x87, 0x77, 0x82, - 0x54, 0xb3, 0x4a, 0x4f, 0xde, 0x68, 0x6d, 0x35, 0x87, 0x27, 0x10, 0x3d, 0x95, 0x44, 0x8f, 0xc9, - 0xfa, 0x14, 0xa2, 0xd1, 0x23, 0x3e, 0xd6, 0xab, 0xaf, 0x08, 0x5f, 0x1f, 0x4a, 0x46, 0xed, 0xaa, - 0x66, 0xf5, 0x21, 0x27, 0x62, 0xda, 0xe6, 0x18, 0x35, 0x89, 0xf8, 0x80, 0xac, 0xe6, 0x46, 0xdc, - 0x7c, 0x79, 0xd6, 0xd3, 0xd1, 0x79, 0x4f, 0x47, 0x7f, 0x7a, 0x3a, 0x3a, 0xed, 0xeb, 0x85, 0xf3, - 0xbe, 0x5e, 0xf8, 0xd5, 0xd7, 0x0b, 0xbb, 0x8f, 0x6c, 0x47, 0xbc, 0xe9, 0xb6, 0xcc, 0x36, 0xef, - 0x64, 0xc9, 0x1d, 0x0f, 0x04, 0xc5, 0x89, 0xcf, 0xc2, 0x56, 0x49, 0xfe, 0x69, 0xad, 0xff, 0x0b, - 0x00, 0x00, 0xff, 0xff, 0xb9, 0xf1, 0x73, 0x69, 0x9d, 0x07, 0x00, 0x00, + // 699 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0x4d, 0x4f, 0x13, 0x41, + 0x18, 0xc7, 0xbb, 0x20, 0x28, 0xa3, 0xf1, 0x30, 0x22, 0x81, 0xd5, 0x2c, 0x66, 0x0d, 0x50, 0x34, + 0xee, 0x58, 0xc0, 0x78, 0x30, 0x1e, 0x4a, 0x54, 0x82, 0x26, 0xa4, 0xf6, 0xc8, 0x85, 0x4c, 0xdb, + 0x61, 0xdd, 0xb0, 0xdd, 0x59, 0x76, 0xa7, 0x0a, 0x31, 0x26, 0xc6, 0x9b, 0x37, 0x12, 0x13, 0x3d, + 0x18, 0x4f, 0x7e, 0x19, 0x8e, 0x24, 0x5e, 0x3c, 0x19, 0xd3, 0xfa, 0x41, 0xcc, 0xbc, 0xb4, 0xdd, + 0xdd, 0xee, 0x76, 0xdb, 0x04, 0x6e, 0xed, 0x3c, 0x2f, 0xf3, 0x7b, 0xfe, 0xff, 0xee, 0xd3, 0x05, + 0x3a, 0x39, 0xa2, 0x75, 0x1a, 0x10, 0x44, 0x03, 0x5c, 0x77, 0x09, 0x3a, 0x6c, 0x91, 0xe0, 0xd8, + 0xf2, 0x03, 0xca, 0x28, 0xbc, 0xae, 0x62, 0x96, 0x8c, 0xe9, 0xb3, 0x36, 0xb5, 0xa9, 0x08, 0x21, + 0xfe, 0x49, 0x66, 0xe9, 0xb7, 0x6d, 0x4a, 0x6d, 0x97, 0x20, 0xec, 0x3b, 0x08, 0x7b, 0x1e, 0x65, + 0x98, 0x39, 0xd4, 0x0b, 0x55, 0xf4, 0x5e, 0x9d, 0x86, 0x4d, 0x1a, 0xa2, 0x1a, 0x0e, 0x55, 0x73, + 0xf4, 0xb6, 0x54, 0x23, 0x0c, 0x97, 0x90, 0x8f, 0x6d, 0xc7, 0x13, 0xc9, 0x2a, 0xf7, 0x56, 0x82, + 0xc5, 0xc7, 0x01, 0x6e, 0x86, 0x59, 0xc1, 0xc0, 0xa9, 0x93, 0x6e, 0x70, 0x31, 0x11, 0x0c, 0x68, + 0xcb, 0x6b, 0xec, 0x39, 0xde, 0x3e, 0x1d, 0x9a, 0xd0, 0xc0, 0x0c, 0xcb, 0x04, 0x73, 0x16, 0xc0, + 0xd7, 0x9c, 0xae, 0x22, 0xee, 0xac, 0x92, 0xc3, 0x16, 0x09, 0x99, 0xf9, 0x0a, 0xdc, 0x88, 0x9d, + 0x86, 0x3e, 0xf5, 0x42, 0x02, 0x37, 0xc0, 0xb4, 0x64, 0x9b, 0xd7, 0xee, 0x68, 0xc5, 0xab, 0x6b, + 0x73, 0x56, 0x5c, 0x29, 0x4b, 0xe6, 0x6f, 0x5e, 0x3a, 0xfd, 0xb3, 0x58, 0xa8, 0xaa, 0x5c, 0xb3, + 0x04, 0x6e, 0x8a, 0x66, 0x5b, 0x84, 0x55, 0x04, 0xbc, 0xba, 0x05, 0xce, 0x83, 0xcb, 0x8c, 0x1e, + 0x10, 0x6f, 0xbb, 0x21, 0xfa, 0x4d, 0x55, 0xbb, 0x5f, 0xcd, 0x1d, 0x30, 0x97, 0x2c, 0x89, 0x20, + 0x88, 0x93, 0x4c, 0x04, 0x11, 0xed, 0x21, 0x88, 0x6f, 0xe6, 0x9e, 0x42, 0x28, 0xbb, 0x6e, 0x1c, + 0xe1, 0x05, 0x00, 0x7d, 0x3b, 0x54, 0xcb, 0x65, 0x4b, 0x7a, 0x67, 0x71, 0xef, 0x2c, 0xf9, 0xc3, + 0x50, 0xde, 0x59, 0x15, 0x6c, 0x13, 0x55, 0x5b, 0x8d, 0x54, 0x9a, 0xdf, 0x34, 0x45, 0x1c, 0xb9, + 0x21, 0x85, 0x78, 0x72, 0x54, 0x62, 0xb8, 0x15, 0x03, 0x9b, 0x10, 0x60, 0x2b, 0xb9, 0x60, 0xf2, + 0xca, 0x18, 0xd9, 0x06, 0x98, 0xef, 0x4a, 0x59, 0xe5, 0xe6, 0x6f, 0x7b, 0xfb, 0x34, 0xdf, 0x80, + 0x5d, 0xb0, 0x90, 0x52, 0xa5, 0x26, 0x7a, 0x0a, 0x66, 0x82, 0xee, 0xa1, 0xd2, 0x6c, 0x21, 0x39, + 0x54, 0xaf, 0x4a, 0xcd, 0xd5, 0xaf, 0x30, 0x6b, 0x8a, 0xa8, 0xec, 0xba, 0x03, 0x44, 0xe7, 0xe5, + 0xc7, 0x4f, 0x4d, 0x0d, 0x10, 0xbf, 0x24, 0x7d, 0x80, 0xc9, 0xf1, 0x06, 0xb8, 0x38, 0x6f, 0x9e, + 0x61, 0x86, 0xc7, 0xf7, 0x46, 0x56, 0x25, 0x46, 0xe3, 0x87, 0x43, 0xbd, 0xe1, 0x09, 0xb1, 0xd1, + 0xf8, 0xc1, 0x80, 0x37, 0x51, 0xa2, 0x0b, 0xf3, 0x66, 0xd8, 0x00, 0x93, 0xe3, 0x0d, 0x70, 0x6e, + 0xde, 0xac, 0x7d, 0xbf, 0x02, 0xa6, 0x04, 0x25, 0xfc, 0xa8, 0x81, 0x69, 0xb9, 0xd8, 0xa0, 0x99, + 0x24, 0x19, 0xdc, 0x9d, 0xfa, 0xdd, 0xa1, 0x39, 0xf2, 0x26, 0xf3, 0xc1, 0xa7, 0x5f, 0xff, 0xbe, + 0x4c, 0xac, 0xc0, 0x25, 0xf4, 0x5c, 0x26, 0xef, 0x10, 0xf6, 0x8e, 0x06, 0x07, 0x28, 0xf5, 0xaf, + 0x00, 0x9e, 0x70, 0x04, 0xb9, 0x18, 0x96, 0x52, 0xdb, 0x27, 0x77, 0xab, 0xbe, 0x9c, 0x97, 0xa6, + 0x40, 0x1e, 0x0b, 0x90, 0x12, 0x44, 0x79, 0x20, 0xa2, 0x0c, 0xbd, 0x57, 0x3f, 0xc2, 0x0f, 0xf0, + 0xb3, 0x06, 0x66, 0x64, 0xaf, 0xb2, 0xeb, 0x66, 0x50, 0x25, 0xd7, 0x6d, 0x06, 0xd5, 0xc0, 0xce, + 0x1c, 0x5d, 0x1e, 0xa9, 0xc9, 0x0f, 0x0d, 0xcc, 0xf4, 0x9e, 0x57, 0x58, 0xcc, 0x1a, 0x3d, 0xb9, + 0x6d, 0xf4, 0xd5, 0x11, 0x32, 0x15, 0xd1, 0x13, 0x41, 0xf4, 0x08, 0xae, 0xe7, 0x10, 0xf5, 0xff, + 0x81, 0x23, 0x5a, 0x7d, 0xd5, 0xc0, 0xb5, 0x5e, 0x4b, 0x2e, 0x57, 0x31, 0x4b, 0x87, 0x11, 0x11, + 0xd3, 0xb6, 0x9a, 0x59, 0x12, 0x88, 0xf7, 0xe1, 0xea, 0xc8, 0x88, 0x7d, 0xe1, 0xc4, 0xb3, 0x33, + 0x5c, 0xb8, 0xc8, 0x2a, 0xc8, 0x11, 0x2e, 0xfa, 0x3c, 0x8f, 0x29, 0x1c, 0x7f, 0x33, 0x49, 0x13, + 0x8e, 0xb7, 0xcc, 0x17, 0x2e, 0x1f, 0x31, 0x6d, 0xe5, 0x8c, 0x29, 0x1c, 0x47, 0xdc, 0x7c, 0x79, + 0xda, 0x36, 0xb4, 0xb3, 0xb6, 0xa1, 0xfd, 0x6d, 0x1b, 0xda, 0x49, 0xc7, 0x28, 0x9c, 0x75, 0x8c, + 0xc2, 0xef, 0x8e, 0x51, 0xd8, 0x7d, 0x68, 0x3b, 0xec, 0x4d, 0xab, 0x66, 0xd5, 0x69, 0x33, 0xab, + 0xdd, 0x51, 0xb7, 0x21, 0x3b, 0xf6, 0x49, 0x58, 0x9b, 0x16, 0x6f, 0x62, 0xeb, 0xff, 0x03, 0x00, + 0x00, 0xff, 0xff, 0x2e, 0xc3, 0xd4, 0x35, 0x93, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -559,6 +752,9 @@ type QueryClient interface { // Queries a list of RoundInfo items. RoundInfo(ctx context.Context, in *QueryGetRoundInfoRequest, opts ...grpc.CallOption) (*QueryGetRoundInfoResponse, error) RoundInfoAll(ctx context.Context, in *QueryAllRoundInfoRequest, opts ...grpc.CallOption) (*QueryAllRoundInfoResponse, error) + // Queries a list of RoundData items. + RoundData(ctx context.Context, in *QueryGetRoundDataRequest, opts ...grpc.CallOption) (*QueryGetRoundDataResponse, error) + RoundDataAll(ctx context.Context, in *QueryAllRoundDataRequest, opts ...grpc.CallOption) (*QueryAllRoundDataResponse, error) } type queryClient struct { @@ -614,6 +810,24 @@ func (c *queryClient) RoundInfoAll(ctx context.Context, in *QueryAllRoundInfoReq return out, nil } +func (c *queryClient) RoundData(ctx context.Context, in *QueryGetRoundDataRequest, opts ...grpc.CallOption) (*QueryGetRoundDataResponse, error) { + out := new(QueryGetRoundDataResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RoundData", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RoundDataAll(ctx context.Context, in *QueryAllRoundDataRequest, opts ...grpc.CallOption) (*QueryAllRoundDataResponse, error) { + out := new(QueryAllRoundDataResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RoundDataAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -624,6 +838,9 @@ type QueryServer interface { // Queries a list of RoundInfo items. RoundInfo(context.Context, *QueryGetRoundInfoRequest) (*QueryGetRoundInfoResponse, error) RoundInfoAll(context.Context, *QueryAllRoundInfoRequest) (*QueryAllRoundInfoResponse, error) + // Queries a list of RoundData items. + RoundData(context.Context, *QueryGetRoundDataRequest) (*QueryGetRoundDataResponse, error) + RoundDataAll(context.Context, *QueryAllRoundDataRequest) (*QueryAllRoundDataResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -645,6 +862,12 @@ func (*UnimplementedQueryServer) RoundInfo(ctx context.Context, req *QueryGetRou func (*UnimplementedQueryServer) RoundInfoAll(ctx context.Context, req *QueryAllRoundInfoRequest) (*QueryAllRoundInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RoundInfoAll not implemented") } +func (*UnimplementedQueryServer) RoundData(ctx context.Context, req *QueryGetRoundDataRequest) (*QueryGetRoundDataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RoundData not implemented") +} +func (*UnimplementedQueryServer) RoundDataAll(ctx context.Context, req *QueryAllRoundDataRequest) (*QueryAllRoundDataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RoundDataAll not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -740,6 +963,42 @@ func _Query_RoundInfoAll_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Query_RoundData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetRoundDataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RoundData(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/RoundData", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RoundData(ctx, req.(*QueryGetRoundDataRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RoundDataAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllRoundDataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RoundDataAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/RoundDataAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RoundDataAll(ctx, req.(*QueryAllRoundDataRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "exocore.oracle.Query", HandlerType: (*QueryServer)(nil), @@ -764,6 +1023,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "RoundInfoAll", Handler: _Query_RoundInfoAll_Handler, }, + { + MethodName: "RoundData", + Handler: _Query_RoundData_Handler, + }, + { + MethodName: "RoundDataAll", + Handler: _Query_RoundDataAll_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "exocore/oracle/query.proto", @@ -1115,94 +1382,239 @@ func (m *QueryAllRoundInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryGetRoundDataRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n +func (m *QueryGetRoundDataRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetPricesRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryGetRoundDataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l if m.TokenId != 0 { - n += 1 + sovQuery(uint64(m.TokenId)) + i = encodeVarintQuery(dAtA, i, uint64(m.TokenId)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *QueryGetPricesResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryGetRoundDataResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - l = m.Prices.Size() - n += 1 + l + sovQuery(uint64(l)) - return n + return dAtA[:n], nil } -func (m *QueryAllPricesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n +func (m *QueryGetRoundDataResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllPricesResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryGetRoundDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Prices) > 0 { - for _, e := range m.Prices { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + { + size, err := m.RoundData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *QueryGetRoundInfoRequest) Size() (n int) { - if m == nil { +func (m *QueryAllRoundDataRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllRoundDataRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRoundDataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllRoundDataResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllRoundDataResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRoundDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.RoundData) > 0 { + for iNdEx := len(m.RoundData) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RoundData[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetPricesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovQuery(uint64(m.TokenId)) + } + return n +} + +func (m *QueryGetPricesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Prices.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllPricesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllPricesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Prices) > 0 { + for _, e := range m.Prices { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetRoundInfoRequest) Size() (n int) { + if m == nil { return 0 } var l int @@ -1234,35 +1646,375 @@ func (m *QueryAllRoundInfoRequest) Size() (n int) { l = m.Pagination.Size() n += 1 + l + sovQuery(uint64(l)) } - return n -} + return n +} + +func (m *QueryAllRoundInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RoundInfo) > 0 { + for _, e := range m.RoundInfo { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetRoundDataRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovQuery(uint64(m.TokenId)) + } + return n +} + +func (m *QueryGetRoundDataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.RoundData.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllRoundDataRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllRoundDataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RoundData) > 0 { + for _, e := range m.RoundData { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetPricesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + } + m.TokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TokenId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } -func (m *QueryAllRoundInfoResponse) Size() (n int) { - if m == nil { - return 0 + if iNdEx > l { + return io.ErrUnexpectedEOF } - var l int - _ = l - if len(m.RoundInfo) > 0 { - for _, e := range m.RoundInfo { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + return nil +} +func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetPricesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Prices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1285,12 +2037,48 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllPricesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1312,7 +2100,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1335,15 +2123,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllPricesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1370,7 +2158,44 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Prices = append(m.Prices, Prices{}) + if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1395,7 +2220,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetRoundInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1418,10 +2243,10 @@ func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetPricesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRoundInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRoundInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1464,7 +2289,7 @@ func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetRoundInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1487,15 +2312,15 @@ func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetPricesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRoundInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRoundInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RoundInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1522,7 +2347,7 @@ func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Prices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RoundInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1547,7 +2372,7 @@ func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllRoundInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1570,10 +2395,10 @@ func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllPricesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllRoundInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllRoundInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1633,7 +2458,7 @@ func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllRoundInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1656,15 +2481,15 @@ func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllPricesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllRoundInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllRoundInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RoundInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1691,8 +2516,8 @@ func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Prices = append(m.Prices, Prices{}) - if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.RoundInfo = append(m.RoundInfo, RoundInfo{}) + if err := m.RoundInfo[len(m.RoundInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1753,7 +2578,7 @@ func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetRoundInfoRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetRoundDataRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1776,10 +2601,10 @@ func (m *QueryGetRoundInfoRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetRoundInfoRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRoundDataRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetRoundInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRoundDataRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1822,7 +2647,7 @@ func (m *QueryGetRoundInfoRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetRoundInfoResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetRoundDataResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1845,15 +2670,15 @@ func (m *QueryGetRoundInfoResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetRoundInfoResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRoundDataResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetRoundInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRoundDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RoundInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RoundData", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1880,7 +2705,7 @@ func (m *QueryGetRoundInfoResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.RoundInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RoundData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1905,7 +2730,7 @@ func (m *QueryGetRoundInfoResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllRoundInfoRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllRoundDataRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1928,10 +2753,10 @@ func (m *QueryAllRoundInfoRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllRoundInfoRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllRoundDataRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRoundInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllRoundDataRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1991,7 +2816,7 @@ func (m *QueryAllRoundInfoRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllRoundInfoResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllRoundDataResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2014,15 +2839,15 @@ func (m *QueryAllRoundInfoResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllRoundInfoResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllRoundDataResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRoundInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllRoundDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RoundInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RoundData", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2049,8 +2874,8 @@ func (m *QueryAllRoundInfoResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RoundInfo = append(m.RoundInfo, RoundInfo{}) - if err := m.RoundInfo[len(m.RoundInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.RoundData = append(m.RoundData, RoundData{}) + if err := m.RoundData[len(m.RoundData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index 6820dfc5b..18ac45276 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -231,6 +231,96 @@ func local_request_Query_RoundInfoAll_0(ctx context.Context, marshaler runtime.M } +func request_Query_RoundData_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRoundDataRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tokenId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tokenId") + } + + protoReq.TokenId, err = runtime.Int32(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tokenId", err) + } + + msg, err := client.RoundData(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RoundData_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRoundDataRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tokenId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tokenId") + } + + protoReq.TokenId, err = runtime.Int32(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tokenId", err) + } + + msg, err := server.RoundData(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_RoundDataAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_RoundDataAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRoundDataRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RoundDataAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RoundDataAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RoundDataAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRoundDataRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RoundDataAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RoundDataAll(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -352,6 +442,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_RoundData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RoundData_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RoundData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RoundDataAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RoundDataAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RoundDataAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -493,6 +629,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_RoundData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RoundData_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RoundData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RoundDataAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RoundDataAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RoundDataAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -506,6 +682,10 @@ var ( pattern_Query_RoundInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "round_info", "tokenId"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_RoundInfoAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "round_info"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RoundData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "round_data", "tokenId"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RoundDataAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "round_data"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -518,4 +698,8 @@ var ( forward_Query_RoundInfo_0 = runtime.ForwardResponseMessage forward_Query_RoundInfoAll_0 = runtime.ForwardResponseMessage + + forward_Query_RoundData_0 = runtime.ForwardResponseMessage + + forward_Query_RoundDataAll_0 = runtime.ForwardResponseMessage ) diff --git a/x/oracle/types/round_data.pb.go b/x/oracle/types/round_data.pb.go new file mode 100644 index 000000000..58b9d47fb --- /dev/null +++ b/x/oracle/types/round_data.pb.go @@ -0,0 +1,584 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/round_data.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type RoundData struct { + TokenId int32 `protobuf:"varint,1,opt,name=tokenId,proto3" json:"tokenId,omitempty"` + PricesSource []*PricesWithSource `protobuf:"bytes,2,rep,name=prices_source,json=pricesSource,proto3" json:"prices_source,omitempty"` +} + +func (m *RoundData) Reset() { *m = RoundData{} } +func (m *RoundData) String() string { return proto.CompactTextString(m) } +func (*RoundData) ProtoMessage() {} +func (*RoundData) Descriptor() ([]byte, []int) { + return fileDescriptor_a5d205303c327dea, []int{0} +} +func (m *RoundData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RoundData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RoundData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RoundData) XXX_Merge(src proto.Message) { + xxx_messageInfo_RoundData.Merge(m, src) +} +func (m *RoundData) XXX_Size() int { + return m.Size() +} +func (m *RoundData) XXX_DiscardUnknown() { + xxx_messageInfo_RoundData.DiscardUnknown(m) +} + +var xxx_messageInfo_RoundData proto.InternalMessageInfo + +func (m *RoundData) GetTokenId() int32 { + if m != nil { + return m.TokenId + } + return 0 +} + +func (m *RoundData) GetPricesSource() []*PricesWithSource { + if m != nil { + return m.PricesSource + } + return nil +} + +type PricesWithSource struct { + SourceId int32 `protobuf:"varint,1,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + PricesTimeRound []*PriceWithTimeAndRound `protobuf:"bytes,2,rep,name=prices_time_round,json=pricesTimeRound,proto3" json:"prices_time_round,omitempty"` +} + +func (m *PricesWithSource) Reset() { *m = PricesWithSource{} } +func (m *PricesWithSource) String() string { return proto.CompactTextString(m) } +func (*PricesWithSource) ProtoMessage() {} +func (*PricesWithSource) Descriptor() ([]byte, []int) { + return fileDescriptor_a5d205303c327dea, []int{1} +} +func (m *PricesWithSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PricesWithSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PricesWithSource.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PricesWithSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_PricesWithSource.Merge(m, src) +} +func (m *PricesWithSource) XXX_Size() int { + return m.Size() +} +func (m *PricesWithSource) XXX_DiscardUnknown() { + xxx_messageInfo_PricesWithSource.DiscardUnknown(m) +} + +var xxx_messageInfo_PricesWithSource proto.InternalMessageInfo + +func (m *PricesWithSource) GetSourceId() int32 { + if m != nil { + return m.SourceId + } + return 0 +} + +func (m *PricesWithSource) GetPricesTimeRound() []*PriceWithTimeAndRound { + if m != nil { + return m.PricesTimeRound + } + return nil +} + +func init() { + proto.RegisterType((*RoundData)(nil), "exocore.oracle.RoundData") + proto.RegisterType((*PricesWithSource)(nil), "exocore.oracle.PricesWithSource") +} + +func init() { proto.RegisterFile("exocore/oracle/round_data.proto", fileDescriptor_a5d205303c327dea) } + +var fileDescriptor_a5d205303c327dea = []byte{ + // 276 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0xca, 0x2f, 0xcd, 0x4b, + 0x89, 0x4f, 0x49, 0x2c, 0x49, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x2a, 0xd0, + 0x83, 0x28, 0x90, 0x92, 0x42, 0xd3, 0x50, 0x50, 0x94, 0x99, 0x9c, 0x0a, 0x51, 0xab, 0x94, 0xc3, + 0xc5, 0x19, 0x04, 0xd2, 0xef, 0x92, 0x58, 0x92, 0x28, 0x24, 0xc1, 0xc5, 0x5e, 0x92, 0x9f, 0x9d, + 0x9a, 0xe7, 0x99, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x1a, 0x04, 0xe3, 0x0a, 0xb9, 0x72, 0xf1, + 0x82, 0x75, 0x15, 0xc7, 0x17, 0xe7, 0x97, 0x16, 0x25, 0xa7, 0x4a, 0x30, 0x29, 0x30, 0x6b, 0x70, + 0x1b, 0x29, 0xe8, 0xa1, 0x5a, 0xa5, 0x17, 0x00, 0x56, 0x14, 0x9e, 0x59, 0x92, 0x11, 0x0c, 0x56, + 0x17, 0xc4, 0x03, 0xd1, 0x06, 0xe1, 0x29, 0x35, 0x31, 0x72, 0x09, 0xa0, 0x2b, 0x11, 0x92, 0xe6, + 0xe2, 0x84, 0x18, 0x1a, 0x9f, 0x09, 0xb3, 0x97, 0x03, 0x22, 0xe0, 0x99, 0x22, 0x14, 0xc8, 0x25, + 0x08, 0xb5, 0xb8, 0x24, 0x33, 0x37, 0x35, 0x1e, 0xec, 0x57, 0xa8, 0xe5, 0xaa, 0x58, 0x2d, 0x07, + 0x19, 0x1c, 0x92, 0x99, 0x9b, 0xea, 0x98, 0x97, 0x02, 0xf6, 0x58, 0x10, 0x3f, 0x44, 0x3f, 0x48, + 0x0c, 0x2c, 0xe0, 0xe4, 0x75, 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, 0x06, + 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xae, 0x10, 0xb3, 0xfd, 0x52, + 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0x61, 0x41, 0x58, 0x01, 0x0b, 0xc4, 0x92, 0xca, 0x82, 0xd4, + 0xe2, 0x24, 0x36, 0x70, 0x28, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x95, 0x4a, 0xae, + 0x94, 0x01, 0x00, 0x00, +} + +func (m *RoundData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RoundData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RoundData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PricesSource) > 0 { + for iNdEx := len(m.PricesSource) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PricesSource[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRoundData(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.TokenId != 0 { + i = encodeVarintRoundData(dAtA, i, uint64(m.TokenId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PricesWithSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PricesWithSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PricesWithSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PricesTimeRound) > 0 { + for iNdEx := len(m.PricesTimeRound) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PricesTimeRound[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRoundData(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.SourceId != 0 { + i = encodeVarintRoundData(dAtA, i, uint64(m.SourceId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintRoundData(dAtA []byte, offset int, v uint64) int { + offset -= sovRoundData(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RoundData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovRoundData(uint64(m.TokenId)) + } + if len(m.PricesSource) > 0 { + for _, e := range m.PricesSource { + l = e.Size() + n += 1 + l + sovRoundData(uint64(l)) + } + } + return n +} + +func (m *PricesWithSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SourceId != 0 { + n += 1 + sovRoundData(uint64(m.SourceId)) + } + if len(m.PricesTimeRound) > 0 { + for _, e := range m.PricesTimeRound { + l = e.Size() + n += 1 + l + sovRoundData(uint64(l)) + } + } + return n +} + +func sovRoundData(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRoundData(x uint64) (n int) { + return sovRoundData(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RoundData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRoundData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RoundData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RoundData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + } + m.TokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRoundData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TokenId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PricesSource", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRoundData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRoundData + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRoundData + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PricesSource = append(m.PricesSource, &PricesWithSource{}) + if err := m.PricesSource[len(m.PricesSource)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRoundData(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRoundData + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PricesWithSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRoundData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PricesWithSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PricesWithSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceId", wireType) + } + m.SourceId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRoundData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SourceId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PricesTimeRound", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRoundData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRoundData + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRoundData + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PricesTimeRound = append(m.PricesTimeRound, &PriceWithTimeAndRound{}) + if err := m.PricesTimeRound[len(m.PricesTimeRound)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRoundData(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRoundData + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRoundData(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRoundData + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRoundData + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRoundData + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthRoundData + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRoundData + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRoundData + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRoundData = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRoundData = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRoundData = fmt.Errorf("proto: unexpected end of group") +) From 6787b14d10bfd5ec91335f57bcf79f4a1732bb86 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Mon, 26 Feb 2024 14:53:53 +0800 Subject: [PATCH 12/37] feat(oracle-proto):add validators state for aggregation --- proto/exocore/oracle/genesis.proto | 6 +- proto/exocore/oracle/query.proto | 28 + proto/exocore/oracle/validator_power.proto | 10 + proto/exocore/oracle/validators.proto | 12 + x/oracle/client/cli/query.go | 2 + x/oracle/client/cli/query_validators.go | 82 ++ x/oracle/client/cli/query_validators_test.go | 160 +++ x/oracle/genesis.go | 5 + x/oracle/genesis_test.go | 9 + x/oracle/keeper/query_validators.go | 57 + x/oracle/keeper/query_validators_test.go | 127 ++ x/oracle/keeper/validators.go | 63 + x/oracle/keeper/validators_test.go | 63 + x/oracle/types/genesis.go | 17 +- x/oracle/types/genesis.pb.go | 106 +- x/oracle/types/genesis_test.go | 22 + x/oracle/types/key_validators.go | 24 + x/oracle/types/query.pb.go | 1310 ++++++++++++++---- x/oracle/types/query.pb.gw.go | 184 +++ x/oracle/types/validator_power.pb.go | 370 +++++ x/oracle/types/validators.pb.go | 363 +++++ 21 files changed, 2753 insertions(+), 267 deletions(-) create mode 100644 proto/exocore/oracle/validator_power.proto create mode 100644 proto/exocore/oracle/validators.proto create mode 100644 x/oracle/client/cli/query_validators.go create mode 100644 x/oracle/client/cli/query_validators_test.go create mode 100644 x/oracle/keeper/query_validators.go create mode 100644 x/oracle/keeper/query_validators_test.go create mode 100644 x/oracle/keeper/validators.go create mode 100644 x/oracle/keeper/validators_test.go create mode 100644 x/oracle/types/key_validators.go create mode 100644 x/oracle/types/validator_power.pb.go create mode 100644 x/oracle/types/validators.pb.go diff --git a/proto/exocore/oracle/genesis.proto b/proto/exocore/oracle/genesis.proto index 29fd96ea7..03d73b6ad 100644 --- a/proto/exocore/oracle/genesis.proto +++ b/proto/exocore/oracle/genesis.proto @@ -7,6 +7,7 @@ import "exocore/oracle/params.proto"; import "exocore/oracle/prices.proto"; import "exocore/oracle/round_info.proto"; import "exocore/oracle/round_data.proto"; +import "exocore/oracle/validators.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; @@ -16,7 +17,8 @@ message GenesisState { repeated Prices pricesList = 2 [(gogoproto.nullable) = false]; //TODO: userDefinedTokenFeeder - repeated RoundInfo roundInfoList = 3 [(gogoproto.nullable) = false]; - repeated RoundData roundDataList = 4 [(gogoproto.nullable) = false]; + repeated RoundInfo roundInfoList = 3 [(gogoproto.nullable) = false]; + repeated RoundData roundDataList = 4 [(gogoproto.nullable) = false]; + repeated Validators validatorsList = 5 [(gogoproto.nullable) = false]; } diff --git a/proto/exocore/oracle/query.proto b/proto/exocore/oracle/query.proto index cbe742275..47984868a 100644 --- a/proto/exocore/oracle/query.proto +++ b/proto/exocore/oracle/query.proto @@ -9,6 +9,7 @@ import "exocore/oracle/params.proto"; import "exocore/oracle/prices.proto"; import "exocore/oracle/round_info.proto"; import "exocore/oracle/round_data.proto"; +import "exocore/oracle/validators.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; @@ -50,6 +51,16 @@ service Query { option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/round_data"; } + + // Queries a list of Validators items. + rpc Validators (QueryGetValidatorsRequest) returns (QueryGetValidatorsResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/validators/{block}"; + + } + rpc ValidatorsAll (QueryAllValidatorsRequest) returns (QueryAllValidatorsResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/validators"; + + } } // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} @@ -112,3 +123,20 @@ message QueryAllRoundDataResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +message QueryGetValidatorsRequest { + uint64 block = 1; +} + +message QueryGetValidatorsResponse { + Validators validators = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllValidatorsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllValidatorsResponse { + repeated Validators validators = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + diff --git a/proto/exocore/oracle/validator_power.proto b/proto/exocore/oracle/validator_power.proto new file mode 100644 index 000000000..8fe635c11 --- /dev/null +++ b/proto/exocore/oracle/validator_power.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package exocore.oracle; + +option go_package= "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message ValidatorWithPower{ + string operator_address = 1; + string tokens = 2; +} diff --git a/proto/exocore/oracle/validators.proto b/proto/exocore/oracle/validators.proto new file mode 100644 index 000000000..d850d2c33 --- /dev/null +++ b/proto/exocore/oracle/validators.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package exocore.oracle; + +import "exocore/oracle/validator_power.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message Validators { + uint64 block = 1; + repeated ValidatorWithPower validator_power = 2; +} + diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go index 5c9ad4e71..1bd4dbd8f 100644 --- a/x/oracle/client/cli/query.go +++ b/x/oracle/client/cli/query.go @@ -31,6 +31,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdShowRoundInfo()) cmd.AddCommand(CmdListRoundData()) cmd.AddCommand(CmdShowRoundData()) + cmd.AddCommand(CmdListValidators()) + cmd.AddCommand(CmdShowValidators()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/oracle/client/cli/query_validators.go b/x/oracle/client/cli/query_validators.go new file mode 100644 index 000000000..621354d62 --- /dev/null +++ b/x/oracle/client/cli/query_validators.go @@ -0,0 +1,82 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/spf13/cast" +) + +func CmdListValidators() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-validators", + Short: "list all validators", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllValidatorsRequest{ + Pagination: pageReq, + } + + res, err := queryClient.ValidatorsAll(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowValidators() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-validators [block]", + Short: "shows a validators", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + argBlock, err := cast.ToUint64E(args[0]) + if err != nil { + return err + } + + params := &types.QueryGetValidatorsRequest{ + Block: argBlock, + } + + res, err := queryClient.Validators(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_validators_test.go b/x/oracle/client/cli/query_validators_test.go new file mode 100644 index 000000000..1a6841357 --- /dev/null +++ b/x/oracle/client/cli/query_validators_test.go @@ -0,0 +1,160 @@ +package cli_test + +import ( + "fmt" + "strconv" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func networkWithValidatorsObjects(t *testing.T, n int) (*network.Network, []types.Validators) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + for i := 0; i < n; i++ { + validators := types.Validators{ + Block: uint64(i), + } + nullify.Fill(&validators) + state.ValidatorsList = append(state.ValidatorsList, validators) + } + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.ValidatorsList +} + +func TestShowValidators(t *testing.T) { + net, objs := networkWithValidatorsObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + idBlock uint64 + + args []string + err error + obj types.Validators + }{ + { + desc: "found", + idBlock: objs[0].Block, + + args: common, + obj: objs[0], + }, + { + desc: "not found", + idBlock: 100000, + + args: common, + err: status.Error(codes.NotFound, "not found"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + args := []string{ + strconv.Itoa(int(tc.idBlock)), + } + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowValidators(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetValidatorsResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.Validators) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.Validators), + ) + } + }) + } +} + +func TestListValidators(t *testing.T) { + net, objs := networkWithValidatorsObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(objs); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListValidators(), args) + require.NoError(t, err) + var resp types.QueryAllValidatorsResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.Validators), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.Validators), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListValidators(), args) + require.NoError(t, err) + var resp types.QueryAllValidatorsResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.Validators), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.Validators), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(objs)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListValidators(), args) + require.NoError(t, err) + var resp types.QueryAllValidatorsResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(objs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(objs), + nullify.Fill(resp.Validators), + ) + }) +} diff --git a/x/oracle/genesis.go b/x/oracle/genesis.go index b0c7a547b..f4f66668c 100644 --- a/x/oracle/genesis.go +++ b/x/oracle/genesis.go @@ -20,6 +20,10 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) for _, elem := range genState.RoundDataList { k.SetRoundData(ctx, elem) } + // Set all the validators + for _, elem := range genState.ValidatorsList { + k.SetValidators(ctx, elem) + } // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, genState.Params) } @@ -32,6 +36,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.PricesList = k.GetAllPrices(ctx) genesis.RoundInfoList = k.GetAllRoundInfo(ctx) genesis.RoundDataList = k.GetAllRoundData(ctx) + genesis.ValidatorsList = k.GetAllValidators(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/oracle/genesis_test.go b/x/oracle/genesis_test.go index 69a68109e..c7885f089 100644 --- a/x/oracle/genesis_test.go +++ b/x/oracle/genesis_test.go @@ -38,6 +38,14 @@ func TestGenesis(t *testing.T) { TokenId: 1, }, }, + ValidatorsList: []types.Validators{ + { + Block: 0, + }, + { + Block: 1, + }, + }, // this line is used by starport scaffolding # genesis/test/state } @@ -52,5 +60,6 @@ func TestGenesis(t *testing.T) { require.ElementsMatch(t, genesisState.PricesList, got.PricesList) require.ElementsMatch(t, genesisState.RoundInfoList, got.RoundInfoList) require.ElementsMatch(t, genesisState.RoundDataList, got.RoundDataList) + require.ElementsMatch(t, genesisState.ValidatorsList, got.ValidatorsList) // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/oracle/keeper/query_validators.go b/x/oracle/keeper/query_validators.go new file mode 100644 index 000000000..a5e0d4cc8 --- /dev/null +++ b/x/oracle/keeper/query_validators.go @@ -0,0 +1,57 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) ValidatorsAll(goCtx context.Context, req *types.QueryAllValidatorsRequest) (*types.QueryAllValidatorsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var validatorss []types.Validators + ctx := sdk.UnwrapSDKContext(goCtx) + + store := ctx.KVStore(k.storeKey) + validatorsStore := prefix.NewStore(store, types.KeyPrefix(types.ValidatorsKeyPrefix)) + + pageRes, err := query.Paginate(validatorsStore, req.Pagination, func(key []byte, value []byte) error { + var validators types.Validators + if err := k.cdc.Unmarshal(value, &validators); err != nil { + return err + } + + validatorss = append(validatorss, validators) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllValidatorsResponse{Validators: validatorss, Pagination: pageRes}, nil +} + +func (k Keeper) Validators(goCtx context.Context, req *types.QueryGetValidatorsRequest) (*types.QueryGetValidatorsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetValidators( + ctx, + req.Block, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetValidatorsResponse{Validators: val}, nil +} diff --git a/x/oracle/keeper/query_validators_test.go b/x/oracle/keeper/query_validators_test.go new file mode 100644 index 000000000..4d2e5da6b --- /dev/null +++ b/x/oracle/keeper/query_validators_test.go @@ -0,0 +1,127 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestValidatorsQuerySingle(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNValidators(keeper, ctx, 2) + tests := []struct { + desc string + request *types.QueryGetValidatorsRequest + response *types.QueryGetValidatorsResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetValidatorsRequest{ + Block: msgs[0].Block, + }, + response: &types.QueryGetValidatorsResponse{Validators: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetValidatorsRequest{ + Block: msgs[1].Block, + }, + response: &types.QueryGetValidatorsResponse{Validators: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetValidatorsRequest{ + Block: 100000, + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.Validators(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} + +func TestValidatorsQueryPaginated(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNValidators(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllValidatorsRequest { + return &types.QueryAllValidatorsRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := keeper.ValidatorsAll(wctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.Validators), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.Validators), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.ValidatorsAll(wctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.Validators), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.Validators), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.ValidatorsAll(wctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(msgs), + nullify.Fill(resp.Validators), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.ValidatorsAll(wctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/oracle/keeper/validators.go b/x/oracle/keeper/validators.go new file mode 100644 index 000000000..038b4ac83 --- /dev/null +++ b/x/oracle/keeper/validators.go @@ -0,0 +1,63 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetValidators set a specific validators in the store from its index +func (k Keeper) SetValidators(ctx sdk.Context, validators types.Validators) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorsKeyPrefix)) + b := k.cdc.MustMarshal(&validators) + store.Set(types.ValidatorsKey( + validators.Block, + ), b) +} + +// GetValidators returns a validators from its index +func (k Keeper) GetValidators( + ctx sdk.Context, + block uint64, + +) (val types.Validators, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorsKeyPrefix)) + + b := store.Get(types.ValidatorsKey( + block, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveValidators removes a validators from the store +func (k Keeper) RemoveValidators( + ctx sdk.Context, + block uint64, + +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorsKeyPrefix)) + store.Delete(types.ValidatorsKey( + block, + )) +} + +// GetAllValidators returns all validators +func (k Keeper) GetAllValidators(ctx sdk.Context) (list []types.Validators) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorsKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Validators + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/oracle/keeper/validators_test.go b/x/oracle/keeper/validators_test.go new file mode 100644 index 000000000..967aa925e --- /dev/null +++ b/x/oracle/keeper/validators_test.go @@ -0,0 +1,63 @@ +package keeper_test + +import ( + "strconv" + "testing" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNValidators(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.Validators { + items := make([]types.Validators, n) + for i := range items { + items[i].Block = uint64(i) + + keeper.SetValidators(ctx, items[i]) + } + return items +} + +func TestValidatorsGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNValidators(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetValidators(ctx, + item.Block, + ) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) + } +} +func TestValidatorsRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNValidators(keeper, ctx, 10) + for _, item := range items { + keeper.RemoveValidators(ctx, + item.Block, + ) + _, found := keeper.GetValidators(ctx, + item.Block, + ) + require.False(t, found) + } +} + +func TestValidatorsGetAll(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNValidators(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllValidators(ctx)), + ) +} diff --git a/x/oracle/types/genesis.go b/x/oracle/types/genesis.go index e12985704..4dd367f2a 100644 --- a/x/oracle/types/genesis.go +++ b/x/oracle/types/genesis.go @@ -10,9 +10,10 @@ const DefaultIndex uint64 = 1 // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - PricesList: []Prices{}, - RoundInfoList: []RoundInfo{}, - RoundDataList: []RoundData{}, + PricesList: []Prices{}, + RoundInfoList: []RoundInfo{}, + RoundDataList: []RoundData{}, + ValidatorsList: []Validators{}, // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } @@ -51,6 +52,16 @@ func (gs GenesisState) Validate() error { } roundDataIndexMap[index] = struct{}{} } + // Check for duplicated index in validators + validatorsIndexMap := make(map[string]struct{}) + + for _, elem := range gs.ValidatorsList { + index := string(ValidatorsKey(elem.Block)) + if _, ok := validatorsIndexMap[index]; ok { + return fmt.Errorf("duplicated index for validators") + } + validatorsIndexMap[index] = struct{}{} + } // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go index 3b99cb272..3940d6da1 100644 --- a/x/oracle/types/genesis.pb.go +++ b/x/oracle/types/genesis.pb.go @@ -28,8 +28,9 @@ type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` PricesList []Prices `protobuf:"bytes,2,rep,name=pricesList,proto3" json:"pricesList"` //TODO: userDefinedTokenFeeder - RoundInfoList []RoundInfo `protobuf:"bytes,3,rep,name=roundInfoList,proto3" json:"roundInfoList"` - RoundDataList []RoundData `protobuf:"bytes,4,rep,name=roundDataList,proto3" json:"roundDataList"` + RoundInfoList []RoundInfo `protobuf:"bytes,3,rep,name=roundInfoList,proto3" json:"roundInfoList"` + RoundDataList []RoundData `protobuf:"bytes,4,rep,name=roundDataList,proto3" json:"roundDataList"` + ValidatorsList []Validators `protobuf:"bytes,5,rep,name=validatorsList,proto3" json:"validatorsList"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -93,6 +94,13 @@ func (m *GenesisState) GetRoundDataList() []RoundData { return nil } +func (m *GenesisState) GetValidatorsList() []Validators { + if m != nil { + return m.ValidatorsList + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "exocore.oracle.GenesisState") } @@ -100,25 +108,27 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/genesis.proto", fileDescriptor_dbe067676c4dc0de) } var fileDescriptor_dbe067676c4dc0de = []byte{ - // 291 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xad, 0xc8, 0x4f, - 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, - 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xca, 0xea, 0x41, 0x64, 0xa5, - 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x94, 0x34, 0x9a, 0x19, - 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0xb8, 0x24, 0x8b, 0x32, 0x93, 0x53, 0x61, 0x92, 0xf2, 0x68, - 0x92, 0x45, 0xf9, 0xa5, 0x79, 0x29, 0xf1, 0x99, 0x79, 0x69, 0xf9, 0x78, 0x15, 0xa4, 0x24, 0x96, - 0x24, 0x42, 0x14, 0x28, 0x4d, 0x60, 0xe2, 0xe2, 0x71, 0x87, 0xb8, 0x39, 0xb8, 0x24, 0xb1, 0x24, - 0x55, 0xc8, 0x84, 0x8b, 0x0d, 0x62, 0xbf, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x98, 0x1e, - 0xaa, 0x1f, 0xf4, 0x02, 0xc0, 0xb2, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xd5, 0x0a, - 0xd9, 0x70, 0x71, 0x41, 0x1c, 0xe6, 0x93, 0x59, 0x5c, 0x22, 0xc1, 0xa4, 0xc0, 0x8c, 0x55, 0x27, - 0x58, 0x05, 0x54, 0x27, 0x92, 0x7a, 0x21, 0x57, 0x2e, 0x5e, 0xb0, 0xc3, 0x3c, 0xf3, 0xd2, 0xf2, - 0xc1, 0x06, 0x30, 0x83, 0x0d, 0x90, 0x44, 0x37, 0x20, 0x08, 0xa6, 0x08, 0x6a, 0x06, 0xaa, 0x2e, - 0xb8, 0x31, 0x2e, 0x89, 0x25, 0x89, 0x60, 0x63, 0x58, 0xf0, 0x18, 0x03, 0x52, 0x84, 0x62, 0x0c, - 0x4c, 0x97, 0x93, 0xd7, 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, 0xa4, - 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xbb, 0x42, 0xcc, 0xf4, 0x4b, 0x2d, - 0x29, 0xcf, 0x2f, 0xca, 0xd6, 0x87, 0x85, 0x73, 0x05, 0x2c, 0xa4, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, - 0x93, 0xd8, 0xc0, 0xa1, 0x6c, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x9b, 0x76, 0xba, 0xab, 0x27, + // 323 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0x3f, 0x4b, 0xc3, 0x40, + 0x18, 0xc6, 0x93, 0xb6, 0x76, 0x38, 0xb5, 0x43, 0x10, 0xa9, 0x51, 0xae, 0xc5, 0xc9, 0x29, 0x11, + 0x75, 0x74, 0x2a, 0x16, 0xff, 0x20, 0x22, 0x15, 0x1c, 0x5c, 0xe4, 0x9a, 0x5c, 0xe3, 0x61, 0x9b, + 0x37, 0x5c, 0xae, 0x5a, 0xbf, 0x85, 0x1f, 0xab, 0x63, 0x47, 0x71, 0x10, 0x49, 0xbe, 0x88, 0xf4, + 0xee, 0x52, 0xcd, 0x61, 0xbb, 0x05, 0x9e, 0xdf, 0xf3, 0xcb, 0xfb, 0xde, 0x8b, 0xf6, 0xe8, 0x04, + 0x02, 0xe0, 0xd4, 0x07, 0x4e, 0x82, 0x21, 0xf5, 0x23, 0x1a, 0xd3, 0x94, 0xa5, 0x5e, 0xc2, 0x41, + 0x80, 0xd3, 0xd0, 0xa9, 0xa7, 0x52, 0x77, 0x2b, 0x82, 0x08, 0x64, 0xe4, 0xcf, 0xbf, 0x14, 0xe5, + 0xee, 0x1a, 0x8e, 0x84, 0x70, 0x32, 0x4a, 0x97, 0x85, 0x9c, 0x05, 0xb4, 0x08, 0x5b, 0x46, 0xc8, + 0x61, 0x1c, 0x87, 0x8f, 0x2c, 0x1e, 0xc0, 0x4a, 0x20, 0x24, 0x82, 0x2c, 0x01, 0x5e, 0xc8, 0x90, + 0x85, 0x44, 0x00, 0xd7, 0xbf, 0xd8, 0xff, 0xac, 0xa0, 0x8d, 0x73, 0xb5, 0xd4, 0x9d, 0x20, 0x82, + 0x3a, 0x27, 0xa8, 0xae, 0x06, 0x6c, 0xda, 0x6d, 0xfb, 0x60, 0xfd, 0x68, 0xdb, 0x2b, 0x2f, 0xe9, + 0xdd, 0xca, 0xb4, 0x53, 0x9b, 0x7e, 0xb5, 0xac, 0x9e, 0x66, 0x9d, 0x53, 0x84, 0xd4, 0xe4, 0xd7, + 0x2c, 0x15, 0xcd, 0x4a, 0xbb, 0xfa, 0x6f, 0x53, 0x12, 0xba, 0xf9, 0x87, 0x77, 0xba, 0x68, 0x53, + 0x4e, 0x7e, 0x19, 0x0f, 0x40, 0x0a, 0xaa, 0x52, 0xb0, 0x63, 0x0a, 0x7a, 0x05, 0xa4, 0x1d, 0xe5, + 0xd6, 0x42, 0x73, 0x46, 0x04, 0x91, 0x9a, 0xda, 0x0a, 0xcd, 0x1c, 0x2a, 0x69, 0x8a, 0x96, 0x73, + 0x81, 0x1a, 0xbf, 0xcf, 0x24, 0x3d, 0x6b, 0xd2, 0xe3, 0x9a, 0x9e, 0xfb, 0x05, 0xa5, 0x45, 0x46, + 0xaf, 0x73, 0x35, 0xcd, 0xb0, 0x3d, 0xcb, 0xb0, 0xfd, 0x9d, 0x61, 0xfb, 0x3d, 0xc7, 0xd6, 0x2c, + 0xc7, 0xd6, 0x47, 0x8e, 0xad, 0x87, 0xc3, 0x88, 0x89, 0xa7, 0x71, 0xdf, 0x0b, 0x60, 0xe4, 0x77, + 0x95, 0xf5, 0x86, 0x8a, 0x57, 0xe0, 0xcf, 0x7e, 0x71, 0xb1, 0x49, 0x71, 0x33, 0xf1, 0x96, 0xd0, + 0xb4, 0x5f, 0x97, 0xf7, 0x3a, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x5c, 0x40, 0x5a, 0x92, 0x02, 0x00, 0x00, } @@ -142,6 +152,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ValidatorsList) > 0 { + for iNdEx := len(m.ValidatorsList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ValidatorsList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } if len(m.RoundDataList) > 0 { for iNdEx := len(m.RoundDataList) - 1; iNdEx >= 0; iNdEx-- { { @@ -234,6 +258,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.ValidatorsList) > 0 { + for _, e := range m.ValidatorsList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -407,6 +437,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorsList = append(m.ValidatorsList, Validators{}) + if err := m.ValidatorsList[len(m.ValidatorsList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/oracle/types/genesis_test.go b/x/oracle/types/genesis_test.go index 78db07cb9..4902253b0 100644 --- a/x/oracle/types/genesis_test.go +++ b/x/oracle/types/genesis_test.go @@ -46,6 +46,14 @@ func TestGenesisState_Validate(t *testing.T) { TokenId: 1, }, }, + ValidatorsList: []types.Validators{ + { + Block: 0, + }, + { + Block: 1, + }, + }, // this line is used by starport scaffolding # types/genesis/validField }, valid: true, @@ -92,6 +100,20 @@ func TestGenesisState_Validate(t *testing.T) { }, valid: false, }, + { + desc: "duplicated validators", + genState: &types.GenesisState{ + ValidatorsList: []types.Validators{ + { + Block: 0, + }, + { + Block: 0, + }, + }, + }, + valid: false, + }, // this line is used by starport scaffolding # types/genesis/testcase } for _, tc := range tests { diff --git a/x/oracle/types/key_validators.go b/x/oracle/types/key_validators.go new file mode 100644 index 000000000..b78b6ef02 --- /dev/null +++ b/x/oracle/types/key_validators.go @@ -0,0 +1,24 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // ValidatorsKeyPrefix is the prefix to retrieve all Validators + ValidatorsKeyPrefix = "Validators/value/" +) + +// ValidatorsKey returns the store key to retrieve a Validators from the index fields +func ValidatorsKey( + block uint64, +) []byte { + var key []byte + + blockBytes := make([]byte, 8) + binary.BigEndian.PutUint64(blockBytes, block) + key = append(key, blockBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index c3cd3292c..a56cd0188 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -665,6 +665,190 @@ func (m *QueryAllRoundDataResponse) GetPagination() *query.PageResponse { return nil } +type QueryGetValidatorsRequest struct { + Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` +} + +func (m *QueryGetValidatorsRequest) Reset() { *m = QueryGetValidatorsRequest{} } +func (m *QueryGetValidatorsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetValidatorsRequest) ProtoMessage() {} +func (*QueryGetValidatorsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{14} +} +func (m *QueryGetValidatorsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetValidatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetValidatorsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetValidatorsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetValidatorsRequest.Merge(m, src) +} +func (m *QueryGetValidatorsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetValidatorsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetValidatorsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetValidatorsRequest proto.InternalMessageInfo + +func (m *QueryGetValidatorsRequest) GetBlock() uint64 { + if m != nil { + return m.Block + } + return 0 +} + +type QueryGetValidatorsResponse struct { + Validators Validators `protobuf:"bytes,1,opt,name=validators,proto3" json:"validators"` +} + +func (m *QueryGetValidatorsResponse) Reset() { *m = QueryGetValidatorsResponse{} } +func (m *QueryGetValidatorsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetValidatorsResponse) ProtoMessage() {} +func (*QueryGetValidatorsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{15} +} +func (m *QueryGetValidatorsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetValidatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetValidatorsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetValidatorsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetValidatorsResponse.Merge(m, src) +} +func (m *QueryGetValidatorsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetValidatorsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetValidatorsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetValidatorsResponse proto.InternalMessageInfo + +func (m *QueryGetValidatorsResponse) GetValidators() Validators { + if m != nil { + return m.Validators + } + return Validators{} +} + +type QueryAllValidatorsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllValidatorsRequest) Reset() { *m = QueryAllValidatorsRequest{} } +func (m *QueryAllValidatorsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllValidatorsRequest) ProtoMessage() {} +func (*QueryAllValidatorsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{16} +} +func (m *QueryAllValidatorsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllValidatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllValidatorsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllValidatorsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllValidatorsRequest.Merge(m, src) +} +func (m *QueryAllValidatorsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllValidatorsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllValidatorsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllValidatorsRequest proto.InternalMessageInfo + +func (m *QueryAllValidatorsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllValidatorsResponse struct { + Validators []Validators `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllValidatorsResponse) Reset() { *m = QueryAllValidatorsResponse{} } +func (m *QueryAllValidatorsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllValidatorsResponse) ProtoMessage() {} +func (*QueryAllValidatorsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{17} +} +func (m *QueryAllValidatorsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllValidatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllValidatorsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllValidatorsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllValidatorsResponse.Merge(m, src) +} +func (m *QueryAllValidatorsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllValidatorsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllValidatorsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllValidatorsResponse proto.InternalMessageInfo + +func (m *QueryAllValidatorsResponse) GetValidators() []Validators { + if m != nil { + return m.Validators + } + return nil +} + +func (m *QueryAllValidatorsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "exocore.oracle.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "exocore.oracle.QueryParamsResponse") @@ -680,56 +864,68 @@ func init() { proto.RegisterType((*QueryGetRoundDataResponse)(nil), "exocore.oracle.QueryGetRoundDataResponse") proto.RegisterType((*QueryAllRoundDataRequest)(nil), "exocore.oracle.QueryAllRoundDataRequest") proto.RegisterType((*QueryAllRoundDataResponse)(nil), "exocore.oracle.QueryAllRoundDataResponse") + proto.RegisterType((*QueryGetValidatorsRequest)(nil), "exocore.oracle.QueryGetValidatorsRequest") + proto.RegisterType((*QueryGetValidatorsResponse)(nil), "exocore.oracle.QueryGetValidatorsResponse") + proto.RegisterType((*QueryAllValidatorsRequest)(nil), "exocore.oracle.QueryAllValidatorsRequest") + proto.RegisterType((*QueryAllValidatorsResponse)(nil), "exocore.oracle.QueryAllValidatorsResponse") } func init() { proto.RegisterFile("exocore/oracle/query.proto", fileDescriptor_f604621c8da1a6f3) } var fileDescriptor_f604621c8da1a6f3 = []byte{ - // 699 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0x4d, 0x4f, 0x13, 0x41, - 0x18, 0xc7, 0xbb, 0x20, 0x28, 0xa3, 0xf1, 0x30, 0x22, 0x81, 0xd5, 0x2c, 0x66, 0x0d, 0x50, 0x34, - 0xee, 0x58, 0xc0, 0x78, 0x30, 0x1e, 0x4a, 0x54, 0x82, 0x26, 0xa4, 0xf6, 0xc8, 0x85, 0x4c, 0xdb, - 0x61, 0xdd, 0xb0, 0xdd, 0x59, 0x76, 0xa7, 0x0a, 0x31, 0x26, 0xc6, 0x9b, 0x37, 0x12, 0x13, 0x3d, - 0x18, 0x4f, 0x7e, 0x19, 0x8e, 0x24, 0x5e, 0x3c, 0x19, 0xd3, 0xfa, 0x41, 0xcc, 0xbc, 0xb4, 0xdd, - 0xdd, 0xee, 0x76, 0xdb, 0x04, 0x6e, 0xed, 0x3c, 0x2f, 0xf3, 0x7b, 0xfe, 0xff, 0xee, 0xd3, 0x05, - 0x3a, 0x39, 0xa2, 0x75, 0x1a, 0x10, 0x44, 0x03, 0x5c, 0x77, 0x09, 0x3a, 0x6c, 0x91, 0xe0, 0xd8, - 0xf2, 0x03, 0xca, 0x28, 0xbc, 0xae, 0x62, 0x96, 0x8c, 0xe9, 0xb3, 0x36, 0xb5, 0xa9, 0x08, 0x21, - 0xfe, 0x49, 0x66, 0xe9, 0xb7, 0x6d, 0x4a, 0x6d, 0x97, 0x20, 0xec, 0x3b, 0x08, 0x7b, 0x1e, 0x65, - 0x98, 0x39, 0xd4, 0x0b, 0x55, 0xf4, 0x5e, 0x9d, 0x86, 0x4d, 0x1a, 0xa2, 0x1a, 0x0e, 0x55, 0x73, - 0xf4, 0xb6, 0x54, 0x23, 0x0c, 0x97, 0x90, 0x8f, 0x6d, 0xc7, 0x13, 0xc9, 0x2a, 0xf7, 0x56, 0x82, - 0xc5, 0xc7, 0x01, 0x6e, 0x86, 0x59, 0xc1, 0xc0, 0xa9, 0x93, 0x6e, 0x70, 0x31, 0x11, 0x0c, 0x68, - 0xcb, 0x6b, 0xec, 0x39, 0xde, 0x3e, 0x1d, 0x9a, 0xd0, 0xc0, 0x0c, 0xcb, 0x04, 0x73, 0x16, 0xc0, - 0xd7, 0x9c, 0xae, 0x22, 0xee, 0xac, 0x92, 0xc3, 0x16, 0x09, 0x99, 0xf9, 0x0a, 0xdc, 0x88, 0x9d, - 0x86, 0x3e, 0xf5, 0x42, 0x02, 0x37, 0xc0, 0xb4, 0x64, 0x9b, 0xd7, 0xee, 0x68, 0xc5, 0xab, 0x6b, - 0x73, 0x56, 0x5c, 0x29, 0x4b, 0xe6, 0x6f, 0x5e, 0x3a, 0xfd, 0xb3, 0x58, 0xa8, 0xaa, 0x5c, 0xb3, - 0x04, 0x6e, 0x8a, 0x66, 0x5b, 0x84, 0x55, 0x04, 0xbc, 0xba, 0x05, 0xce, 0x83, 0xcb, 0x8c, 0x1e, - 0x10, 0x6f, 0xbb, 0x21, 0xfa, 0x4d, 0x55, 0xbb, 0x5f, 0xcd, 0x1d, 0x30, 0x97, 0x2c, 0x89, 0x20, - 0x88, 0x93, 0x4c, 0x04, 0x11, 0xed, 0x21, 0x88, 0x6f, 0xe6, 0x9e, 0x42, 0x28, 0xbb, 0x6e, 0x1c, - 0xe1, 0x05, 0x00, 0x7d, 0x3b, 0x54, 0xcb, 0x65, 0x4b, 0x7a, 0x67, 0x71, 0xef, 0x2c, 0xf9, 0xc3, - 0x50, 0xde, 0x59, 0x15, 0x6c, 0x13, 0x55, 0x5b, 0x8d, 0x54, 0x9a, 0xdf, 0x34, 0x45, 0x1c, 0xb9, - 0x21, 0x85, 0x78, 0x72, 0x54, 0x62, 0xb8, 0x15, 0x03, 0x9b, 0x10, 0x60, 0x2b, 0xb9, 0x60, 0xf2, - 0xca, 0x18, 0xd9, 0x06, 0x98, 0xef, 0x4a, 0x59, 0xe5, 0xe6, 0x6f, 0x7b, 0xfb, 0x34, 0xdf, 0x80, - 0x5d, 0xb0, 0x90, 0x52, 0xa5, 0x26, 0x7a, 0x0a, 0x66, 0x82, 0xee, 0xa1, 0xd2, 0x6c, 0x21, 0x39, - 0x54, 0xaf, 0x4a, 0xcd, 0xd5, 0xaf, 0x30, 0x6b, 0x8a, 0xa8, 0xec, 0xba, 0x03, 0x44, 0xe7, 0xe5, - 0xc7, 0x4f, 0x4d, 0x0d, 0x10, 0xbf, 0x24, 0x7d, 0x80, 0xc9, 0xf1, 0x06, 0xb8, 0x38, 0x6f, 0x9e, - 0x61, 0x86, 0xc7, 0xf7, 0x46, 0x56, 0x25, 0x46, 0xe3, 0x87, 0x43, 0xbd, 0xe1, 0x09, 0xb1, 0xd1, - 0xf8, 0xc1, 0x80, 0x37, 0x51, 0xa2, 0x0b, 0xf3, 0x66, 0xd8, 0x00, 0x93, 0xe3, 0x0d, 0x70, 0x6e, - 0xde, 0xac, 0x7d, 0xbf, 0x02, 0xa6, 0x04, 0x25, 0xfc, 0xa8, 0x81, 0x69, 0xb9, 0xd8, 0xa0, 0x99, - 0x24, 0x19, 0xdc, 0x9d, 0xfa, 0xdd, 0xa1, 0x39, 0xf2, 0x26, 0xf3, 0xc1, 0xa7, 0x5f, 0xff, 0xbe, - 0x4c, 0xac, 0xc0, 0x25, 0xf4, 0x5c, 0x26, 0xef, 0x10, 0xf6, 0x8e, 0x06, 0x07, 0x28, 0xf5, 0xaf, - 0x00, 0x9e, 0x70, 0x04, 0xb9, 0x18, 0x96, 0x52, 0xdb, 0x27, 0x77, 0xab, 0xbe, 0x9c, 0x97, 0xa6, - 0x40, 0x1e, 0x0b, 0x90, 0x12, 0x44, 0x79, 0x20, 0xa2, 0x0c, 0xbd, 0x57, 0x3f, 0xc2, 0x0f, 0xf0, - 0xb3, 0x06, 0x66, 0x64, 0xaf, 0xb2, 0xeb, 0x66, 0x50, 0x25, 0xd7, 0x6d, 0x06, 0xd5, 0xc0, 0xce, - 0x1c, 0x5d, 0x1e, 0xa9, 0xc9, 0x0f, 0x0d, 0xcc, 0xf4, 0x9e, 0x57, 0x58, 0xcc, 0x1a, 0x3d, 0xb9, - 0x6d, 0xf4, 0xd5, 0x11, 0x32, 0x15, 0xd1, 0x13, 0x41, 0xf4, 0x08, 0xae, 0xe7, 0x10, 0xf5, 0xff, - 0x81, 0x23, 0x5a, 0x7d, 0xd5, 0xc0, 0xb5, 0x5e, 0x4b, 0x2e, 0x57, 0x31, 0x4b, 0x87, 0x11, 0x11, - 0xd3, 0xb6, 0x9a, 0x59, 0x12, 0x88, 0xf7, 0xe1, 0xea, 0xc8, 0x88, 0x7d, 0xe1, 0xc4, 0xb3, 0x33, - 0x5c, 0xb8, 0xc8, 0x2a, 0xc8, 0x11, 0x2e, 0xfa, 0x3c, 0x8f, 0x29, 0x1c, 0x7f, 0x33, 0x49, 0x13, - 0x8e, 0xb7, 0xcc, 0x17, 0x2e, 0x1f, 0x31, 0x6d, 0xe5, 0x8c, 0x29, 0x1c, 0x47, 0xdc, 0x7c, 0x79, - 0xda, 0x36, 0xb4, 0xb3, 0xb6, 0xa1, 0xfd, 0x6d, 0x1b, 0xda, 0x49, 0xc7, 0x28, 0x9c, 0x75, 0x8c, - 0xc2, 0xef, 0x8e, 0x51, 0xd8, 0x7d, 0x68, 0x3b, 0xec, 0x4d, 0xab, 0x66, 0xd5, 0x69, 0x33, 0xab, - 0xdd, 0x51, 0xb7, 0x21, 0x3b, 0xf6, 0x49, 0x58, 0x9b, 0x16, 0x6f, 0x62, 0xeb, 0xff, 0x03, 0x00, - 0x00, 0xff, 0xff, 0x2e, 0xc3, 0xd4, 0x35, 0x93, 0x0a, 0x00, 0x00, + // 829 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x97, 0xcf, 0x4f, 0x13, 0x41, + 0x14, 0xc7, 0x3b, 0x14, 0x30, 0x8c, 0x3f, 0x0e, 0x23, 0x12, 0x58, 0x4d, 0x31, 0x6b, 0xf8, 0x69, + 0xdc, 0xb5, 0x80, 0x31, 0xc6, 0x98, 0x08, 0x51, 0x09, 0x9a, 0x10, 0xec, 0xc1, 0x03, 0x07, 0xc9, + 0x74, 0x3b, 0xac, 0x1b, 0x96, 0x9d, 0xb2, 0xbb, 0x45, 0x08, 0x21, 0x31, 0xde, 0xbc, 0x91, 0x98, + 0x68, 0x3c, 0xe8, 0xc5, 0x83, 0xff, 0x0a, 0x47, 0x12, 0x2f, 0x9c, 0x8c, 0x01, 0xff, 0x10, 0x33, + 0x3f, 0xda, 0xfd, 0xd1, 0xdd, 0xee, 0x36, 0x29, 0x37, 0x3a, 0xf3, 0xde, 0x9b, 0xcf, 0xf7, 0xfb, + 0x9a, 0xf7, 0x0a, 0x54, 0xc8, 0x1e, 0x35, 0xa8, 0x4b, 0x74, 0xea, 0x62, 0xc3, 0x26, 0xfa, 0x4e, + 0x83, 0xb8, 0xfb, 0x5a, 0xdd, 0xa5, 0x3e, 0x45, 0xd7, 0xe4, 0x9d, 0x26, 0xee, 0x94, 0x61, 0x93, + 0x9a, 0x94, 0x5f, 0xe9, 0xec, 0x2f, 0x11, 0xa5, 0xdc, 0x32, 0x29, 0x35, 0x6d, 0xa2, 0xe3, 0xba, + 0xa5, 0x63, 0xc7, 0xa1, 0x3e, 0xf6, 0x2d, 0xea, 0x78, 0xf2, 0x76, 0xd6, 0xa0, 0xde, 0x36, 0xf5, + 0xf4, 0x2a, 0xf6, 0x64, 0x71, 0x7d, 0xb7, 0x5c, 0x25, 0x3e, 0x2e, 0xeb, 0x75, 0x6c, 0x5a, 0x0e, + 0x0f, 0x96, 0xb1, 0x37, 0x63, 0x2c, 0x75, 0xec, 0xe2, 0x6d, 0x2f, 0xed, 0xd2, 0xb5, 0x0c, 0xd2, + 0xbc, 0x1c, 0x8f, 0x5d, 0xba, 0xb4, 0xe1, 0xd4, 0x36, 0x2c, 0x67, 0x93, 0x76, 0x0c, 0xa8, 0x61, + 0x1f, 0xa7, 0x04, 0xec, 0x62, 0xdb, 0xaa, 0x61, 0x9f, 0xba, 0xf2, 0x09, 0x75, 0x18, 0xa2, 0xd7, + 0x0c, 0x7f, 0x8d, 0x43, 0x55, 0xc8, 0x4e, 0x83, 0x78, 0xbe, 0xfa, 0x0a, 0x5e, 0x8f, 0x9c, 0x7a, + 0x75, 0xea, 0x78, 0x04, 0x2d, 0xc0, 0x41, 0x01, 0x3f, 0x0a, 0x6e, 0x83, 0xe9, 0xcb, 0x73, 0x23, + 0x5a, 0xd4, 0x4a, 0x4d, 0xc4, 0x2f, 0xf5, 0x1f, 0xff, 0x19, 0x2f, 0x54, 0x64, 0xac, 0x5a, 0x86, + 0x37, 0x78, 0xb1, 0x65, 0xe2, 0xaf, 0x71, 0x75, 0xf2, 0x15, 0x34, 0x0a, 0x2f, 0xf9, 0x74, 0x8b, + 0x38, 0x2b, 0x35, 0x5e, 0x6f, 0xa0, 0xd2, 0xfc, 0xa8, 0xae, 0xc2, 0x91, 0x78, 0x4a, 0x08, 0x81, + 0x9f, 0xa4, 0x22, 0xf0, 0xdb, 0x16, 0x02, 0xff, 0xa4, 0x6e, 0x48, 0x84, 0x45, 0xdb, 0x8e, 0x22, + 0xbc, 0x80, 0x30, 0xe8, 0x97, 0x2c, 0x39, 0xa9, 0x89, 0xe6, 0x6a, 0xac, 0xb9, 0x9a, 0xf8, 0xe6, + 0xc8, 0xe6, 0x6a, 0x6b, 0xd8, 0x24, 0x32, 0xb7, 0x12, 0xca, 0x54, 0xbf, 0x02, 0x49, 0x1c, 0x7a, + 0x21, 0x81, 0xb8, 0x98, 0x97, 0x18, 0x2d, 0x47, 0xc0, 0xfa, 0x38, 0xd8, 0x54, 0x26, 0x98, 0x78, + 0x32, 0x42, 0xb6, 0x00, 0x47, 0x9b, 0x56, 0x56, 0xd8, 0xb7, 0x63, 0xc5, 0xd9, 0xa4, 0xd9, 0x0d, + 0x58, 0x87, 0x63, 0x09, 0x59, 0x52, 0xd1, 0x13, 0x38, 0xe4, 0x36, 0x0f, 0xa5, 0x67, 0x63, 0x71, + 0x51, 0xad, 0x2c, 0xa9, 0x2b, 0xc8, 0x50, 0xab, 0x92, 0x68, 0xd1, 0xb6, 0xdb, 0x88, 0x7a, 0xd5, + 0x8f, 0x9f, 0x40, 0x0a, 0x88, 0x3e, 0x92, 0x2c, 0xa0, 0xd8, 0x9d, 0x80, 0x8b, 0xeb, 0xcd, 0x33, + 0xec, 0xe3, 0xee, 0x7b, 0x23, 0xb2, 0x62, 0xd2, 0xd8, 0x61, 0xc7, 0xde, 0xb0, 0x80, 0x88, 0x34, + 0x76, 0xd0, 0xd6, 0x9b, 0x30, 0xd1, 0x85, 0xf5, 0xa6, 0x93, 0x80, 0x62, 0x77, 0x02, 0x7a, 0xd7, + 0x9b, 0x72, 0xe0, 0xf2, 0x9b, 0xd6, 0xd0, 0x6c, 0x5a, 0x31, 0x0c, 0x07, 0xaa, 0x36, 0x35, 0xb6, + 0xb8, 0x0b, 0xfd, 0x15, 0xf1, 0x41, 0x7d, 0x0b, 0x95, 0xa4, 0x14, 0x29, 0xec, 0x29, 0x84, 0xc1, + 0xf4, 0x95, 0xf6, 0x29, 0x71, 0x65, 0x41, 0x9e, 0x94, 0x16, 0xca, 0x51, 0x8d, 0xc0, 0xb7, 0x76, + 0xa4, 0x5e, 0x75, 0xe7, 0x17, 0x90, 0x2a, 0x62, 0xaf, 0xa4, 0xa8, 0x28, 0x76, 0xab, 0xa2, 0x67, + 0x1d, 0x9a, 0x3b, 0x85, 0x70, 0x80, 0x93, 0xa2, 0x0f, 0x00, 0x0e, 0x8a, 0xd5, 0x83, 0xd4, 0x38, + 0x4b, 0xfb, 0x76, 0x53, 0xee, 0x74, 0x8c, 0x11, 0x2f, 0xa9, 0xf7, 0x3e, 0xfe, 0xfe, 0xf7, 0xb9, + 0x6f, 0x0a, 0x4d, 0xe8, 0xcf, 0x45, 0xf0, 0x2a, 0xf1, 0xdf, 0x53, 0x77, 0x4b, 0x4f, 0xdc, 0xe6, + 0xe8, 0x88, 0x21, 0x88, 0xd1, 0x3d, 0x91, 0x58, 0x3e, 0xbe, 0xfd, 0x94, 0xc9, 0xac, 0x30, 0x09, + 0xf2, 0x90, 0x83, 0x94, 0x91, 0x9e, 0x05, 0xc2, 0xd3, 0xf4, 0x03, 0x39, 0x26, 0x0e, 0xd1, 0x27, + 0x00, 0x87, 0x44, 0xad, 0x45, 0xdb, 0x4e, 0xa1, 0x8a, 0x2f, 0xc4, 0x14, 0xaa, 0xb6, 0xad, 0x96, + 0xdf, 0x1e, 0xe1, 0xc9, 0x77, 0x00, 0x87, 0x5a, 0x13, 0x15, 0x4d, 0xa7, 0x49, 0x8f, 0xef, 0x03, + 0x65, 0x26, 0x47, 0xa4, 0x24, 0x7a, 0xcc, 0x89, 0x1e, 0xa0, 0xf9, 0x0c, 0xa2, 0xe0, 0x47, 0x54, + 0xc8, 0xab, 0x2f, 0x00, 0x5e, 0x69, 0x95, 0x64, 0x76, 0x4d, 0xa7, 0xf9, 0x90, 0x13, 0x31, 0x69, + 0xef, 0xa8, 0x65, 0x8e, 0x78, 0x17, 0xcd, 0xe4, 0x46, 0x0c, 0x8c, 0xe3, 0xd3, 0xad, 0xb3, 0x71, + 0xa1, 0x61, 0x9d, 0x61, 0x5c, 0x78, 0xe2, 0x76, 0x69, 0x1c, 0xfb, 0x71, 0x99, 0x64, 0x1c, 0x2b, + 0x99, 0x6d, 0x5c, 0x36, 0x62, 0xd2, 0x52, 0xe8, 0xd2, 0x38, 0x86, 0x88, 0x7e, 0x00, 0x08, 0x83, + 0x39, 0x84, 0x52, 0xfd, 0x68, 0x9b, 0xa4, 0xca, 0x6c, 0x9e, 0x50, 0x09, 0xf6, 0x88, 0x83, 0xcd, + 0xa3, 0x72, 0x06, 0x58, 0x30, 0xff, 0xf4, 0x03, 0xbe, 0x2c, 0x0e, 0xd1, 0x37, 0x00, 0xaf, 0x06, + 0x15, 0x99, 0x75, 0xa9, 0x86, 0xe4, 0x65, 0x4c, 0x1c, 0xd9, 0xb9, 0xcd, 0x0b, 0x18, 0x97, 0x5e, + 0x1e, 0x9f, 0x95, 0xc0, 0xc9, 0x59, 0x09, 0xfc, 0x3d, 0x2b, 0x81, 0xa3, 0xf3, 0x52, 0xe1, 0xe4, + 0xbc, 0x54, 0x38, 0x3d, 0x2f, 0x15, 0xd6, 0xef, 0x9b, 0x96, 0xff, 0xae, 0x51, 0xd5, 0x0c, 0xba, + 0x9d, 0x56, 0x6e, 0xaf, 0x59, 0xd0, 0xdf, 0xaf, 0x13, 0xaf, 0x3a, 0xc8, 0xff, 0xd1, 0x98, 0xff, + 0x1f, 0x00, 0x00, 0xff, 0xff, 0x54, 0x54, 0x9b, 0x6a, 0x93, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -755,6 +951,9 @@ type QueryClient interface { // Queries a list of RoundData items. RoundData(ctx context.Context, in *QueryGetRoundDataRequest, opts ...grpc.CallOption) (*QueryGetRoundDataResponse, error) RoundDataAll(ctx context.Context, in *QueryAllRoundDataRequest, opts ...grpc.CallOption) (*QueryAllRoundDataResponse, error) + // Queries a list of Validators items. + Validators(ctx context.Context, in *QueryGetValidatorsRequest, opts ...grpc.CallOption) (*QueryGetValidatorsResponse, error) + ValidatorsAll(ctx context.Context, in *QueryAllValidatorsRequest, opts ...grpc.CallOption) (*QueryAllValidatorsResponse, error) } type queryClient struct { @@ -828,6 +1027,24 @@ func (c *queryClient) RoundDataAll(ctx context.Context, in *QueryAllRoundDataReq return out, nil } +func (c *queryClient) Validators(ctx context.Context, in *QueryGetValidatorsRequest, opts ...grpc.CallOption) (*QueryGetValidatorsResponse, error) { + out := new(QueryGetValidatorsResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/Validators", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ValidatorsAll(ctx context.Context, in *QueryAllValidatorsRequest, opts ...grpc.CallOption) (*QueryAllValidatorsResponse, error) { + out := new(QueryAllValidatorsResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/ValidatorsAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -841,6 +1058,9 @@ type QueryServer interface { // Queries a list of RoundData items. RoundData(context.Context, *QueryGetRoundDataRequest) (*QueryGetRoundDataResponse, error) RoundDataAll(context.Context, *QueryAllRoundDataRequest) (*QueryAllRoundDataResponse, error) + // Queries a list of Validators items. + Validators(context.Context, *QueryGetValidatorsRequest) (*QueryGetValidatorsResponse, error) + ValidatorsAll(context.Context, *QueryAllValidatorsRequest) (*QueryAllValidatorsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -868,6 +1088,12 @@ func (*UnimplementedQueryServer) RoundData(ctx context.Context, req *QueryGetRou func (*UnimplementedQueryServer) RoundDataAll(ctx context.Context, req *QueryAllRoundDataRequest) (*QueryAllRoundDataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RoundDataAll not implemented") } +func (*UnimplementedQueryServer) Validators(ctx context.Context, req *QueryGetValidatorsRequest) (*QueryGetValidatorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Validators not implemented") +} +func (*UnimplementedQueryServer) ValidatorsAll(ctx context.Context, req *QueryAllValidatorsRequest) (*QueryAllValidatorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorsAll not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -999,6 +1225,42 @@ func _Query_RoundDataAll_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Query_Validators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetValidatorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Validators(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/Validators", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Validators(ctx, req.(*QueryGetValidatorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ValidatorsAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllValidatorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ValidatorsAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/ValidatorsAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ValidatorsAll(ctx, req.(*QueryAllValidatorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "exocore.oracle.Query", HandlerType: (*QueryServer)(nil), @@ -1031,6 +1293,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "RoundDataAll", Handler: _Query_RoundDataAll_Handler, }, + { + MethodName: "Validators", + Handler: _Query_Validators_Handler, + }, + { + MethodName: "ValidatorsAll", + Handler: _Query_ValidatorsAll_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "exocore/oracle/query.proto", @@ -1527,96 +1797,241 @@ func (m *QueryAllRoundDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryGetValidatorsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n +func (m *QueryGetValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetPricesRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryGetValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.TokenId != 0 { - n += 1 + sovQuery(uint64(m.TokenId)) + if m.Block != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *QueryGetPricesResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryGetValidatorsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - l = m.Prices.Size() - n += 1 + l + sovQuery(uint64(l)) - return n + return dAtA[:n], nil } -func (m *QueryAllPricesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n +func (m *QueryGetValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllPricesResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryGetValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Prices) > 0 { - for _, e := range m.Prices { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + { + size, err := m.Validators.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *QueryGetRoundInfoRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryAllValidatorsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllValidatorsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetPricesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovQuery(uint64(m.TokenId)) + } + return n +} + +func (m *QueryGetPricesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Prices.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllPricesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllPricesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Prices) > 0 { + for _, e := range m.Prices { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetRoundInfoRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.TokenId != 0 { @@ -1661,75 +2076,415 @@ func (m *QueryAllRoundInfoResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) } } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetRoundDataRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TokenId != 0 { - n += 1 + sovQuery(uint64(m.TokenId)) - } - return n -} - -func (m *QueryGetRoundDataResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.RoundData.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllRoundDataRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetRoundDataRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovQuery(uint64(m.TokenId)) + } + return n +} + +func (m *QueryGetRoundDataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.RoundData.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllRoundDataRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllRoundDataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RoundData) > 0 { + for _, e := range m.RoundData { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetValidatorsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Block != 0 { + n += 1 + sovQuery(uint64(m.Block)) + } + return n +} + +func (m *QueryGetValidatorsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Validators.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllValidatorsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllValidatorsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Validators) > 0 { + for _, e := range m.Validators { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetPricesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + } + m.TokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TokenId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetPricesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Prices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } -func (m *QueryAllRoundDataResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.RoundData) > 0 { - for _, e := range m.RoundData { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if iNdEx > l { + return io.ErrUnexpectedEOF } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return nil } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1752,12 +2507,48 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllPricesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1779,7 +2570,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1802,15 +2593,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllPricesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1837,7 +2628,44 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Prices = append(m.Prices, Prices{}) + if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1862,7 +2690,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetRoundInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1885,10 +2713,10 @@ func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetPricesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRoundInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRoundInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1931,7 +2759,7 @@ func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetRoundInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1954,15 +2782,15 @@ func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetPricesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRoundInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRoundInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RoundInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1989,7 +2817,7 @@ func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Prices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RoundInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2014,7 +2842,7 @@ func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllRoundInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2037,10 +2865,10 @@ func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllPricesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllRoundInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllRoundInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2100,7 +2928,7 @@ func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllRoundInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2123,15 +2951,15 @@ func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllPricesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllRoundInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllRoundInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RoundInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2158,8 +2986,8 @@ func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Prices = append(m.Prices, Prices{}) - if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.RoundInfo = append(m.RoundInfo, RoundInfo{}) + if err := m.RoundInfo[len(m.RoundInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2220,7 +3048,7 @@ func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetRoundInfoRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetRoundDataRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2243,10 +3071,10 @@ func (m *QueryGetRoundInfoRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetRoundInfoRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRoundDataRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetRoundInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRoundDataRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2289,7 +3117,7 @@ func (m *QueryGetRoundInfoRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetRoundInfoResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetRoundDataResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2312,15 +3140,15 @@ func (m *QueryGetRoundInfoResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetRoundInfoResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRoundDataResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetRoundInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRoundDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RoundInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RoundData", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2347,7 +3175,7 @@ func (m *QueryGetRoundInfoResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.RoundInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RoundData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2372,7 +3200,7 @@ func (m *QueryGetRoundInfoResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllRoundInfoRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllRoundDataRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2395,10 +3223,10 @@ func (m *QueryAllRoundInfoRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllRoundInfoRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllRoundDataRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRoundInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllRoundDataRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2458,7 +3286,7 @@ func (m *QueryAllRoundInfoRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllRoundInfoResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllRoundDataResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2481,15 +3309,15 @@ func (m *QueryAllRoundInfoResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllRoundInfoResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllRoundDataResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRoundInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllRoundDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RoundInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RoundData", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2516,8 +3344,8 @@ func (m *QueryAllRoundInfoResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RoundInfo = append(m.RoundInfo, RoundInfo{}) - if err := m.RoundInfo[len(m.RoundInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.RoundData = append(m.RoundData, RoundData{}) + if err := m.RoundData[len(m.RoundData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2578,7 +3406,7 @@ func (m *QueryAllRoundInfoResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetRoundDataRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetValidatorsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2601,17 +3429,17 @@ func (m *QueryGetRoundDataRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetRoundDataRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetValidatorsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetRoundDataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) } - m.TokenId = 0 + m.Block = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2621,7 +3449,7 @@ func (m *QueryGetRoundDataRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TokenId |= int32(b&0x7F) << shift + m.Block |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2647,7 +3475,7 @@ func (m *QueryGetRoundDataRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetRoundDataResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetValidatorsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2670,15 +3498,15 @@ func (m *QueryGetRoundDataResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetRoundDataResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetValidatorsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetRoundDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RoundData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2705,7 +3533,7 @@ func (m *QueryGetRoundDataResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.RoundData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Validators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2730,7 +3558,7 @@ func (m *QueryGetRoundDataResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllRoundDataRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllValidatorsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2753,10 +3581,10 @@ func (m *QueryAllRoundDataRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllRoundDataRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllValidatorsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRoundDataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2816,7 +3644,7 @@ func (m *QueryAllRoundDataRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllRoundDataResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllValidatorsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2839,15 +3667,15 @@ func (m *QueryAllRoundDataResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllRoundDataResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllValidatorsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRoundDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RoundData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2874,8 +3702,8 @@ func (m *QueryAllRoundDataResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RoundData = append(m.RoundData, RoundData{}) - if err := m.RoundData[len(m.RoundData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Validators = append(m.Validators, Validators{}) + if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index 18ac45276..b324d384a 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -321,6 +321,96 @@ func local_request_Query_RoundDataAll_0(ctx context.Context, marshaler runtime.M } +func request_Query_Validators_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetValidatorsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["block"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "block") + } + + protoReq.Block, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "block", err) + } + + msg, err := client.Validators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Validators_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetValidatorsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["block"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "block") + } + + protoReq.Block, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "block", err) + } + + msg, err := server.Validators(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_ValidatorsAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_ValidatorsAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllValidatorsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ValidatorsAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ValidatorsAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ValidatorsAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllValidatorsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ValidatorsAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ValidatorsAll(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -488,6 +578,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_Validators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Validators_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Validators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ValidatorsAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ValidatorsAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ValidatorsAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -669,6 +805,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_Validators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Validators_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Validators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ValidatorsAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ValidatorsAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ValidatorsAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -686,6 +862,10 @@ var ( pattern_Query_RoundData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "round_data", "tokenId"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_RoundDataAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "round_data"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Validators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "validators", "block"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_ValidatorsAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "validators"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -702,4 +882,8 @@ var ( forward_Query_RoundData_0 = runtime.ForwardResponseMessage forward_Query_RoundDataAll_0 = runtime.ForwardResponseMessage + + forward_Query_Validators_0 = runtime.ForwardResponseMessage + + forward_Query_ValidatorsAll_0 = runtime.ForwardResponseMessage ) diff --git a/x/oracle/types/validator_power.pb.go b/x/oracle/types/validator_power.pb.go new file mode 100644 index 000000000..97481f2b5 --- /dev/null +++ b/x/oracle/types/validator_power.pb.go @@ -0,0 +1,370 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/validator_power.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type ValidatorWithPower struct { + OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` + Tokens string `protobuf:"bytes,2,opt,name=tokens,proto3" json:"tokens,omitempty"` +} + +func (m *ValidatorWithPower) Reset() { *m = ValidatorWithPower{} } +func (m *ValidatorWithPower) String() string { return proto.CompactTextString(m) } +func (*ValidatorWithPower) ProtoMessage() {} +func (*ValidatorWithPower) Descriptor() ([]byte, []int) { + return fileDescriptor_352b7bebb4b6a982, []int{0} +} +func (m *ValidatorWithPower) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorWithPower) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorWithPower.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ValidatorWithPower) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorWithPower.Merge(m, src) +} +func (m *ValidatorWithPower) XXX_Size() int { + return m.Size() +} +func (m *ValidatorWithPower) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorWithPower.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorWithPower proto.InternalMessageInfo + +func (m *ValidatorWithPower) GetOperatorAddress() string { + if m != nil { + return m.OperatorAddress + } + return "" +} + +func (m *ValidatorWithPower) GetTokens() string { + if m != nil { + return m.Tokens + } + return "" +} + +func init() { + proto.RegisterType((*ValidatorWithPower)(nil), "exocore.oracle.ValidatorWithPower") +} + +func init() { + proto.RegisterFile("exocore/oracle/validator_power.proto", fileDescriptor_352b7bebb4b6a982) +} + +var fileDescriptor_352b7bebb4b6a982 = []byte{ + // 196 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x4b, 0xcc, 0xc9, 0x4c, + 0x49, 0x2c, 0xc9, 0x2f, 0x8a, 0x2f, 0xc8, 0x2f, 0x4f, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, + 0x17, 0xe2, 0x83, 0xaa, 0xd2, 0x83, 0xa8, 0x52, 0x0a, 0xe7, 0x12, 0x0a, 0x83, 0x29, 0x0c, 0xcf, + 0x2c, 0xc9, 0x08, 0x00, 0xa9, 0x15, 0xd2, 0xe4, 0x12, 0xc8, 0x2f, 0x48, 0x2d, 0x02, 0xeb, 0x4e, + 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e, 0x96, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0xe2, 0x87, 0x89, + 0x3b, 0x42, 0x84, 0x85, 0xc4, 0xb8, 0xd8, 0x4a, 0xf2, 0xb3, 0x53, 0xf3, 0x8a, 0x25, 0x98, 0xc0, + 0x0a, 0xa0, 0x3c, 0x27, 0xaf, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, + 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x32, + 0x48, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x77, 0x85, 0xb8, 0xc6, 0x2f, + 0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x5b, 0x1f, 0xe6, 0x85, 0x0a, 0x98, 0x27, 0x4a, 0x2a, 0x0b, 0x52, + 0x8b, 0x93, 0xd8, 0xc0, 0x6e, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x6e, 0x12, 0xf5, 0x73, + 0xe3, 0x00, 0x00, 0x00, +} + +func (m *ValidatorWithPower) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidatorWithPower) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorWithPower) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Tokens) > 0 { + i -= len(m.Tokens) + copy(dAtA[i:], m.Tokens) + i = encodeVarintValidatorPower(dAtA, i, uint64(len(m.Tokens))) + i-- + dAtA[i] = 0x12 + } + if len(m.OperatorAddress) > 0 { + i -= len(m.OperatorAddress) + copy(dAtA[i:], m.OperatorAddress) + i = encodeVarintValidatorPower(dAtA, i, uint64(len(m.OperatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintValidatorPower(dAtA []byte, offset int, v uint64) int { + offset -= sovValidatorPower(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ValidatorWithPower) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAddress) + if l > 0 { + n += 1 + l + sovValidatorPower(uint64(l)) + } + l = len(m.Tokens) + if l > 0 { + n += 1 + l + sovValidatorPower(uint64(l)) + } + return n +} + +func sovValidatorPower(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozValidatorPower(x uint64) (n int) { + return sovValidatorPower(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ValidatorWithPower) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorPower + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidatorWithPower: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorWithPower: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorPower + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthValidatorPower + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthValidatorPower + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OperatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tokens", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorPower + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthValidatorPower + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthValidatorPower + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tokens = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipValidatorPower(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthValidatorPower + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipValidatorPower(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidatorPower + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidatorPower + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidatorPower + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthValidatorPower + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupValidatorPower + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthValidatorPower + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthValidatorPower = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowValidatorPower = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupValidatorPower = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/validators.pb.go b/x/oracle/types/validators.pb.go new file mode 100644 index 000000000..39fc4bf88 --- /dev/null +++ b/x/oracle/types/validators.pb.go @@ -0,0 +1,363 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/validators.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Validators struct { + Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` + ValidatorPower []*ValidatorWithPower `protobuf:"bytes,2,rep,name=validator_power,json=validatorPower,proto3" json:"validator_power,omitempty"` +} + +func (m *Validators) Reset() { *m = Validators{} } +func (m *Validators) String() string { return proto.CompactTextString(m) } +func (*Validators) ProtoMessage() {} +func (*Validators) Descriptor() ([]byte, []int) { + return fileDescriptor_4264e9827808bf71, []int{0} +} +func (m *Validators) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Validators) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Validators.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Validators) XXX_Merge(src proto.Message) { + xxx_messageInfo_Validators.Merge(m, src) +} +func (m *Validators) XXX_Size() int { + return m.Size() +} +func (m *Validators) XXX_DiscardUnknown() { + xxx_messageInfo_Validators.DiscardUnknown(m) +} + +var xxx_messageInfo_Validators proto.InternalMessageInfo + +func (m *Validators) GetBlock() uint64 { + if m != nil { + return m.Block + } + return 0 +} + +func (m *Validators) GetValidatorPower() []*ValidatorWithPower { + if m != nil { + return m.ValidatorPower + } + return nil +} + +func init() { + proto.RegisterType((*Validators)(nil), "exocore.oracle.Validators") +} + +func init() { proto.RegisterFile("exocore/oracle/validators.proto", fileDescriptor_4264e9827808bf71) } + +var fileDescriptor_4264e9827808bf71 = []byte{ + // 202 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x4b, 0xcc, 0xc9, 0x4c, + 0x49, 0x2c, 0xc9, 0x2f, 0x2a, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x2a, 0xd0, + 0x83, 0x28, 0x90, 0x52, 0xc1, 0xa5, 0x21, 0xbe, 0x20, 0xbf, 0x3c, 0xb5, 0x08, 0xa2, 0x4b, 0x29, + 0x9f, 0x8b, 0x2b, 0x0c, 0x6e, 0x92, 0x90, 0x08, 0x17, 0x6b, 0x52, 0x4e, 0x7e, 0x72, 0xb6, 0x04, + 0xa3, 0x02, 0xa3, 0x06, 0x4b, 0x10, 0x84, 0x23, 0xe4, 0xcd, 0xc5, 0x8f, 0xa6, 0x59, 0x82, 0x49, + 0x81, 0x59, 0x83, 0xdb, 0x48, 0x49, 0x0f, 0xd5, 0x4e, 0x3d, 0xb8, 0x51, 0xe1, 0x99, 0x25, 0x19, + 0x01, 0x20, 0x95, 0x41, 0x7c, 0x70, 0xad, 0x60, 0xbe, 0x93, 0xd7, 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, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, + 0xea, 0xbb, 0x42, 0xcc, 0xf5, 0x4b, 0x2d, 0x29, 0xcf, 0x2f, 0xca, 0xd6, 0x87, 0x79, 0xa5, 0x02, + 0xe6, 0x99, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x1f, 0x8c, 0x01, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x0f, 0x7c, 0x34, 0x2c, 0x1c, 0x01, 0x00, 0x00, +} + +func (m *Validators) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Validators) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Validators) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorPower) > 0 { + for iNdEx := len(m.ValidatorPower) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ValidatorPower[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintValidators(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Block != 0 { + i = encodeVarintValidators(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintValidators(dAtA []byte, offset int, v uint64) int { + offset -= sovValidators(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Validators) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Block != 0 { + n += 1 + sovValidators(uint64(m.Block)) + } + if len(m.ValidatorPower) > 0 { + for _, e := range m.ValidatorPower { + l = e.Size() + n += 1 + l + sovValidators(uint64(l)) + } + } + return n +} + +func sovValidators(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozValidators(x uint64) (n int) { + return sovValidators(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Validators) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidators + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Validators: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Validators: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + m.Block = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidators + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Block |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorPower", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidators + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthValidators + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthValidators + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorPower = append(m.ValidatorPower, &ValidatorWithPower{}) + if err := m.ValidatorPower[len(m.ValidatorPower)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipValidators(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthValidators + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipValidators(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidators + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidators + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidators + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthValidators + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupValidators + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthValidators + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthValidators = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowValidators = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupValidators = fmt.Errorf("proto: unexpected end of group") +) From 7695c4f5903be5a97e302dcf565fe087d932e80f Mon Sep 17 00:00:00 2001 From: leonz789 Date: Thu, 29 Feb 2024 03:10:17 +0800 Subject: [PATCH 13/37] feat(oracle-keeper): add aggregator, implement calculator, filter, aggregator --- proto/exocore/oracle/info.proto | 1 + proto/exocore/oracle/price.proto | 8 +- proto/exocore/oracle/tx.proto | 1 + x/oracle/keeper/aggregator.go | 134 +++++++++++++ x/oracle/keeper/aggregator.go_bak | 87 +++++++++ x/oracle/keeper/aggregator_aggregator.go | 96 ++++++++++ x/oracle/keeper/aggregator_calculator.go | 80 ++++++++ x/oracle/keeper/aggregator_filter.go | 84 +++++++++ x/oracle/keeper/keeper.go | 11 +- x/oracle/keeper/msg_server_create_price.go | 6 + x/oracle/keeper/params.go | 1 + x/oracle/keeper/readme.md | 79 ++++++++ x/oracle/keeper/tmp.md | 0 x/oracle/keeper/types.go | 100 ++++++++++ x/oracle/types/info.pb.go | 98 +++++++--- x/oracle/types/params.go | 8 + x/oracle/types/price.pb.go | 208 ++++++++++----------- x/oracle/types/tx.pb.go | 76 ++++++-- 18 files changed, 918 insertions(+), 160 deletions(-) create mode 100644 x/oracle/keeper/aggregator.go create mode 100644 x/oracle/keeper/aggregator.go_bak create mode 100644 x/oracle/keeper/aggregator_aggregator.go create mode 100644 x/oracle/keeper/aggregator_calculator.go create mode 100644 x/oracle/keeper/aggregator_filter.go create mode 100644 x/oracle/keeper/readme.md create mode 100644 x/oracle/keeper/tmp.md create mode 100644 x/oracle/keeper/types.go diff --git a/proto/exocore/oracle/info.proto b/proto/exocore/oracle/info.proto index d3be094fd..0d77c1895 100644 --- a/proto/exocore/oracle/info.proto +++ b/proto/exocore/oracle/info.proto @@ -38,4 +38,5 @@ message Source { Endpoint entry = 2; //set false when the source is out of service or reject to accept this source for official service bool valid = 3; + bool deterministic = 4; } diff --git a/proto/exocore/oracle/price.proto b/proto/exocore/oracle/price.proto index 58268af87..92df523f4 100644 --- a/proto/exocore/oracle/price.proto +++ b/proto/exocore/oracle/price.proto @@ -6,23 +6,23 @@ option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; //token price with timestamp fetched from source //{price:"12345",decimal:"2"}->price: 123.45 usdt -message PriceWithTime { +message PriceWithTimeAndDetId { string price = 1; int32 decimal = 2; string timestamp = 3; + string det_id = 4; } message PriceWithSource{ //refer to id from Params.SourceList, where this price fetched from, 0 is reserved for custom usage int32 source_id = 1; //if source is deteministic like chainlink with roundID, set this value with which returned from source - string det_id = 2; //up to 3 values in case of the async of network, to give more time for oracle nodes(validators) get into consensus //eg.with deterministic source, this array will contian 3 continuous values up to latest //for non-deterministic source, it's a choice by v2 rules. - repeated PriceWithTime prices = 3; + repeated PriceWithTimeAndDetId prices = 2; //used for 0-sourceID-customDefinedSource - string desc = 4; + string desc = 3; } message PriceWithTimeAndRound { diff --git a/proto/exocore/oracle/tx.proto b/proto/exocore/oracle/tx.proto index 22cb208ee..5d1d8252d 100644 --- a/proto/exocore/oracle/tx.proto +++ b/proto/exocore/oracle/tx.proto @@ -18,6 +18,7 @@ message MsgCreatePrice { repeated PriceWithSource prices = 3; //on which block commit does this message be built on uint64 based_block = 4; + int32 nonce = 5; } message MsgCreatePriceResponse {} diff --git a/x/oracle/keeper/aggregator.go b/x/oracle/keeper/aggregator.go new file mode 100644 index 000000000..da7b1b2a9 --- /dev/null +++ b/x/oracle/keeper/aggregator.go @@ -0,0 +1,134 @@ +package keeper + +import ( + "errors" + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// TODO: these consts should be defined in params +const ( + //maxNonce indicates how many messages a validator can submit in a single roudn to offer price + maxNonce = 3 + //these two threshold value used to set the threshold to tell when the price had come to consensus and was able to get a final price of that round + threshold_a = 2 + threshold_b = 3 + //maxDetId each validator can submit, so the calculator can cache maximum of maxDetId*count(validators) values, this is for resistance of malicious validator submmiting invalid detId + maxDetId = 5 +) + +type roundInfo struct { + //this round of price will start from block basedBlock+1, the basedBlock served as a trigger to notify validators to submit prices + basedBlock uint64 + //next round id of the price oracle service, price with thie id will be record on block basedBlock+1 if all prices submitted by validators(for v1, validators serve as oracle nodes) get to consensus immedately + nextRoundId uint64 + //indicate if this round is open for collecting prices or closed in either condition that success with a consensused price or not + //1: open, 2: closed + status int32 +} + +// worker is the actual instance used to calculate final price for each tokenFeeder's round. Which means, every tokenFeeder corresponds to a specified token, and for that tokenFeeder, each round we use a worker instance to calculate the final price +type worker struct { + //mainly used for deterministic source data to check conflics and validation + f *filter + //used to get to consensus on deterministic source's data + c *calculator + //when enough data(exceeds threshold) collected, aggregate to conduct the final price + a *aggregator +} + +// aggregatorContext keeps memory cache for state params, validatorset, and updatedthese values as they udpated on chain. And it keeps the infomation to track all tokenFeeders' status and data collection +type aggregatorContext struct { + params *params + + //validator->power + validatorsPower map[string]*big.Int + totalPower *big.Int + + rounds map[int32]*roundInfo + + aggregators map[int32]*worker +} + +// NewCreatePrice receives msgCreatePrice message, and goes process: filter->aggregator, filter->calculator->aggregator +// non-deterministic data will goes directly into aggregator, and deterministic data will goes into calculator first to get consensus on the deterministic id. +func (agc *aggregatorContext) NewCreatePrice(price types.MsgCreatePrice) (bool, error) { + //sanity check + //TODO: check nonce [1,3] in anteHandler, related to params, may not able + //TODO: check the msgCreatePrice's Decimal is correct with params setting + //TODO: check len(price.prices)>0, len(price.prices._range_eachPriceWithSource.Prices)>0, at least has one source, and for each source has at least one price + + //TODO: check for each source, at most maxDetId count price (now in filter, ->anteHandler) + if price.Nonce < 1 || price.Nonce > maxNonce { + return false, errors.New("") + } + + //TODO: sanity check for price(no more than maxDetId count for each source, this should be take care in anteHandler) + if price.Prices == nil || len(price.Prices) == 0 { + return false, errors.New("") + } + for _, pSource := range price.Prices { + if pSource.Prices == nil || len(pSource.Prices) == 0 || len(pSource.Prices) > maxDetId || !agc.params.isValidSource(pSource.SourceId) { + return false, errors.New("") + } + //check with params is coressponding source is deteministic + if agc.params.isDeterministicSource(pSource.SourceId) { + for _, pDetId := range pSource.Prices { + //TODO: verify the format of DetId is correct, since this is string, and we will make consensus with validator's power, so it's ok not to verify the format + //just make sure the DetId won't mess up with NS's placeholder id, the limitation of maximum count one validator can submit will be check by filter + if len(pDetId.DetId) == 0 { + //deterministic must have specified deterministicId + return false, errors.New("") + } + } + } else { + //sanity check: NS submit only one price with detId=="" + if len(pSource.Prices) > 1 || len(pSource.Prices[0].DetId) > 0 { + return false, errors.New("") + } + } + } + + validator := price.Creator + //validator exists in current active validator set + if power := agc.validatorsPower[validator]; power != nil { + //check feeder is active + feederContext := agc.rounds[price.FeederId] + if feederContext == nil || feederContext.status != 1 { + //feederId does not exist or not alive + return false, errors.New("") + } + //senity check on basedBlock + if price.BasedBlock != feederContext.basedBlock { + return false, errors.New("") + } + + //check sources rule matches + if ok, err := agc.params.checkRules(price.FeederId, price.Prices); !ok { + return false, err + } + + feederWorker := agc.aggregators[price.FeederId] + //worker initialzed here reduce workload for Endblocker + if feederWorker == nil { + feederWorker = agc.newWorker() + agc.aggregators[price.FeederId] = feederWorker + } + + list4Calculator, list4Aggregator := feederWorker.f.filtrate(price) + feederWorker.a.fillPrice(list4Aggregator, validator, power) + feederWorker.c.fillPrice(list4Calculator, validator, power) + } + //invalid creator, require validator to be the price reporter + return false, errors.New("") +} + +// newWorker new a instance for a tokenFeeder's specific round +func (aggC *aggregatorContext) newWorker() *worker { + return &worker{ + f: newFilter(maxNonce, maxDetId), + c: newCalculator(len(aggC.validatorsPower)), + a: newAggregator(len(aggC.validatorsPower), aggC.totalPower), + } +} diff --git a/x/oracle/keeper/aggregator.go_bak b/x/oracle/keeper/aggregator.go_bak new file mode 100644 index 000000000..d0b752f16 --- /dev/null +++ b/x/oracle/keeper/aggregator.go_bak @@ -0,0 +1,87 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type filter struct { +} + +type calculator struct { +} + +type aggregator struct { +} + +var agg *aggregator + +// TODO: we do the translation here from KVstore's tokenId->data in both roundInfo and roundData for calculation convinence, but this cause additional calculation +// TODO: !!!neeed to refactor the key for KVStore for both these two stucture before deployed +type aggregator struct { + //read only, params will not be modified from aggregagor + params *params + //context infomation for every round aggregation corespond to each tokenId + roundInfo map[int32]*types.RoundInfo + //collec + roundData map[int32]*types.RoundData + // validators map[uint64]*types.Validators + validators []*types.Validators + + k Keeper +} + +func GetAggregator() *aggregator { + if agg != nil { + return agg + } + return &aggregator{} +} + +func (k *Keeper) RecacheAgg(ctx sdk.Context) { + +} + +// UpdateParams will update the params in mem cache, check and conduce all related consequece from this update. +func (k *Keeper) UpdateParams4Agg(ctx sdk.Context) { + + //triggered by k.SetParams and do the validation and update on agg context{roundInfo, roundData, } + // agg.params = k.GetParams(ctx) + if agg.params == nil { + //prepare the initial params, just set the value, with the server on, this will be called once, and updated everytime the params be updated. + //this must be the very first time we interact with the aggregator, so recache any possible contextInfo(roundInfo, roundData) from KVStore(eg. restart a node) + return + } + //udpate params with specified keys, and trigger the ralted modificaiton for the context(roundId, roundData) + +} + +// UpdateContext4Agg updates related data in roundInfo and this may trigger modification on roundData +func (k *Keeper) UpdateContext4Agg(ctx sdk.Context) { + //fill roundInfo for all aflice feeders, do this in The EndBlock, prepare all context for the next block + //check/update agg.params first + //iterates feeders to fill roundInfo + //ops: 1. status:1, 2 + //ops: 2. trigger AppendPrices(success, failed, both lead to a new roundId) +} + +//func (k *Keeper) PrepareRoundInfo(ctx sdk.Context) { +// +//} + +// When the aggregation completed(both success and fail), this method will be called to set the Price of a now round and increase the corresponding NextRoundId +func (k *Keeper) AppendPricesAndSeal(ctx sdk.Context, tokenId int32, roundId uint64, price types.PriceWithTimeAndRound) { + //When aggregation is completed(both success or fail), prices will be updated with new roundId +} + +func (k *Keeper) GetFeederIdStatus(feederId int32) bool { + // if feeder := k.params.getTokenFeeder(feederId); feeder != nil{ + // agg.RoundInfo[] + // return TODO + // } + return agg.roundInfo[feederId].Status == int32(1) +} + +func (k *Keeper) UpdatePrices() { + +} diff --git a/x/oracle/keeper/aggregator_aggregator.go b/x/oracle/keeper/aggregator_aggregator.go new file mode 100644 index 000000000..c6c09fad3 --- /dev/null +++ b/x/oracle/keeper/aggregator_aggregator.go @@ -0,0 +1,96 @@ +package keeper + +import ( + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +type reportPrice struct { + validator string + //final price, set to -1 as initial + price *big.Int + //sourceId->priceWithTimeAndRound + prices map[int32]*priceWithTimeAndRound + power *big.Int +} + +type aggregator struct { + reports []*reportPrice + //total valiadtor power who has submitted pice + reportPower *big.Int + totalPower *big.Int + //validator set total power + // totalPower string + //sourceId->roundId used to track the confirmed DS roundId + //updated by calculator, detId use string + dsPrices map[int32]string +} + +// fill price from validator submittion into aggregator, and calculation the voting power and check with the consensus status of deterministic soruce value to decide when to do the aggregation +func (agg *aggregator) fillPrice(prices []*types.PriceWithSource, validator string, power *big.Int) { + report := agg.getReport(validator) + if report == nil { + report = &reportPrice{ + validator: validator, + prices: make(map[int32]*priceWithTimeAndRound), + power: power, + } + agg.reports = append(agg.reports, report) + agg.reportPower = new(big.Int).Add(agg.totalPower, power) + } + + for _, p := range prices { + if len(p.Prices[0].DetId) == 0 { + //this is an NS price report, price will just be updated instead of append + if pTR := report.prices[p.SourceId]; pTR == nil { + pTmp := p.Prices[0] + priceBigInt, _ := (&big.Int{}).SetString(pTmp.Price, 10) + pTR = &priceWithTimeAndRound{ + price: priceBigInt, + decimal: pTmp.Decimal, + timestamp: pTmp.Timestamp, + // detRoundId: p.DetId, + } + report.prices[p.SourceId] = pTR + } else { + pTR.price, _ = (&big.Int{}).SetString(p.Prices[0].Price, 10) + } + } else { + //this is an DS price report + if pTR := report.prices[p.SourceId]; pTR == nil { + pTmp := p.Prices[0] + pTR = &priceWithTimeAndRound{ + //price: nil, + decimal: pTmp.Decimal, + timestamp: "", + //detRoundId: "", + } + report.prices[p.SourceId] = pTR + } + } + } +} + +func (agg *aggregator) getReport(validator string) *reportPrice { + for _, r := range agg.reports { + if r.validator == validator { + return r + } + } + return nil +} + +func (agg *aggregator) aggregate() { + //TODO: implemetn different MODE for definition of consensus, + //currently: use rule_1+MODE_1: {rule:specified source:`chainlink`, MODE: asap when power exceeds the threshold} +} + +func newAggregator(validatorSetLength int, totalPower *big.Int) *aggregator { + return &aggregator{ + reports: make([]*reportPrice, validatorSetLength), + reportPower: big.NewInt(0), + dsPrices: make(map[int32]string), + totalPower: totalPower, + } +} diff --git a/x/oracle/keeper/aggregator_calculator.go b/x/oracle/keeper/aggregator_calculator.go new file mode 100644 index 000000000..aae647ff1 --- /dev/null +++ b/x/oracle/keeper/aggregator_calculator.go @@ -0,0 +1,80 @@ +package keeper + +import ( + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// internal struct +type priceAndPower struct { + price *big.Int + power *big.Int +} + +type roundPrices struct { //0 means NS + detId string + prices []*priceAndPower + confirmed bool +} + +type roundPricesList []*roundPrices + +func (r roundPricesList) getRound(detId string) *roundPrices { + for _, round := range r { + if round.detId == detId { + return round + } + } + return nil +} + +// calculator used to get consensus on deterministic source based data from validator set reports of price +type calculator struct { + //sourceId->{[]{roundId, []{price,power}, confirmed}}, confirmed value will be set in [0] + deterministicSource map[int32]roundPricesList + validatorLength int +} + +// fillPrice called upon new MsgCreatPrice arrived, to trigger the calculation to get to consensus on the same roundID_of_deterministic_source +func (c *calculator) fillPrice(prices []*types.PriceWithSource, validator string, power *big.Int) { + for _, pSource := range prices { + rounds := c.deterministicSource[pSource.SourceId] + if rounds == nil { + rounds = make([]*roundPrices, 0, maxDetId*c.validatorLength) + c.deterministicSource[pSource.SourceId] = rounds + } + + for _, pDetId := range pSource.Prices { + + round := rounds.getRound(pDetId.DetId) + if round == nil { + if len(rounds) < cap(rounds) { + //add a new roundId from source + round = &roundPrices{ + detId: pDetId.DetId, + prices: make([]*priceAndPower, 0, c.validatorLength), + //confirmed: false, + } + roundPrice, _ := new(big.Int).SetString(pDetId.Price, 10) + round.prices = append(round.prices, &priceAndPower{roundPrice, power}) + //TODO: check if power exceeds the threshold, which means single validator has most of the voting power, bad. + rounds = append(rounds, round) + c.deterministicSource[pSource.SourceId] = rounds + } + //ignore this source price + //only accept maxDetId count different roundId + } else { + //TODO: do the calculation and trigger the aggregator update if any value's power exceeds the threshold + + } + } + } +} + +func newCalculator(validatorSetLength int) *calculator { + return &calculator{ + deterministicSource: make(map[int32]roundPricesList), + validatorLength: validatorSetLength, + } +} diff --git a/x/oracle/keeper/aggregator_filter.go b/x/oracle/keeper/aggregator_filter.go new file mode 100644 index 000000000..1281bdd22 --- /dev/null +++ b/x/oracle/keeper/aggregator_filter.go @@ -0,0 +1,84 @@ +package keeper + +import ( + "strconv" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +type filter struct { + maxNonce int + maxDetId int + //nonce start from 1 + validatorNonce map[string]*set[int32] + //validator_sourceId -> roundID, NS use 0 + validatorSource map[string]*set[string] +} + +func newFilter(maxNonce, maxDetId int) *filter { + return &filter{ + maxNonce: maxNonce, + maxDetId: maxDetId, + validatorNonce: make(map[string]*set[int32]), + validatorSource: make(map[string]*set[string]), + } +} + +func (f *filter) newVNSet() *set[int32] { + return newSet[int32](f.maxNonce) +} + +func (f *filter) newVSSet() *set[string] { + return newSet[string](f.maxDetId) +} + +// add priceWithSource into calculator list and aggregator list depends on the source type(deterministic/non-deterministic) +func (f *filter) addPSource(pSources []*types.PriceWithSource, validator string) (list4Calculator []*types.PriceWithSource, list4Aggregator []*types.PriceWithSource) { + for _, pSource := range pSources { + //check conflicts or duplicate data for the same roundId within the same source + if len(pSource.Prices[0].DetId) > 0 { + k := validator + strconv.Itoa(int(pSource.SourceId)) + detIds := f.validatorSource[k] + if detIds == nil { + detIds = f.newVSSet() + f.validatorSource[k] = detIds + } + + pSourceTmp := &types.PriceWithSource{ + SourceId: pSource.SourceId, + Prices: make([]*types.PriceWithTimeAndDetId, 0, len(pSource.Prices)), + Desc: pSource.Desc, + } + + for _, pDetId := range pSource.Prices { + if ok := detIds.Add(pDetId.DetId); ok { + //deterministic id has not seen in filter and limitation of ids this souce has not reached + pSourceTmp.Prices = append(pSourceTmp.Prices, pDetId) + } + } + if len(pSourceTmp.Prices) > 0 { + list4Calculator = append(list4Calculator, pSourceTmp) + list4Aggregator = append(list4Aggregator, pSourceTmp) + } + } else { + //add non-deterministic pSource value into aggregator list + list4Aggregator = append(list4Aggregator, pSource) + } + } + return list4Calculator, list4Aggregator +} + +// filtrate checks data from MsgCreatePrice, and will drop the conflict or duplicate data, it will then fill data into calculator(for deterministic source data to get to consensus) and aggregator (for both deterministic and non0-deterministic source data run 2-layers aggregation to get the final price) +func (f *filter) filtrate(price types.MsgCreatePrice) (list4Calculator []*types.PriceWithSource, list4Aggregator []*types.PriceWithSource) { + validator := price.Creator + nonces := f.validatorNonce[validator] + if nonces == nil { + nonces = f.newVNSet() + f.validatorNonce[validator] = nonces + } + + if ok := nonces.Add(price.Nonce); ok { + list4Calculator, list4Aggregator = f.addPSource(price.Prices, validator) + } + return +} diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index 2897c30d1..00ad24470 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -10,14 +10,17 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/ExocoreNetwork/exocore/x/oracle/types" + + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" ) type ( Keeper struct { - cdc codec.BinaryCodec - storeKey storetypes.StoreKey - memKey storetypes.StoreKey - paramstore paramtypes.Subspace + cdc codec.BinaryCodec + storeKey storetypes.StoreKey + memKey storetypes.StoreKey + paramstore paramtypes.Subspace + stakingKeeper stakingkeeper.Keeper } ) diff --git a/x/oracle/keeper/msg_server_create_price.go b/x/oracle/keeper/msg_server_create_price.go index fc1f7d545..657cc8b27 100644 --- a/x/oracle/keeper/msg_server_create_price.go +++ b/x/oracle/keeper/msg_server_create_price.go @@ -13,5 +13,11 @@ func (k msgServer) CreatePrice(goCtx context.Context, msg *types.MsgCreatePrice) // TODO: Handling the message _ = ctx + /** + 1. aggregator.rInfo.Tokenid->status == 0(1 ignore and return) + 2. basedBlock is valid [roundInfo.basedBlock, *+5], each base only allow for one submit each validator, window for submition is 5 blocks while every validator only allowed to submit at most 3 transactions each round + 3. check the rule fulfilled(sources check), check the decimal of the 1st mathc the params' definition(among prices the decimal had been checked in ante stage), timestamp:later than previous block's timestamp, [not future than now(+1s), this is checked in anteHandler], timestamp verification is not necessary + **/ + return &types.MsgCreatePriceResponse{}, nil } diff --git a/x/oracle/keeper/params.go b/x/oracle/keeper/params.go index c0f27ef4e..ff807b200 100644 --- a/x/oracle/keeper/params.go +++ b/x/oracle/keeper/params.go @@ -12,5 +12,6 @@ func (k Keeper) GetParams(ctx sdk.Context) types.Params { // SetParams set the params func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + //TODO: update the aggregator's params, call k.UpdateParams k.paramstore.SetParamSet(ctx, ¶ms) } diff --git a/x/oracle/keeper/readme.md b/x/oracle/keeper/readme.md new file mode 100644 index 000000000..129e43468 --- /dev/null +++ b/x/oracle/keeper/readme.md @@ -0,0 +1,79 @@ +# State for Aggregator rechache +## []Params: used as circle +- TokenFeeder: (active/inactive) +- block -> Params +- length = x +### Spec. +only latest Params matter for recache +## ValidatorSet +- block -> []validator{address, power} +## []msgCreatePrice: used as circle +- block -> []msgCreatePrice +--- +x: configured in Params +# Recache +Current block : h +## params update: +1,2,[3],4,5 +a. start feeder: no affect on former round/txs +b. stop feeder: related round/txs sealed at H=3 +Just recache from earliest block-2 +- msg in or before block-1 must have been seald in or before block-5, means the windows are closed, don't need cache for the collection +## validatoset update: +1,2,[3],4,5 +Validator set changed on block-3, this would be done in EndBlock of block-3, and all live round/txs would be seald here, means we don't need to recache any msgs from 1,2,3 +Just remove all block/txs info in 1,2,3 in block-3 Endblock after sealed all live round/txs +## workflow => +h0 = h-x +reProcess blocks from max{h0, min_[]msgCreatePrice.block} to fill the cache +--- +# Aggregator +1. initCache if cache is nil +- if []msgCreatePrice is empty just load Params and validatorSet +- if []msgCreatePrice is not empty, recache the `Aggregator` + +## Triggerd +1. create-price-service(): msg accepted call collectPrice()-> initCache if nil +2. EndBlock() +Seal()-> initCache if nil +- check params update +-- stop feeder(update live feeder's EndBlock): seal related round/txs +--- if any feeder stop at current block, no realted txs will be accepted, +-- new feeder(for new token from currently service) + +- check validatorset update: +-- true: seal all alive round/txs here, update aggregator's status: 1->2 +-- clear all []historyBlock-mem (which would be persit in KV) + +- aggregate() +-- initCache if nil +-- check all live round and: +--- consensus reached, then the round seal with sucess new price(basedBlock), status:1->2 +--- consensus not reached yet, but +---- feeder stops here(set by params), seal with previous price(basedBlock), status: 1->2//and clear corresponding roundInfo[feederId], dealed in postAggregation +---- window ends here, seal with previous price(basedBlock), udpate the related roundInfo[feederId].status:1->2 +---- validatorset changed: seal with previous price(basedBlock), update the related roundInfo[feeerId].status:1->2 +** this change will be active on next block, so we should seal here in front + +- postAggregation() +-- remove all stopped feeders related roundInfo[feederId] +-- if validator changed, remove all roundData + +- Prepare() -> initCache if nil +-- params is up to date already +-- based on current blockHeight and params(feeder)_ fromAggregatorCache, is there any possible status: 0->1(with info filled), 2->1(with info update) +-- update validatorset if changed + +- Persist memCache for recache +- if validatorset changed: +-- clear all the inMem_[]msgCreatePrice, nothing to persist, and clear KV's []msgCreatePrice +-- set inMem_[]validatorSet +- if Parmas cahged: +-- set Params +- msgCreatePrice, if not nil, append to KV +- params, if not nil, append to KV +- validatorset, if not nil, Set to KV(only keep one validatorSet) + +# params update +## updateTime, activeTime +TODO: When set up a new feeder, the feeder activeTime should be later than updateTime(may be dynamic) diff --git a/x/oracle/keeper/tmp.md b/x/oracle/keeper/tmp.md new file mode 100644 index 000000000..e69de29bb diff --git a/x/oracle/keeper/types.go b/x/oracle/keeper/types.go new file mode 100644 index 000000000..b017d7866 --- /dev/null +++ b/x/oracle/keeper/types.go @@ -0,0 +1,100 @@ +package keeper + +import ( + "errors" + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +type priceWithTimeAndRound struct { + price *big.Int + decimal int32 + timestamp string + detRoundId string //roundId from source if exists +} + +type params types.Params + +func (p *params) isDeterministicSource(sourceId int32) bool { + return p.Sources[int(sourceId)].Deterministic +} + +func (p *params) isValidSource(sourceId int32) bool { + if sourceId == 0 { + //custom defined source + return true + } + return p.Sources[int(sourceId)].Valid +} + +func (p *params) getTokenFeeder(feederId int32) *types.TokenFeeder { + for k, v := range p.TokenFeeders { + if int32(k) == feederId { + return v + } + } + return nil +} + +func (p *params) checkRules(feederId int32, prices []*types.PriceWithSource) (bool, error) { + feeder := p.TokenFeeders[feederId] + rule := p.Rules[feeder.RuleId] + //specified sources set, v1 use this rule to set `chainlink` as official source + if rule.SourceIds != nil && len(rule.SourceIds) > 0 { + if len(rule.SourceIds) != len(prices) { + return false, errors.New("") + } + for _, source := range rule.SourceIds { + for _, p := range prices { + if p.SourceId == source { + continue + } + } + return false, errors.New("") + } + } + + //TODO: check NOM + //return true if no rule set, we will accept any source + return true, nil +} + +type set[T comparable] struct { + size int + slice []T +} + +func (s *set[T]) Add(value T) bool { + if len(s.slice) == s.size { + return false + } + for _, v := range s.slice { + if v == value { + return false + } + } + s.slice = append(s.slice, value) + s.size++ + return true +} + +func (s *set[T]) Has(value T) bool { + for _, v := range s.slice { + if v == value { + return true + } + } + return false +} + +func (s *set[T]) length() int { + return s.size +} + +func newSet[T comparable](length int) *set[T] { + return &set[T]{ + size: length, + slice: make([]T, 0, length), + } +} diff --git a/x/oracle/types/info.pb.go b/x/oracle/types/info.pb.go index fd2fa8dd5..98fbd0aeb 100644 --- a/x/oracle/types/info.pb.go +++ b/x/oracle/types/info.pb.go @@ -216,7 +216,8 @@ type Source struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Entry *Endpoint `protobuf:"bytes,2,opt,name=entry,proto3" json:"entry,omitempty"` // set false when the source is out of service or reject to accept this source for official service - Valid bool `protobuf:"varint,3,opt,name=valid,proto3" json:"valid,omitempty"` + Valid bool `protobuf:"varint,3,opt,name=valid,proto3" json:"valid,omitempty"` + Deterministic bool `protobuf:"varint,4,opt,name=deterministic,proto3" json:"deterministic,omitempty"` } func (m *Source) Reset() { *m = Source{} } @@ -273,6 +274,13 @@ func (m *Source) GetValid() bool { return false } +func (m *Source) GetDeterministic() bool { + if m != nil { + return m.Deterministic + } + return false +} + func init() { proto.RegisterType((*Chain)(nil), "exocore.oracle.Chain") proto.RegisterType((*Token)(nil), "exocore.oracle.Token") @@ -285,33 +293,34 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/info.proto", fileDescriptor_a9bbae837d8caf59) } var fileDescriptor_a9bbae837d8caf59 = []byte{ - // 411 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xcf, 0x6e, 0x13, 0x31, - 0x10, 0xc6, 0xe3, 0x4d, 0x37, 0x59, 0xa6, 0xfc, 0xa9, 0xac, 0x0a, 0xb9, 0x39, 0xac, 0xa2, 0x95, - 0x40, 0xe1, 0xb2, 0x8b, 0xca, 0x05, 0x95, 0x03, 0xa2, 0x28, 0x07, 0x38, 0x80, 0xb4, 0x70, 0xe2, - 0x52, 0x39, 0xb6, 0x93, 0x5a, 0x49, 0x3c, 0x91, 0xd7, 0x29, 0xcd, 0x1b, 0x70, 0x44, 0xe2, 0xa5, - 0x38, 0xf6, 0xc8, 0x11, 0x25, 0x2f, 0x82, 0xd6, 0xde, 0x45, 0xad, 0xd4, 0x1e, 0x7a, 0x9b, 0x6f, - 0x66, 0xbe, 0x9f, 0xe5, 0x99, 0x81, 0x23, 0x75, 0x89, 0x02, 0xad, 0x2a, 0xd0, 0x72, 0xb1, 0x50, - 0x85, 0x36, 0x53, 0xcc, 0x57, 0x16, 0x1d, 0xd2, 0xc7, 0x4d, 0x29, 0x0f, 0xa5, 0xc1, 0xe1, 0x0c, - 0x67, 0xe8, 0x4b, 0x45, 0x1d, 0x85, 0xae, 0xac, 0x80, 0xf8, 0xfd, 0x39, 0xd7, 0x86, 0x52, 0xd8, - 0x33, 0x7c, 0xa9, 0x18, 0x19, 0x92, 0xd1, 0x83, 0xd2, 0xc7, 0x75, 0x4e, 0xaa, 0x4a, 0xb0, 0x28, - 0xe4, 0xea, 0x38, 0xfb, 0x45, 0x20, 0xfe, 0x8a, 0x73, 0x75, 0xbb, 0xe3, 0x08, 0x12, 0x51, 0xe3, - 0xce, 0xb4, 0xf4, 0xae, 0xb8, 0xec, 0x7b, 0xfd, 0x41, 0xd2, 0x17, 0x70, 0x20, 0xd0, 0x38, 0xcb, - 0x85, 0x3b, 0xe3, 0x52, 0x5a, 0x55, 0x55, 0xac, 0xeb, 0xad, 0x4f, 0xda, 0xfc, 0xbb, 0x90, 0xa6, - 0x0c, 0xfa, 0x52, 0x09, 0xbd, 0xe4, 0x0b, 0xb6, 0x17, 0x20, 0x8d, 0xa4, 0x4f, 0xa1, 0xc7, 0x85, - 0xd3, 0x17, 0x8a, 0xc5, 0x43, 0x32, 0x4a, 0xca, 0x46, 0x65, 0x3f, 0x22, 0x48, 0xc6, 0x46, 0xae, - 0x50, 0x1b, 0x47, 0x4f, 0x21, 0xc1, 0xe9, 0xd4, 0xbf, 0xcb, 0xc8, 0xb0, 0x3b, 0xda, 0x3f, 0x7e, - 0x9e, 0xdf, 0x1c, 0x46, 0xde, 0xf6, 0xe6, 0x9f, 0x9b, 0xc6, 0xb1, 0x71, 0x76, 0x53, 0xfe, 0xf7, - 0xd1, 0xb7, 0xd0, 0x47, 0x13, 0x10, 0x91, 0x47, 0x3c, 0xbb, 0x1b, 0x61, 0xae, 0x11, 0x5a, 0xd7, - 0xe0, 0x0d, 0x3c, 0xba, 0xc1, 0xa6, 0x07, 0xd0, 0x9d, 0xab, 0x8d, 0x9f, 0x56, 0x5c, 0xd6, 0x21, - 0x3d, 0x84, 0xf8, 0x82, 0x2f, 0xd6, 0xaa, 0x99, 0x6f, 0x10, 0x27, 0xd1, 0x6b, 0x32, 0x38, 0x81, - 0x87, 0xd7, 0xa9, 0xf7, 0xf1, 0x66, 0x13, 0xe8, 0x7d, 0xc1, 0xb5, 0x15, 0xea, 0xd6, 0x05, 0xe5, - 0x10, 0xab, 0x1a, 0xe9, 0x7d, 0xfb, 0xc7, 0xec, 0xae, 0x5f, 0x95, 0xa1, 0xad, 0x79, 0x47, 0x4b, - 0xbf, 0xaa, 0xa4, 0x0c, 0xe2, 0xf4, 0xe3, 0xef, 0x6d, 0x4a, 0xae, 0xb6, 0x29, 0xf9, 0xbb, 0x4d, - 0xc9, 0xcf, 0x5d, 0xda, 0xb9, 0xda, 0xa5, 0x9d, 0x3f, 0xbb, 0xb4, 0xf3, 0xed, 0xe5, 0x4c, 0xbb, - 0xf3, 0xf5, 0x24, 0x17, 0xb8, 0x2c, 0xc6, 0x01, 0xfd, 0x49, 0xb9, 0xef, 0x68, 0xe7, 0x45, 0x7b, - 0xaa, 0x97, 0xed, 0xb1, 0xba, 0xcd, 0x4a, 0x55, 0x93, 0x9e, 0x3f, 0xc4, 0x57, 0xff, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x44, 0x77, 0xfd, 0x8e, 0xcb, 0x02, 0x00, 0x00, + // 429 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0xb3, 0x49, 0x9d, 0x98, 0x29, 0x85, 0x6a, 0x55, 0x21, 0x37, 0x07, 0x2b, 0x8a, 0x00, + 0x85, 0x8b, 0x8d, 0xca, 0x05, 0x95, 0x03, 0xa2, 0x28, 0x07, 0x38, 0x80, 0x64, 0x38, 0x71, 0xa9, + 0xdc, 0xdd, 0x49, 0xba, 0x4a, 0xbc, 0x13, 0xad, 0x37, 0xa5, 0x79, 0x83, 0x1e, 0x91, 0x78, 0x29, + 0x8e, 0x3d, 0x72, 0x44, 0xc9, 0x8b, 0x20, 0xef, 0xda, 0xa8, 0x91, 0x9a, 0x03, 0xb7, 0x99, 0x7f, + 0xe6, 0xff, 0xd6, 0x9e, 0x19, 0x38, 0xc6, 0x6b, 0x12, 0x64, 0x30, 0x25, 0x93, 0x8b, 0x39, 0xa6, + 0x4a, 0x4f, 0x28, 0x59, 0x18, 0xb2, 0xc4, 0x1f, 0xd5, 0xa5, 0xc4, 0x97, 0xfa, 0x47, 0x53, 0x9a, + 0x92, 0x2b, 0xa5, 0x55, 0xe4, 0xbb, 0x86, 0x29, 0x04, 0xef, 0x2f, 0x73, 0xa5, 0x39, 0x87, 0x3d, + 0x9d, 0x17, 0x18, 0xb1, 0x01, 0x1b, 0x3d, 0xc8, 0x5c, 0x5c, 0x69, 0x12, 0x4b, 0x11, 0xb5, 0xbd, + 0x56, 0xc5, 0xc3, 0x9f, 0x0c, 0x82, 0xaf, 0x34, 0xc3, 0xfb, 0x1d, 0xc7, 0x10, 0x8a, 0x0a, 0x77, + 0xae, 0xa4, 0x73, 0x05, 0x59, 0xcf, 0xe5, 0x1f, 0x24, 0x7f, 0x01, 0x87, 0x82, 0xb4, 0x35, 0xb9, + 0xb0, 0xe7, 0xb9, 0x94, 0x06, 0xcb, 0x32, 0xea, 0x38, 0xeb, 0xe3, 0x46, 0x7f, 0xe7, 0x65, 0x1e, + 0x41, 0x4f, 0xa2, 0x50, 0x45, 0x3e, 0x8f, 0xf6, 0x3c, 0xa4, 0x4e, 0xf9, 0x13, 0xe8, 0xe6, 0xc2, + 0xaa, 0x2b, 0x8c, 0x82, 0x01, 0x1b, 0x85, 0x59, 0x9d, 0x0d, 0x6f, 0xda, 0x10, 0x8e, 0xb5, 0x5c, + 0x90, 0xd2, 0x96, 0x9f, 0x41, 0x48, 0x93, 0x89, 0x7b, 0x37, 0x62, 0x83, 0xce, 0x68, 0xff, 0xe4, + 0x79, 0xb2, 0x3d, 0x8c, 0xa4, 0xe9, 0x4d, 0x3e, 0xd7, 0x8d, 0x63, 0x6d, 0xcd, 0x2a, 0xfb, 0xe7, + 0xe3, 0x6f, 0xa1, 0x47, 0xda, 0x23, 0xda, 0x0e, 0xf1, 0x6c, 0x37, 0x42, 0xdf, 0x21, 0x34, 0xae, + 0xfe, 0x1b, 0x38, 0xd8, 0x62, 0xf3, 0x43, 0xe8, 0xcc, 0x70, 0xe5, 0xa6, 0x15, 0x64, 0x55, 0xc8, + 0x8f, 0x20, 0xb8, 0xca, 0xe7, 0x4b, 0xac, 0xe7, 0xeb, 0x93, 0xd3, 0xf6, 0x6b, 0xd6, 0x3f, 0x85, + 0x87, 0x77, 0xa9, 0xff, 0xe3, 0x1d, 0xde, 0x30, 0xe8, 0x7e, 0xa1, 0xa5, 0x11, 0x78, 0xef, 0x86, + 0x12, 0x08, 0xb0, 0x62, 0x3a, 0xe3, 0xfe, 0x49, 0xb4, 0xeb, 0xb7, 0x32, 0xdf, 0x56, 0x3f, 0xa4, + 0xa4, 0xdb, 0x55, 0x98, 0xf9, 0x84, 0x3f, 0x85, 0x03, 0x89, 0x16, 0x4d, 0xa1, 0xb4, 0x2a, 0xad, + 0x12, 0x6e, 0x4f, 0x61, 0xb6, 0x2d, 0x9e, 0x7d, 0xfc, 0xb5, 0x8e, 0xd9, 0xed, 0x3a, 0x66, 0x7f, + 0xd6, 0x31, 0xfb, 0xb1, 0x89, 0x5b, 0xb7, 0x9b, 0xb8, 0xf5, 0x7b, 0x13, 0xb7, 0xbe, 0xbd, 0x9c, + 0x2a, 0x7b, 0xb9, 0xbc, 0x48, 0x04, 0x15, 0xe9, 0xd8, 0x7f, 0xc0, 0x27, 0xb4, 0xdf, 0xc9, 0xcc, + 0xd2, 0xe6, 0xa2, 0xaf, 0x9b, 0x9b, 0xb6, 0xab, 0x05, 0x96, 0x17, 0x5d, 0x77, 0xaf, 0xaf, 0xfe, + 0x06, 0x00, 0x00, 0xff, 0xff, 0xe8, 0x9c, 0x27, 0x52, 0xf2, 0x02, 0x00, 0x00, } func (m *Chain) Marshal() (dAtA []byte, err error) { @@ -485,6 +494,16 @@ func (m *Source) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Deterministic { + i-- + if m.Deterministic { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } if m.Valid { i-- if m.Valid { @@ -613,6 +632,9 @@ func (m *Source) Size() (n int) { if m.Valid { n += 2 } + if m.Deterministic { + n += 2 + } return n } @@ -1301,6 +1323,26 @@ func (m *Source) Unmarshal(dAtA []byte) error { } } m.Valid = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Deterministic", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Deterministic = bool(v != 0) default: iNdEx = preIndex skippy, err := skipInfo(dAtA[iNdEx:]) diff --git a/x/oracle/types/params.go b/x/oracle/types/params.go index 357196ad6..77d7d59f4 100644 --- a/x/oracle/types/params.go +++ b/x/oracle/types/params.go @@ -5,6 +5,14 @@ import ( "gopkg.in/yaml.v2" ) +var ( + KeyChains = []byte("Chains") + KeyTokens = []byte("Tokens") + KeySources = []byte("Sources") + KeyRules = []byte("Sources") + KeyTokenFeeders = []byte("TokenFeeders") +) + var _ paramtypes.ParamSet = (*Params)(nil) // ParamKeyTable the param key table for launch module diff --git a/x/oracle/types/price.pb.go b/x/oracle/types/price.pb.go index 1b7c67beb..f9fc239f1 100644 --- a/x/oracle/types/price.pb.go +++ b/x/oracle/types/price.pb.go @@ -24,24 +24,25 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // token price with timestamp fetched from source // {price:"12345",decimal:"2"}->price: 123.45 usdt -type PriceWithTime struct { +type PriceWithTimeAndDetId struct { Price string `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"` Decimal int32 `protobuf:"varint,2,opt,name=decimal,proto3" json:"decimal,omitempty"` Timestamp string `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + DetId string `protobuf:"bytes,4,opt,name=det_id,json=detId,proto3" json:"det_id,omitempty"` } -func (m *PriceWithTime) Reset() { *m = PriceWithTime{} } -func (m *PriceWithTime) String() string { return proto.CompactTextString(m) } -func (*PriceWithTime) ProtoMessage() {} -func (*PriceWithTime) Descriptor() ([]byte, []int) { +func (m *PriceWithTimeAndDetId) Reset() { *m = PriceWithTimeAndDetId{} } +func (m *PriceWithTimeAndDetId) String() string { return proto.CompactTextString(m) } +func (*PriceWithTimeAndDetId) ProtoMessage() {} +func (*PriceWithTimeAndDetId) Descriptor() ([]byte, []int) { return fileDescriptor_6755466c800b64fc, []int{0} } -func (m *PriceWithTime) XXX_Unmarshal(b []byte) error { +func (m *PriceWithTimeAndDetId) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *PriceWithTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *PriceWithTimeAndDetId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_PriceWithTime.Marshal(b, m, deterministic) + return xxx_messageInfo_PriceWithTimeAndDetId.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -51,50 +52,56 @@ func (m *PriceWithTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } -func (m *PriceWithTime) XXX_Merge(src proto.Message) { - xxx_messageInfo_PriceWithTime.Merge(m, src) +func (m *PriceWithTimeAndDetId) XXX_Merge(src proto.Message) { + xxx_messageInfo_PriceWithTimeAndDetId.Merge(m, src) } -func (m *PriceWithTime) XXX_Size() int { +func (m *PriceWithTimeAndDetId) XXX_Size() int { return m.Size() } -func (m *PriceWithTime) XXX_DiscardUnknown() { - xxx_messageInfo_PriceWithTime.DiscardUnknown(m) +func (m *PriceWithTimeAndDetId) XXX_DiscardUnknown() { + xxx_messageInfo_PriceWithTimeAndDetId.DiscardUnknown(m) } -var xxx_messageInfo_PriceWithTime proto.InternalMessageInfo +var xxx_messageInfo_PriceWithTimeAndDetId proto.InternalMessageInfo -func (m *PriceWithTime) GetPrice() string { +func (m *PriceWithTimeAndDetId) GetPrice() string { if m != nil { return m.Price } return "" } -func (m *PriceWithTime) GetDecimal() int32 { +func (m *PriceWithTimeAndDetId) GetDecimal() int32 { if m != nil { return m.Decimal } return 0 } -func (m *PriceWithTime) GetTimestamp() string { +func (m *PriceWithTimeAndDetId) GetTimestamp() string { if m != nil { return m.Timestamp } return "" } +func (m *PriceWithTimeAndDetId) GetDetId() string { + if m != nil { + return m.DetId + } + return "" +} + type PriceWithSource struct { //refer to id from Params.SourceList, where this price fetched from, 0 is reserved for custom usage SourceId int32 `protobuf:"varint,1,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` //if source is deteministic like chainlink with roundID, set this value with which returned from source - DetId string `protobuf:"bytes,2,opt,name=det_id,json=detId,proto3" json:"det_id,omitempty"` //up to 3 values in case of the async of network, to give more time for oracle nodes(validators) get into consensus //eg.with deterministic source, this array will contian 3 continuous values up to latest //for non-deterministic source, it's a choice by v2 rules. - Prices []*PriceWithTime `protobuf:"bytes,3,rep,name=prices,proto3" json:"prices,omitempty"` + Prices []*PriceWithTimeAndDetId `protobuf:"bytes,2,rep,name=prices,proto3" json:"prices,omitempty"` //used for 0-sourceID-customDefinedSource - Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` } func (m *PriceWithSource) Reset() { *m = PriceWithSource{} } @@ -137,14 +144,7 @@ func (m *PriceWithSource) GetSourceId() int32 { return 0 } -func (m *PriceWithSource) GetDetId() string { - if m != nil { - return m.DetId - } - return "" -} - -func (m *PriceWithSource) GetPrices() []*PriceWithTime { +func (m *PriceWithSource) GetPrices() []*PriceWithTimeAndDetId { if m != nil { return m.Prices } @@ -227,7 +227,7 @@ func (m *PriceWithTimeAndRound) GetRoundId() uint64 { } func init() { - proto.RegisterType((*PriceWithTime)(nil), "exocore.oracle.PriceWithTime") + proto.RegisterType((*PriceWithTimeAndDetId)(nil), "exocore.oracle.PriceWithTimeAndDetId") proto.RegisterType((*PriceWithSource)(nil), "exocore.oracle.PriceWithSource") proto.RegisterType((*PriceWithTimeAndRound)(nil), "exocore.oracle.PriceWithTimeAndRound") } @@ -235,30 +235,30 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/price.proto", fileDescriptor_6755466c800b64fc) } var fileDescriptor_6755466c800b64fc = []byte{ - // 313 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x51, 0x4d, 0x4b, 0x03, 0x31, - 0x14, 0x6c, 0xfa, 0xdd, 0x27, 0x2a, 0x04, 0x0b, 0xf1, 0x2b, 0x94, 0x9e, 0x7a, 0xda, 0x15, 0xc5, - 0x1f, 0xa0, 0xe0, 0xa1, 0x1e, 0x44, 0xa2, 0x20, 0x08, 0x22, 0x6d, 0xf2, 0xb0, 0xc1, 0x6e, 0xb3, - 0x64, 0x53, 0xac, 0x37, 0x7f, 0x42, 0x7f, 0x96, 0xc7, 0x1e, 0x3d, 0x4a, 0xf7, 0x8f, 0xc8, 0x66, - 0xbb, 0xca, 0xde, 0xbd, 0xbd, 0xf7, 0x66, 0x32, 0x93, 0x61, 0xe0, 0x00, 0x17, 0x46, 0x1a, 0x8b, - 0xa1, 0xb1, 0x23, 0x39, 0xc5, 0x30, 0xb6, 0x5a, 0x62, 0x10, 0x5b, 0xe3, 0x0c, 0xdd, 0xd9, 0x60, - 0x41, 0x8e, 0xf5, 0x9f, 0x60, 0xfb, 0x36, 0x83, 0x1f, 0xb4, 0x9b, 0xdc, 0xeb, 0x08, 0xe9, 0x1e, - 0x34, 0x3c, 0x9f, 0x91, 0x1e, 0x19, 0x74, 0x44, 0xbe, 0x50, 0x06, 0x2d, 0x85, 0x52, 0x47, 0xa3, - 0x29, 0xab, 0xf6, 0xc8, 0xa0, 0x21, 0x8a, 0x95, 0x1e, 0x41, 0xc7, 0xe9, 0x08, 0x13, 0x37, 0x8a, - 0x62, 0x56, 0xf3, 0x6f, 0xfe, 0x0e, 0xfd, 0x25, 0x81, 0xdd, 0x5f, 0xfd, 0x3b, 0x33, 0xb7, 0x12, - 0xe9, 0x21, 0x74, 0x12, 0x3f, 0x3d, 0x6b, 0xe5, 0x5d, 0x1a, 0xa2, 0x9d, 0x1f, 0x86, 0x8a, 0x76, - 0xa1, 0xa9, 0xd0, 0x65, 0x48, 0x35, 0xf7, 0x57, 0xe8, 0x86, 0x8a, 0x9e, 0x43, 0xd3, 0x7f, 0x24, - 0x61, 0xb5, 0x5e, 0x6d, 0xb0, 0x75, 0x7a, 0x1c, 0x94, 0x73, 0x04, 0xa5, 0x10, 0x62, 0x43, 0xa6, - 0x14, 0xea, 0x0a, 0x13, 0xc9, 0xea, 0x5e, 0xcb, 0xcf, 0xfd, 0x0f, 0x02, 0xdd, 0x12, 0xfb, 0x62, - 0xa6, 0x84, 0x99, 0xcf, 0xd4, 0xff, 0x46, 0xa7, 0xfb, 0xd0, 0xb6, 0x99, 0x6c, 0x96, 0x25, 0xf3, - 0xaf, 0x8b, 0x96, 0xdf, 0x87, 0xea, 0xf2, 0xfa, 0x73, 0xcd, 0xc9, 0x6a, 0xcd, 0xc9, 0xf7, 0x9a, - 0x93, 0x65, 0xca, 0x2b, 0xab, 0x94, 0x57, 0xbe, 0x52, 0x5e, 0x79, 0x3c, 0x79, 0xd1, 0x6e, 0x32, - 0x1f, 0x07, 0xd2, 0x44, 0xe1, 0x55, 0x9e, 0xf0, 0x06, 0xdd, 0x9b, 0xb1, 0xaf, 0x61, 0x51, 0xea, - 0xa2, 0xa8, 0xd5, 0xbd, 0xc7, 0x98, 0x8c, 0x9b, 0xbe, 0xd7, 0xb3, 0x9f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x72, 0x2f, 0x17, 0x64, 0xf5, 0x01, 0x00, 0x00, + // 315 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x4c, 0x4e, + 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xca, 0xe9, 0x41, 0xe4, 0x94, 0x6a, 0xb8, + 0x44, 0x03, 0x40, 0xd2, 0xe1, 0x99, 0x25, 0x19, 0x21, 0x99, 0xb9, 0xa9, 0x8e, 0x79, 0x29, 0x2e, + 0xa9, 0x25, 0x9e, 0x29, 0x42, 0x22, 0x5c, 0xac, 0x60, 0x7d, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, + 0x41, 0x10, 0x8e, 0x90, 0x04, 0x17, 0x7b, 0x4a, 0x6a, 0x72, 0x66, 0x6e, 0x62, 0x8e, 0x04, 0x93, + 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x8c, 0x2b, 0x24, 0xc3, 0xc5, 0x59, 0x92, 0x99, 0x9b, 0x5a, 0x5c, + 0x92, 0x98, 0x5b, 0x20, 0xc1, 0x0c, 0xd6, 0x83, 0x10, 0x10, 0x12, 0xe5, 0x62, 0x4b, 0x49, 0x2d, + 0x89, 0xcf, 0x4c, 0x91, 0x60, 0x81, 0x18, 0x97, 0x02, 0xb2, 0x44, 0xa9, 0x91, 0x91, 0x8b, 0x1f, + 0x6e, 0x7d, 0x70, 0x7e, 0x69, 0x51, 0x72, 0xaa, 0x90, 0x34, 0x17, 0x67, 0x31, 0x98, 0x05, 0x52, + 0xcd, 0x08, 0xb6, 0x84, 0x03, 0x22, 0xe0, 0x99, 0x22, 0x64, 0xcb, 0xc5, 0x06, 0x76, 0x48, 0xb1, + 0x04, 0x93, 0x02, 0xb3, 0x06, 0xb7, 0x91, 0xaa, 0x1e, 0xaa, 0x7f, 0xf4, 0xb0, 0x7a, 0x26, 0x08, + 0xaa, 0x49, 0x48, 0x88, 0x8b, 0x25, 0x25, 0xb5, 0x38, 0x19, 0xea, 0x3e, 0x30, 0x5b, 0xa9, 0x81, + 0x11, 0x33, 0x08, 0x82, 0xf2, 0x4b, 0xf3, 0xa8, 0x1d, 0x04, 0x92, 0x5c, 0x1c, 0x45, 0x20, 0x63, + 0x61, 0x81, 0xc0, 0x12, 0xc4, 0x0e, 0xe6, 0x7b, 0xa6, 0x38, 0x79, 0x9d, 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, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, + 0xae, 0xbe, 0x2b, 0xc4, 0xa7, 0x7e, 0xa9, 0x25, 0xe5, 0xf9, 0x45, 0xd9, 0xfa, 0xb0, 0x48, 0xae, + 0x80, 0x45, 0x73, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x9e, 0x8d, 0x01, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xa6, 0x63, 0xc2, 0xdd, 0x05, 0x02, 0x00, 0x00, } -func (m *PriceWithTime) Marshal() (dAtA []byte, err error) { +func (m *PriceWithTimeAndDetId) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -268,16 +268,23 @@ func (m *PriceWithTime) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PriceWithTime) MarshalTo(dAtA []byte) (int, error) { +func (m *PriceWithTimeAndDetId) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PriceWithTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PriceWithTimeAndDetId) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.DetId) > 0 { + i -= len(m.DetId) + copy(dAtA[i:], m.DetId) + i = encodeVarintPrice(dAtA, i, uint64(len(m.DetId))) + i-- + dAtA[i] = 0x22 + } if len(m.Timestamp) > 0 { i -= len(m.Timestamp) copy(dAtA[i:], m.Timestamp) @@ -325,7 +332,7 @@ func (m *PriceWithSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Desc) i = encodeVarintPrice(dAtA, i, uint64(len(m.Desc))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } if len(m.Prices) > 0 { for iNdEx := len(m.Prices) - 1; iNdEx >= 0; iNdEx-- { @@ -338,16 +345,9 @@ func (m *PriceWithSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintPrice(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } } - if len(m.DetId) > 0 { - i -= len(m.DetId) - copy(dAtA[i:], m.DetId) - i = encodeVarintPrice(dAtA, i, uint64(len(m.DetId))) - i-- - dAtA[i] = 0x12 - } if m.SourceId != 0 { i = encodeVarintPrice(dAtA, i, uint64(m.SourceId)) i-- @@ -414,7 +414,7 @@ func encodeVarintPrice(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *PriceWithTime) Size() (n int) { +func (m *PriceWithTimeAndDetId) Size() (n int) { if m == nil { return 0 } @@ -431,6 +431,10 @@ func (m *PriceWithTime) Size() (n int) { if l > 0 { n += 1 + l + sovPrice(uint64(l)) } + l = len(m.DetId) + if l > 0 { + n += 1 + l + sovPrice(uint64(l)) + } return n } @@ -443,10 +447,6 @@ func (m *PriceWithSource) Size() (n int) { if m.SourceId != 0 { n += 1 + sovPrice(uint64(m.SourceId)) } - l = len(m.DetId) - if l > 0 { - n += 1 + l + sovPrice(uint64(l)) - } if len(m.Prices) > 0 { for _, e := range m.Prices { l = e.Size() @@ -489,7 +489,7 @@ func sovPrice(x uint64) (n int) { func sozPrice(x uint64) (n int) { return sovPrice(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *PriceWithTime) Unmarshal(dAtA []byte) error { +func (m *PriceWithTimeAndDetId) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -512,10 +512,10 @@ func (m *PriceWithTime) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PriceWithTime: wiretype end group for non-group") + return fmt.Errorf("proto: PriceWithTimeAndDetId: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PriceWithTime: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PriceWithTimeAndDetId: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -601,6 +601,38 @@ func (m *PriceWithTime) Unmarshal(dAtA []byte) error { } m.Timestamp = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DetId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrice + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPrice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DetId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPrice(dAtA[iNdEx:]) @@ -671,38 +703,6 @@ func (m *PriceWithSource) Unmarshal(dAtA []byte) error { } } case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DetId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrice - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPrice - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPrice - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DetId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) } @@ -731,12 +731,12 @@ func (m *PriceWithSource) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Prices = append(m.Prices, &PriceWithTime{}) + m.Prices = append(m.Prices, &PriceWithTimeAndDetId{}) if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Desc", wireType) } diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go index 982c60051..b9d95cad0 100644 --- a/x/oracle/types/tx.pb.go +++ b/x/oracle/types/tx.pb.go @@ -34,6 +34,7 @@ type MsgCreatePrice struct { Prices []*PriceWithSource `protobuf:"bytes,3,rep,name=prices,proto3" json:"prices,omitempty"` //on which block commit does this message be built on BasedBlock uint64 `protobuf:"varint,4,opt,name=based_block,json=basedBlock,proto3" json:"based_block,omitempty"` + Nonce int32 `protobuf:"varint,5,opt,name=nonce,proto3" json:"nonce,omitempty"` } func (m *MsgCreatePrice) Reset() { *m = MsgCreatePrice{} } @@ -97,6 +98,13 @@ func (m *MsgCreatePrice) GetBasedBlock() uint64 { return 0 } +func (m *MsgCreatePrice) GetNonce() int32 { + if m != nil { + return m.Nonce + } + return 0 +} + type MsgCreatePriceResponse struct { } @@ -141,26 +149,27 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/tx.proto", fileDescriptor_02cf64aff79d2288) } var fileDescriptor_02cf64aff79d2288 = []byte{ - // 295 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xad, 0xc8, 0x4f, - 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xe8, 0x41, 0x24, 0xa4, 0xa4, 0xd0, 0x14, 0x16, 0x14, - 0x65, 0x26, 0xa7, 0x42, 0xd4, 0x2a, 0x2d, 0x64, 0xe4, 0xe2, 0xf3, 0x2d, 0x4e, 0x77, 0x2e, 0x4a, - 0x4d, 0x2c, 0x49, 0x0d, 0x00, 0x49, 0x08, 0x49, 0x70, 0xb1, 0x27, 0x83, 0xb8, 0xf9, 0x45, 0x12, - 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x30, 0xae, 0x90, 0x34, 0x17, 0x67, 0x5a, 0x6a, 0x6a, 0x4a, - 0x6a, 0x51, 0x7c, 0x66, 0x8a, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x07, 0x44, 0xc0, 0x33, - 0x45, 0xc8, 0x9c, 0x8b, 0x0d, 0x6c, 0x70, 0xb1, 0x04, 0xb3, 0x02, 0xb3, 0x06, 0xb7, 0x91, 0xbc, - 0x1e, 0xaa, 0x33, 0xf4, 0xc0, 0xa6, 0x87, 0x67, 0x96, 0x64, 0x04, 0xe7, 0x97, 0x16, 0x25, 0xa7, - 0x06, 0x41, 0x95, 0x0b, 0xc9, 0x73, 0x71, 0x27, 0x25, 0x16, 0xa7, 0xa6, 0xc4, 0x27, 0xe5, 0xe4, - 0x27, 0x67, 0x4b, 0xb0, 0x28, 0x30, 0x6a, 0xb0, 0x04, 0x71, 0x81, 0x85, 0x9c, 0x40, 0x22, 0x4a, - 0x12, 0x5c, 0x62, 0xa8, 0x4e, 0x0c, 0x4a, 0x2d, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0x35, 0x8a, 0xe1, - 0x62, 0xf6, 0x2d, 0x4e, 0x17, 0x0a, 0xe5, 0xe2, 0x46, 0xf6, 0x80, 0x1c, 0xba, 0xcd, 0xa8, 0xba, - 0xa5, 0xd4, 0xf0, 0xcb, 0xc3, 0x4c, 0x77, 0xf2, 0x3a, 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, 0x83, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x57, - 0x88, 0x59, 0x7e, 0xa9, 0x25, 0xe5, 0xf9, 0x45, 0xd9, 0xfa, 0xb0, 0xb0, 0xae, 0x80, 0x47, 0x4b, - 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0xb8, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe1, - 0x2b, 0x61, 0x19, 0xb5, 0x01, 0x00, 0x00, + // 308 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x51, 0xcd, 0x4a, 0xf3, 0x40, + 0x14, 0xed, 0x7c, 0xfd, 0xf9, 0xec, 0x14, 0xba, 0x18, 0x44, 0x87, 0x0a, 0xd3, 0xd0, 0x85, 0x64, + 0x95, 0x48, 0x5d, 0xb8, 0xaf, 0xb8, 0x50, 0xa8, 0x48, 0x44, 0x04, 0x11, 0x4a, 0x33, 0xb9, 0xb6, + 0xa1, 0xb5, 0x37, 0xcc, 0x4c, 0x31, 0xbe, 0x85, 0x6f, 0xe3, 0x2b, 0xb8, 0xec, 0xd2, 0xa5, 0x24, + 0x2f, 0x22, 0x49, 0x1a, 0x31, 0x5d, 0xb8, 0x3c, 0x3f, 0x73, 0xe6, 0x5c, 0x0e, 0x3d, 0x84, 0x18, + 0x25, 0x2a, 0x70, 0x51, 0x4d, 0xe5, 0x12, 0x5c, 0x13, 0x3b, 0x91, 0x42, 0x83, 0xac, 0xbb, 0x15, + 0x9c, 0x42, 0xe8, 0xf5, 0x76, 0x8c, 0x91, 0x0a, 0x25, 0x14, 0xde, 0xc1, 0x3b, 0xa1, 0xdd, 0xb1, + 0x9e, 0x9d, 0x2b, 0x98, 0x1a, 0xb8, 0xc9, 0x04, 0xc6, 0xe9, 0x7f, 0x99, 0x41, 0x54, 0x9c, 0x58, + 0xc4, 0x6e, 0x7b, 0x25, 0x64, 0x47, 0xb4, 0xfd, 0x04, 0x10, 0x80, 0x9a, 0x84, 0x01, 0xff, 0x67, + 0x11, 0xbb, 0xe9, 0xed, 0x15, 0xc4, 0x65, 0xc0, 0xce, 0x68, 0x2b, 0x0f, 0xd6, 0xbc, 0x6e, 0xd5, + 0xed, 0xce, 0xb0, 0xef, 0x54, 0x6b, 0x38, 0x79, 0xfa, 0x7d, 0x68, 0xe6, 0xb7, 0xb8, 0x56, 0x12, + 0xbc, 0xad, 0x9d, 0xf5, 0x69, 0xc7, 0x9f, 0x6a, 0x08, 0x26, 0xfe, 0x12, 0xe5, 0x82, 0x37, 0x2c, + 0x62, 0x37, 0x3c, 0x9a, 0x53, 0xa3, 0x8c, 0x61, 0xfb, 0xb4, 0xb9, 0xc2, 0x95, 0x04, 0xde, 0xcc, + 0xbf, 0x2c, 0xc0, 0x80, 0xd3, 0x83, 0x6a, 0x71, 0x0f, 0x74, 0x84, 0x2b, 0x0d, 0xc3, 0x47, 0x5a, + 0x1f, 0xeb, 0x19, 0xbb, 0xa3, 0x9d, 0xdf, 0x67, 0x89, 0xdd, 0x3e, 0xd5, 0xd7, 0xbd, 0xe3, 0xbf, + 0xf5, 0x32, 0x7d, 0x74, 0xf5, 0x91, 0x08, 0xb2, 0x49, 0x04, 0xf9, 0x4a, 0x04, 0x79, 0x4b, 0x45, + 0x6d, 0x93, 0x8a, 0xda, 0x67, 0x2a, 0x6a, 0x0f, 0x27, 0xb3, 0xd0, 0xcc, 0xd7, 0xbe, 0x23, 0xf1, + 0xd9, 0xbd, 0x28, 0xb2, 0xae, 0xc1, 0xbc, 0xa0, 0x5a, 0xb8, 0xe5, 0x02, 0xf1, 0xcf, 0x58, 0xaf, + 0x11, 0x68, 0xbf, 0x95, 0x8f, 0x70, 0xfa, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x8e, 0x94, 0xc6, + 0xcb, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -265,6 +274,11 @@ func (m *MsgCreatePrice) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Nonce != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Nonce)) + i-- + dAtA[i] = 0x28 + } if m.BasedBlock != 0 { i = encodeVarintTx(dAtA, i, uint64(m.BasedBlock)) i-- @@ -355,6 +369,9 @@ func (m *MsgCreatePrice) Size() (n int) { if m.BasedBlock != 0 { n += 1 + sovTx(uint64(m.BasedBlock)) } + if m.Nonce != 0 { + n += 1 + sovTx(uint64(m.Nonce)) + } return n } @@ -506,6 +523,25 @@ func (m *MsgCreatePrice) Unmarshal(dAtA []byte) error { break } } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + m.Nonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Nonce |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From 2e655191a243e6df5dbf97993871e36443ad3c1a Mon Sep 17 00:00:00 2001 From: leonz789 Date: Thu, 29 Feb 2024 03:25:09 +0800 Subject: [PATCH 14/37] refactor(oracle-proto): remove round related state definition --- proto/exocore/oracle/genesis.proto | 6 - proto/exocore/oracle/query.proto | 85 +- proto/exocore/oracle/round_data.proto | 17 - proto/exocore/oracle/round_info.proto | 14 - proto/exocore/oracle/validator_power.proto | 10 - proto/exocore/oracle/validators.proto | 12 - x/oracle/client/cli/query.go | 6 - x/oracle/client/cli/query_round_data.go | 82 - x/oracle/client/cli/query_round_data_test.go | 160 - x/oracle/client/cli/query_round_info.go | 82 - x/oracle/client/cli/query_round_info_test.go | 160 - x/oracle/client/cli/query_validators.go | 82 - x/oracle/client/cli/query_validators_test.go | 160 - x/oracle/genesis.go | 15 - x/oracle/genesis_test.go | 27 - x/oracle/keeper/aggregator.go_bak | 87 - x/oracle/keeper/readme.md | 79 - x/oracle/keeper/tmp.md | 0 x/oracle/module.go | 1 + x/oracle/types/genesis.go | 35 +- x/oracle/types/genesis.pb.go | 225 +- x/oracle/types/genesis_test.go | 66 - x/oracle/types/key_round_data.go | 24 - x/oracle/types/key_round_info.go | 24 - x/oracle/types/key_validators.go | 24 - x/oracle/types/query.pb.go | 3359 +++--------------- x/oracle/types/query.pb.gw.go | 552 --- x/oracle/types/round_data.pb.go | 584 --- x/oracle/types/round_info.pb.go | 444 --- x/oracle/types/validator_power.pb.go | 370 -- x/oracle/types/validators.pb.go | 363 -- 31 files changed, 458 insertions(+), 6697 deletions(-) delete mode 100644 proto/exocore/oracle/round_data.proto delete mode 100644 proto/exocore/oracle/round_info.proto delete mode 100644 proto/exocore/oracle/validator_power.proto delete mode 100644 proto/exocore/oracle/validators.proto delete mode 100644 x/oracle/client/cli/query_round_data.go delete mode 100644 x/oracle/client/cli/query_round_data_test.go delete mode 100644 x/oracle/client/cli/query_round_info.go delete mode 100644 x/oracle/client/cli/query_round_info_test.go delete mode 100644 x/oracle/client/cli/query_validators.go delete mode 100644 x/oracle/client/cli/query_validators_test.go delete mode 100644 x/oracle/keeper/aggregator.go_bak delete mode 100644 x/oracle/keeper/readme.md delete mode 100644 x/oracle/keeper/tmp.md delete mode 100644 x/oracle/types/key_round_data.go delete mode 100644 x/oracle/types/key_round_info.go delete mode 100644 x/oracle/types/key_validators.go delete mode 100644 x/oracle/types/round_data.pb.go delete mode 100644 x/oracle/types/round_info.pb.go delete mode 100644 x/oracle/types/validator_power.pb.go delete mode 100644 x/oracle/types/validators.pb.go diff --git a/proto/exocore/oracle/genesis.proto b/proto/exocore/oracle/genesis.proto index 03d73b6ad..cf569580a 100644 --- a/proto/exocore/oracle/genesis.proto +++ b/proto/exocore/oracle/genesis.proto @@ -5,9 +5,6 @@ package exocore.oracle; import "gogoproto/gogo.proto"; import "exocore/oracle/params.proto"; import "exocore/oracle/prices.proto"; -import "exocore/oracle/round_info.proto"; -import "exocore/oracle/round_data.proto"; -import "exocore/oracle/validators.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; @@ -17,8 +14,5 @@ message GenesisState { repeated Prices pricesList = 2 [(gogoproto.nullable) = false]; //TODO: userDefinedTokenFeeder - repeated RoundInfo roundInfoList = 3 [(gogoproto.nullable) = false]; - repeated RoundData roundDataList = 4 [(gogoproto.nullable) = false]; - repeated Validators validatorsList = 5 [(gogoproto.nullable) = false]; } diff --git a/proto/exocore/oracle/query.proto b/proto/exocore/oracle/query.proto index 47984868a..d0f60bdf8 100644 --- a/proto/exocore/oracle/query.proto +++ b/proto/exocore/oracle/query.proto @@ -7,9 +7,6 @@ import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "exocore/oracle/params.proto"; import "exocore/oracle/prices.proto"; -import "exocore/oracle/round_info.proto"; -import "exocore/oracle/round_data.proto"; -import "exocore/oracle/validators.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; @@ -31,36 +28,7 @@ service Query { option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/prices"; } - - // Queries a list of RoundInfo items. - rpc RoundInfo (QueryGetRoundInfoRequest) returns (QueryGetRoundInfoResponse) { - option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/round_info/{tokenId}"; - - } - rpc RoundInfoAll (QueryAllRoundInfoRequest) returns (QueryAllRoundInfoResponse) { - option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/round_info"; - - } - - // Queries a list of RoundData items. - rpc RoundData (QueryGetRoundDataRequest) returns (QueryGetRoundDataResponse) { - option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/round_data/{tokenId}"; - - } - rpc RoundDataAll (QueryAllRoundDataRequest) returns (QueryAllRoundDataResponse) { - option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/round_data"; - - } - - // Queries a list of Validators items. - rpc Validators (QueryGetValidatorsRequest) returns (QueryGetValidatorsResponse) { - option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/validators/{block}"; - - } - rpc ValidatorsAll (QueryAllValidatorsRequest) returns (QueryAllValidatorsResponse) { - option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/validators"; - - } + } // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} @@ -89,54 +57,3 @@ message QueryAllPricesResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } -message QueryGetRoundInfoRequest { - int32 tokenId = 1; -} - -message QueryGetRoundInfoResponse { - RoundInfo roundInfo = 1 [(gogoproto.nullable) = false]; -} - -message QueryAllRoundInfoRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllRoundInfoResponse { - repeated RoundInfo roundInfo = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -message QueryGetRoundDataRequest { - int32 tokenId = 1; -} - -message QueryGetRoundDataResponse { - RoundData roundData = 1 [(gogoproto.nullable) = false]; -} - -message QueryAllRoundDataRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllRoundDataResponse { - repeated RoundData roundData = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -message QueryGetValidatorsRequest { - uint64 block = 1; -} - -message QueryGetValidatorsResponse { - Validators validators = 1 [(gogoproto.nullable) = false]; -} - -message QueryAllValidatorsRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllValidatorsResponse { - repeated Validators validators = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - diff --git a/proto/exocore/oracle/round_data.proto b/proto/exocore/oracle/round_data.proto deleted file mode 100644 index da2dde169..000000000 --- a/proto/exocore/oracle/round_data.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package exocore.oracle; - -import "exocore/oracle/price.proto"; - -option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; - -message RoundData { - int32 tokenId = 1; - repeated PricesWithSource prices_source = 2; -} - -message PricesWithSource { - int32 source_id = 1; - repeated PriceWithTimeAndRound prices_time_round = 2; -} - diff --git a/proto/exocore/oracle/round_info.proto b/proto/exocore/oracle/round_info.proto deleted file mode 100644 index 1307d9cb1..000000000 --- a/proto/exocore/oracle/round_info.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; -package exocore.oracle; - -option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; - -message RoundInfo { - int32 token_id = 1; - uint64 based_block = 2; - uint64 nexit_roundId = 3; - int32 feeder_id = 4; - int32 status = 5; - -} - diff --git a/proto/exocore/oracle/validator_power.proto b/proto/exocore/oracle/validator_power.proto deleted file mode 100644 index 8fe635c11..000000000 --- a/proto/exocore/oracle/validator_power.proto +++ /dev/null @@ -1,10 +0,0 @@ -syntax = "proto3"; - -package exocore.oracle; - -option go_package= "github.com/ExocoreNetwork/exocore/x/oracle/types"; - -message ValidatorWithPower{ - string operator_address = 1; - string tokens = 2; -} diff --git a/proto/exocore/oracle/validators.proto b/proto/exocore/oracle/validators.proto deleted file mode 100644 index d850d2c33..000000000 --- a/proto/exocore/oracle/validators.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package exocore.oracle; - -import "exocore/oracle/validator_power.proto"; - -option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; - -message Validators { - uint64 block = 1; - repeated ValidatorWithPower validator_power = 2; -} - diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go index 1bd4dbd8f..8b27813af 100644 --- a/x/oracle/client/cli/query.go +++ b/x/oracle/client/cli/query.go @@ -27,12 +27,6 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryParams()) cmd.AddCommand(CmdListPrices()) cmd.AddCommand(CmdShowPrices()) - cmd.AddCommand(CmdListRoundInfo()) - cmd.AddCommand(CmdShowRoundInfo()) - cmd.AddCommand(CmdListRoundData()) - cmd.AddCommand(CmdShowRoundData()) - cmd.AddCommand(CmdListValidators()) - cmd.AddCommand(CmdShowValidators()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/oracle/client/cli/query_round_data.go b/x/oracle/client/cli/query_round_data.go deleted file mode 100644 index 08a3a2933..000000000 --- a/x/oracle/client/cli/query_round_data.go +++ /dev/null @@ -1,82 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/ExocoreNetwork/exocore/x/oracle/types" - "github.com/spf13/cast" -) - -func CmdListRoundData() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-round-data", - Short: "list all round-data", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAllRoundDataRequest{ - Pagination: pageReq, - } - - res, err := queryClient.RoundDataAll(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdShowRoundData() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-round-data [token-id]", - Short: "shows a round-data", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - argTokenId, err := cast.ToInt32E(args[0]) - if err != nil { - return err - } - - params := &types.QueryGetRoundDataRequest{ - TokenId: argTokenId, - } - - res, err := queryClient.RoundData(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/oracle/client/cli/query_round_data_test.go b/x/oracle/client/cli/query_round_data_test.go deleted file mode 100644 index 97126553e..000000000 --- a/x/oracle/client/cli/query_round_data_test.go +++ /dev/null @@ -1,160 +0,0 @@ -package cli_test - -import ( - "fmt" - "strconv" - "testing" - - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/ExocoreNetwork/exocore/testutil/network" - "github.com/ExocoreNetwork/exocore/testutil/nullify" - "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" - "github.com/ExocoreNetwork/exocore/x/oracle/types" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func networkWithRoundDataObjects(t *testing.T, n int) (*network.Network, []types.RoundData) { - t.Helper() - cfg := network.DefaultConfig() - state := types.GenesisState{} - for i := 0; i < n; i++ { - roundData := types.RoundData{ - TokenId: int32(i), - } - nullify.Fill(&roundData) - state.RoundDataList = append(state.RoundDataList, roundData) - } - buf, err := cfg.Codec.MarshalJSON(&state) - require.NoError(t, err) - cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), state.RoundDataList -} - -func TestShowRoundData(t *testing.T) { - net, objs := networkWithRoundDataObjects(t, 2) - - ctx := net.Validators[0].ClientCtx - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - tests := []struct { - desc string - idTokenId int32 - - args []string - err error - obj types.RoundData - }{ - { - desc: "found", - idTokenId: objs[0].TokenId, - - args: common, - obj: objs[0], - }, - { - desc: "not found", - idTokenId: 100000, - - args: common, - err: status.Error(codes.NotFound, "not found"), - }, - } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - args := []string{ - strconv.Itoa(int(tc.idTokenId)), - } - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowRoundData(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - } else { - require.NoError(t, err) - var resp types.QueryGetRoundDataResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.RoundData) - require.Equal(t, - nullify.Fill(&tc.obj), - nullify.Fill(&resp.RoundData), - ) - } - }) - } -} - -func TestListRoundData(t *testing.T) { - net, objs := networkWithRoundDataObjects(t, 5) - - ctx := net.Validators[0].ClientCtx - request := func(next []byte, offset, limit uint64, total bool) []string { - args := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - if next == nil { - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) - } else { - args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) - } - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) - if total { - args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) - } - return args - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(objs); i += step { - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRoundData(), args) - require.NoError(t, err) - var resp types.QueryAllRoundDataResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.RoundData), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.RoundData), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(objs); i += step { - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRoundData(), args) - require.NoError(t, err) - var resp types.QueryAllRoundDataResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.RoundData), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.RoundData), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRoundData(), args) - require.NoError(t, err) - var resp types.QueryAllRoundDataResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NoError(t, err) - require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(objs), - nullify.Fill(resp.RoundData), - ) - }) -} diff --git a/x/oracle/client/cli/query_round_info.go b/x/oracle/client/cli/query_round_info.go deleted file mode 100644 index 9c4e223e8..000000000 --- a/x/oracle/client/cli/query_round_info.go +++ /dev/null @@ -1,82 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/ExocoreNetwork/exocore/x/oracle/types" - "github.com/spf13/cast" -) - -func CmdListRoundInfo() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-round-info", - Short: "list all round-info", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAllRoundInfoRequest{ - Pagination: pageReq, - } - - res, err := queryClient.RoundInfoAll(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdShowRoundInfo() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-round-info [token-id]", - Short: "shows a round-info", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - argTokenId, err := cast.ToInt32E(args[0]) - if err != nil { - return err - } - - params := &types.QueryGetRoundInfoRequest{ - TokenId: argTokenId, - } - - res, err := queryClient.RoundInfo(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/oracle/client/cli/query_round_info_test.go b/x/oracle/client/cli/query_round_info_test.go deleted file mode 100644 index df27b1262..000000000 --- a/x/oracle/client/cli/query_round_info_test.go +++ /dev/null @@ -1,160 +0,0 @@ -package cli_test - -import ( - "fmt" - "strconv" - "testing" - - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/ExocoreNetwork/exocore/testutil/network" - "github.com/ExocoreNetwork/exocore/testutil/nullify" - "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" - "github.com/ExocoreNetwork/exocore/x/oracle/types" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func networkWithRoundInfoObjects(t *testing.T, n int) (*network.Network, []types.RoundInfo) { - t.Helper() - cfg := network.DefaultConfig() - state := types.GenesisState{} - for i := 0; i < n; i++ { - roundInfo := types.RoundInfo{ - TokenId: int32(i), - } - nullify.Fill(&roundInfo) - state.RoundInfoList = append(state.RoundInfoList, roundInfo) - } - buf, err := cfg.Codec.MarshalJSON(&state) - require.NoError(t, err) - cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), state.RoundInfoList -} - -func TestShowRoundInfo(t *testing.T) { - net, objs := networkWithRoundInfoObjects(t, 2) - - ctx := net.Validators[0].ClientCtx - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - tests := []struct { - desc string - idTokenId int32 - - args []string - err error - obj types.RoundInfo - }{ - { - desc: "found", - idTokenId: objs[0].TokenId, - - args: common, - obj: objs[0], - }, - { - desc: "not found", - idTokenId: 100000, - - args: common, - err: status.Error(codes.NotFound, "not found"), - }, - } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - args := []string{ - strconv.Itoa(int(tc.idTokenId)), - } - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowRoundInfo(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - } else { - require.NoError(t, err) - var resp types.QueryGetRoundInfoResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.RoundInfo) - require.Equal(t, - nullify.Fill(&tc.obj), - nullify.Fill(&resp.RoundInfo), - ) - } - }) - } -} - -func TestListRoundInfo(t *testing.T) { - net, objs := networkWithRoundInfoObjects(t, 5) - - ctx := net.Validators[0].ClientCtx - request := func(next []byte, offset, limit uint64, total bool) []string { - args := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - if next == nil { - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) - } else { - args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) - } - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) - if total { - args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) - } - return args - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(objs); i += step { - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRoundInfo(), args) - require.NoError(t, err) - var resp types.QueryAllRoundInfoResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.RoundInfo), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.RoundInfo), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(objs); i += step { - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRoundInfo(), args) - require.NoError(t, err) - var resp types.QueryAllRoundInfoResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.RoundInfo), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.RoundInfo), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRoundInfo(), args) - require.NoError(t, err) - var resp types.QueryAllRoundInfoResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NoError(t, err) - require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(objs), - nullify.Fill(resp.RoundInfo), - ) - }) -} diff --git a/x/oracle/client/cli/query_validators.go b/x/oracle/client/cli/query_validators.go deleted file mode 100644 index 621354d62..000000000 --- a/x/oracle/client/cli/query_validators.go +++ /dev/null @@ -1,82 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/ExocoreNetwork/exocore/x/oracle/types" - "github.com/spf13/cast" -) - -func CmdListValidators() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-validators", - Short: "list all validators", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAllValidatorsRequest{ - Pagination: pageReq, - } - - res, err := queryClient.ValidatorsAll(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdShowValidators() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-validators [block]", - Short: "shows a validators", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - argBlock, err := cast.ToUint64E(args[0]) - if err != nil { - return err - } - - params := &types.QueryGetValidatorsRequest{ - Block: argBlock, - } - - res, err := queryClient.Validators(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/oracle/client/cli/query_validators_test.go b/x/oracle/client/cli/query_validators_test.go deleted file mode 100644 index 1a6841357..000000000 --- a/x/oracle/client/cli/query_validators_test.go +++ /dev/null @@ -1,160 +0,0 @@ -package cli_test - -import ( - "fmt" - "strconv" - "testing" - - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/ExocoreNetwork/exocore/testutil/network" - "github.com/ExocoreNetwork/exocore/testutil/nullify" - "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" - "github.com/ExocoreNetwork/exocore/x/oracle/types" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func networkWithValidatorsObjects(t *testing.T, n int) (*network.Network, []types.Validators) { - t.Helper() - cfg := network.DefaultConfig() - state := types.GenesisState{} - for i := 0; i < n; i++ { - validators := types.Validators{ - Block: uint64(i), - } - nullify.Fill(&validators) - state.ValidatorsList = append(state.ValidatorsList, validators) - } - buf, err := cfg.Codec.MarshalJSON(&state) - require.NoError(t, err) - cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), state.ValidatorsList -} - -func TestShowValidators(t *testing.T) { - net, objs := networkWithValidatorsObjects(t, 2) - - ctx := net.Validators[0].ClientCtx - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - tests := []struct { - desc string - idBlock uint64 - - args []string - err error - obj types.Validators - }{ - { - desc: "found", - idBlock: objs[0].Block, - - args: common, - obj: objs[0], - }, - { - desc: "not found", - idBlock: 100000, - - args: common, - err: status.Error(codes.NotFound, "not found"), - }, - } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - args := []string{ - strconv.Itoa(int(tc.idBlock)), - } - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowValidators(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - } else { - require.NoError(t, err) - var resp types.QueryGetValidatorsResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.Validators) - require.Equal(t, - nullify.Fill(&tc.obj), - nullify.Fill(&resp.Validators), - ) - } - }) - } -} - -func TestListValidators(t *testing.T) { - net, objs := networkWithValidatorsObjects(t, 5) - - ctx := net.Validators[0].ClientCtx - request := func(next []byte, offset, limit uint64, total bool) []string { - args := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - if next == nil { - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) - } else { - args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) - } - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) - if total { - args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) - } - return args - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(objs); i += step { - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListValidators(), args) - require.NoError(t, err) - var resp types.QueryAllValidatorsResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.Validators), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.Validators), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(objs); i += step { - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListValidators(), args) - require.NoError(t, err) - var resp types.QueryAllValidatorsResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.Validators), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.Validators), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListValidators(), args) - require.NoError(t, err) - var resp types.QueryAllValidatorsResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NoError(t, err) - require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(objs), - nullify.Fill(resp.Validators), - ) - }) -} diff --git a/x/oracle/genesis.go b/x/oracle/genesis.go index f4f66668c..4da2af620 100644 --- a/x/oracle/genesis.go +++ b/x/oracle/genesis.go @@ -12,18 +12,6 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) for _, elem := range genState.PricesList { k.SetPrices(ctx, elem) } - // Set all the roundInfo - for _, elem := range genState.RoundInfoList { - k.SetRoundInfo(ctx, elem) - } - // Set all the roundData - for _, elem := range genState.RoundDataList { - k.SetRoundData(ctx, elem) - } - // Set all the validators - for _, elem := range genState.ValidatorsList { - k.SetValidators(ctx, elem) - } // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, genState.Params) } @@ -34,9 +22,6 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.Params = k.GetParams(ctx) genesis.PricesList = k.GetAllPrices(ctx) - genesis.RoundInfoList = k.GetAllRoundInfo(ctx) - genesis.RoundDataList = k.GetAllRoundData(ctx) - genesis.ValidatorsList = k.GetAllValidators(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/oracle/genesis_test.go b/x/oracle/genesis_test.go index c7885f089..442d83398 100644 --- a/x/oracle/genesis_test.go +++ b/x/oracle/genesis_test.go @@ -22,30 +22,6 @@ func TestGenesis(t *testing.T) { TokenId: 1, }, }, - RoundInfoList: []types.RoundInfo{ - { - TokenId: 0, - }, - { - TokenId: 1, - }, - }, - RoundDataList: []types.RoundData{ - { - TokenId: 0, - }, - { - TokenId: 1, - }, - }, - ValidatorsList: []types.Validators{ - { - Block: 0, - }, - { - Block: 1, - }, - }, // this line is used by starport scaffolding # genesis/test/state } @@ -58,8 +34,5 @@ func TestGenesis(t *testing.T) { nullify.Fill(got) require.ElementsMatch(t, genesisState.PricesList, got.PricesList) - require.ElementsMatch(t, genesisState.RoundInfoList, got.RoundInfoList) - require.ElementsMatch(t, genesisState.RoundDataList, got.RoundDataList) - require.ElementsMatch(t, genesisState.ValidatorsList, got.ValidatorsList) // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/oracle/keeper/aggregator.go_bak b/x/oracle/keeper/aggregator.go_bak deleted file mode 100644 index d0b752f16..000000000 --- a/x/oracle/keeper/aggregator.go_bak +++ /dev/null @@ -1,87 +0,0 @@ -package keeper - -import ( - "github.com/ExocoreNetwork/exocore/x/oracle/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -type filter struct { -} - -type calculator struct { -} - -type aggregator struct { -} - -var agg *aggregator - -// TODO: we do the translation here from KVstore's tokenId->data in both roundInfo and roundData for calculation convinence, but this cause additional calculation -// TODO: !!!neeed to refactor the key for KVStore for both these two stucture before deployed -type aggregator struct { - //read only, params will not be modified from aggregagor - params *params - //context infomation for every round aggregation corespond to each tokenId - roundInfo map[int32]*types.RoundInfo - //collec - roundData map[int32]*types.RoundData - // validators map[uint64]*types.Validators - validators []*types.Validators - - k Keeper -} - -func GetAggregator() *aggregator { - if agg != nil { - return agg - } - return &aggregator{} -} - -func (k *Keeper) RecacheAgg(ctx sdk.Context) { - -} - -// UpdateParams will update the params in mem cache, check and conduce all related consequece from this update. -func (k *Keeper) UpdateParams4Agg(ctx sdk.Context) { - - //triggered by k.SetParams and do the validation and update on agg context{roundInfo, roundData, } - // agg.params = k.GetParams(ctx) - if agg.params == nil { - //prepare the initial params, just set the value, with the server on, this will be called once, and updated everytime the params be updated. - //this must be the very first time we interact with the aggregator, so recache any possible contextInfo(roundInfo, roundData) from KVStore(eg. restart a node) - return - } - //udpate params with specified keys, and trigger the ralted modificaiton for the context(roundId, roundData) - -} - -// UpdateContext4Agg updates related data in roundInfo and this may trigger modification on roundData -func (k *Keeper) UpdateContext4Agg(ctx sdk.Context) { - //fill roundInfo for all aflice feeders, do this in The EndBlock, prepare all context for the next block - //check/update agg.params first - //iterates feeders to fill roundInfo - //ops: 1. status:1, 2 - //ops: 2. trigger AppendPrices(success, failed, both lead to a new roundId) -} - -//func (k *Keeper) PrepareRoundInfo(ctx sdk.Context) { -// -//} - -// When the aggregation completed(both success and fail), this method will be called to set the Price of a now round and increase the corresponding NextRoundId -func (k *Keeper) AppendPricesAndSeal(ctx sdk.Context, tokenId int32, roundId uint64, price types.PriceWithTimeAndRound) { - //When aggregation is completed(both success or fail), prices will be updated with new roundId -} - -func (k *Keeper) GetFeederIdStatus(feederId int32) bool { - // if feeder := k.params.getTokenFeeder(feederId); feeder != nil{ - // agg.RoundInfo[] - // return TODO - // } - return agg.roundInfo[feederId].Status == int32(1) -} - -func (k *Keeper) UpdatePrices() { - -} diff --git a/x/oracle/keeper/readme.md b/x/oracle/keeper/readme.md deleted file mode 100644 index 129e43468..000000000 --- a/x/oracle/keeper/readme.md +++ /dev/null @@ -1,79 +0,0 @@ -# State for Aggregator rechache -## []Params: used as circle -- TokenFeeder: (active/inactive) -- block -> Params -- length = x -### Spec. -only latest Params matter for recache -## ValidatorSet -- block -> []validator{address, power} -## []msgCreatePrice: used as circle -- block -> []msgCreatePrice ---- -x: configured in Params -# Recache -Current block : h -## params update: -1,2,[3],4,5 -a. start feeder: no affect on former round/txs -b. stop feeder: related round/txs sealed at H=3 -Just recache from earliest block-2 -- msg in or before block-1 must have been seald in or before block-5, means the windows are closed, don't need cache for the collection -## validatoset update: -1,2,[3],4,5 -Validator set changed on block-3, this would be done in EndBlock of block-3, and all live round/txs would be seald here, means we don't need to recache any msgs from 1,2,3 -Just remove all block/txs info in 1,2,3 in block-3 Endblock after sealed all live round/txs -## workflow => -h0 = h-x -reProcess blocks from max{h0, min_[]msgCreatePrice.block} to fill the cache ---- -# Aggregator -1. initCache if cache is nil -- if []msgCreatePrice is empty just load Params and validatorSet -- if []msgCreatePrice is not empty, recache the `Aggregator` - -## Triggerd -1. create-price-service(): msg accepted call collectPrice()-> initCache if nil -2. EndBlock() -Seal()-> initCache if nil -- check params update --- stop feeder(update live feeder's EndBlock): seal related round/txs ---- if any feeder stop at current block, no realted txs will be accepted, --- new feeder(for new token from currently service) - -- check validatorset update: --- true: seal all alive round/txs here, update aggregator's status: 1->2 --- clear all []historyBlock-mem (which would be persit in KV) - -- aggregate() --- initCache if nil --- check all live round and: ---- consensus reached, then the round seal with sucess new price(basedBlock), status:1->2 ---- consensus not reached yet, but ----- feeder stops here(set by params), seal with previous price(basedBlock), status: 1->2//and clear corresponding roundInfo[feederId], dealed in postAggregation ----- window ends here, seal with previous price(basedBlock), udpate the related roundInfo[feederId].status:1->2 ----- validatorset changed: seal with previous price(basedBlock), update the related roundInfo[feeerId].status:1->2 -** this change will be active on next block, so we should seal here in front - -- postAggregation() --- remove all stopped feeders related roundInfo[feederId] --- if validator changed, remove all roundData - -- Prepare() -> initCache if nil --- params is up to date already --- based on current blockHeight and params(feeder)_ fromAggregatorCache, is there any possible status: 0->1(with info filled), 2->1(with info update) --- update validatorset if changed - -- Persist memCache for recache -- if validatorset changed: --- clear all the inMem_[]msgCreatePrice, nothing to persist, and clear KV's []msgCreatePrice --- set inMem_[]validatorSet -- if Parmas cahged: --- set Params -- msgCreatePrice, if not nil, append to KV -- params, if not nil, append to KV -- validatorset, if not nil, Set to KV(only keep one validatorSet) - -# params update -## updateTime, activeTime -TODO: When set up a new feeder, the feeder activeTime should be later than updateTime(may be dynamic) diff --git a/x/oracle/keeper/tmp.md b/x/oracle/keeper/tmp.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/x/oracle/module.go b/x/oracle/module.go index dbcbb25d8..e96e3cfa6 100644 --- a/x/oracle/module.go +++ b/x/oracle/module.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "fmt" + // this line is used by starport scaffolding # 1 "github.com/grpc-ecosystem/grpc-gateway/runtime" diff --git a/x/oracle/types/genesis.go b/x/oracle/types/genesis.go index 4dd367f2a..325628b43 100644 --- a/x/oracle/types/genesis.go +++ b/x/oracle/types/genesis.go @@ -10,10 +10,7 @@ const DefaultIndex uint64 = 1 // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - PricesList: []Prices{}, - RoundInfoList: []RoundInfo{}, - RoundDataList: []RoundData{}, - ValidatorsList: []Validators{}, + PricesList: []Prices{}, // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } @@ -32,36 +29,6 @@ func (gs GenesisState) Validate() error { } pricesIndexMap[index] = struct{}{} } - // Check for duplicated index in roundInfo - roundInfoIndexMap := make(map[string]struct{}) - - for _, elem := range gs.RoundInfoList { - index := string(RoundInfoKey(elem.TokenId)) - if _, ok := roundInfoIndexMap[index]; ok { - return fmt.Errorf("duplicated index for roundInfo") - } - roundInfoIndexMap[index] = struct{}{} - } - // Check for duplicated index in roundData - roundDataIndexMap := make(map[string]struct{}) - - for _, elem := range gs.RoundDataList { - index := string(RoundDataKey(elem.TokenId)) - if _, ok := roundDataIndexMap[index]; ok { - return fmt.Errorf("duplicated index for roundData") - } - roundDataIndexMap[index] = struct{}{} - } - // Check for duplicated index in validators - validatorsIndexMap := make(map[string]struct{}) - - for _, elem := range gs.ValidatorsList { - index := string(ValidatorsKey(elem.Block)) - if _, ok := validatorsIndexMap[index]; ok { - return fmt.Errorf("duplicated index for validators") - } - validatorsIndexMap[index] = struct{}{} - } // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go index 3940d6da1..d98939b2d 100644 --- a/x/oracle/types/genesis.pb.go +++ b/x/oracle/types/genesis.pb.go @@ -27,10 +27,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` PricesList []Prices `protobuf:"bytes,2,rep,name=pricesList,proto3" json:"pricesList"` - //TODO: userDefinedTokenFeeder - RoundInfoList []RoundInfo `protobuf:"bytes,3,rep,name=roundInfoList,proto3" json:"roundInfoList"` - RoundDataList []RoundData `protobuf:"bytes,4,rep,name=roundDataList,proto3" json:"roundDataList"` - ValidatorsList []Validators `protobuf:"bytes,5,rep,name=validatorsList,proto3" json:"validatorsList"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -80,27 +76,6 @@ func (m *GenesisState) GetPricesList() []Prices { return nil } -func (m *GenesisState) GetRoundInfoList() []RoundInfo { - if m != nil { - return m.RoundInfoList - } - return nil -} - -func (m *GenesisState) GetRoundDataList() []RoundData { - if m != nil { - return m.RoundDataList - } - return nil -} - -func (m *GenesisState) GetValidatorsList() []Validators { - if m != nil { - return m.ValidatorsList - } - return nil -} - func init() { proto.RegisterType((*GenesisState)(nil), "exocore.oracle.GenesisState") } @@ -108,28 +83,22 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/genesis.proto", fileDescriptor_dbe067676c4dc0de) } var fileDescriptor_dbe067676c4dc0de = []byte{ - // 323 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0x3f, 0x4b, 0xc3, 0x40, - 0x18, 0xc6, 0x93, 0xb6, 0x76, 0x38, 0xb5, 0x43, 0x10, 0xa9, 0x51, 0xae, 0xc5, 0xc9, 0x29, 0x11, - 0x75, 0x74, 0x2a, 0x16, 0xff, 0x20, 0x22, 0x15, 0x1c, 0x5c, 0xe4, 0x9a, 0x5c, 0xe3, 0x61, 0x9b, - 0x37, 0x5c, 0xae, 0x5a, 0xbf, 0x85, 0x1f, 0xab, 0x63, 0x47, 0x71, 0x10, 0x49, 0xbe, 0x88, 0xf4, - 0xee, 0x52, 0xcd, 0x61, 0xbb, 0x05, 0x9e, 0xdf, 0xf3, 0xcb, 0xfb, 0xde, 0x8b, 0xf6, 0xe8, 0x04, - 0x02, 0xe0, 0xd4, 0x07, 0x4e, 0x82, 0x21, 0xf5, 0x23, 0x1a, 0xd3, 0x94, 0xa5, 0x5e, 0xc2, 0x41, - 0x80, 0xd3, 0xd0, 0xa9, 0xa7, 0x52, 0x77, 0x2b, 0x82, 0x08, 0x64, 0xe4, 0xcf, 0xbf, 0x14, 0xe5, - 0xee, 0x1a, 0x8e, 0x84, 0x70, 0x32, 0x4a, 0x97, 0x85, 0x9c, 0x05, 0xb4, 0x08, 0x5b, 0x46, 0xc8, - 0x61, 0x1c, 0x87, 0x8f, 0x2c, 0x1e, 0xc0, 0x4a, 0x20, 0x24, 0x82, 0x2c, 0x01, 0x5e, 0xc8, 0x90, - 0x85, 0x44, 0x00, 0xd7, 0xbf, 0xd8, 0xff, 0xac, 0xa0, 0x8d, 0x73, 0xb5, 0xd4, 0x9d, 0x20, 0x82, - 0x3a, 0x27, 0xa8, 0xae, 0x06, 0x6c, 0xda, 0x6d, 0xfb, 0x60, 0xfd, 0x68, 0xdb, 0x2b, 0x2f, 0xe9, - 0xdd, 0xca, 0xb4, 0x53, 0x9b, 0x7e, 0xb5, 0xac, 0x9e, 0x66, 0x9d, 0x53, 0x84, 0xd4, 0xe4, 0xd7, - 0x2c, 0x15, 0xcd, 0x4a, 0xbb, 0xfa, 0x6f, 0x53, 0x12, 0xba, 0xf9, 0x87, 0x77, 0xba, 0x68, 0x53, - 0x4e, 0x7e, 0x19, 0x0f, 0x40, 0x0a, 0xaa, 0x52, 0xb0, 0x63, 0x0a, 0x7a, 0x05, 0xa4, 0x1d, 0xe5, - 0xd6, 0x42, 0x73, 0x46, 0x04, 0x91, 0x9a, 0xda, 0x0a, 0xcd, 0x1c, 0x2a, 0x69, 0x8a, 0x96, 0x73, - 0x81, 0x1a, 0xbf, 0xcf, 0x24, 0x3d, 0x6b, 0xd2, 0xe3, 0x9a, 0x9e, 0xfb, 0x05, 0xa5, 0x45, 0x46, - 0xaf, 0x73, 0x35, 0xcd, 0xb0, 0x3d, 0xcb, 0xb0, 0xfd, 0x9d, 0x61, 0xfb, 0x3d, 0xc7, 0xd6, 0x2c, - 0xc7, 0xd6, 0x47, 0x8e, 0xad, 0x87, 0xc3, 0x88, 0x89, 0xa7, 0x71, 0xdf, 0x0b, 0x60, 0xe4, 0x77, - 0x95, 0xf5, 0x86, 0x8a, 0x57, 0xe0, 0xcf, 0x7e, 0x71, 0xb1, 0x49, 0x71, 0x33, 0xf1, 0x96, 0xd0, - 0xb4, 0x5f, 0x97, 0xf7, 0x3a, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x5c, 0x40, 0x5a, 0x92, - 0x02, 0x00, 0x00, + // 225 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, + 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xca, 0xea, 0x41, 0x64, 0xa5, + 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x94, 0x34, 0x9a, 0x19, + 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0xb8, 0x24, 0x8b, 0x32, 0x93, 0x53, 0xa1, 0x92, 0x4a, 0x4d, + 0x8c, 0x5c, 0x3c, 0xee, 0x10, 0x1b, 0x83, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0x4c, 0xb8, 0xd8, 0x20, + 0xba, 0x25, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0xc4, 0xf4, 0x50, 0x5d, 0xa0, 0x17, 0x00, 0x96, + 0x75, 0x62, 0x39, 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xaa, 0x56, 0xc8, 0x86, 0x8b, 0x0b, 0x62, 0xac, + 0x4f, 0x66, 0x71, 0x89, 0x04, 0x93, 0x02, 0x33, 0x56, 0x9d, 0x60, 0x15, 0x50, 0x9d, 0x48, 0xea, + 0x9d, 0xbc, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, + 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x20, 0x3d, 0xb3, + 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0xdf, 0x15, 0x62, 0x9a, 0x5f, 0x6a, 0x49, 0x79, + 0x7e, 0x51, 0xb6, 0x3e, 0xcc, 0x57, 0x15, 0x30, 0x7f, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, + 0x81, 0xfd, 0x65, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x65, 0xb2, 0x58, 0x9a, 0x57, 0x01, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -152,48 +121,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.ValidatorsList) > 0 { - for iNdEx := len(m.ValidatorsList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ValidatorsList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.RoundDataList) > 0 { - for iNdEx := len(m.RoundDataList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RoundDataList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.RoundInfoList) > 0 { - for iNdEx := len(m.RoundInfoList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RoundInfoList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } if len(m.PricesList) > 0 { for iNdEx := len(m.PricesList) - 1; iNdEx >= 0; iNdEx-- { { @@ -246,24 +173,6 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.RoundInfoList) > 0 { - for _, e := range m.RoundInfoList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.RoundDataList) > 0 { - for _, e := range m.RoundDataList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.ValidatorsList) > 0 { - for _, e := range m.ValidatorsList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } return n } @@ -369,108 +278,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RoundInfoList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RoundInfoList = append(m.RoundInfoList, RoundInfo{}) - if err := m.RoundInfoList[len(m.RoundInfoList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RoundDataList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RoundDataList = append(m.RoundDataList, RoundData{}) - if err := m.RoundDataList[len(m.RoundDataList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorsList = append(m.ValidatorsList, Validators{}) - if err := m.ValidatorsList[len(m.ValidatorsList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/oracle/types/genesis_test.go b/x/oracle/types/genesis_test.go index 4902253b0..0fe5bfe87 100644 --- a/x/oracle/types/genesis_test.go +++ b/x/oracle/types/genesis_test.go @@ -30,30 +30,6 @@ func TestGenesisState_Validate(t *testing.T) { TokenId: 1, }, }, - RoundInfoList: []types.RoundInfo{ - { - TokenId: 0, - }, - { - TokenId: 1, - }, - }, - RoundDataList: []types.RoundData{ - { - TokenId: 0, - }, - { - TokenId: 1, - }, - }, - ValidatorsList: []types.Validators{ - { - Block: 0, - }, - { - Block: 1, - }, - }, // this line is used by starport scaffolding # types/genesis/validField }, valid: true, @@ -72,48 +48,6 @@ func TestGenesisState_Validate(t *testing.T) { }, valid: false, }, - { - desc: "duplicated roundInfo", - genState: &types.GenesisState{ - RoundInfoList: []types.RoundInfo{ - { - TokenId: 0, - }, - { - TokenId: 0, - }, - }, - }, - valid: false, - }, - { - desc: "duplicated roundData", - genState: &types.GenesisState{ - RoundDataList: []types.RoundData{ - { - TokenId: 0, - }, - { - TokenId: 0, - }, - }, - }, - valid: false, - }, - { - desc: "duplicated validators", - genState: &types.GenesisState{ - ValidatorsList: []types.Validators{ - { - Block: 0, - }, - { - Block: 0, - }, - }, - }, - valid: false, - }, // this line is used by starport scaffolding # types/genesis/testcase } for _, tc := range tests { diff --git a/x/oracle/types/key_round_data.go b/x/oracle/types/key_round_data.go deleted file mode 100644 index 1f9e41a98..000000000 --- a/x/oracle/types/key_round_data.go +++ /dev/null @@ -1,24 +0,0 @@ -package types - -import "encoding/binary" - -var _ binary.ByteOrder - -const ( - // RoundDataKeyPrefix is the prefix to retrieve all RoundData - RoundDataKeyPrefix = "RoundData/value/" -) - -// RoundDataKey returns the store key to retrieve a RoundData from the index fields -func RoundDataKey( - tokenId int32, -) []byte { - var key []byte - - tokenIdBytes := make([]byte, 4) - binary.BigEndian.PutUint32(tokenIdBytes, uint32(tokenId)) - key = append(key, tokenIdBytes...) - key = append(key, []byte("/")...) - - return key -} diff --git a/x/oracle/types/key_round_info.go b/x/oracle/types/key_round_info.go deleted file mode 100644 index a2c85055d..000000000 --- a/x/oracle/types/key_round_info.go +++ /dev/null @@ -1,24 +0,0 @@ -package types - -import "encoding/binary" - -var _ binary.ByteOrder - -const ( - // RoundInfoKeyPrefix is the prefix to retrieve all RoundInfo - RoundInfoKeyPrefix = "RoundInfo/value/" -) - -// RoundInfoKey returns the store key to retrieve a RoundInfo from the index fields -func RoundInfoKey( - tokenId int32, -) []byte { - var key []byte - - tokenIdBytes := make([]byte, 4) - binary.BigEndian.PutUint32(tokenIdBytes, uint32(tokenId)) - key = append(key, tokenIdBytes...) - key = append(key, []byte("/")...) - - return key -} diff --git a/x/oracle/types/key_validators.go b/x/oracle/types/key_validators.go deleted file mode 100644 index b78b6ef02..000000000 --- a/x/oracle/types/key_validators.go +++ /dev/null @@ -1,24 +0,0 @@ -package types - -import "encoding/binary" - -var _ binary.ByteOrder - -const ( - // ValidatorsKeyPrefix is the prefix to retrieve all Validators - ValidatorsKeyPrefix = "Validators/value/" -) - -// ValidatorsKey returns the store key to retrieve a Validators from the index fields -func ValidatorsKey( - block uint64, -) []byte { - var key []byte - - blockBytes := make([]byte, 8) - binary.BigEndian.PutUint64(blockBytes, block) - key = append(key, blockBytes...) - key = append(key, []byte("/")...) - - return key -} diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index a56cd0188..3b3f9c090 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -297,2910 +297,502 @@ func (m *QueryAllPricesResponse) GetPagination() *query.PageResponse { return nil } -type QueryGetRoundInfoRequest struct { - TokenId int32 `protobuf:"varint,1,opt,name=tokenId,proto3" json:"tokenId,omitempty"` +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "exocore.oracle.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "exocore.oracle.QueryParamsResponse") + proto.RegisterType((*QueryGetPricesRequest)(nil), "exocore.oracle.QueryGetPricesRequest") + proto.RegisterType((*QueryGetPricesResponse)(nil), "exocore.oracle.QueryGetPricesResponse") + proto.RegisterType((*QueryAllPricesRequest)(nil), "exocore.oracle.QueryAllPricesRequest") + proto.RegisterType((*QueryAllPricesResponse)(nil), "exocore.oracle.QueryAllPricesResponse") } -func (m *QueryGetRoundInfoRequest) Reset() { *m = QueryGetRoundInfoRequest{} } -func (m *QueryGetRoundInfoRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetRoundInfoRequest) ProtoMessage() {} -func (*QueryGetRoundInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{6} -} -func (m *QueryGetRoundInfoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetRoundInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetRoundInfoRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryGetRoundInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetRoundInfoRequest.Merge(m, src) -} -func (m *QueryGetRoundInfoRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetRoundInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetRoundInfoRequest.DiscardUnknown(m) +func init() { proto.RegisterFile("exocore/oracle/query.proto", fileDescriptor_f604621c8da1a6f3) } + +var fileDescriptor_f604621c8da1a6f3 = []byte{ + // 481 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x41, 0x6b, 0xd4, 0x40, + 0x14, 0xc7, 0x33, 0xad, 0x5d, 0x71, 0x04, 0x0f, 0x63, 0x2d, 0x25, 0x4a, 0x94, 0x91, 0xb6, 0x22, + 0x38, 0x63, 0xaa, 0xe0, 0xb9, 0x82, 0x16, 0x15, 0xca, 0x9a, 0xa3, 0x17, 0x99, 0xc4, 0x21, 0x86, + 0x66, 0xf3, 0xd2, 0xcc, 0xac, 0xb6, 0x88, 0x20, 0xde, 0xbc, 0x15, 0x3c, 0xf8, 0x19, 0xfc, 0x26, + 0x3d, 0x16, 0xbc, 0x78, 0x12, 0xd9, 0xf5, 0x83, 0x48, 0x66, 0xa6, 0x9a, 0xa4, 0x9b, 0x6e, 0x6f, + 0x9b, 0xf9, 0xff, 0xdf, 0xff, 0xfd, 0xe6, 0xcd, 0x5b, 0xec, 0xcb, 0x7d, 0x48, 0xa0, 0x92, 0x1c, + 0x2a, 0x91, 0xe4, 0x92, 0xef, 0x8d, 0x65, 0x75, 0xc0, 0xca, 0x0a, 0x34, 0x90, 0x2b, 0x4e, 0x63, + 0x56, 0xf3, 0x97, 0x53, 0x48, 0xc1, 0x48, 0xbc, 0xfe, 0x65, 0x5d, 0xfe, 0x8d, 0x14, 0x20, 0xcd, + 0x25, 0x17, 0x65, 0xc6, 0x45, 0x51, 0x80, 0x16, 0x3a, 0x83, 0x42, 0x39, 0xf5, 0x6e, 0x02, 0x6a, + 0x04, 0x8a, 0xc7, 0x42, 0xb9, 0x70, 0xfe, 0x2e, 0x8c, 0xa5, 0x16, 0x21, 0x2f, 0x45, 0x9a, 0x15, + 0xc6, 0xec, 0xbc, 0xd7, 0x3b, 0x2c, 0xa5, 0xa8, 0xc4, 0x48, 0xf5, 0x89, 0x55, 0x96, 0x48, 0x27, + 0xd2, 0x65, 0x4c, 0x5e, 0xd6, 0xd9, 0x43, 0x53, 0x11, 0xc9, 0xbd, 0xb1, 0x54, 0x9a, 0xbe, 0xc0, + 0x57, 0x5b, 0xa7, 0xaa, 0x84, 0x42, 0x49, 0xf2, 0x10, 0x0f, 0x6c, 0xf2, 0x2a, 0xba, 0x85, 0xee, + 0x5c, 0xde, 0x5c, 0x61, 0xed, 0x7b, 0x32, 0xeb, 0x7f, 0x7c, 0xe1, 0xe8, 0xd7, 0x4d, 0x2f, 0x72, + 0x5e, 0x1a, 0xe2, 0x6b, 0x26, 0x6c, 0x5b, 0xea, 0xa1, 0x69, 0xed, 0xba, 0x90, 0x55, 0x7c, 0x51, + 0xc3, 0xae, 0x2c, 0x9e, 0xbd, 0x31, 0x79, 0x4b, 0xd1, 0xc9, 0x27, 0xdd, 0xc1, 0x2b, 0xdd, 0x92, + 0x06, 0x82, 0x39, 0xe9, 0x45, 0x30, 0xea, 0x3f, 0x04, 0xf3, 0x45, 0x5f, 0x3b, 0x84, 0xad, 0x3c, + 0x6f, 0x23, 0x3c, 0xc5, 0xf8, 0xff, 0x30, 0x5d, 0xe4, 0x3a, 0xb3, 0x93, 0x67, 0xf5, 0xe4, 0x99, + 0x7d, 0x56, 0x37, 0x79, 0x36, 0x14, 0xa9, 0x74, 0xb5, 0x51, 0xa3, 0x92, 0x7e, 0x43, 0x8e, 0xb8, + 0xd1, 0x61, 0x06, 0xf1, 0xe2, 0x79, 0x89, 0xc9, 0x76, 0x0b, 0x6c, 0xc1, 0x80, 0x6d, 0xcc, 0x05, + 0xb3, 0x2d, 0x9b, 0x64, 0x9b, 0xdf, 0x17, 0xf1, 0x92, 0x21, 0x23, 0x9f, 0x10, 0x1e, 0xd8, 0x07, + 0x22, 0xb4, 0xcb, 0x70, 0x7a, 0x07, 0xfc, 0xdb, 0x67, 0x7a, 0x6c, 0x27, 0x7a, 0xef, 0xf3, 0x8f, + 0x3f, 0x5f, 0x17, 0x36, 0xc8, 0x1a, 0x7f, 0x62, 0xcd, 0x3b, 0x52, 0xbf, 0x87, 0x6a, 0x97, 0xcf, + 0x5c, 0x48, 0x72, 0x58, 0x23, 0xd8, 0x0b, 0xae, 0xcd, 0x8c, 0xef, 0xee, 0x88, 0xbf, 0x3e, 0xcf, + 0xe6, 0x40, 0x1e, 0x19, 0x90, 0x90, 0xf0, 0x79, 0x20, 0xa6, 0x8c, 0x7f, 0x70, 0x9b, 0xf6, 0x91, + 0x7c, 0x41, 0xf8, 0x92, 0xcd, 0xda, 0xca, 0xf3, 0x1e, 0xaa, 0xee, 0xda, 0xf4, 0x50, 0x9d, 0x7a, + 0xfb, 0xf3, 0x8f, 0xc7, 0xae, 0xc0, 0xf3, 0xa3, 0x49, 0x80, 0x8e, 0x27, 0x01, 0xfa, 0x3d, 0x09, + 0xd0, 0xe1, 0x34, 0xf0, 0x8e, 0xa7, 0x81, 0xf7, 0x73, 0x1a, 0x78, 0xaf, 0xee, 0xa7, 0x99, 0x7e, + 0x3b, 0x8e, 0x59, 0x02, 0xa3, 0xbe, 0xa8, 0xfd, 0x93, 0x30, 0x7d, 0x50, 0x4a, 0x15, 0x0f, 0xcc, + 0xff, 0xfb, 0xc1, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x80, 0x04, 0x70, 0x59, 0xa7, 0x04, 0x00, + 0x00, } -var xxx_messageInfo_QueryGetRoundInfoRequest proto.InternalMessageInfo +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn -func (m *QueryGetRoundInfoRequest) GetTokenId() int32 { - if m != nil { - return m.TokenId - } - return 0 -} +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 -type QueryGetRoundInfoResponse struct { - RoundInfo RoundInfo `protobuf:"bytes,1,opt,name=roundInfo,proto3" json:"roundInfo"` +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Queries a list of Prices items. + Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) + PricesAll(ctx context.Context, in *QueryAllPricesRequest, opts ...grpc.CallOption) (*QueryAllPricesResponse, error) } -func (m *QueryGetRoundInfoResponse) Reset() { *m = QueryGetRoundInfoResponse{} } -func (m *QueryGetRoundInfoResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetRoundInfoResponse) ProtoMessage() {} -func (*QueryGetRoundInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{7} -} -func (m *QueryGetRoundInfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetRoundInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetRoundInfoResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryGetRoundInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetRoundInfoResponse.Merge(m, src) -} -func (m *QueryGetRoundInfoResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetRoundInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetRoundInfoResponse.DiscardUnknown(m) +type queryClient struct { + cc grpc1.ClientConn } -var xxx_messageInfo_QueryGetRoundInfoResponse proto.InternalMessageInfo - -func (m *QueryGetRoundInfoResponse) GetRoundInfo() RoundInfo { - if m != nil { - return m.RoundInfo - } - return RoundInfo{} +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} } -type QueryAllRoundInfoRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *QueryAllRoundInfoRequest) Reset() { *m = QueryAllRoundInfoRequest{} } -func (m *QueryAllRoundInfoRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllRoundInfoRequest) ProtoMessage() {} -func (*QueryAllRoundInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{8} -} -func (m *QueryAllRoundInfoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllRoundInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllRoundInfoRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (c *queryClient) Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) { + out := new(QueryGetPricesResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/Prices", in, out, opts...) + if err != nil { + return nil, err } + return out, nil } -func (m *QueryAllRoundInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllRoundInfoRequest.Merge(m, src) -} -func (m *QueryAllRoundInfoRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllRoundInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllRoundInfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllRoundInfoRequest proto.InternalMessageInfo -func (m *QueryAllRoundInfoRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination +func (c *queryClient) PricesAll(ctx context.Context, in *QueryAllPricesRequest, opts ...grpc.CallOption) (*QueryAllPricesResponse, error) { + out := new(QueryAllPricesResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/PricesAll", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -type QueryAllRoundInfoResponse struct { - RoundInfo []RoundInfo `protobuf:"bytes,1,rep,name=roundInfo,proto3" json:"roundInfo"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +// QueryServer is the server API for Query service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a list of Prices items. + Prices(context.Context, *QueryGetPricesRequest) (*QueryGetPricesResponse, error) + PricesAll(context.Context, *QueryAllPricesRequest) (*QueryAllPricesResponse, error) } -func (m *QueryAllRoundInfoResponse) Reset() { *m = QueryAllRoundInfoResponse{} } -func (m *QueryAllRoundInfoResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllRoundInfoResponse) ProtoMessage() {} -func (*QueryAllRoundInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{9} -} -func (m *QueryAllRoundInfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllRoundInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllRoundInfoResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { } -func (m *QueryAllRoundInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllRoundInfoResponse.Merge(m, src) + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (m *QueryAllRoundInfoResponse) XXX_Size() int { - return m.Size() +func (*UnimplementedQueryServer) Prices(ctx context.Context, req *QueryGetPricesRequest) (*QueryGetPricesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Prices not implemented") } -func (m *QueryAllRoundInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllRoundInfoResponse.DiscardUnknown(m) +func (*UnimplementedQueryServer) PricesAll(ctx context.Context, req *QueryAllPricesRequest) (*QueryAllPricesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PricesAll not implemented") } -var xxx_messageInfo_QueryAllRoundInfoResponse proto.InternalMessageInfo +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} -func (m *QueryAllRoundInfoResponse) GetRoundInfo() []RoundInfo { - if m != nil { - return m.RoundInfo +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 } - return nil + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryAllRoundInfoResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination +func _Query_Prices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetPricesRequest) + if err := dec(in); err != nil { + return nil, err } - return nil + if interceptor == nil { + return srv.(QueryServer).Prices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/Prices", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Prices(ctx, req.(*QueryGetPricesRequest)) + } + return interceptor(ctx, in, info, handler) } -type QueryGetRoundDataRequest struct { - TokenId int32 `protobuf:"varint,1,opt,name=tokenId,proto3" json:"tokenId,omitempty"` +func _Query_PricesAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllPricesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).PricesAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/PricesAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PricesAll(ctx, req.(*QueryAllPricesRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryGetRoundDataRequest) Reset() { *m = QueryGetRoundDataRequest{} } -func (m *QueryGetRoundDataRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetRoundDataRequest) ProtoMessage() {} -func (*QueryGetRoundDataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{10} -} -func (m *QueryGetRoundDataRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "exocore.oracle.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Prices", + Handler: _Query_Prices_Handler, + }, + { + MethodName: "PricesAll", + Handler: _Query_PricesAll_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "exocore/oracle/query.proto", } -func (m *QueryGetRoundDataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetRoundDataRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil } -func (m *QueryGetRoundDataRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetRoundDataRequest.Merge(m, src) -} -func (m *QueryGetRoundDataRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetRoundDataRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetRoundDataRequest.DiscardUnknown(m) + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -var xxx_messageInfo_QueryGetRoundDataRequest proto.InternalMessageInfo +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} -func (m *QueryGetRoundDataRequest) GetTokenId() int32 { - if m != nil { - return m.TokenId +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return 0 + return dAtA[:n], nil } -type QueryGetRoundDataResponse struct { - RoundData RoundData `protobuf:"bytes,1,opt,name=roundData,proto3" json:"roundData"` -} - -func (m *QueryGetRoundDataResponse) Reset() { *m = QueryGetRoundDataResponse{} } -func (m *QueryGetRoundDataResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetRoundDataResponse) ProtoMessage() {} -func (*QueryGetRoundDataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{11} -} -func (m *QueryGetRoundDataResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetRoundDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetRoundDataResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryGetRoundDataResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetRoundDataResponse.Merge(m, src) -} -func (m *QueryGetRoundDataResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetRoundDataResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetRoundDataResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetRoundDataResponse proto.InternalMessageInfo - -func (m *QueryGetRoundDataResponse) GetRoundData() RoundData { - if m != nil { - return m.RoundData - } - return RoundData{} -} - -type QueryAllRoundDataRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllRoundDataRequest) Reset() { *m = QueryAllRoundDataRequest{} } -func (m *QueryAllRoundDataRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllRoundDataRequest) ProtoMessage() {} -func (*QueryAllRoundDataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{12} -} -func (m *QueryAllRoundDataRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllRoundDataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllRoundDataRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAllRoundDataRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllRoundDataRequest.Merge(m, src) -} -func (m *QueryAllRoundDataRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllRoundDataRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllRoundDataRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllRoundDataRequest proto.InternalMessageInfo - -func (m *QueryAllRoundDataRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryAllRoundDataResponse struct { - RoundData []RoundData `protobuf:"bytes,1,rep,name=roundData,proto3" json:"roundData"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllRoundDataResponse) Reset() { *m = QueryAllRoundDataResponse{} } -func (m *QueryAllRoundDataResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllRoundDataResponse) ProtoMessage() {} -func (*QueryAllRoundDataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{13} -} -func (m *QueryAllRoundDataResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllRoundDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllRoundDataResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAllRoundDataResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllRoundDataResponse.Merge(m, src) -} -func (m *QueryAllRoundDataResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllRoundDataResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllRoundDataResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllRoundDataResponse proto.InternalMessageInfo - -func (m *QueryAllRoundDataResponse) GetRoundData() []RoundData { - if m != nil { - return m.RoundData - } - return nil -} - -func (m *QueryAllRoundDataResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryGetValidatorsRequest struct { - Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` -} - -func (m *QueryGetValidatorsRequest) Reset() { *m = QueryGetValidatorsRequest{} } -func (m *QueryGetValidatorsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetValidatorsRequest) ProtoMessage() {} -func (*QueryGetValidatorsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{14} -} -func (m *QueryGetValidatorsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetValidatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetValidatorsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryGetValidatorsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetValidatorsRequest.Merge(m, src) -} -func (m *QueryGetValidatorsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetValidatorsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetValidatorsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetValidatorsRequest proto.InternalMessageInfo - -func (m *QueryGetValidatorsRequest) GetBlock() uint64 { - if m != nil { - return m.Block - } - return 0 -} - -type QueryGetValidatorsResponse struct { - Validators Validators `protobuf:"bytes,1,opt,name=validators,proto3" json:"validators"` +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetValidatorsResponse) Reset() { *m = QueryGetValidatorsResponse{} } -func (m *QueryGetValidatorsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetValidatorsResponse) ProtoMessage() {} -func (*QueryGetValidatorsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{15} -} -func (m *QueryGetValidatorsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetValidatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetValidatorsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) if err != nil { - return nil, err + return 0, err } - return b[:n], nil + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } -} -func (m *QueryGetValidatorsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetValidatorsResponse.Merge(m, src) -} -func (m *QueryGetValidatorsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetValidatorsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetValidatorsResponse.DiscardUnknown(m) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -var xxx_messageInfo_QueryGetValidatorsResponse proto.InternalMessageInfo - -func (m *QueryGetValidatorsResponse) GetValidators() Validators { - if m != nil { - return m.Validators +func (m *QueryGetPricesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return Validators{} + return dAtA[:n], nil } -type QueryAllValidatorsRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +func (m *QueryGetPricesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllValidatorsRequest) Reset() { *m = QueryAllValidatorsRequest{} } -func (m *QueryAllValidatorsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllValidatorsRequest) ProtoMessage() {} -func (*QueryAllValidatorsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{16} -} -func (m *QueryAllValidatorsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllValidatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllValidatorsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *QueryGetPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TokenId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.TokenId)) + i-- + dAtA[i] = 0x8 } -} -func (m *QueryAllValidatorsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllValidatorsRequest.Merge(m, src) -} -func (m *QueryAllValidatorsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllValidatorsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllValidatorsRequest.DiscardUnknown(m) + return len(dAtA) - i, nil } -var xxx_messageInfo_QueryAllValidatorsRequest proto.InternalMessageInfo - -func (m *QueryAllValidatorsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination +func (m *QueryGetPricesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil + return dAtA[:n], nil } -type QueryAllValidatorsResponse struct { - Validators []Validators `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +func (m *QueryGetPricesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllValidatorsResponse) Reset() { *m = QueryAllValidatorsResponse{} } -func (m *QueryAllValidatorsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllValidatorsResponse) ProtoMessage() {} -func (*QueryAllValidatorsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{17} -} -func (m *QueryAllValidatorsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllValidatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllValidatorsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) +func (m *QueryGetPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Prices.MarshalToSizedBuffer(dAtA[:i]) if err != nil { - return nil, err + return 0, err } - return b[:n], nil - } -} -func (m *QueryAllValidatorsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllValidatorsResponse.Merge(m, src) -} -func (m *QueryAllValidatorsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllValidatorsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllValidatorsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllValidatorsResponse proto.InternalMessageInfo - -func (m *QueryAllValidatorsResponse) GetValidators() []Validators { - if m != nil { - return m.Validators + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - return nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *QueryAllValidatorsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination +func (m *QueryAllPricesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return nil -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "exocore.oracle.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "exocore.oracle.QueryParamsResponse") - proto.RegisterType((*QueryGetPricesRequest)(nil), "exocore.oracle.QueryGetPricesRequest") - proto.RegisterType((*QueryGetPricesResponse)(nil), "exocore.oracle.QueryGetPricesResponse") - proto.RegisterType((*QueryAllPricesRequest)(nil), "exocore.oracle.QueryAllPricesRequest") - proto.RegisterType((*QueryAllPricesResponse)(nil), "exocore.oracle.QueryAllPricesResponse") - proto.RegisterType((*QueryGetRoundInfoRequest)(nil), "exocore.oracle.QueryGetRoundInfoRequest") - proto.RegisterType((*QueryGetRoundInfoResponse)(nil), "exocore.oracle.QueryGetRoundInfoResponse") - proto.RegisterType((*QueryAllRoundInfoRequest)(nil), "exocore.oracle.QueryAllRoundInfoRequest") - proto.RegisterType((*QueryAllRoundInfoResponse)(nil), "exocore.oracle.QueryAllRoundInfoResponse") - proto.RegisterType((*QueryGetRoundDataRequest)(nil), "exocore.oracle.QueryGetRoundDataRequest") - proto.RegisterType((*QueryGetRoundDataResponse)(nil), "exocore.oracle.QueryGetRoundDataResponse") - proto.RegisterType((*QueryAllRoundDataRequest)(nil), "exocore.oracle.QueryAllRoundDataRequest") - proto.RegisterType((*QueryAllRoundDataResponse)(nil), "exocore.oracle.QueryAllRoundDataResponse") - proto.RegisterType((*QueryGetValidatorsRequest)(nil), "exocore.oracle.QueryGetValidatorsRequest") - proto.RegisterType((*QueryGetValidatorsResponse)(nil), "exocore.oracle.QueryGetValidatorsResponse") - proto.RegisterType((*QueryAllValidatorsRequest)(nil), "exocore.oracle.QueryAllValidatorsRequest") - proto.RegisterType((*QueryAllValidatorsResponse)(nil), "exocore.oracle.QueryAllValidatorsResponse") + return dAtA[:n], nil } -func init() { proto.RegisterFile("exocore/oracle/query.proto", fileDescriptor_f604621c8da1a6f3) } - -var fileDescriptor_f604621c8da1a6f3 = []byte{ - // 829 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x97, 0xcf, 0x4f, 0x13, 0x41, - 0x14, 0xc7, 0x3b, 0x14, 0x30, 0x8c, 0x3f, 0x0e, 0x23, 0x12, 0x58, 0x4d, 0x31, 0x6b, 0xf8, 0x69, - 0xdc, 0xb5, 0x80, 0x31, 0xc6, 0x98, 0x08, 0x51, 0x09, 0x9a, 0x10, 0xec, 0xc1, 0x03, 0x07, 0xc9, - 0x74, 0x3b, 0xac, 0x1b, 0x96, 0x9d, 0xb2, 0xbb, 0x45, 0x08, 0x21, 0x31, 0xde, 0xbc, 0x91, 0x98, - 0x68, 0x3c, 0xe8, 0xc5, 0x83, 0xff, 0x0a, 0x47, 0x12, 0x2f, 0x9c, 0x8c, 0x01, 0xff, 0x10, 0x33, - 0x3f, 0xda, 0xfd, 0xd1, 0xdd, 0xee, 0x36, 0x29, 0x37, 0x3a, 0xf3, 0xde, 0x9b, 0xcf, 0xf7, 0xfb, - 0x9a, 0xf7, 0x0a, 0x54, 0xc8, 0x1e, 0x35, 0xa8, 0x4b, 0x74, 0xea, 0x62, 0xc3, 0x26, 0xfa, 0x4e, - 0x83, 0xb8, 0xfb, 0x5a, 0xdd, 0xa5, 0x3e, 0x45, 0xd7, 0xe4, 0x9d, 0x26, 0xee, 0x94, 0x61, 0x93, - 0x9a, 0x94, 0x5f, 0xe9, 0xec, 0x2f, 0x11, 0xa5, 0xdc, 0x32, 0x29, 0x35, 0x6d, 0xa2, 0xe3, 0xba, - 0xa5, 0x63, 0xc7, 0xa1, 0x3e, 0xf6, 0x2d, 0xea, 0x78, 0xf2, 0x76, 0xd6, 0xa0, 0xde, 0x36, 0xf5, - 0xf4, 0x2a, 0xf6, 0x64, 0x71, 0x7d, 0xb7, 0x5c, 0x25, 0x3e, 0x2e, 0xeb, 0x75, 0x6c, 0x5a, 0x0e, - 0x0f, 0x96, 0xb1, 0x37, 0x63, 0x2c, 0x75, 0xec, 0xe2, 0x6d, 0x2f, 0xed, 0xd2, 0xb5, 0x0c, 0xd2, - 0xbc, 0x1c, 0x8f, 0x5d, 0xba, 0xb4, 0xe1, 0xd4, 0x36, 0x2c, 0x67, 0x93, 0x76, 0x0c, 0xa8, 0x61, - 0x1f, 0xa7, 0x04, 0xec, 0x62, 0xdb, 0xaa, 0x61, 0x9f, 0xba, 0xf2, 0x09, 0x75, 0x18, 0xa2, 0xd7, - 0x0c, 0x7f, 0x8d, 0x43, 0x55, 0xc8, 0x4e, 0x83, 0x78, 0xbe, 0xfa, 0x0a, 0x5e, 0x8f, 0x9c, 0x7a, - 0x75, 0xea, 0x78, 0x04, 0x2d, 0xc0, 0x41, 0x01, 0x3f, 0x0a, 0x6e, 0x83, 0xe9, 0xcb, 0x73, 0x23, - 0x5a, 0xd4, 0x4a, 0x4d, 0xc4, 0x2f, 0xf5, 0x1f, 0xff, 0x19, 0x2f, 0x54, 0x64, 0xac, 0x5a, 0x86, - 0x37, 0x78, 0xb1, 0x65, 0xe2, 0xaf, 0x71, 0x75, 0xf2, 0x15, 0x34, 0x0a, 0x2f, 0xf9, 0x74, 0x8b, - 0x38, 0x2b, 0x35, 0x5e, 0x6f, 0xa0, 0xd2, 0xfc, 0xa8, 0xae, 0xc2, 0x91, 0x78, 0x4a, 0x08, 0x81, - 0x9f, 0xa4, 0x22, 0xf0, 0xdb, 0x16, 0x02, 0xff, 0xa4, 0x6e, 0x48, 0x84, 0x45, 0xdb, 0x8e, 0x22, - 0xbc, 0x80, 0x30, 0xe8, 0x97, 0x2c, 0x39, 0xa9, 0x89, 0xe6, 0x6a, 0xac, 0xb9, 0x9a, 0xf8, 0xe6, - 0xc8, 0xe6, 0x6a, 0x6b, 0xd8, 0x24, 0x32, 0xb7, 0x12, 0xca, 0x54, 0xbf, 0x02, 0x49, 0x1c, 0x7a, - 0x21, 0x81, 0xb8, 0x98, 0x97, 0x18, 0x2d, 0x47, 0xc0, 0xfa, 0x38, 0xd8, 0x54, 0x26, 0x98, 0x78, - 0x32, 0x42, 0xb6, 0x00, 0x47, 0x9b, 0x56, 0x56, 0xd8, 0xb7, 0x63, 0xc5, 0xd9, 0xa4, 0xd9, 0x0d, - 0x58, 0x87, 0x63, 0x09, 0x59, 0x52, 0xd1, 0x13, 0x38, 0xe4, 0x36, 0x0f, 0xa5, 0x67, 0x63, 0x71, - 0x51, 0xad, 0x2c, 0xa9, 0x2b, 0xc8, 0x50, 0xab, 0x92, 0x68, 0xd1, 0xb6, 0xdb, 0x88, 0x7a, 0xd5, - 0x8f, 0x9f, 0x40, 0x0a, 0x88, 0x3e, 0x92, 0x2c, 0xa0, 0xd8, 0x9d, 0x80, 0x8b, 0xeb, 0xcd, 0x33, - 0xec, 0xe3, 0xee, 0x7b, 0x23, 0xb2, 0x62, 0xd2, 0xd8, 0x61, 0xc7, 0xde, 0xb0, 0x80, 0x88, 0x34, - 0x76, 0xd0, 0xd6, 0x9b, 0x30, 0xd1, 0x85, 0xf5, 0xa6, 0x93, 0x80, 0x62, 0x77, 0x02, 0x7a, 0xd7, - 0x9b, 0x72, 0xe0, 0xf2, 0x9b, 0xd6, 0xd0, 0x6c, 0x5a, 0x31, 0x0c, 0x07, 0xaa, 0x36, 0x35, 0xb6, - 0xb8, 0x0b, 0xfd, 0x15, 0xf1, 0x41, 0x7d, 0x0b, 0x95, 0xa4, 0x14, 0x29, 0xec, 0x29, 0x84, 0xc1, - 0xf4, 0x95, 0xf6, 0x29, 0x71, 0x65, 0x41, 0x9e, 0x94, 0x16, 0xca, 0x51, 0x8d, 0xc0, 0xb7, 0x76, - 0xa4, 0x5e, 0x75, 0xe7, 0x17, 0x90, 0x2a, 0x62, 0xaf, 0xa4, 0xa8, 0x28, 0x76, 0xab, 0xa2, 0x67, - 0x1d, 0x9a, 0x3b, 0x85, 0x70, 0x80, 0x93, 0xa2, 0x0f, 0x00, 0x0e, 0x8a, 0xd5, 0x83, 0xd4, 0x38, - 0x4b, 0xfb, 0x76, 0x53, 0xee, 0x74, 0x8c, 0x11, 0x2f, 0xa9, 0xf7, 0x3e, 0xfe, 0xfe, 0xf7, 0xb9, - 0x6f, 0x0a, 0x4d, 0xe8, 0xcf, 0x45, 0xf0, 0x2a, 0xf1, 0xdf, 0x53, 0x77, 0x4b, 0x4f, 0xdc, 0xe6, - 0xe8, 0x88, 0x21, 0x88, 0xd1, 0x3d, 0x91, 0x58, 0x3e, 0xbe, 0xfd, 0x94, 0xc9, 0xac, 0x30, 0x09, - 0xf2, 0x90, 0x83, 0x94, 0x91, 0x9e, 0x05, 0xc2, 0xd3, 0xf4, 0x03, 0x39, 0x26, 0x0e, 0xd1, 0x27, - 0x00, 0x87, 0x44, 0xad, 0x45, 0xdb, 0x4e, 0xa1, 0x8a, 0x2f, 0xc4, 0x14, 0xaa, 0xb6, 0xad, 0x96, - 0xdf, 0x1e, 0xe1, 0xc9, 0x77, 0x00, 0x87, 0x5a, 0x13, 0x15, 0x4d, 0xa7, 0x49, 0x8f, 0xef, 0x03, - 0x65, 0x26, 0x47, 0xa4, 0x24, 0x7a, 0xcc, 0x89, 0x1e, 0xa0, 0xf9, 0x0c, 0xa2, 0xe0, 0x47, 0x54, - 0xc8, 0xab, 0x2f, 0x00, 0x5e, 0x69, 0x95, 0x64, 0x76, 0x4d, 0xa7, 0xf9, 0x90, 0x13, 0x31, 0x69, - 0xef, 0xa8, 0x65, 0x8e, 0x78, 0x17, 0xcd, 0xe4, 0x46, 0x0c, 0x8c, 0xe3, 0xd3, 0xad, 0xb3, 0x71, - 0xa1, 0x61, 0x9d, 0x61, 0x5c, 0x78, 0xe2, 0x76, 0x69, 0x1c, 0xfb, 0x71, 0x99, 0x64, 0x1c, 0x2b, - 0x99, 0x6d, 0x5c, 0x36, 0x62, 0xd2, 0x52, 0xe8, 0xd2, 0x38, 0x86, 0x88, 0x7e, 0x00, 0x08, 0x83, - 0x39, 0x84, 0x52, 0xfd, 0x68, 0x9b, 0xa4, 0xca, 0x6c, 0x9e, 0x50, 0x09, 0xf6, 0x88, 0x83, 0xcd, - 0xa3, 0x72, 0x06, 0x58, 0x30, 0xff, 0xf4, 0x03, 0xbe, 0x2c, 0x0e, 0xd1, 0x37, 0x00, 0xaf, 0x06, - 0x15, 0x99, 0x75, 0xa9, 0x86, 0xe4, 0x65, 0x4c, 0x1c, 0xd9, 0xb9, 0xcd, 0x0b, 0x18, 0x97, 0x5e, - 0x1e, 0x9f, 0x95, 0xc0, 0xc9, 0x59, 0x09, 0xfc, 0x3d, 0x2b, 0x81, 0xa3, 0xf3, 0x52, 0xe1, 0xe4, - 0xbc, 0x54, 0x38, 0x3d, 0x2f, 0x15, 0xd6, 0xef, 0x9b, 0x96, 0xff, 0xae, 0x51, 0xd5, 0x0c, 0xba, - 0x9d, 0x56, 0x6e, 0xaf, 0x59, 0xd0, 0xdf, 0xaf, 0x13, 0xaf, 0x3a, 0xc8, 0xff, 0xd1, 0x98, 0xff, - 0x1f, 0x00, 0x00, 0xff, 0xff, 0x54, 0x54, 0x9b, 0x6a, 0x93, 0x0d, 0x00, 0x00, +func (m *QueryAllPricesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - // Parameters queries the parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Queries a list of Prices items. - Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) - PricesAll(ctx context.Context, in *QueryAllPricesRequest, opts ...grpc.CallOption) (*QueryAllPricesResponse, error) - // Queries a list of RoundInfo items. - RoundInfo(ctx context.Context, in *QueryGetRoundInfoRequest, opts ...grpc.CallOption) (*QueryGetRoundInfoResponse, error) - RoundInfoAll(ctx context.Context, in *QueryAllRoundInfoRequest, opts ...grpc.CallOption) (*QueryAllRoundInfoResponse, error) - // Queries a list of RoundData items. - RoundData(ctx context.Context, in *QueryGetRoundDataRequest, opts ...grpc.CallOption) (*QueryGetRoundDataResponse, error) - RoundDataAll(ctx context.Context, in *QueryAllRoundDataRequest, opts ...grpc.CallOption) (*QueryAllRoundDataResponse, error) - // Queries a list of Validators items. - Validators(ctx context.Context, in *QueryGetValidatorsRequest, opts ...grpc.CallOption) (*QueryGetValidatorsResponse, error) - ValidatorsAll(ctx context.Context, in *QueryAllValidatorsRequest, opts ...grpc.CallOption) (*QueryAllValidatorsResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) 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, "/exocore.oracle.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) { - out := new(QueryGetPricesResponse) - err := c.cc.Invoke(ctx, "/exocore.oracle.Query/Prices", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) PricesAll(ctx context.Context, in *QueryAllPricesRequest, opts ...grpc.CallOption) (*QueryAllPricesResponse, error) { - out := new(QueryAllPricesResponse) - err := c.cc.Invoke(ctx, "/exocore.oracle.Query/PricesAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) RoundInfo(ctx context.Context, in *QueryGetRoundInfoRequest, opts ...grpc.CallOption) (*QueryGetRoundInfoResponse, error) { - out := new(QueryGetRoundInfoResponse) - err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RoundInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) RoundInfoAll(ctx context.Context, in *QueryAllRoundInfoRequest, opts ...grpc.CallOption) (*QueryAllRoundInfoResponse, error) { - out := new(QueryAllRoundInfoResponse) - err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RoundInfoAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) RoundData(ctx context.Context, in *QueryGetRoundDataRequest, opts ...grpc.CallOption) (*QueryGetRoundDataResponse, error) { - out := new(QueryGetRoundDataResponse) - err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RoundData", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) RoundDataAll(ctx context.Context, in *QueryAllRoundDataRequest, opts ...grpc.CallOption) (*QueryAllRoundDataResponse, error) { - out := new(QueryAllRoundDataResponse) - err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RoundDataAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Validators(ctx context.Context, in *QueryGetValidatorsRequest, opts ...grpc.CallOption) (*QueryGetValidatorsResponse, error) { - out := new(QueryGetValidatorsResponse) - err := c.cc.Invoke(ctx, "/exocore.oracle.Query/Validators", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ValidatorsAll(ctx context.Context, in *QueryAllValidatorsRequest, opts ...grpc.CallOption) (*QueryAllValidatorsResponse, error) { - out := new(QueryAllValidatorsResponse) - err := c.cc.Invoke(ctx, "/exocore.oracle.Query/ValidatorsAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries a list of Prices items. - Prices(context.Context, *QueryGetPricesRequest) (*QueryGetPricesResponse, error) - PricesAll(context.Context, *QueryAllPricesRequest) (*QueryAllPricesResponse, error) - // Queries a list of RoundInfo items. - RoundInfo(context.Context, *QueryGetRoundInfoRequest) (*QueryGetRoundInfoResponse, error) - RoundInfoAll(context.Context, *QueryAllRoundInfoRequest) (*QueryAllRoundInfoResponse, error) - // Queries a list of RoundData items. - RoundData(context.Context, *QueryGetRoundDataRequest) (*QueryGetRoundDataResponse, error) - RoundDataAll(context.Context, *QueryAllRoundDataRequest) (*QueryAllRoundDataResponse, error) - // Queries a list of Validators items. - Validators(context.Context, *QueryGetValidatorsRequest) (*QueryGetValidatorsResponse, error) - ValidatorsAll(context.Context, *QueryAllValidatorsRequest) (*QueryAllValidatorsResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (*UnimplementedQueryServer) Prices(ctx context.Context, req *QueryGetPricesRequest) (*QueryGetPricesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Prices not implemented") -} -func (*UnimplementedQueryServer) PricesAll(ctx context.Context, req *QueryAllPricesRequest) (*QueryAllPricesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PricesAll not implemented") -} -func (*UnimplementedQueryServer) RoundInfo(ctx context.Context, req *QueryGetRoundInfoRequest) (*QueryGetRoundInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RoundInfo not implemented") -} -func (*UnimplementedQueryServer) RoundInfoAll(ctx context.Context, req *QueryAllRoundInfoRequest) (*QueryAllRoundInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RoundInfoAll not implemented") -} -func (*UnimplementedQueryServer) RoundData(ctx context.Context, req *QueryGetRoundDataRequest) (*QueryGetRoundDataResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RoundData not implemented") -} -func (*UnimplementedQueryServer) RoundDataAll(ctx context.Context, req *QueryAllRoundDataRequest) (*QueryAllRoundDataResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RoundDataAll not implemented") -} -func (*UnimplementedQueryServer) Validators(ctx context.Context, req *QueryGetValidatorsRequest) (*QueryGetValidatorsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Validators not implemented") -} -func (*UnimplementedQueryServer) ValidatorsAll(ctx context.Context, req *QueryAllValidatorsRequest) (*QueryAllValidatorsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidatorsAll not implemented") -} - -func RegisterQueryServer(s grpc1.Server, 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: "/exocore.oracle.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Prices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetPricesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Prices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.oracle.Query/Prices", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Prices(ctx, req.(*QueryGetPricesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_PricesAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllPricesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).PricesAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.oracle.Query/PricesAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).PricesAll(ctx, req.(*QueryAllPricesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_RoundInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetRoundInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).RoundInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.oracle.Query/RoundInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).RoundInfo(ctx, req.(*QueryGetRoundInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_RoundInfoAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllRoundInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).RoundInfoAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.oracle.Query/RoundInfoAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).RoundInfoAll(ctx, req.(*QueryAllRoundInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_RoundData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetRoundDataRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).RoundData(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.oracle.Query/RoundData", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).RoundData(ctx, req.(*QueryGetRoundDataRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_RoundDataAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllRoundDataRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).RoundDataAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.oracle.Query/RoundDataAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).RoundDataAll(ctx, req.(*QueryAllRoundDataRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Validators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetValidatorsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Validators(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.oracle.Query/Validators", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Validators(ctx, req.(*QueryGetValidatorsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_ValidatorsAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllValidatorsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ValidatorsAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.oracle.Query/ValidatorsAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ValidatorsAll(ctx, req.(*QueryAllValidatorsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "exocore.oracle.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Prices", - Handler: _Query_Prices_Handler, - }, - { - MethodName: "PricesAll", - Handler: _Query_PricesAll_Handler, - }, - { - MethodName: "RoundInfo", - Handler: _Query_RoundInfo_Handler, - }, - { - MethodName: "RoundInfoAll", - Handler: _Query_RoundInfoAll_Handler, - }, - { - MethodName: "RoundData", - Handler: _Query_RoundData_Handler, - }, - { - MethodName: "RoundDataAll", - Handler: _Query_RoundDataAll_Handler, - }, - { - MethodName: "Validators", - Handler: _Query_Validators_Handler, - }, - { - MethodName: "ValidatorsAll", - Handler: _Query_ValidatorsAll_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "exocore/oracle/query.proto", -} - -func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryGetPricesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryGetPricesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TokenId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.TokenId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryGetPricesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryGetPricesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Prices.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryAllPricesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllPricesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllPricesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllPricesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Prices) > 0 { - for iNdEx := len(m.Prices) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Prices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryGetRoundInfoRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryGetRoundInfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetRoundInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TokenId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.TokenId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryGetRoundInfoResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryGetRoundInfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetRoundInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.RoundInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryAllRoundInfoRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllRoundInfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllRoundInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllRoundInfoResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllRoundInfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllRoundInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.RoundInfo) > 0 { - for iNdEx := len(m.RoundInfo) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RoundInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryGetRoundDataRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryGetRoundDataRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetRoundDataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TokenId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.TokenId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryGetRoundDataResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryGetRoundDataResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetRoundDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.RoundData.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryAllRoundDataRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllRoundDataRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllRoundDataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllRoundDataResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllRoundDataResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllRoundDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.RoundData) > 0 { - for iNdEx := len(m.RoundData) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RoundData[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryGetValidatorsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryGetValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Block != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryGetValidatorsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryGetValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Validators.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryAllValidatorsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllValidatorsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Validators) > 0 { - for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryGetPricesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TokenId != 0 { - n += 1 + sovQuery(uint64(m.TokenId)) - } - return n -} - -func (m *QueryGetPricesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Prices.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllPricesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllPricesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Prices) > 0 { - for _, e := range m.Prices { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetRoundInfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TokenId != 0 { - n += 1 + sovQuery(uint64(m.TokenId)) - } - return n -} - -func (m *QueryGetRoundInfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.RoundInfo.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllRoundInfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllRoundInfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.RoundInfo) > 0 { - for _, e := range m.RoundInfo { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetRoundDataRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TokenId != 0 { - n += 1 + sovQuery(uint64(m.TokenId)) - } - return n -} - -func (m *QueryGetRoundDataResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.RoundData.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllRoundDataRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllRoundDataResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.RoundData) > 0 { - for _, e := range m.RoundData { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetValidatorsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Block != 0 { - n += 1 + sovQuery(uint64(m.Block)) - } - return n -} - -func (m *QueryGetValidatorsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Validators.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllValidatorsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllValidatorsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Validators) > 0 { - for _, e := range m.Validators { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGetPricesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) - } - m.TokenId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TokenId |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGetPricesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Prices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllPricesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllPricesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Prices = append(m.Prices, Prices{}) - if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetRoundInfoRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGetRoundInfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetRoundInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) - } - m.TokenId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TokenId |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetRoundInfoResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGetRoundInfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetRoundInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RoundInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.RoundInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllRoundInfoRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllRoundInfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRoundInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllRoundInfoResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllRoundInfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRoundInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RoundInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RoundInfo = append(m.RoundInfo, RoundInfo{}) - if err := m.RoundInfo[len(m.RoundInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetRoundDataRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGetRoundDataRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetRoundDataRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) - } - m.TokenId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TokenId |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetRoundDataResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGetRoundDataResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetRoundDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RoundData", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.RoundData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) +func (m *QueryAllPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) if err != nil { - return err + return 0, err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllPricesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllPricesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Prices) > 0 { + for iNdEx := len(m.Prices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Prices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - iNdEx += skippy + i-- + dAtA[i] = 0xa } } + return len(dAtA) - i, nil +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return nil + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetPricesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovQuery(uint64(m.TokenId)) + } + return n +} + +func (m *QueryGetPricesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Prices.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllPricesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllPricesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Prices) > 0 { + for _, e := range m.Prices { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryAllRoundDataRequest) Unmarshal(dAtA []byte) error { +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3223,48 +815,12 @@ func (m *QueryAllRoundDataRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllRoundDataRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRoundDataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -3286,7 +842,7 @@ func (m *QueryAllRoundDataRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllRoundDataResponse) Unmarshal(dAtA []byte) error { +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3309,49 +865,15 @@ func (m *QueryAllRoundDataResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllRoundDataResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRoundDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RoundData", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RoundData = append(m.RoundData, RoundData{}) - if err := m.RoundData[len(m.RoundData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3378,10 +900,7 @@ func (m *QueryAllRoundDataResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3406,7 +925,7 @@ func (m *QueryAllRoundDataResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetValidatorsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3429,17 +948,17 @@ func (m *QueryGetValidatorsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetValidatorsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetPricesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) } - m.Block = 0 + m.TokenId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3449,7 +968,7 @@ func (m *QueryGetValidatorsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Block |= uint64(b&0x7F) << shift + m.TokenId |= int32(b&0x7F) << shift if b < 0x80 { break } @@ -3475,7 +994,7 @@ func (m *QueryGetValidatorsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetValidatorsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3498,15 +1017,15 @@ func (m *QueryGetValidatorsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetValidatorsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetPricesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3533,7 +1052,7 @@ func (m *QueryGetValidatorsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Validators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Prices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3558,7 +1077,7 @@ func (m *QueryGetValidatorsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllValidatorsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3581,10 +1100,10 @@ func (m *QueryAllValidatorsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllValidatorsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllPricesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3644,7 +1163,7 @@ func (m *QueryAllValidatorsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllValidatorsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3667,15 +1186,15 @@ func (m *QueryAllValidatorsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllValidatorsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllPricesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3702,8 +1221,8 @@ func (m *QueryAllValidatorsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Validators = append(m.Validators, Validators{}) - if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Prices = append(m.Prices, Prices{}) + if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index b324d384a..872eb9da9 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -141,276 +141,6 @@ func local_request_Query_PricesAll_0(ctx context.Context, marshaler runtime.Mars } -func request_Query_RoundInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetRoundInfoRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["tokenId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tokenId") - } - - protoReq.TokenId, err = runtime.Int32(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tokenId", err) - } - - msg, err := client.RoundInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_RoundInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetRoundInfoRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["tokenId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tokenId") - } - - protoReq.TokenId, err = runtime.Int32(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tokenId", err) - } - - msg, err := server.RoundInfo(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_RoundInfoAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_RoundInfoAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllRoundInfoRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RoundInfoAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.RoundInfoAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_RoundInfoAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllRoundInfoRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RoundInfoAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.RoundInfoAll(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_RoundData_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetRoundDataRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["tokenId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tokenId") - } - - protoReq.TokenId, err = runtime.Int32(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tokenId", err) - } - - msg, err := client.RoundData(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_RoundData_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetRoundDataRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["tokenId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tokenId") - } - - protoReq.TokenId, err = runtime.Int32(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tokenId", err) - } - - msg, err := server.RoundData(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_RoundDataAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_RoundDataAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllRoundDataRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RoundDataAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.RoundDataAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_RoundDataAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllRoundDataRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RoundDataAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.RoundDataAll(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Validators_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetValidatorsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["block"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "block") - } - - protoReq.Block, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "block", err) - } - - msg, err := client.Validators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Validators_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetValidatorsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["block"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "block") - } - - protoReq.Block, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "block", err) - } - - msg, err := server.Validators(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_ValidatorsAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_ValidatorsAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllValidatorsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ValidatorsAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ValidatorsAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ValidatorsAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllValidatorsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ValidatorsAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ValidatorsAll(ctx, &protoReq) - return msg, metadata, err - -} - // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -486,144 +216,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_RoundInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_RoundInfo_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_RoundInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_RoundInfoAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_RoundInfoAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_RoundInfoAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_RoundData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_RoundData_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_RoundData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_RoundDataAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_RoundDataAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_RoundDataAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Validators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Validators_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Validators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ValidatorsAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ValidatorsAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ValidatorsAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -725,126 +317,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_RoundInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_RoundInfo_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_RoundInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_RoundInfoAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_RoundInfoAll_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_RoundInfoAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_RoundData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_RoundData_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_RoundData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_RoundDataAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_RoundDataAll_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_RoundDataAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Validators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Validators_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Validators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ValidatorsAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ValidatorsAll_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ValidatorsAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -854,18 +326,6 @@ var ( pattern_Query_Prices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "prices", "tokenId"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_PricesAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "prices"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_RoundInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "round_info", "tokenId"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_RoundInfoAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "round_info"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_RoundData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "round_data", "tokenId"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_RoundDataAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "round_data"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_Validators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "validators", "block"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_ValidatorsAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "validators"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -874,16 +334,4 @@ var ( forward_Query_Prices_0 = runtime.ForwardResponseMessage forward_Query_PricesAll_0 = runtime.ForwardResponseMessage - - forward_Query_RoundInfo_0 = runtime.ForwardResponseMessage - - forward_Query_RoundInfoAll_0 = runtime.ForwardResponseMessage - - forward_Query_RoundData_0 = runtime.ForwardResponseMessage - - forward_Query_RoundDataAll_0 = runtime.ForwardResponseMessage - - forward_Query_Validators_0 = runtime.ForwardResponseMessage - - forward_Query_ValidatorsAll_0 = runtime.ForwardResponseMessage ) diff --git a/x/oracle/types/round_data.pb.go b/x/oracle/types/round_data.pb.go deleted file mode 100644 index 58b9d47fb..000000000 --- a/x/oracle/types/round_data.pb.go +++ /dev/null @@ -1,584 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: exocore/oracle/round_data.proto - -package types - -import ( - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type RoundData struct { - TokenId int32 `protobuf:"varint,1,opt,name=tokenId,proto3" json:"tokenId,omitempty"` - PricesSource []*PricesWithSource `protobuf:"bytes,2,rep,name=prices_source,json=pricesSource,proto3" json:"prices_source,omitempty"` -} - -func (m *RoundData) Reset() { *m = RoundData{} } -func (m *RoundData) String() string { return proto.CompactTextString(m) } -func (*RoundData) ProtoMessage() {} -func (*RoundData) Descriptor() ([]byte, []int) { - return fileDescriptor_a5d205303c327dea, []int{0} -} -func (m *RoundData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RoundData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RoundData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RoundData) XXX_Merge(src proto.Message) { - xxx_messageInfo_RoundData.Merge(m, src) -} -func (m *RoundData) XXX_Size() int { - return m.Size() -} -func (m *RoundData) XXX_DiscardUnknown() { - xxx_messageInfo_RoundData.DiscardUnknown(m) -} - -var xxx_messageInfo_RoundData proto.InternalMessageInfo - -func (m *RoundData) GetTokenId() int32 { - if m != nil { - return m.TokenId - } - return 0 -} - -func (m *RoundData) GetPricesSource() []*PricesWithSource { - if m != nil { - return m.PricesSource - } - return nil -} - -type PricesWithSource struct { - SourceId int32 `protobuf:"varint,1,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` - PricesTimeRound []*PriceWithTimeAndRound `protobuf:"bytes,2,rep,name=prices_time_round,json=pricesTimeRound,proto3" json:"prices_time_round,omitempty"` -} - -func (m *PricesWithSource) Reset() { *m = PricesWithSource{} } -func (m *PricesWithSource) String() string { return proto.CompactTextString(m) } -func (*PricesWithSource) ProtoMessage() {} -func (*PricesWithSource) Descriptor() ([]byte, []int) { - return fileDescriptor_a5d205303c327dea, []int{1} -} -func (m *PricesWithSource) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PricesWithSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PricesWithSource.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PricesWithSource) XXX_Merge(src proto.Message) { - xxx_messageInfo_PricesWithSource.Merge(m, src) -} -func (m *PricesWithSource) XXX_Size() int { - return m.Size() -} -func (m *PricesWithSource) XXX_DiscardUnknown() { - xxx_messageInfo_PricesWithSource.DiscardUnknown(m) -} - -var xxx_messageInfo_PricesWithSource proto.InternalMessageInfo - -func (m *PricesWithSource) GetSourceId() int32 { - if m != nil { - return m.SourceId - } - return 0 -} - -func (m *PricesWithSource) GetPricesTimeRound() []*PriceWithTimeAndRound { - if m != nil { - return m.PricesTimeRound - } - return nil -} - -func init() { - proto.RegisterType((*RoundData)(nil), "exocore.oracle.RoundData") - proto.RegisterType((*PricesWithSource)(nil), "exocore.oracle.PricesWithSource") -} - -func init() { proto.RegisterFile("exocore/oracle/round_data.proto", fileDescriptor_a5d205303c327dea) } - -var fileDescriptor_a5d205303c327dea = []byte{ - // 276 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xad, 0xc8, 0x4f, - 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0xca, 0x2f, 0xcd, 0x4b, - 0x89, 0x4f, 0x49, 0x2c, 0x49, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x2a, 0xd0, - 0x83, 0x28, 0x90, 0x92, 0x42, 0xd3, 0x50, 0x50, 0x94, 0x99, 0x9c, 0x0a, 0x51, 0xab, 0x94, 0xc3, - 0xc5, 0x19, 0x04, 0xd2, 0xef, 0x92, 0x58, 0x92, 0x28, 0x24, 0xc1, 0xc5, 0x5e, 0x92, 0x9f, 0x9d, - 0x9a, 0xe7, 0x99, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x1a, 0x04, 0xe3, 0x0a, 0xb9, 0x72, 0xf1, - 0x82, 0x75, 0x15, 0xc7, 0x17, 0xe7, 0x97, 0x16, 0x25, 0xa7, 0x4a, 0x30, 0x29, 0x30, 0x6b, 0x70, - 0x1b, 0x29, 0xe8, 0xa1, 0x5a, 0xa5, 0x17, 0x00, 0x56, 0x14, 0x9e, 0x59, 0x92, 0x11, 0x0c, 0x56, - 0x17, 0xc4, 0x03, 0xd1, 0x06, 0xe1, 0x29, 0x35, 0x31, 0x72, 0x09, 0xa0, 0x2b, 0x11, 0x92, 0xe6, - 0xe2, 0x84, 0x18, 0x1a, 0x9f, 0x09, 0xb3, 0x97, 0x03, 0x22, 0xe0, 0x99, 0x22, 0x14, 0xc8, 0x25, - 0x08, 0xb5, 0xb8, 0x24, 0x33, 0x37, 0x35, 0x1e, 0xec, 0x57, 0xa8, 0xe5, 0xaa, 0x58, 0x2d, 0x07, - 0x19, 0x1c, 0x92, 0x99, 0x9b, 0xea, 0x98, 0x97, 0x02, 0xf6, 0x58, 0x10, 0x3f, 0x44, 0x3f, 0x48, - 0x0c, 0x2c, 0xe0, 0xe4, 0x75, 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, 0x06, - 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xae, 0x10, 0xb3, 0xfd, 0x52, - 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0x61, 0x41, 0x58, 0x01, 0x0b, 0xc4, 0x92, 0xca, 0x82, 0xd4, - 0xe2, 0x24, 0x36, 0x70, 0x28, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x95, 0x4a, 0xae, - 0x94, 0x01, 0x00, 0x00, -} - -func (m *RoundData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RoundData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RoundData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PricesSource) > 0 { - for iNdEx := len(m.PricesSource) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PricesSource[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRoundData(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.TokenId != 0 { - i = encodeVarintRoundData(dAtA, i, uint64(m.TokenId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *PricesWithSource) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PricesWithSource) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PricesWithSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PricesTimeRound) > 0 { - for iNdEx := len(m.PricesTimeRound) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PricesTimeRound[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRoundData(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.SourceId != 0 { - i = encodeVarintRoundData(dAtA, i, uint64(m.SourceId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintRoundData(dAtA []byte, offset int, v uint64) int { - offset -= sovRoundData(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *RoundData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TokenId != 0 { - n += 1 + sovRoundData(uint64(m.TokenId)) - } - if len(m.PricesSource) > 0 { - for _, e := range m.PricesSource { - l = e.Size() - n += 1 + l + sovRoundData(uint64(l)) - } - } - return n -} - -func (m *PricesWithSource) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SourceId != 0 { - n += 1 + sovRoundData(uint64(m.SourceId)) - } - if len(m.PricesTimeRound) > 0 { - for _, e := range m.PricesTimeRound { - l = e.Size() - n += 1 + l + sovRoundData(uint64(l)) - } - } - return n -} - -func sovRoundData(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRoundData(x uint64) (n int) { - return sovRoundData(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *RoundData) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRoundData - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RoundData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RoundData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) - } - m.TokenId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRoundData - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TokenId |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PricesSource", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRoundData - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRoundData - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRoundData - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PricesSource = append(m.PricesSource, &PricesWithSource{}) - if err := m.PricesSource[len(m.PricesSource)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRoundData(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRoundData - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PricesWithSource) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRoundData - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PricesWithSource: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PricesWithSource: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceId", wireType) - } - m.SourceId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRoundData - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SourceId |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PricesTimeRound", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRoundData - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRoundData - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRoundData - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PricesTimeRound = append(m.PricesTimeRound, &PriceWithTimeAndRound{}) - if err := m.PricesTimeRound[len(m.PricesTimeRound)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRoundData(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRoundData - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRoundData(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRoundData - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRoundData - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRoundData - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRoundData - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRoundData - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRoundData - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthRoundData = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRoundData = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRoundData = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/oracle/types/round_info.pb.go b/x/oracle/types/round_info.pb.go deleted file mode 100644 index 239722e5b..000000000 --- a/x/oracle/types/round_info.pb.go +++ /dev/null @@ -1,444 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: exocore/oracle/round_info.proto - -package types - -import ( - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type RoundInfo struct { - TokenId int32 `protobuf:"varint,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` - BasedBlock uint64 `protobuf:"varint,2,opt,name=based_block,json=basedBlock,proto3" json:"based_block,omitempty"` - NexitRoundId uint64 `protobuf:"varint,3,opt,name=nexit_roundId,json=nexitRoundId,proto3" json:"nexit_roundId,omitempty"` - FeederId int32 `protobuf:"varint,4,opt,name=feeder_id,json=feederId,proto3" json:"feeder_id,omitempty"` - Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` -} - -func (m *RoundInfo) Reset() { *m = RoundInfo{} } -func (m *RoundInfo) String() string { return proto.CompactTextString(m) } -func (*RoundInfo) ProtoMessage() {} -func (*RoundInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_1bbd3567e4c61954, []int{0} -} -func (m *RoundInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RoundInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RoundInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RoundInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_RoundInfo.Merge(m, src) -} -func (m *RoundInfo) XXX_Size() int { - return m.Size() -} -func (m *RoundInfo) XXX_DiscardUnknown() { - xxx_messageInfo_RoundInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_RoundInfo proto.InternalMessageInfo - -func (m *RoundInfo) GetTokenId() int32 { - if m != nil { - return m.TokenId - } - return 0 -} - -func (m *RoundInfo) GetBasedBlock() uint64 { - if m != nil { - return m.BasedBlock - } - return 0 -} - -func (m *RoundInfo) GetNexitRoundId() uint64 { - if m != nil { - return m.NexitRoundId - } - return 0 -} - -func (m *RoundInfo) GetFeederId() int32 { - if m != nil { - return m.FeederId - } - return 0 -} - -func (m *RoundInfo) GetStatus() int32 { - if m != nil { - return m.Status - } - return 0 -} - -func init() { - proto.RegisterType((*RoundInfo)(nil), "exocore.oracle.RoundInfo") -} - -func init() { proto.RegisterFile("exocore/oracle/round_info.proto", fileDescriptor_1bbd3567e4c61954) } - -var fileDescriptor_1bbd3567e4c61954 = []byte{ - // 254 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x90, 0x3f, 0x4e, 0xc3, 0x30, - 0x14, 0x87, 0x63, 0x68, 0x4b, 0x6b, 0xfe, 0x0c, 0x1e, 0x50, 0x10, 0x92, 0x5b, 0xc1, 0xd2, 0x29, - 0x41, 0xe2, 0x06, 0x95, 0x18, 0xc2, 0xc0, 0x90, 0x91, 0x25, 0x4a, 0xe2, 0x17, 0x88, 0x52, 0xfc, - 0x2a, 0xc7, 0x11, 0xe1, 0x16, 0x5c, 0x81, 0xdb, 0x30, 0x76, 0x64, 0x44, 0xc9, 0x45, 0xaa, 0x3c, - 0x37, 0xe3, 0xfb, 0xfc, 0x49, 0x9f, 0xfc, 0xe3, 0x4b, 0x68, 0x31, 0x47, 0x03, 0x21, 0x9a, 0x34, - 0xdf, 0x42, 0x68, 0xb0, 0xd1, 0x2a, 0x29, 0x75, 0x81, 0xc1, 0xce, 0xa0, 0x45, 0x71, 0x75, 0x14, - 0x02, 0x27, 0xdc, 0xfd, 0x30, 0xbe, 0x88, 0x07, 0x29, 0xd2, 0x05, 0x8a, 0x1b, 0x3e, 0xb7, 0x58, - 0x81, 0x4e, 0x4a, 0xe5, 0xb3, 0x15, 0x5b, 0x4f, 0xe3, 0x33, 0xba, 0x23, 0x25, 0x96, 0xfc, 0x3c, - 0x4b, 0x6b, 0x50, 0x49, 0xb6, 0xc5, 0xbc, 0xf2, 0x4f, 0x56, 0x6c, 0x3d, 0x89, 0x39, 0xa1, 0xcd, - 0x40, 0xc4, 0x3d, 0xbf, 0xd4, 0xd0, 0x96, 0x36, 0xa1, 0x66, 0xa4, 0xfc, 0x53, 0x52, 0x2e, 0x08, - 0xba, 0x84, 0x12, 0xb7, 0x7c, 0x51, 0x00, 0x28, 0x30, 0x43, 0x61, 0x42, 0x85, 0xb9, 0x03, 0x91, - 0x12, 0xd7, 0x7c, 0x56, 0xdb, 0xd4, 0x36, 0xb5, 0x3f, 0xa5, 0x97, 0xe3, 0xb5, 0x79, 0xfe, 0xed, - 0x24, 0xdb, 0x77, 0x92, 0xfd, 0x77, 0x92, 0x7d, 0xf7, 0xd2, 0xdb, 0xf7, 0xd2, 0xfb, 0xeb, 0xa5, - 0xf7, 0xfa, 0xf0, 0x56, 0xda, 0xf7, 0x26, 0x0b, 0x72, 0xfc, 0x08, 0x9f, 0xdc, 0xc7, 0x5e, 0xc0, - 0x7e, 0xa2, 0xa9, 0xc2, 0x71, 0x88, 0x76, 0x9c, 0xc2, 0x7e, 0xed, 0xa0, 0xce, 0x66, 0x34, 0xc3, - 0xe3, 0x21, 0x00, 0x00, 0xff, 0xff, 0x66, 0xb4, 0x0d, 0xef, 0x29, 0x01, 0x00, 0x00, -} - -func (m *RoundInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RoundInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RoundInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Status != 0 { - i = encodeVarintRoundInfo(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x28 - } - if m.FeederId != 0 { - i = encodeVarintRoundInfo(dAtA, i, uint64(m.FeederId)) - i-- - dAtA[i] = 0x20 - } - if m.NexitRoundId != 0 { - i = encodeVarintRoundInfo(dAtA, i, uint64(m.NexitRoundId)) - i-- - dAtA[i] = 0x18 - } - if m.BasedBlock != 0 { - i = encodeVarintRoundInfo(dAtA, i, uint64(m.BasedBlock)) - i-- - dAtA[i] = 0x10 - } - if m.TokenId != 0 { - i = encodeVarintRoundInfo(dAtA, i, uint64(m.TokenId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintRoundInfo(dAtA []byte, offset int, v uint64) int { - offset -= sovRoundInfo(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *RoundInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TokenId != 0 { - n += 1 + sovRoundInfo(uint64(m.TokenId)) - } - if m.BasedBlock != 0 { - n += 1 + sovRoundInfo(uint64(m.BasedBlock)) - } - if m.NexitRoundId != 0 { - n += 1 + sovRoundInfo(uint64(m.NexitRoundId)) - } - if m.FeederId != 0 { - n += 1 + sovRoundInfo(uint64(m.FeederId)) - } - if m.Status != 0 { - n += 1 + sovRoundInfo(uint64(m.Status)) - } - return n -} - -func sovRoundInfo(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRoundInfo(x uint64) (n int) { - return sovRoundInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *RoundInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRoundInfo - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RoundInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RoundInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) - } - m.TokenId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRoundInfo - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TokenId |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BasedBlock", wireType) - } - m.BasedBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRoundInfo - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BasedBlock |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NexitRoundId", wireType) - } - m.NexitRoundId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRoundInfo - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NexitRoundId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FeederId", wireType) - } - m.FeederId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRoundInfo - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FeederId |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRoundInfo - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRoundInfo(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRoundInfo - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRoundInfo(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRoundInfo - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRoundInfo - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRoundInfo - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRoundInfo - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRoundInfo - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRoundInfo - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthRoundInfo = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRoundInfo = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRoundInfo = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/oracle/types/validator_power.pb.go b/x/oracle/types/validator_power.pb.go deleted file mode 100644 index 97481f2b5..000000000 --- a/x/oracle/types/validator_power.pb.go +++ /dev/null @@ -1,370 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: exocore/oracle/validator_power.proto - -package types - -import ( - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type ValidatorWithPower struct { - OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` - Tokens string `protobuf:"bytes,2,opt,name=tokens,proto3" json:"tokens,omitempty"` -} - -func (m *ValidatorWithPower) Reset() { *m = ValidatorWithPower{} } -func (m *ValidatorWithPower) String() string { return proto.CompactTextString(m) } -func (*ValidatorWithPower) ProtoMessage() {} -func (*ValidatorWithPower) Descriptor() ([]byte, []int) { - return fileDescriptor_352b7bebb4b6a982, []int{0} -} -func (m *ValidatorWithPower) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorWithPower) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorWithPower.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ValidatorWithPower) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorWithPower.Merge(m, src) -} -func (m *ValidatorWithPower) XXX_Size() int { - return m.Size() -} -func (m *ValidatorWithPower) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorWithPower.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorWithPower proto.InternalMessageInfo - -func (m *ValidatorWithPower) GetOperatorAddress() string { - if m != nil { - return m.OperatorAddress - } - return "" -} - -func (m *ValidatorWithPower) GetTokens() string { - if m != nil { - return m.Tokens - } - return "" -} - -func init() { - proto.RegisterType((*ValidatorWithPower)(nil), "exocore.oracle.ValidatorWithPower") -} - -func init() { - proto.RegisterFile("exocore/oracle/validator_power.proto", fileDescriptor_352b7bebb4b6a982) -} - -var fileDescriptor_352b7bebb4b6a982 = []byte{ - // 196 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0xad, 0xc8, 0x4f, - 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x4b, 0xcc, 0xc9, 0x4c, - 0x49, 0x2c, 0xc9, 0x2f, 0x8a, 0x2f, 0xc8, 0x2f, 0x4f, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, - 0x17, 0xe2, 0x83, 0xaa, 0xd2, 0x83, 0xa8, 0x52, 0x0a, 0xe7, 0x12, 0x0a, 0x83, 0x29, 0x0c, 0xcf, - 0x2c, 0xc9, 0x08, 0x00, 0xa9, 0x15, 0xd2, 0xe4, 0x12, 0xc8, 0x2f, 0x48, 0x2d, 0x02, 0xeb, 0x4e, - 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e, 0x96, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0xe2, 0x87, 0x89, - 0x3b, 0x42, 0x84, 0x85, 0xc4, 0xb8, 0xd8, 0x4a, 0xf2, 0xb3, 0x53, 0xf3, 0x8a, 0x25, 0x98, 0xc0, - 0x0a, 0xa0, 0x3c, 0x27, 0xaf, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, - 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x32, - 0x48, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x77, 0x85, 0xb8, 0xc6, 0x2f, - 0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x5b, 0x1f, 0xe6, 0x85, 0x0a, 0x98, 0x27, 0x4a, 0x2a, 0x0b, 0x52, - 0x8b, 0x93, 0xd8, 0xc0, 0x6e, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x6e, 0x12, 0xf5, 0x73, - 0xe3, 0x00, 0x00, 0x00, -} - -func (m *ValidatorWithPower) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ValidatorWithPower) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorWithPower) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Tokens) > 0 { - i -= len(m.Tokens) - copy(dAtA[i:], m.Tokens) - i = encodeVarintValidatorPower(dAtA, i, uint64(len(m.Tokens))) - i-- - dAtA[i] = 0x12 - } - if len(m.OperatorAddress) > 0 { - i -= len(m.OperatorAddress) - copy(dAtA[i:], m.OperatorAddress) - i = encodeVarintValidatorPower(dAtA, i, uint64(len(m.OperatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintValidatorPower(dAtA []byte, offset int, v uint64) int { - offset -= sovValidatorPower(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ValidatorWithPower) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.OperatorAddress) - if l > 0 { - n += 1 + l + sovValidatorPower(uint64(l)) - } - l = len(m.Tokens) - if l > 0 { - n += 1 + l + sovValidatorPower(uint64(l)) - } - return n -} - -func sovValidatorPower(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozValidatorPower(x uint64) (n int) { - return sovValidatorPower(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ValidatorWithPower) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidatorPower - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ValidatorWithPower: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorWithPower: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidatorPower - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthValidatorPower - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthValidatorPower - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OperatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tokens", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidatorPower - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthValidatorPower - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthValidatorPower - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tokens = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipValidatorPower(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthValidatorPower - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipValidatorPower(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowValidatorPower - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowValidatorPower - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowValidatorPower - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthValidatorPower - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupValidatorPower - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthValidatorPower - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthValidatorPower = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowValidatorPower = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupValidatorPower = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/oracle/types/validators.pb.go b/x/oracle/types/validators.pb.go deleted file mode 100644 index 39fc4bf88..000000000 --- a/x/oracle/types/validators.pb.go +++ /dev/null @@ -1,363 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: exocore/oracle/validators.proto - -package types - -import ( - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Validators struct { - Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` - ValidatorPower []*ValidatorWithPower `protobuf:"bytes,2,rep,name=validator_power,json=validatorPower,proto3" json:"validator_power,omitempty"` -} - -func (m *Validators) Reset() { *m = Validators{} } -func (m *Validators) String() string { return proto.CompactTextString(m) } -func (*Validators) ProtoMessage() {} -func (*Validators) Descriptor() ([]byte, []int) { - return fileDescriptor_4264e9827808bf71, []int{0} -} -func (m *Validators) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Validators) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Validators.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Validators) XXX_Merge(src proto.Message) { - xxx_messageInfo_Validators.Merge(m, src) -} -func (m *Validators) XXX_Size() int { - return m.Size() -} -func (m *Validators) XXX_DiscardUnknown() { - xxx_messageInfo_Validators.DiscardUnknown(m) -} - -var xxx_messageInfo_Validators proto.InternalMessageInfo - -func (m *Validators) GetBlock() uint64 { - if m != nil { - return m.Block - } - return 0 -} - -func (m *Validators) GetValidatorPower() []*ValidatorWithPower { - if m != nil { - return m.ValidatorPower - } - return nil -} - -func init() { - proto.RegisterType((*Validators)(nil), "exocore.oracle.Validators") -} - -func init() { proto.RegisterFile("exocore/oracle/validators.proto", fileDescriptor_4264e9827808bf71) } - -var fileDescriptor_4264e9827808bf71 = []byte{ - // 202 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xad, 0xc8, 0x4f, - 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x4b, 0xcc, 0xc9, 0x4c, - 0x49, 0x2c, 0xc9, 0x2f, 0x2a, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x2a, 0xd0, - 0x83, 0x28, 0x90, 0x52, 0xc1, 0xa5, 0x21, 0xbe, 0x20, 0xbf, 0x3c, 0xb5, 0x08, 0xa2, 0x4b, 0x29, - 0x9f, 0x8b, 0x2b, 0x0c, 0x6e, 0x92, 0x90, 0x08, 0x17, 0x6b, 0x52, 0x4e, 0x7e, 0x72, 0xb6, 0x04, - 0xa3, 0x02, 0xa3, 0x06, 0x4b, 0x10, 0x84, 0x23, 0xe4, 0xcd, 0xc5, 0x8f, 0xa6, 0x59, 0x82, 0x49, - 0x81, 0x59, 0x83, 0xdb, 0x48, 0x49, 0x0f, 0xd5, 0x4e, 0x3d, 0xb8, 0x51, 0xe1, 0x99, 0x25, 0x19, - 0x01, 0x20, 0x95, 0x41, 0x7c, 0x70, 0xad, 0x60, 0xbe, 0x93, 0xd7, 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, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, - 0xea, 0xbb, 0x42, 0xcc, 0xf5, 0x4b, 0x2d, 0x29, 0xcf, 0x2f, 0xca, 0xd6, 0x87, 0x79, 0xa5, 0x02, - 0xe6, 0x99, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x1f, 0x8c, 0x01, 0x01, 0x00, 0x00, - 0xff, 0xff, 0x0f, 0x7c, 0x34, 0x2c, 0x1c, 0x01, 0x00, 0x00, -} - -func (m *Validators) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Validators) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Validators) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ValidatorPower) > 0 { - for iNdEx := len(m.ValidatorPower) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ValidatorPower[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintValidators(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Block != 0 { - i = encodeVarintValidators(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintValidators(dAtA []byte, offset int, v uint64) int { - offset -= sovValidators(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Validators) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Block != 0 { - n += 1 + sovValidators(uint64(m.Block)) - } - if len(m.ValidatorPower) > 0 { - for _, e := range m.ValidatorPower { - l = e.Size() - n += 1 + l + sovValidators(uint64(l)) - } - } - return n -} - -func sovValidators(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozValidators(x uint64) (n int) { - return sovValidators(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Validators) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidators - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Validators: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Validators: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - m.Block = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidators - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Block |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorPower", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidators - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthValidators - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthValidators - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorPower = append(m.ValidatorPower, &ValidatorWithPower{}) - if err := m.ValidatorPower[len(m.ValidatorPower)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipValidators(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthValidators - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipValidators(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowValidators - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowValidators - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowValidators - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthValidators - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupValidators - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthValidators - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthValidators = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowValidators = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupValidators = fmt.Errorf("proto: unexpected end of group") -) From cc373c92ca5c411ad09cbb15f42b8d320713b643 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Tue, 5 Mar 2024 17:55:07 +0800 Subject: [PATCH 15/37] feat(oracle-keeper):update aggregator implementation, remove round related data in keeper --- x/oracle/keeper/aggregator.go | 46 +++++-- x/oracle/keeper/aggregator_aggregator.go | 82 ++++++++++--- x/oracle/keeper/aggregator_calculator.go | 147 +++++++++++++++++------ x/oracle/keeper/aggregator_filter.go | 2 +- x/oracle/keeper/keeper.go | 21 ++++ x/oracle/keeper/query_round_data.go | 57 --------- x/oracle/keeper/query_round_data_test.go | 127 -------------------- x/oracle/keeper/query_round_info.go | 57 --------- x/oracle/keeper/query_round_info_test.go | 127 -------------------- x/oracle/keeper/round_data.go | 63 ---------- x/oracle/keeper/round_data_test.go | 63 ---------- x/oracle/keeper/round_info.go | 63 ---------- x/oracle/keeper/round_info_test.go | 63 ---------- x/oracle/keeper/types.go | 4 + 14 files changed, 242 insertions(+), 680 deletions(-) delete mode 100644 x/oracle/keeper/query_round_data.go delete mode 100644 x/oracle/keeper/query_round_data_test.go delete mode 100644 x/oracle/keeper/query_round_info.go delete mode 100644 x/oracle/keeper/query_round_info_test.go delete mode 100644 x/oracle/keeper/round_data.go delete mode 100644 x/oracle/keeper/round_data_test.go delete mode 100644 x/oracle/keeper/round_info.go delete mode 100644 x/oracle/keeper/round_info_test.go diff --git a/x/oracle/keeper/aggregator.go b/x/oracle/keeper/aggregator.go index da7b1b2a9..fab30889e 100644 --- a/x/oracle/keeper/aggregator.go +++ b/x/oracle/keeper/aggregator.go @@ -16,6 +16,8 @@ const ( threshold_b = 3 //maxDetId each validator can submit, so the calculator can cache maximum of maxDetId*count(validators) values, this is for resistance of malicious validator submmiting invalid detId maxDetId = 5 + //consensus mode: v1: as soon as possbile + mode = 1 ) type roundInfo struct { @@ -46,31 +48,35 @@ type aggregatorContext struct { validatorsPower map[string]*big.Int totalPower *big.Int + //each active feederToken has a roundInfo rounds map[int32]*roundInfo + //each roundInfo has a worker aggregators map[int32]*worker + + k *Keeper } -// NewCreatePrice receives msgCreatePrice message, and goes process: filter->aggregator, filter->calculator->aggregator -// non-deterministic data will goes directly into aggregator, and deterministic data will goes into calculator first to get consensus on the deterministic id. -func (agc *aggregatorContext) NewCreatePrice(price types.MsgCreatePrice) (bool, error) { +//workerInstance chan *type.MsgCreatePrice + +func (agc *aggregatorContext) sanityCheck(price types.MsgCreatePrice) error { //sanity check //TODO: check nonce [1,3] in anteHandler, related to params, may not able //TODO: check the msgCreatePrice's Decimal is correct with params setting //TODO: check len(price.prices)>0, len(price.prices._range_eachPriceWithSource.Prices)>0, at least has one source, and for each source has at least one price - //TODO: check for each source, at most maxDetId count price (now in filter, ->anteHandler) if price.Nonce < 1 || price.Nonce > maxNonce { - return false, errors.New("") + return errors.New("") } //TODO: sanity check for price(no more than maxDetId count for each source, this should be take care in anteHandler) if price.Prices == nil || len(price.Prices) == 0 { - return false, errors.New("") + return errors.New("") } + for _, pSource := range price.Prices { if pSource.Prices == nil || len(pSource.Prices) == 0 || len(pSource.Prices) > maxDetId || !agc.params.isValidSource(pSource.SourceId) { - return false, errors.New("") + return errors.New("") } //check with params is coressponding source is deteministic if agc.params.isDeterministicSource(pSource.SourceId) { @@ -79,17 +85,29 @@ func (agc *aggregatorContext) NewCreatePrice(price types.MsgCreatePrice) (bool, //just make sure the DetId won't mess up with NS's placeholder id, the limitation of maximum count one validator can submit will be check by filter if len(pDetId.DetId) == 0 { //deterministic must have specified deterministicId - return false, errors.New("") + return errors.New("") } + //DS's price value will go through consensus process, so it's safe to skip the check here } } else { //sanity check: NS submit only one price with detId=="" if len(pSource.Prices) > 1 || len(pSource.Prices[0].DetId) > 0 { - return false, errors.New("") + return errors.New("") } } } + return nil +} + +// NewCreatePrice receives msgCreatePrice message, and goes process: filter->aggregator, filter->calculator->aggregator +// non-deterministic data will goes directly into aggregator, and deterministic data will goes into calculator first to get consensus on the deterministic id. +func (agc *aggregatorContext) NewCreatePrice(price types.MsgCreatePrice) (bool, error) { + + if err := agc.sanityCheck(price); err != nil { + return false, err + } + validator := price.Creator //validator exists in current active validator set if power := agc.validatorsPower[validator]; power != nil { @@ -117,9 +135,15 @@ func (agc *aggregatorContext) NewCreatePrice(price types.MsgCreatePrice) (bool, } list4Calculator, list4Aggregator := feederWorker.f.filtrate(price) + feederWorker.a.fillPrice(list4Aggregator, validator, power) - feederWorker.c.fillPrice(list4Calculator, validator, power) + if confirmedRounds := feederWorker.c.fillPrice(list4Calculator, validator, power); confirmedRounds != nil { + feederWorker.a.confirmDSPrice(confirmedRounds) + } + + agc.k.addCache(&cacheItem{list4Aggregator, validator, power}) } + //invalid creator, require validator to be the price reporter return false, errors.New("") } @@ -128,7 +152,7 @@ func (agc *aggregatorContext) NewCreatePrice(price types.MsgCreatePrice) (bool, func (aggC *aggregatorContext) newWorker() *worker { return &worker{ f: newFilter(maxNonce, maxDetId), - c: newCalculator(len(aggC.validatorsPower)), + c: newCalculator(len(aggC.validatorsPower), aggC.totalPower), a: newAggregator(len(aggC.validatorsPower), aggC.totalPower), } } diff --git a/x/oracle/keeper/aggregator_aggregator.go b/x/oracle/keeper/aggregator_aggregator.go index c6c09fad3..261a8c0fa 100644 --- a/x/oracle/keeper/aggregator_aggregator.go +++ b/x/oracle/keeper/aggregator_aggregator.go @@ -15,8 +15,18 @@ type reportPrice struct { power *big.Int } +func (r *reportPrice) aggregate() *big.Int { + if r.price != nil { + return r.price + } + //TODO: Median(r.prices) + r.price = median(r.prices) + return r.price +} + type aggregator struct { - reports []*reportPrice + finalPrice *big.Int + reports []*reportPrice //total valiadtor power who has submitted pice reportPower *big.Int totalPower *big.Int @@ -28,7 +38,8 @@ type aggregator struct { } // fill price from validator submittion into aggregator, and calculation the voting power and check with the consensus status of deterministic soruce value to decide when to do the aggregation -func (agg *aggregator) fillPrice(prices []*types.PriceWithSource, validator string, power *big.Int) { +// TODO: currently apply mode=1 in V1, add swith modes +func (agg *aggregator) fillPrice(pSources []*types.PriceWithSource, validator string, power *big.Int) { report := agg.getReport(validator) if report == nil { report = &reportPrice{ @@ -40,11 +51,11 @@ func (agg *aggregator) fillPrice(prices []*types.PriceWithSource, validator stri agg.reportPower = new(big.Int).Add(agg.totalPower, power) } - for _, p := range prices { - if len(p.Prices[0].DetId) == 0 { + for _, pSource := range pSources { + if len(pSource.Prices[0].DetId) == 0 { //this is an NS price report, price will just be updated instead of append - if pTR := report.prices[p.SourceId]; pTR == nil { - pTmp := p.Prices[0] + if pTR := report.prices[pSource.SourceId]; pTR == nil { + pTmp := pSource.Prices[0] priceBigInt, _ := (&big.Int{}).SetString(pTmp.Price, 10) pTR = &priceWithTimeAndRound{ price: priceBigInt, @@ -52,22 +63,42 @@ func (agg *aggregator) fillPrice(prices []*types.PriceWithSource, validator stri timestamp: pTmp.Timestamp, // detRoundId: p.DetId, } - report.prices[p.SourceId] = pTR + report.prices[pSource.SourceId] = pTR } else { - pTR.price, _ = (&big.Int{}).SetString(p.Prices[0].Price, 10) + pTR.price, _ = (&big.Int{}).SetString(pSource.Prices[0].Price, 10) } } else { //this is an DS price report - if pTR := report.prices[p.SourceId]; pTR == nil { - pTmp := p.Prices[0] + if pTR := report.prices[pSource.SourceId]; pTR == nil { + pTmp := pSource.Prices[0] pTR = &priceWithTimeAndRound{ //price: nil, - decimal: pTmp.Decimal, - timestamp: "", + decimal: pTmp.Decimal, + // timestamp: "", //detRoundId: "", } - report.prices[p.SourceId] = pTR + report.prices[pSource.SourceId] = pTR } + //skip if this DS's slot exists, DS's value only updated by calculator + } + } +} + +// TODO: for v1 use mode=1, which means agg.dsPrices with each key only be updated once, switch modes +func (agg *aggregator) confirmDSPrice(confirmedRounds []*confirmedPrice) { + for _, priceSourceRound := range confirmedRounds { + //update the latest round-detId for DS, TODO: in v1 we only update this value once since calculator will just ignore any further value once a detId has reached consensus + agg.dsPrices[priceSourceRound.sourceId] = priceSourceRound.detId + for _, report := range agg.reports { + if report.price != nil { + //price of IVA has completed + continue + } + if price := report.prices[priceSourceRound.sourceId]; price != nil { + price.detRoundId = priceSourceRound.detId + price.timestamp = priceSourceRound.timestamp + price.price = priceSourceRound.price + } //else TODO: panice in V1 } } } @@ -81,9 +112,28 @@ func (agg *aggregator) getReport(validator string) *reportPrice { return nil } -func (agg *aggregator) aggregate() { +func (agg *aggregator) aggregate() *big.Int { + if agg.finalPrice != nil { + return agg.finalPrice + } //TODO: implemetn different MODE for definition of consensus, //currently: use rule_1+MODE_1: {rule:specified source:`chainlink`, MODE: asap when power exceeds the threshold} + //1. check OVA threshold + //2. check IVA consensus with rule, TODO: for v1 we only implement with mode=1&rule=1 + if exceedsThreshold(agg.reportPower, agg.totalPower) { + //TODO: this is kind of a mock way to suite V1, need update to check with params.rule + //check if IVA all reached consensus + if len(agg.dsPrices) > 0 { + validatorPrices := make([]*big.Int, 0, len(agg.reports)) + //do the aggregation to find out the 'final price' + for _, validatorReport := range agg.reports { + validatorPrices = append(validatorPrices, validatorReport.aggregate()) + } + //TODO: median(validatorPrices) + agg.finalPrice = median(validatorPrices) + } + } + return agg.finalPrice } func newAggregator(validatorSetLength int, totalPower *big.Int) *aggregator { @@ -94,3 +144,7 @@ func newAggregator(validatorSetLength int, totalPower *big.Int) *aggregator { totalPower: totalPower, } } + +func median(mock any) *big.Int { + return big.NewInt(1) +} diff --git a/x/oracle/keeper/aggregator_calculator.go b/x/oracle/keeper/aggregator_calculator.go index aae647ff1..48b24ae89 100644 --- a/x/oracle/keeper/aggregator_calculator.go +++ b/x/oracle/keeper/aggregator_calculator.go @@ -6,75 +6,154 @@ import ( "github.com/ExocoreNetwork/exocore/x/oracle/types" ) +type confirmedPrice struct { + sourceId int32 + detId string + price *big.Int + timestamp string +} + // internal struct type priceAndPower struct { price *big.Int power *big.Int } +// for a specific DS round, it could have multiple values provided by different validators(should not be true if there's no malicious validator) type roundPrices struct { //0 means NS detId string prices []*priceAndPower - confirmed bool + price *big.Int + timestamp string +} + +// udpate priceAndPower for a specific DSRoundID, if the price exists, increase its power with provided data +// return confirmed=true, when detect power exceeds the threshold +func (r *roundPrices) updatePriceAndPower(pw *priceAndPower, totalPower *big.Int) (updated bool, confirmed bool) { + if r.price != nil { + confirmed = true + return + } + for _, item := range r.prices { + if item.price.Cmp(pw.price) == 0 { + item.power = new(big.Int).Add(item.power, pw.power) + updated = true + if exceedsThreshold(item.power, totalPower) { + r.price = item.price + confirmed = true + } + return + } + } + if len(r.prices) < cap(r.prices) { + r.prices = append(r.prices, pw) + updated = true + if exceedsThreshold(pw.power, totalPower) { + r.price = pw.price + confirmed = true + } + } + return } -type roundPricesList []*roundPrices +// each DS corresponding a roundPriceList to represent its multiple rounds(DS round) in one oracle-round +type roundPricesList struct { + roundPricesList []*roundPrices + //each round can have at most roundPricesCount priceAndPower + roundPricesCount int +} + +// to tell if any round of this DS has reached consensus/confirmed +func (r *roundPricesList) hasConfirmedDetId() bool { + for _, round := range r.roundPricesList { + if round.price != nil { + return true + } + } + return false +} -func (r roundPricesList) getRound(detId string) *roundPrices { - for _, round := range r { +// get the roundPriceList correspond to specifid detID of a DS +// if no required data and the pricesList has not reach its limitation, we will add a new slot for this detId +func (r *roundPricesList) getOrNewRound(detId string, timestamp string) (round *roundPrices) { + for _, round = range r.roundPricesList { if round.detId == detId { - return round + return } } - return nil + + if len(r.roundPricesList) < cap(r.roundPricesList) { + round = &roundPrices{ + detId: detId, + prices: make([]*priceAndPower, r.roundPricesCount), + timestamp: timestamp, + } + r.roundPricesList = append(r.roundPricesList, round) + return + } + return } // calculator used to get consensus on deterministic source based data from validator set reports of price type calculator struct { //sourceId->{[]{roundId, []{price,power}, confirmed}}, confirmed value will be set in [0] - deterministicSource map[int32]roundPricesList + deterministicSource map[int32]*roundPricesList validatorLength int + totalPower *big.Int +} + +func (c *calculator) newRoundPricesList() *roundPricesList { + return &roundPricesList{ + roundPricesList: make([]*roundPrices, 0, maxDetId*c.validatorLength), + //for each DS-roundId, the count of prices provided is the number of validators at most + roundPricesCount: c.validatorLength, + } +} + +func (c *calculator) getOrNewSourceId(sourceId int32) *roundPricesList { + rounds := c.deterministicSource[sourceId] + if rounds == nil { + rounds = c.newRoundPricesList() + c.deterministicSource[sourceId] = rounds + } + return rounds } // fillPrice called upon new MsgCreatPrice arrived, to trigger the calculation to get to consensus on the same roundID_of_deterministic_source -func (c *calculator) fillPrice(prices []*types.PriceWithSource, validator string, power *big.Int) { - for _, pSource := range prices { - rounds := c.deterministicSource[pSource.SourceId] - if rounds == nil { - rounds = make([]*roundPrices, 0, maxDetId*c.validatorLength) - c.deterministicSource[pSource.SourceId] = rounds +// v1 use mode1, TODO: switch modes +func (c *calculator) fillPrice(pSources []*types.PriceWithSource, validator string, power *big.Int) (confirmedRounds []*confirmedPrice) { + for _, pSource := range pSources { + rounds := c.getOrNewSourceId(pSource.SourceId) + if rounds.hasConfirmedDetId() { + //TODO: this skip is just for V1 to do fast calculation and release EndBlocker pressure, may lead to 'not latest detId' be chosen + break } - for _, pDetId := range pSource.Prices { - round := rounds.getRound(pDetId.DetId) + round := rounds.getOrNewRound(pDetId.DetId, pDetId.Timestamp) if round == nil { - if len(rounds) < cap(rounds) { - //add a new roundId from source - round = &roundPrices{ - detId: pDetId.DetId, - prices: make([]*priceAndPower, 0, c.validatorLength), - //confirmed: false, - } - roundPrice, _ := new(big.Int).SetString(pDetId.Price, 10) - round.prices = append(round.prices, &priceAndPower{roundPrice, power}) - //TODO: check if power exceeds the threshold, which means single validator has most of the voting power, bad. - rounds = append(rounds, round) - c.deterministicSource[pSource.SourceId] = rounds - } - //ignore this source price - //only accept maxDetId count different roundId - } else { - //TODO: do the calculation and trigger the aggregator update if any value's power exceeds the threshold + //this sourceId has reach the limitation of different detId, or has confirmed + continue + } + + roundPrice, _ := new(big.Int).SetString(pDetId.Price, 10) + updated, confirmed := round.updatePriceAndPower(&priceAndPower{roundPrice, power}, c.totalPower) + if updated && confirmed { + //sourceId, detId, price + confirmedRounds = append(confirmedRounds, &confirmedPrice{pSource.SourceId, round.detId, round.price, round.timestamp}) //TODO: just in v1 with mode==1, we use asap, so we just ignore any further data from this DS, even higher detId may get to consensus, in this way, in most case, we can complete the calculation in the transaction execution process. Release the pressure in EndBlocker + //TODO: this may delay to current block finish + break } } } + return } -func newCalculator(validatorSetLength int) *calculator { +func newCalculator(validatorSetLength int, totalPower *big.Int) *calculator { return &calculator{ - deterministicSource: make(map[int32]roundPricesList), + deterministicSource: make(map[int32]*roundPricesList), validatorLength: validatorSetLength, + totalPower: totalPower, } } diff --git a/x/oracle/keeper/aggregator_filter.go b/x/oracle/keeper/aggregator_filter.go index 1281bdd22..1dc8eba79 100644 --- a/x/oracle/keeper/aggregator_filter.go +++ b/x/oracle/keeper/aggregator_filter.go @@ -65,7 +65,7 @@ func (f *filter) addPSource(pSources []*types.PriceWithSource, validator string) list4Aggregator = append(list4Aggregator, pSource) } } - return list4Calculator, list4Aggregator + return } // filtrate checks data from MsgCreatePrice, and will drop the conflict or duplicate data, it will then fill data into calculator(for deterministic source data to get to consensus) and aggregator (for both deterministic and non0-deterministic source data run 2-layers aggregation to get the final price) diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index 00ad24470..5673d793a 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + "math/big" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" @@ -24,6 +25,16 @@ type ( } ) +// TODO +// add(block txs)_remove_maxDistande +var recentTxs map[uint64][]*types.PriceWithSource + +type cacheItem struct { + pSources []*types.PriceWithSource + validator string + power *big.Int +} + func NewKeeper( cdc codec.BinaryCodec, storeKey, @@ -47,3 +58,13 @@ func NewKeeper( func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } + +func (k *Keeper) addCache(item *cacheItem) +func (k *Keeper) removeCache(item *cacheItem) + +// persist cache into KV +func (k *Keeper) updateRecentTxs() { + //TODO: add + + //TODO: delete, use map in the KVStore, so actually dont need to implement the exactly 'delete' at firt, just remove all blocks before maxDistance +} diff --git a/x/oracle/keeper/query_round_data.go b/x/oracle/keeper/query_round_data.go deleted file mode 100644 index 011dfc612..000000000 --- a/x/oracle/keeper/query_round_data.go +++ /dev/null @@ -1,57 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/ExocoreNetwork/exocore/x/oracle/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) RoundDataAll(goCtx context.Context, req *types.QueryAllRoundDataRequest) (*types.QueryAllRoundDataResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - var roundDatas []types.RoundData - ctx := sdk.UnwrapSDKContext(goCtx) - - store := ctx.KVStore(k.storeKey) - roundDataStore := prefix.NewStore(store, types.KeyPrefix(types.RoundDataKeyPrefix)) - - pageRes, err := query.Paginate(roundDataStore, req.Pagination, func(key []byte, value []byte) error { - var roundData types.RoundData - if err := k.cdc.Unmarshal(value, &roundData); err != nil { - return err - } - - roundDatas = append(roundDatas, roundData) - return nil - }) - - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllRoundDataResponse{RoundData: roundDatas, Pagination: pageRes}, nil -} - -func (k Keeper) RoundData(goCtx context.Context, req *types.QueryGetRoundDataRequest) (*types.QueryGetRoundDataResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(goCtx) - - val, found := k.GetRoundData( - ctx, - req.TokenId, - ) - if !found { - return nil, status.Error(codes.NotFound, "not found") - } - - return &types.QueryGetRoundDataResponse{RoundData: val}, nil -} diff --git a/x/oracle/keeper/query_round_data_test.go b/x/oracle/keeper/query_round_data_test.go deleted file mode 100644 index a7b33eb2d..000000000 --- a/x/oracle/keeper/query_round_data_test.go +++ /dev/null @@ -1,127 +0,0 @@ -package keeper_test - -import ( - "strconv" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" - "github.com/ExocoreNetwork/exocore/testutil/nullify" - "github.com/ExocoreNetwork/exocore/x/oracle/types" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func TestRoundDataQuerySingle(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNRoundData(keeper, ctx, 2) - tests := []struct { - desc string - request *types.QueryGetRoundDataRequest - response *types.QueryGetRoundDataResponse - err error - }{ - { - desc: "First", - request: &types.QueryGetRoundDataRequest{ - TokenId: msgs[0].TokenId, - }, - response: &types.QueryGetRoundDataResponse{RoundData: msgs[0]}, - }, - { - desc: "Second", - request: &types.QueryGetRoundDataRequest{ - TokenId: msgs[1].TokenId, - }, - response: &types.QueryGetRoundDataResponse{RoundData: msgs[1]}, - }, - { - desc: "KeyNotFound", - request: &types.QueryGetRoundDataRequest{ - TokenId: 100000, - }, - err: status.Error(codes.NotFound, "not found"), - }, - { - desc: "InvalidRequest", - err: status.Error(codes.InvalidArgument, "invalid request"), - }, - } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - response, err := keeper.RoundData(wctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.NoError(t, err) - require.Equal(t, - nullify.Fill(tc.response), - nullify.Fill(response), - ) - } - }) - } -} - -func TestRoundDataQueryPaginated(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNRoundData(keeper, ctx, 5) - - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllRoundDataRequest { - return &types.QueryAllRoundDataRequest{ - Pagination: &query.PageRequest{ - Key: next, - Offset: offset, - Limit: limit, - CountTotal: total, - }, - } - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(msgs); i += step { - resp, err := keeper.RoundDataAll(wctx, request(nil, uint64(i), uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.RoundData), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.RoundData), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(msgs); i += step { - resp, err := keeper.RoundDataAll(wctx, request(next, 0, uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.RoundData), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.RoundData), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - resp, err := keeper.RoundDataAll(wctx, request(nil, 0, 0, true)) - require.NoError(t, err) - require.Equal(t, len(msgs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(msgs), - nullify.Fill(resp.RoundData), - ) - }) - t.Run("InvalidRequest", func(t *testing.T) { - _, err := keeper.RoundDataAll(wctx, nil) - require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) - }) -} diff --git a/x/oracle/keeper/query_round_info.go b/x/oracle/keeper/query_round_info.go deleted file mode 100644 index 4d8f6bdb0..000000000 --- a/x/oracle/keeper/query_round_info.go +++ /dev/null @@ -1,57 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/ExocoreNetwork/exocore/x/oracle/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) RoundInfoAll(goCtx context.Context, req *types.QueryAllRoundInfoRequest) (*types.QueryAllRoundInfoResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - var roundInfos []types.RoundInfo - ctx := sdk.UnwrapSDKContext(goCtx) - - store := ctx.KVStore(k.storeKey) - roundInfoStore := prefix.NewStore(store, types.KeyPrefix(types.RoundInfoKeyPrefix)) - - pageRes, err := query.Paginate(roundInfoStore, req.Pagination, func(key []byte, value []byte) error { - var roundInfo types.RoundInfo - if err := k.cdc.Unmarshal(value, &roundInfo); err != nil { - return err - } - - roundInfos = append(roundInfos, roundInfo) - return nil - }) - - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllRoundInfoResponse{RoundInfo: roundInfos, Pagination: pageRes}, nil -} - -func (k Keeper) RoundInfo(goCtx context.Context, req *types.QueryGetRoundInfoRequest) (*types.QueryGetRoundInfoResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(goCtx) - - val, found := k.GetRoundInfo( - ctx, - req.TokenId, - ) - if !found { - return nil, status.Error(codes.NotFound, "not found") - } - - return &types.QueryGetRoundInfoResponse{RoundInfo: val}, nil -} diff --git a/x/oracle/keeper/query_round_info_test.go b/x/oracle/keeper/query_round_info_test.go deleted file mode 100644 index 58c14a6b5..000000000 --- a/x/oracle/keeper/query_round_info_test.go +++ /dev/null @@ -1,127 +0,0 @@ -package keeper_test - -import ( - "strconv" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" - "github.com/ExocoreNetwork/exocore/testutil/nullify" - "github.com/ExocoreNetwork/exocore/x/oracle/types" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func TestRoundInfoQuerySingle(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNRoundInfo(keeper, ctx, 2) - tests := []struct { - desc string - request *types.QueryGetRoundInfoRequest - response *types.QueryGetRoundInfoResponse - err error - }{ - { - desc: "First", - request: &types.QueryGetRoundInfoRequest{ - TokenId: msgs[0].TokenId, - }, - response: &types.QueryGetRoundInfoResponse{RoundInfo: msgs[0]}, - }, - { - desc: "Second", - request: &types.QueryGetRoundInfoRequest{ - TokenId: msgs[1].TokenId, - }, - response: &types.QueryGetRoundInfoResponse{RoundInfo: msgs[1]}, - }, - { - desc: "KeyNotFound", - request: &types.QueryGetRoundInfoRequest{ - TokenId: 100000, - }, - err: status.Error(codes.NotFound, "not found"), - }, - { - desc: "InvalidRequest", - err: status.Error(codes.InvalidArgument, "invalid request"), - }, - } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - response, err := keeper.RoundInfo(wctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.NoError(t, err) - require.Equal(t, - nullify.Fill(tc.response), - nullify.Fill(response), - ) - } - }) - } -} - -func TestRoundInfoQueryPaginated(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNRoundInfo(keeper, ctx, 5) - - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllRoundInfoRequest { - return &types.QueryAllRoundInfoRequest{ - Pagination: &query.PageRequest{ - Key: next, - Offset: offset, - Limit: limit, - CountTotal: total, - }, - } - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(msgs); i += step { - resp, err := keeper.RoundInfoAll(wctx, request(nil, uint64(i), uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.RoundInfo), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.RoundInfo), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(msgs); i += step { - resp, err := keeper.RoundInfoAll(wctx, request(next, 0, uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.RoundInfo), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.RoundInfo), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - resp, err := keeper.RoundInfoAll(wctx, request(nil, 0, 0, true)) - require.NoError(t, err) - require.Equal(t, len(msgs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(msgs), - nullify.Fill(resp.RoundInfo), - ) - }) - t.Run("InvalidRequest", func(t *testing.T) { - _, err := keeper.RoundInfoAll(wctx, nil) - require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) - }) -} diff --git a/x/oracle/keeper/round_data.go b/x/oracle/keeper/round_data.go deleted file mode 100644 index d513da1ef..000000000 --- a/x/oracle/keeper/round_data.go +++ /dev/null @@ -1,63 +0,0 @@ -package keeper - -import ( - "github.com/ExocoreNetwork/exocore/x/oracle/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// SetRoundData set a specific roundData in the store from its index -func (k Keeper) SetRoundData(ctx sdk.Context, roundData types.RoundData) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundDataKeyPrefix)) - b := k.cdc.MustMarshal(&roundData) - store.Set(types.RoundDataKey( - roundData.TokenId, - ), b) -} - -// GetRoundData returns a roundData from its index -func (k Keeper) GetRoundData( - ctx sdk.Context, - tokenId int32, - -) (val types.RoundData, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundDataKeyPrefix)) - - b := store.Get(types.RoundDataKey( - tokenId, - )) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshal(b, &val) - return val, true -} - -// RemoveRoundData removes a roundData from the store -func (k Keeper) RemoveRoundData( - ctx sdk.Context, - tokenId int32, - -) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundDataKeyPrefix)) - store.Delete(types.RoundDataKey( - tokenId, - )) -} - -// GetAllRoundData returns all roundData -func (k Keeper) GetAllRoundData(ctx sdk.Context) (list []types.RoundData) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundDataKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.RoundData - k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return -} diff --git a/x/oracle/keeper/round_data_test.go b/x/oracle/keeper/round_data_test.go deleted file mode 100644 index 97774f4b5..000000000 --- a/x/oracle/keeper/round_data_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package keeper_test - -import ( - "strconv" - "testing" - - keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" - "github.com/ExocoreNetwork/exocore/testutil/nullify" - "github.com/ExocoreNetwork/exocore/x/oracle/keeper" - "github.com/ExocoreNetwork/exocore/x/oracle/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func createNRoundData(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.RoundData { - items := make([]types.RoundData, n) - for i := range items { - items[i].TokenId = int32(i) - - keeper.SetRoundData(ctx, items[i]) - } - return items -} - -func TestRoundDataGet(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - items := createNRoundData(keeper, ctx, 10) - for _, item := range items { - rst, found := keeper.GetRoundData(ctx, - item.TokenId, - ) - require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&rst), - ) - } -} -func TestRoundDataRemove(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - items := createNRoundData(keeper, ctx, 10) - for _, item := range items { - keeper.RemoveRoundData(ctx, - item.TokenId, - ) - _, found := keeper.GetRoundData(ctx, - item.TokenId, - ) - require.False(t, found) - } -} - -func TestRoundDataGetAll(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - items := createNRoundData(keeper, ctx, 10) - require.ElementsMatch(t, - nullify.Fill(items), - nullify.Fill(keeper.GetAllRoundData(ctx)), - ) -} diff --git a/x/oracle/keeper/round_info.go b/x/oracle/keeper/round_info.go deleted file mode 100644 index ca9dc27da..000000000 --- a/x/oracle/keeper/round_info.go +++ /dev/null @@ -1,63 +0,0 @@ -package keeper - -import ( - "github.com/ExocoreNetwork/exocore/x/oracle/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// SetRoundInfo set a specific roundInfo in the store from its index -func (k Keeper) SetRoundInfo(ctx sdk.Context, roundInfo types.RoundInfo) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundInfoKeyPrefix)) - b := k.cdc.MustMarshal(&roundInfo) - store.Set(types.RoundInfoKey( - roundInfo.TokenId, - ), b) -} - -// GetRoundInfo returns a roundInfo from its index -func (k Keeper) GetRoundInfo( - ctx sdk.Context, - tokenId int32, - -) (val types.RoundInfo, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundInfoKeyPrefix)) - - b := store.Get(types.RoundInfoKey( - tokenId, - )) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshal(b, &val) - return val, true -} - -// RemoveRoundInfo removes a roundInfo from the store -func (k Keeper) RemoveRoundInfo( - ctx sdk.Context, - tokenId int32, - -) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundInfoKeyPrefix)) - store.Delete(types.RoundInfoKey( - tokenId, - )) -} - -// GetAllRoundInfo returns all roundInfo -func (k Keeper) GetAllRoundInfo(ctx sdk.Context) (list []types.RoundInfo) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RoundInfoKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.RoundInfo - k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return -} diff --git a/x/oracle/keeper/round_info_test.go b/x/oracle/keeper/round_info_test.go deleted file mode 100644 index 7df55edc9..000000000 --- a/x/oracle/keeper/round_info_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package keeper_test - -import ( - "strconv" - "testing" - - keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" - "github.com/ExocoreNetwork/exocore/testutil/nullify" - "github.com/ExocoreNetwork/exocore/x/oracle/keeper" - "github.com/ExocoreNetwork/exocore/x/oracle/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func createNRoundInfo(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.RoundInfo { - items := make([]types.RoundInfo, n) - for i := range items { - items[i].TokenId = int32(i) - - keeper.SetRoundInfo(ctx, items[i]) - } - return items -} - -func TestRoundInfoGet(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - items := createNRoundInfo(keeper, ctx, 10) - for _, item := range items { - rst, found := keeper.GetRoundInfo(ctx, - item.TokenId, - ) - require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&rst), - ) - } -} -func TestRoundInfoRemove(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - items := createNRoundInfo(keeper, ctx, 10) - for _, item := range items { - keeper.RemoveRoundInfo(ctx, - item.TokenId, - ) - _, found := keeper.GetRoundInfo(ctx, - item.TokenId, - ) - require.False(t, found) - } -} - -func TestRoundInfoGetAll(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - items := createNRoundInfo(keeper, ctx, 10) - require.ElementsMatch(t, - nullify.Fill(items), - nullify.Fill(keeper.GetAllRoundInfo(ctx)), - ) -} diff --git a/x/oracle/keeper/types.go b/x/oracle/keeper/types.go index b017d7866..eec88b3ad 100644 --- a/x/oracle/keeper/types.go +++ b/x/oracle/keeper/types.go @@ -98,3 +98,7 @@ func newSet[T comparable](length int) *set[T] { slice: make([]T, 0, length), } } + +func exceedsThreshold(power *big.Int, totalPower *big.Int) bool { + return new(big.Int).Mul(power, big.NewInt(threshold_b)).Cmp(new(big.Int).Mul(totalPower, big.NewInt(threshold_a))) > 0 +} From c0e19aadc6ad00c8de2cd46e5d1d374c3a4698db Mon Sep 17 00:00:00 2001 From: leonz789 Date: Thu, 7 Mar 2024 15:13:13 +0800 Subject: [PATCH 16/37] feat(oracle-keeper):aggregator, reache, commit to update validator state --- x/oracle/keeper/aggregator.go | 271 ++++++++++++++++----- x/oracle/keeper/aggregator_aggregator.go | 16 +- x/oracle/keeper/aggregator_filter.go | 2 +- x/oracle/keeper/caches.go | 49 ++++ x/oracle/keeper/keeper.go | 21 -- x/oracle/keeper/msg_server_create_price.go | 51 +++- x/oracle/keeper/query_validators.go | 57 ----- x/oracle/keeper/query_validators_test.go | 127 ---------- x/oracle/keeper/types.go | 30 +++ x/oracle/keeper/validators.go | 63 ----- x/oracle/keeper/validators_test.go | 63 ----- x/oracle/module.go | 6 + 12 files changed, 359 insertions(+), 397 deletions(-) create mode 100644 x/oracle/keeper/caches.go delete mode 100644 x/oracle/keeper/query_validators.go delete mode 100644 x/oracle/keeper/query_validators_test.go delete mode 100644 x/oracle/keeper/validators.go delete mode 100644 x/oracle/keeper/validators_test.go diff --git a/x/oracle/keeper/aggregator.go b/x/oracle/keeper/aggregator.go index fab30889e..10804ea65 100644 --- a/x/oracle/keeper/aggregator.go +++ b/x/oracle/keeper/aggregator.go @@ -3,13 +3,16 @@ package keeper import ( "errors" "math/big" + "time" "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) // TODO: these consts should be defined in params const ( //maxNonce indicates how many messages a validator can submit in a single roudn to offer price + //current we use this as a mock distance maxNonce = 3 //these two threshold value used to set the threshold to tell when the price had come to consensus and was able to get a final price of that round threshold_a = 2 @@ -20,24 +23,71 @@ const ( mode = 1 ) -type roundInfo struct { - //this round of price will start from block basedBlock+1, the basedBlock served as a trigger to notify validators to submit prices - basedBlock uint64 - //next round id of the price oracle service, price with thie id will be record on block basedBlock+1 if all prices submitted by validators(for v1, validators serve as oracle nodes) get to consensus immedately - nextRoundId uint64 - //indicate if this round is open for collecting prices or closed in either condition that success with a consensused price or not - //1: open, 2: closed - status int32 +var agc *aggregatorContext + +type priceItemKV struct { + tokenId int32 + priceTR types.PriceWithTimeAndRound } // worker is the actual instance used to calculate final price for each tokenFeeder's round. Which means, every tokenFeeder corresponds to a specified token, and for that tokenFeeder, each round we use a worker instance to calculate the final price type worker struct { + sealed bool + price string + decimal int32 //mainly used for deterministic source data to check conflics and validation f *filter //used to get to consensus on deterministic source's data c *calculator //when enough data(exceeds threshold) collected, aggregate to conduct the final price - a *aggregator + a *aggregator + ctx *aggregatorContext +} + +func (w *worker) do(msg *types.MsgCreatePrice) []*types.PriceWithSource { + validator := msg.Creator + power := w.ctx.validatorsPower[validator] + list4Calculator, list4Aggregator := w.f.filtrate(msg) + if list4Aggregator != nil { + w.a.fillPrice(list4Aggregator, validator, power) + if confirmedRounds := w.c.fillPrice(list4Calculator, validator, power); confirmedRounds != nil { + w.a.confirmDSPrice(confirmedRounds) + } + } + return list4Aggregator +} + +func (w *worker) aggregate() *big.Int { + return w.a.aggregate() +} + +// not concurrency safe +func (w *worker) seal() { + if w.sealed { + return + } + w.sealed = true + w.price = w.a.aggregate().String() + w.f = nil + w.c = nil + w.a = nil +} + +func (w *worker) getPrice() (string, int32) { + if w.sealed { + return w.price, w.decimal + } + return "", 0 +} + +type roundInfo struct { + //this round of price will start from block basedBlock+1, the basedBlock served as a trigger to notify validators to submit prices + basedBlock uint64 + //next round id of the price oracle service, price with thie id will be record on block basedBlock+1 if all prices submitted by validators(for v1, validators serve as oracle nodes) get to consensus immedately + nextRoundId uint64 + //indicate if this round is open for collecting prices or closed in either condition that success with a consensused price or not + //1: open, 2: closed + status int32 } // aggregatorContext keeps memory cache for state params, validatorset, and updatedthese values as they udpated on chain. And it keeps the infomation to track all tokenFeeders' status and data collection @@ -53,28 +103,28 @@ type aggregatorContext struct { //each roundInfo has a worker aggregators map[int32]*worker - - k *Keeper } -//workerInstance chan *type.MsgCreatePrice - -func (agc *aggregatorContext) sanityCheck(price types.MsgCreatePrice) error { +func (agc *aggregatorContext) sanityCheck(msg *types.MsgCreatePrice) error { //sanity check //TODO: check nonce [1,3] in anteHandler, related to params, may not able //TODO: check the msgCreatePrice's Decimal is correct with params setting //TODO: check len(price.prices)>0, len(price.prices._range_eachPriceWithSource.Prices)>0, at least has one source, and for each source has at least one price //TODO: check for each source, at most maxDetId count price (now in filter, ->anteHandler) - if price.Nonce < 1 || price.Nonce > maxNonce { + if agc.validatorsPower[msg.Creator] == nil { + return errors.New("") + } + + if msg.Nonce < 1 || msg.Nonce > maxNonce { return errors.New("") } //TODO: sanity check for price(no more than maxDetId count for each source, this should be take care in anteHandler) - if price.Prices == nil || len(price.Prices) == 0 { + if msg.Prices == nil || len(msg.Prices) == 0 { return errors.New("") } - for _, pSource := range price.Prices { + for _, pSource := range msg.Prices { if pSource.Prices == nil || len(pSource.Prices) == 0 || len(pSource.Prices) > maxDetId || !agc.params.isValidSource(pSource.SourceId) { return errors.New("") } @@ -96,63 +146,172 @@ func (agc *aggregatorContext) sanityCheck(price types.MsgCreatePrice) error { } } } + return nil +} +func (agc *aggregatorContext) checkMsg(msg *types.MsgCreatePrice) error { + if err := agc.sanityCheck(msg); err != nil { + return err + } + + //check feeder is active + feederContext := agc.rounds[msg.FeederId] + if feederContext == nil || feederContext.status != 1 { + //feederId does not exist or not alive + return errors.New("") + } + //senity check on basedBlock + if msg.BasedBlock != feederContext.basedBlock { + return errors.New("") + } + + //check sources rule matches + if ok, err := agc.params.checkRules(msg.FeederId, msg.Prices); !ok { + return err + } return nil } +func (agc *aggregatorContext) fillPrice(msg *types.MsgCreatePrice) (*priceItemKV, *cacheItem, error) { + feederWorker := agc.aggregators[msg.FeederId] + //worker initialzed here reduce workload for Endblocker + if feederWorker == nil { + feederWorker = agc.newWorker(msg.FeederId) + agc.aggregators[msg.FeederId] = feederWorker + } + + if feederWorker.sealed { + return nil, nil, errors.New("") + } + + if listFilled := feederWorker.do(msg); listFilled != nil { + if finalPrice := feederWorker.aggregate(); finalPrice != nil { + agc.rounds[msg.FeederId].status = 2 + feederWorker.seal() + return &priceItemKV{agc.params.getTokenFeeder(msg.FeederId).TokenId, types.PriceWithTimeAndRound{ + Price: finalPrice.String(), + Decimal: agc.params.getTokenInfo(msg.FeederId).Decimal, + //TODO: check the format + Timestamp: time.Now().String(), + RoundId: agc.rounds[msg.FeederId].nextRoundId, + }}, nil, nil + } + return nil, &cacheItem{msg.FeederId, listFilled, msg.Creator}, nil + } + + return nil, nil, errors.New("") +} + // NewCreatePrice receives msgCreatePrice message, and goes process: filter->aggregator, filter->calculator->aggregator // non-deterministic data will goes directly into aggregator, and deterministic data will goes into calculator first to get consensus on the deterministic id. -func (agc *aggregatorContext) NewCreatePrice(price types.MsgCreatePrice) (bool, error) { +func (agc *aggregatorContext) newCreatePrice(ctx sdk.Context, msg *types.MsgCreatePrice) (*priceItemKV, *cacheItem, error) { + + if err := agc.checkMsg(msg); err != nil { + return nil, nil, err + } + + return agc.fillPrice(msg) +} - if err := agc.sanityCheck(price); err != nil { - return false, err +// newWorker new a instance for a tokenFeeder's specific round +func (agc *aggregatorContext) newWorker(feederId int32) *worker { + return &worker{ + f: newFilter(maxNonce, maxDetId), + c: newCalculator(len(agc.validatorsPower), agc.totalPower), + a: newAggregator(len(agc.validatorsPower), agc.totalPower), + decimal: agc.params.getTokenInfo(feederId).Decimal, + ctx: agc, } +} - validator := price.Creator - //validator exists in current active validator set - if power := agc.validatorsPower[validator]; power != nil { - //check feeder is active - feederContext := agc.rounds[price.FeederId] - if feederContext == nil || feederContext.status != 1 { - //feederId does not exist or not alive - return false, errors.New("") +// prepare for new roundInfo, just update the status kept in memory +// executed at EndBlock stage, seall all success or expired roundInfo +// including possible aggregation and state update +// returns: 1st successful sealed, need to be written to KVStore, 2nd: failed sealed tokenId, use previous price to write to KVStore +func (agc *aggregatorContext) sealRound(ctx sdk.Context) (success []*priceItemKV, failed []int32) { + //1. check validatorSet udpate + //TODO: if validatoSet has been updated in current block, just seal all active rounds and return + //1. for sealed worker, the KVStore has been updated + for feederId, round := range agc.rounds { + if round.status == 1 { + feeder := agc.params.getTokenFeeder(feederId) + //TODO: for mode=1, we don't do aggregate() here, since if it donesn't success in the transaction execution stage, it won't success here + //but it's not always the same for other modes, switch modes + switch mode { + case 1: + expired := ctx.BlockHeight() >= feeder.EndBlock + outOfWindow := uint64(ctx.BlockHeight())-round.basedBlock >= uint64(maxNonce) + if expired || outOfWindow { + //TODO: WRITE TO KVSTORE with previous round data for this round + failed = append(failed, feeder.TokenId) + if expired { + delete(agc.rounds, feederId) + delete(agc.aggregators, feederId) + } else { + round.status = 2 + agc.aggregators[feederId] = nil + //TODO: WRITE TO KVSTORE with previous round data for this round + failed = append(failed, feeder.TokenId) + } + } + } } - //senity check on basedBlock - if price.BasedBlock != feederContext.basedBlock { - return false, errors.New("") + //all status: 1->2, remove its aggregator + if agc.aggregators[feederId] != nil && agc.aggregators[feederId].sealed { + agc.aggregators[feederId] = nil } + } + return +} - //check sources rule matches - if ok, err := agc.params.checkRules(price.FeederId, price.Prices); !ok { - return false, err - } +func (agC *aggregatorContext) prepareRound(ctx sdk.Context, block uint64) { + //block>0 means recache initialization, all roundInfo is empty + if block == 0 { + block = uint64(ctx.BlockHeight()) + } - feederWorker := agc.aggregators[price.FeederId] - //worker initialzed here reduce workload for Endblocker - if feederWorker == nil { - feederWorker = agc.newWorker() - agc.aggregators[price.FeederId] = feederWorker + for feederId, feeder := range agc.params.TokenFeeders { + if uint64(feeder.EndBlock) <= block || uint64(feeder.StartBaseBlock) > block { + //this feeder is inactive + continue } - list4Calculator, list4Aggregator := feederWorker.f.filtrate(price) + delta := (block - uint64(feeder.StartBaseBlock)) + left := delta % uint64(feeder.Interval) + count := delta / uint64(feeder.Interval) + latestBasedblock := block - left + latestNextRoundId := uint64(feeder.StartRoundId) + count - feederWorker.a.fillPrice(list4Aggregator, validator, power) - if confirmedRounds := feederWorker.c.fillPrice(list4Calculator, validator, power); confirmedRounds != nil { - feederWorker.a.confirmDSPrice(confirmedRounds) + feederIdInt32 := int32(feederId) + round := agc.rounds[feederIdInt32] + if round == nil { + round = &roundInfo{ + basedBlock: latestBasedblock, + nextRoundId: latestNextRoundId, + } + if left >= maxNonce { + round.status = 2 + } else { + round.status = 1 + } + agc.rounds[feederIdInt32] = round + } else { + //prepare a new round for exist roundInfo + if left == 0 { + round.basedBlock = latestBasedblock + round.nextRoundId = latestNextRoundId + round.status = 1 + //drop previous worker + agc.aggregators[feederIdInt32] = nil + } } - - agc.k.addCache(&cacheItem{list4Aggregator, validator, power}) } - - //invalid creator, require validator to be the price reporter - return false, errors.New("") } -// newWorker new a instance for a tokenFeeder's specific round -func (aggC *aggregatorContext) newWorker() *worker { - return &worker{ - f: newFilter(maxNonce, maxDetId), - c: newCalculator(len(aggC.validatorsPower), aggC.totalPower), - a: newAggregator(len(aggC.validatorsPower), aggC.totalPower), - } +func (agc *aggregatorContext) recache(from, to uint64, k Keeper) { + //block_from'endblocker --> from_to'endblock + //f.prepare->(f+1).msgs->(f+1).seal + //...(to-2).prepare->(to-1).msgs->(to-1).seal + //to.prepare-> return + validatorsPower := k.GetValidators } diff --git a/x/oracle/keeper/aggregator_aggregator.go b/x/oracle/keeper/aggregator_aggregator.go index 261a8c0fa..0c96421c3 100644 --- a/x/oracle/keeper/aggregator_aggregator.go +++ b/x/oracle/keeper/aggregator_aggregator.go @@ -19,8 +19,11 @@ func (r *reportPrice) aggregate() *big.Int { if r.price != nil { return r.price } - //TODO: Median(r.prices) - r.price = median(r.prices) + tmp := make([]*big.Int, len(r.prices)) + for _, p := range r.prices { + tmp = append(tmp, p.price) + } + r.price = bigIntList(tmp).median() return r.price } @@ -129,8 +132,9 @@ func (agg *aggregator) aggregate() *big.Int { for _, validatorReport := range agg.reports { validatorPrices = append(validatorPrices, validatorReport.aggregate()) } - //TODO: median(validatorPrices) - agg.finalPrice = median(validatorPrices) + //vTmp := bigIntList(validatorPrices) + agg.finalPrice = bigIntList(validatorPrices).median() + //clear relative aggregator for this feeder, all the aggregator,calculator, filter can be removed since this round has been sealed } } return agg.finalPrice @@ -144,7 +148,3 @@ func newAggregator(validatorSetLength int, totalPower *big.Int) *aggregator { totalPower: totalPower, } } - -func median(mock any) *big.Int { - return big.NewInt(1) -} diff --git a/x/oracle/keeper/aggregator_filter.go b/x/oracle/keeper/aggregator_filter.go index 1dc8eba79..7a9b308aa 100644 --- a/x/oracle/keeper/aggregator_filter.go +++ b/x/oracle/keeper/aggregator_filter.go @@ -69,7 +69,7 @@ func (f *filter) addPSource(pSources []*types.PriceWithSource, validator string) } // filtrate checks data from MsgCreatePrice, and will drop the conflict or duplicate data, it will then fill data into calculator(for deterministic source data to get to consensus) and aggregator (for both deterministic and non0-deterministic source data run 2-layers aggregation to get the final price) -func (f *filter) filtrate(price types.MsgCreatePrice) (list4Calculator []*types.PriceWithSource, list4Aggregator []*types.PriceWithSource) { +func (f *filter) filtrate(price *types.MsgCreatePrice) (list4Calculator []*types.PriceWithSource, list4Aggregator []*types.PriceWithSource) { validator := price.Creator nonces := f.validatorNonce[validator] if nonces == nil { diff --git a/x/oracle/keeper/caches.go b/x/oracle/keeper/caches.go new file mode 100644 index 000000000..925fcba79 --- /dev/null +++ b/x/oracle/keeper/caches.go @@ -0,0 +1,49 @@ +package keeper + +import ( + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type cacheItem struct { + feederId int32 + pSources []*types.PriceWithSource + validator string + // power *big.Int +} + +// memory cache +func (k *Keeper) addCache(item *cacheItem) { + +} + +// memory cache +func (k *Keeper) removeCache(item *cacheItem) + +// persist cache into KV +func (k *Keeper) updateRecentTxs() { + //TODO: add + + //TODO: delete, use map in the KVStore, so actually dont need to implement the exactly 'delete' at firt, just remove all blocks before maxDistance +} + +// commit memory cache to KVStore +func (k *Keeper) commitCache() { + +} + +// from KVStore +func (k *Keeper) getCaches(ctx sdk.Context) map[uint64]*cacheItem { + return nil +} + +func (k *Keeper) clearCaches(ctx sdk.Context) { + +} + +// from KVStore +func (k *Keeper) getCacheValidators(ctx sdk.Context) map[string]*big.Int { + return nil +} diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index 5673d793a..00ad24470 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -2,7 +2,6 @@ package keeper import ( "fmt" - "math/big" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" @@ -25,16 +24,6 @@ type ( } ) -// TODO -// add(block txs)_remove_maxDistande -var recentTxs map[uint64][]*types.PriceWithSource - -type cacheItem struct { - pSources []*types.PriceWithSource - validator string - power *big.Int -} - func NewKeeper( cdc codec.BinaryCodec, storeKey, @@ -58,13 +47,3 @@ func NewKeeper( func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } - -func (k *Keeper) addCache(item *cacheItem) -func (k *Keeper) removeCache(item *cacheItem) - -// persist cache into KV -func (k *Keeper) updateRecentTxs() { - //TODO: add - - //TODO: delete, use map in the KVStore, so actually dont need to implement the exactly 'delete' at firt, just remove all blocks before maxDistance -} diff --git a/x/oracle/keeper/msg_server_create_price.go b/x/oracle/keeper/msg_server_create_price.go index 657cc8b27..b15f13c20 100644 --- a/x/oracle/keeper/msg_server_create_price.go +++ b/x/oracle/keeper/msg_server_create_price.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "math/big" "github.com/ExocoreNetwork/exocore/x/oracle/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -9,7 +10,6 @@ import ( func (k msgServer) CreatePrice(goCtx context.Context, msg *types.MsgCreatePrice) (*types.MsgCreatePriceResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - // TODO: Handling the message _ = ctx @@ -19,5 +19,54 @@ func (k msgServer) CreatePrice(goCtx context.Context, msg *types.MsgCreatePrice) 3. check the rule fulfilled(sources check), check the decimal of the 1st mathc the params' definition(among prices the decimal had been checked in ante stage), timestamp:later than previous block's timestamp, [not future than now(+1s), this is checked in anteHandler], timestamp verification is not necessary **/ + newItem, caches, _ := getAggregatorContext(ctx, k.Keeper).newCreatePrice(ctx, msg) + + if caches != nil { + k.addCache(caches) + } + + if newItem != nil { + k.AppendPriceTR(ctx, newItem.tokenId, newItem.priceTR) + //TODO: move related caches + k.removeCache(nil) + } + return &types.MsgCreatePriceResponse{}, nil } + +func getAggregatorContext(ctx sdk.Context, k Keeper) *aggregatorContext { + if agc != nil { + return agc + } + + //initialize the aggregatorContext, normally triggered when node restart + k.clearCaches(ctx) + agc = &aggregatorContext{ + validatorsPower: make(map[string]*big.Int), + totalPower: big.NewInt(0), + rounds: make(map[int32]*roundInfo), + aggregators: make(map[int32]*worker), + } + if validators := k.getCacheValidators(ctx); validators != nil { + agc.validatorsPower = validators + for _, v := range validators { + agc.totalPower = new(big.Int).Add(agc.totalPower, v) + } + } + + p := params(k.GetParams(ctx)) + agc.params = &p + + //replay the recentMsgs to recover the cache + agc.prepareRound(ctx, uint64(ctx.BlockHeight())-uint64(maxNonce)) + agc.recache(uint64(ctx.BlockHeight())-uint64(maxNonce), uint64(ctx.BlockHeight())-1, k) + + //TODO: 1. prepare roundInfo with feeder and ctx, prepare response for status: 2->1 + recentItems := k.getCaches(ctx) + + for _, item := range recentItems { + + } + + return agc +} diff --git a/x/oracle/keeper/query_validators.go b/x/oracle/keeper/query_validators.go deleted file mode 100644 index a5e0d4cc8..000000000 --- a/x/oracle/keeper/query_validators.go +++ /dev/null @@ -1,57 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/ExocoreNetwork/exocore/x/oracle/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) ValidatorsAll(goCtx context.Context, req *types.QueryAllValidatorsRequest) (*types.QueryAllValidatorsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - var validatorss []types.Validators - ctx := sdk.UnwrapSDKContext(goCtx) - - store := ctx.KVStore(k.storeKey) - validatorsStore := prefix.NewStore(store, types.KeyPrefix(types.ValidatorsKeyPrefix)) - - pageRes, err := query.Paginate(validatorsStore, req.Pagination, func(key []byte, value []byte) error { - var validators types.Validators - if err := k.cdc.Unmarshal(value, &validators); err != nil { - return err - } - - validatorss = append(validatorss, validators) - return nil - }) - - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllValidatorsResponse{Validators: validatorss, Pagination: pageRes}, nil -} - -func (k Keeper) Validators(goCtx context.Context, req *types.QueryGetValidatorsRequest) (*types.QueryGetValidatorsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(goCtx) - - val, found := k.GetValidators( - ctx, - req.Block, - ) - if !found { - return nil, status.Error(codes.NotFound, "not found") - } - - return &types.QueryGetValidatorsResponse{Validators: val}, nil -} diff --git a/x/oracle/keeper/query_validators_test.go b/x/oracle/keeper/query_validators_test.go deleted file mode 100644 index 4d2e5da6b..000000000 --- a/x/oracle/keeper/query_validators_test.go +++ /dev/null @@ -1,127 +0,0 @@ -package keeper_test - -import ( - "strconv" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" - "github.com/ExocoreNetwork/exocore/testutil/nullify" - "github.com/ExocoreNetwork/exocore/x/oracle/types" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func TestValidatorsQuerySingle(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNValidators(keeper, ctx, 2) - tests := []struct { - desc string - request *types.QueryGetValidatorsRequest - response *types.QueryGetValidatorsResponse - err error - }{ - { - desc: "First", - request: &types.QueryGetValidatorsRequest{ - Block: msgs[0].Block, - }, - response: &types.QueryGetValidatorsResponse{Validators: msgs[0]}, - }, - { - desc: "Second", - request: &types.QueryGetValidatorsRequest{ - Block: msgs[1].Block, - }, - response: &types.QueryGetValidatorsResponse{Validators: msgs[1]}, - }, - { - desc: "KeyNotFound", - request: &types.QueryGetValidatorsRequest{ - Block: 100000, - }, - err: status.Error(codes.NotFound, "not found"), - }, - { - desc: "InvalidRequest", - err: status.Error(codes.InvalidArgument, "invalid request"), - }, - } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - response, err := keeper.Validators(wctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.NoError(t, err) - require.Equal(t, - nullify.Fill(tc.response), - nullify.Fill(response), - ) - } - }) - } -} - -func TestValidatorsQueryPaginated(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNValidators(keeper, ctx, 5) - - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllValidatorsRequest { - return &types.QueryAllValidatorsRequest{ - Pagination: &query.PageRequest{ - Key: next, - Offset: offset, - Limit: limit, - CountTotal: total, - }, - } - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(msgs); i += step { - resp, err := keeper.ValidatorsAll(wctx, request(nil, uint64(i), uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.Validators), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.Validators), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(msgs); i += step { - resp, err := keeper.ValidatorsAll(wctx, request(next, 0, uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.Validators), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.Validators), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - resp, err := keeper.ValidatorsAll(wctx, request(nil, 0, 0, true)) - require.NoError(t, err) - require.Equal(t, len(msgs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(msgs), - nullify.Fill(resp.Validators), - ) - }) - t.Run("InvalidRequest", func(t *testing.T) { - _, err := keeper.ValidatorsAll(wctx, nil) - require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) - }) -} diff --git a/x/oracle/keeper/types.go b/x/oracle/keeper/types.go index eec88b3ad..f1f61a75d 100644 --- a/x/oracle/keeper/types.go +++ b/x/oracle/keeper/types.go @@ -3,6 +3,7 @@ package keeper import ( "errors" "math/big" + "sort" "github.com/ExocoreNetwork/exocore/x/oracle/types" ) @@ -36,6 +37,14 @@ func (p *params) getTokenFeeder(feederId int32) *types.TokenFeeder { } return nil } +func (p *params) getTokenInfo(feederId int32) *types.Token { + for k, v := range p.TokenFeeders { + if int32(k) == feederId { + return p.Tokens[v.TokenId] + } + } + return nil +} func (p *params) checkRules(feederId int32, prices []*types.PriceWithSource) (bool, error) { feeder := p.TokenFeeders[feederId] @@ -102,3 +111,24 @@ func newSet[T comparable](length int) *set[T] { func exceedsThreshold(power *big.Int, totalPower *big.Int) bool { return new(big.Int).Mul(power, big.NewInt(threshold_b)).Cmp(new(big.Int).Mul(totalPower, big.NewInt(threshold_a))) > 0 } + +type bigIntList []*big.Int + +func (b bigIntList) Len() int { + return len(b) +} +func (b bigIntList) Less(i, j int) bool { + return b[i].Cmp(b[j]) < 0 +} +func (b bigIntList) Swap(i, j int) { + b[i], b[j] = b[j], b[i] +} + +func (b bigIntList) median() *big.Int { + sort.Sort(b) + l := len(b) + if l%2 == 1 { + return b[l/2] + } + return new(big.Int).Div(new(big.Int).Add(b[l/2], b[l/2-1]), big.NewInt(2)) +} diff --git a/x/oracle/keeper/validators.go b/x/oracle/keeper/validators.go deleted file mode 100644 index 038b4ac83..000000000 --- a/x/oracle/keeper/validators.go +++ /dev/null @@ -1,63 +0,0 @@ -package keeper - -import ( - "github.com/ExocoreNetwork/exocore/x/oracle/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// SetValidators set a specific validators in the store from its index -func (k Keeper) SetValidators(ctx sdk.Context, validators types.Validators) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorsKeyPrefix)) - b := k.cdc.MustMarshal(&validators) - store.Set(types.ValidatorsKey( - validators.Block, - ), b) -} - -// GetValidators returns a validators from its index -func (k Keeper) GetValidators( - ctx sdk.Context, - block uint64, - -) (val types.Validators, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorsKeyPrefix)) - - b := store.Get(types.ValidatorsKey( - block, - )) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshal(b, &val) - return val, true -} - -// RemoveValidators removes a validators from the store -func (k Keeper) RemoveValidators( - ctx sdk.Context, - block uint64, - -) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorsKeyPrefix)) - store.Delete(types.ValidatorsKey( - block, - )) -} - -// GetAllValidators returns all validators -func (k Keeper) GetAllValidators(ctx sdk.Context) (list []types.Validators) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorsKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.Validators - k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return -} diff --git a/x/oracle/keeper/validators_test.go b/x/oracle/keeper/validators_test.go deleted file mode 100644 index 967aa925e..000000000 --- a/x/oracle/keeper/validators_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package keeper_test - -import ( - "strconv" - "testing" - - keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" - "github.com/ExocoreNetwork/exocore/testutil/nullify" - "github.com/ExocoreNetwork/exocore/x/oracle/keeper" - "github.com/ExocoreNetwork/exocore/x/oracle/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func createNValidators(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.Validators { - items := make([]types.Validators, n) - for i := range items { - items[i].Block = uint64(i) - - keeper.SetValidators(ctx, items[i]) - } - return items -} - -func TestValidatorsGet(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - items := createNValidators(keeper, ctx, 10) - for _, item := range items { - rst, found := keeper.GetValidators(ctx, - item.Block, - ) - require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&rst), - ) - } -} -func TestValidatorsRemove(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - items := createNValidators(keeper, ctx, 10) - for _, item := range items { - keeper.RemoveValidators(ctx, - item.Block, - ) - _, found := keeper.GetValidators(ctx, - item.Block, - ) - require.False(t, found) - } -} - -func TestValidatorsGetAll(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - items := createNValidators(keeper, ctx, 10) - require.ElementsMatch(t, - nullify.Fill(items), - nullify.Fill(keeper.GetAllValidators(ctx)), - ) -} diff --git a/x/oracle/module.go b/x/oracle/module.go index e96e3cfa6..9e568dfdb 100644 --- a/x/oracle/module.go +++ b/x/oracle/module.go @@ -145,5 +145,11 @@ func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} // EndBlock contains the logic that is automatically triggered at the end of each block func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + //TODO: + //1. check validator update + //if {validatorSetUpdate} -> update roundInfo(seal all active) + //check roundInfo -> seal {success, fail} + //{params} -> prepareRoundInfo + //sealRounds() -> prepareRounds() return []abci.ValidatorUpdate{} } From 81b69ff838d03b309be96f158516f2b5858ff778 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Thu, 7 Mar 2024 15:15:01 +0800 Subject: [PATCH 17/37] feat(oracle-proto): update validators in state --- proto/exocore/oracle/genesis.proto | 4 +- proto/exocore/oracle/query.proto | 14 +- proto/exocore/oracle/validators.proto | 14 + x/oracle/client/cli/query.go | 1 + x/oracle/client/cli/query_validators.go | 38 ++ x/oracle/client/cli/query_validators_test.go | 71 +++ x/oracle/genesis.go | 9 + x/oracle/genesis_test.go | 4 + x/oracle/keeper/query_validators.go | 24 + x/oracle/keeper/query_validators_test.go | 50 ++ x/oracle/keeper/validators.go | 33 ++ x/oracle/keeper/validators_test.go | 38 ++ x/oracle/types/genesis.go | 1 + x/oracle/types/genesis.pb.go | 87 ++- x/oracle/types/genesis_test.go | 3 + x/oracle/types/keys.go | 4 + x/oracle/types/query.pb.go | 397 ++++++++++++- x/oracle/types/query.pb.gw.go | 65 ++ x/oracle/types/validators.pb.go | 586 +++++++++++++++++++ 19 files changed, 1397 insertions(+), 46 deletions(-) create mode 100644 proto/exocore/oracle/validators.proto create mode 100644 x/oracle/client/cli/query_validators.go create mode 100644 x/oracle/client/cli/query_validators_test.go create mode 100644 x/oracle/keeper/query_validators.go create mode 100644 x/oracle/keeper/query_validators_test.go create mode 100644 x/oracle/keeper/validators.go create mode 100644 x/oracle/keeper/validators_test.go create mode 100644 x/oracle/types/validators.pb.go diff --git a/proto/exocore/oracle/genesis.proto b/proto/exocore/oracle/genesis.proto index cf569580a..b7ae6007f 100644 --- a/proto/exocore/oracle/genesis.proto +++ b/proto/exocore/oracle/genesis.proto @@ -5,6 +5,7 @@ package exocore.oracle; import "gogoproto/gogo.proto"; import "exocore/oracle/params.proto"; import "exocore/oracle/prices.proto"; +import "exocore/oracle/validators.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; @@ -12,7 +13,8 @@ option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; repeated Prices pricesList = 2 [(gogoproto.nullable) = false]; - + //TODO: userDefinedTokenFeeder + Validators validators = 3; } diff --git a/proto/exocore/oracle/query.proto b/proto/exocore/oracle/query.proto index d0f60bdf8..28b644aaa 100644 --- a/proto/exocore/oracle/query.proto +++ b/proto/exocore/oracle/query.proto @@ -7,6 +7,7 @@ import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "exocore/oracle/params.proto"; import "exocore/oracle/prices.proto"; +import "exocore/oracle/validators.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; @@ -28,7 +29,12 @@ service Query { option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/prices"; } - + + // Queries a Validators by index. + rpc Validators (QueryGetValidatorsRequest) returns (QueryGetValidatorsResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/validators"; + + } } // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} @@ -57,3 +63,9 @@ message QueryAllPricesResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +message QueryGetValidatorsRequest {} + +message QueryGetValidatorsResponse { + Validators Validators = 1 [(gogoproto.nullable) = false]; +} + diff --git a/proto/exocore/oracle/validators.proto b/proto/exocore/oracle/validators.proto new file mode 100644 index 000000000..cbcfdfcc5 --- /dev/null +++ b/proto/exocore/oracle/validators.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package exocore.oracle; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message Validators { + uint64 block = 1; + repeated Validator validator_list = 2; +} + +message Validator{ + string operator = 1; + string power = 2; +} diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go index 8b27813af..ec6cf184c 100644 --- a/x/oracle/client/cli/query.go +++ b/x/oracle/client/cli/query.go @@ -27,6 +27,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryParams()) cmd.AddCommand(CmdListPrices()) cmd.AddCommand(CmdShowPrices()) + cmd.AddCommand(CmdShowValidators()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/oracle/client/cli/query_validators.go b/x/oracle/client/cli/query_validators.go new file mode 100644 index 000000000..846aacd25 --- /dev/null +++ b/x/oracle/client/cli/query_validators.go @@ -0,0 +1,38 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func CmdShowValidators() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-validators", + Short: "shows 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) + + params := &types.QueryGetValidatorsRequest{} + + res, err := queryClient.Validators(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_validators_test.go b/x/oracle/client/cli/query_validators_test.go new file mode 100644 index 000000000..aeac766fd --- /dev/null +++ b/x/oracle/client/cli/query_validators_test.go @@ -0,0 +1,71 @@ +package cli_test + +import ( + "fmt" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func networkWithValidatorsObjects(t *testing.T) (*network.Network, types.Validators) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + validators := &types.Validators{} + nullify.Fill(&validators) + state.Validators = validators + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), *state.Validators +} + +func TestShowValidators(t *testing.T) { + net, obj := networkWithValidatorsObjects(t) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + args []string + err error + obj types.Validators + }{ + { + desc: "get", + args: common, + obj: obj, + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + var args []string + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowValidators(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetValidatorsResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.Validators) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.Validators), + ) + } + }) + } +} diff --git a/x/oracle/genesis.go b/x/oracle/genesis.go index 4da2af620..297162385 100644 --- a/x/oracle/genesis.go +++ b/x/oracle/genesis.go @@ -12,6 +12,10 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) for _, elem := range genState.PricesList { k.SetPrices(ctx, elem) } + // Set if defined + if genState.Validators != nil { + k.SetValidators(ctx, *genState.Validators) + } // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, genState.Params) } @@ -22,6 +26,11 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.Params = k.GetParams(ctx) genesis.PricesList = k.GetAllPrices(ctx) + // Get all validators + validators, found := k.GetValidators(ctx) + if found { + genesis.Validators = &validators + } // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/oracle/genesis_test.go b/x/oracle/genesis_test.go index 442d83398..1c2e97025 100644 --- a/x/oracle/genesis_test.go +++ b/x/oracle/genesis_test.go @@ -22,6 +22,9 @@ func TestGenesis(t *testing.T) { TokenId: 1, }, }, + Validators: &types.Validators{ + Block: 42, + }, // this line is used by starport scaffolding # genesis/test/state } @@ -34,5 +37,6 @@ func TestGenesis(t *testing.T) { nullify.Fill(got) require.ElementsMatch(t, genesisState.PricesList, got.PricesList) + require.Equal(t, genesisState.Validators, got.Validators) // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/oracle/keeper/query_validators.go b/x/oracle/keeper/query_validators.go new file mode 100644 index 000000000..959e7148c --- /dev/null +++ b/x/oracle/keeper/query_validators.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Validators(goCtx context.Context, req *types.QueryGetValidatorsRequest) (*types.QueryGetValidatorsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetValidators(ctx) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetValidatorsResponse{Validators: val}, nil +} diff --git a/x/oracle/keeper/query_validators_test.go b/x/oracle/keeper/query_validators_test.go new file mode 100644 index 000000000..aa81a9dcb --- /dev/null +++ b/x/oracle/keeper/query_validators_test.go @@ -0,0 +1,50 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func TestValidatorsQuery(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + item := createTestValidators(keeper, ctx) + tests := []struct { + desc string + request *types.QueryGetValidatorsRequest + response *types.QueryGetValidatorsResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetValidatorsRequest{}, + response: &types.QueryGetValidatorsResponse{Validators: item}, + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.Validators(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} diff --git a/x/oracle/keeper/validators.go b/x/oracle/keeper/validators.go new file mode 100644 index 000000000..ab2baa2bd --- /dev/null +++ b/x/oracle/keeper/validators.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetValidators set validators in the store +func (k Keeper) SetValidators(ctx sdk.Context, validators types.Validators) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorsKey)) + b := k.cdc.MustMarshal(&validators) + store.Set([]byte{0}, b) +} + +// GetValidators returns validators +func (k Keeper) GetValidators(ctx sdk.Context) (val types.Validators, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorsKey)) + + b := store.Get([]byte{0}) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveValidators removes validators from the store +func (k Keeper) RemoveValidators(ctx sdk.Context) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorsKey)) + store.Delete([]byte{0}) +} diff --git a/x/oracle/keeper/validators_test.go b/x/oracle/keeper/validators_test.go new file mode 100644 index 000000000..b02934aa2 --- /dev/null +++ b/x/oracle/keeper/validators_test.go @@ -0,0 +1,38 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func createTestValidators(keeper *keeper.Keeper, ctx sdk.Context) types.Validators { + item := types.Validators{} + keeper.SetValidators(ctx, item) + return item +} + +func TestValidatorsGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + item := createTestValidators(keeper, ctx) + rst, found := keeper.GetValidators(ctx) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) +} + +func TestValidatorsRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + createTestValidators(keeper, ctx) + keeper.RemoveValidators(ctx) + _, found := keeper.GetValidators(ctx) + require.False(t, found) +} diff --git a/x/oracle/types/genesis.go b/x/oracle/types/genesis.go index 325628b43..24003d88b 100644 --- a/x/oracle/types/genesis.go +++ b/x/oracle/types/genesis.go @@ -11,6 +11,7 @@ const DefaultIndex uint64 = 1 func DefaultGenesis() *GenesisState { return &GenesisState{ PricesList: []Prices{}, + Validators: nil, // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go index d98939b2d..0da8b4a5c 100644 --- a/x/oracle/types/genesis.pb.go +++ b/x/oracle/types/genesis.pb.go @@ -27,6 +27,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` PricesList []Prices `protobuf:"bytes,2,rep,name=pricesList,proto3" json:"pricesList"` + //TODO: userDefinedTokenFeeder + Validators *Validators `protobuf:"bytes,3,opt,name=validators,proto3" json:"validators,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -76,6 +78,13 @@ func (m *GenesisState) GetPricesList() []Prices { return nil } +func (m *GenesisState) GetValidators() *Validators { + if m != nil { + return m.Validators + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "exocore.oracle.GenesisState") } @@ -83,22 +92,24 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/genesis.proto", fileDescriptor_dbe067676c4dc0de) } var fileDescriptor_dbe067676c4dc0de = []byte{ - // 225 bytes of a gzipped FileDescriptorProto + // 260 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xad, 0xc8, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xca, 0xea, 0x41, 0x64, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x94, 0x34, 0x9a, 0x19, - 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0xb8, 0x24, 0x8b, 0x32, 0x93, 0x53, 0xa1, 0x92, 0x4a, 0x4d, - 0x8c, 0x5c, 0x3c, 0xee, 0x10, 0x1b, 0x83, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0x4c, 0xb8, 0xd8, 0x20, - 0xba, 0x25, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0xc4, 0xf4, 0x50, 0x5d, 0xa0, 0x17, 0x00, 0x96, - 0x75, 0x62, 0x39, 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xaa, 0x56, 0xc8, 0x86, 0x8b, 0x0b, 0x62, 0xac, - 0x4f, 0x66, 0x71, 0x89, 0x04, 0x93, 0x02, 0x33, 0x56, 0x9d, 0x60, 0x15, 0x50, 0x9d, 0x48, 0xea, - 0x9d, 0xbc, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, - 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x20, 0x3d, 0xb3, - 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0xdf, 0x15, 0x62, 0x9a, 0x5f, 0x6a, 0x49, 0x79, - 0x7e, 0x51, 0xb6, 0x3e, 0xcc, 0x57, 0x15, 0x30, 0x7f, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, - 0x81, 0xfd, 0x65, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x65, 0xb2, 0x58, 0x9a, 0x57, 0x01, 0x00, - 0x00, + 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0xb8, 0x24, 0x8b, 0x32, 0x93, 0x53, 0x61, 0x92, 0xf2, 0x68, + 0x92, 0x65, 0x89, 0x39, 0x99, 0x29, 0x89, 0x25, 0xf9, 0x45, 0x50, 0x05, 0x4a, 0xfb, 0x18, 0xb9, + 0x78, 0xdc, 0x21, 0x4e, 0x0a, 0x2e, 0x49, 0x2c, 0x49, 0x15, 0x32, 0xe1, 0x62, 0x83, 0x18, 0x2f, + 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa6, 0x87, 0xea, 0x44, 0xbd, 0x00, 0xb0, 0xac, 0x13, + 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, 0x50, 0xb5, 0x42, 0x36, 0x5c, 0x5c, 0x10, 0x7b, 0x7d, 0x32, + 0x8b, 0x4b, 0x24, 0x98, 0x14, 0x98, 0xb1, 0xea, 0x04, 0xab, 0x80, 0xea, 0x44, 0x52, 0x2f, 0x64, + 0xc5, 0xc5, 0x85, 0x70, 0x98, 0x04, 0x33, 0xd8, 0x5e, 0x29, 0x74, 0xdd, 0x61, 0x70, 0x15, 0x41, + 0x48, 0xaa, 0x9d, 0xbc, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, + 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x20, + 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0xdf, 0x15, 0x62, 0x96, 0x5f, 0x6a, + 0x49, 0x79, 0x7e, 0x51, 0xb6, 0x3e, 0x2c, 0x54, 0x2a, 0x60, 0xe1, 0x52, 0x52, 0x59, 0x90, 0x5a, + 0x9c, 0xc4, 0x06, 0x0e, 0x13, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x6b, 0x02, 0xf0, + 0xb4, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -121,6 +132,18 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Validators != nil { + { + size, err := m.Validators.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } if len(m.PricesList) > 0 { for iNdEx := len(m.PricesList) - 1; iNdEx >= 0; iNdEx-- { { @@ -173,6 +196,10 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if m.Validators != nil { + l = m.Validators.Size() + n += 1 + l + sovGenesis(uint64(l)) + } return n } @@ -278,6 +305,42 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Validators == nil { + m.Validators = &Validators{} + } + if err := m.Validators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/oracle/types/genesis_test.go b/x/oracle/types/genesis_test.go index 0fe5bfe87..085e9708b 100644 --- a/x/oracle/types/genesis_test.go +++ b/x/oracle/types/genesis_test.go @@ -30,6 +30,9 @@ func TestGenesisState_Validate(t *testing.T) { TokenId: 1, }, }, + Validators: &types.Validators{ + Block: 45, + }, // this line is used by starport scaffolding # types/genesis/validField }, valid: true, diff --git a/x/oracle/types/keys.go b/x/oracle/types/keys.go index 4616d06a1..051f87814 100644 --- a/x/oracle/types/keys.go +++ b/x/oracle/types/keys.go @@ -17,3 +17,7 @@ const ( func KeyPrefix(p string) []byte { return []byte(p) } + +const ( + ValidatorsKey = "Validators/value/" +) diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index 3b3f9c090..fbc675be8 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -297,6 +297,86 @@ func (m *QueryAllPricesResponse) GetPagination() *query.PageResponse { return nil } +type QueryGetValidatorsRequest struct { +} + +func (m *QueryGetValidatorsRequest) Reset() { *m = QueryGetValidatorsRequest{} } +func (m *QueryGetValidatorsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetValidatorsRequest) ProtoMessage() {} +func (*QueryGetValidatorsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{6} +} +func (m *QueryGetValidatorsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetValidatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetValidatorsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetValidatorsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetValidatorsRequest.Merge(m, src) +} +func (m *QueryGetValidatorsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetValidatorsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetValidatorsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetValidatorsRequest proto.InternalMessageInfo + +type QueryGetValidatorsResponse struct { + Validators Validators `protobuf:"bytes,1,opt,name=Validators,proto3" json:"Validators"` +} + +func (m *QueryGetValidatorsResponse) Reset() { *m = QueryGetValidatorsResponse{} } +func (m *QueryGetValidatorsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetValidatorsResponse) ProtoMessage() {} +func (*QueryGetValidatorsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{7} +} +func (m *QueryGetValidatorsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetValidatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetValidatorsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetValidatorsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetValidatorsResponse.Merge(m, src) +} +func (m *QueryGetValidatorsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetValidatorsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetValidatorsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetValidatorsResponse proto.InternalMessageInfo + +func (m *QueryGetValidatorsResponse) GetValidators() Validators { + if m != nil { + return m.Validators + } + return Validators{} +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "exocore.oracle.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "exocore.oracle.QueryParamsResponse") @@ -304,43 +384,49 @@ func init() { proto.RegisterType((*QueryGetPricesResponse)(nil), "exocore.oracle.QueryGetPricesResponse") proto.RegisterType((*QueryAllPricesRequest)(nil), "exocore.oracle.QueryAllPricesRequest") proto.RegisterType((*QueryAllPricesResponse)(nil), "exocore.oracle.QueryAllPricesResponse") + proto.RegisterType((*QueryGetValidatorsRequest)(nil), "exocore.oracle.QueryGetValidatorsRequest") + proto.RegisterType((*QueryGetValidatorsResponse)(nil), "exocore.oracle.QueryGetValidatorsResponse") } func init() { proto.RegisterFile("exocore/oracle/query.proto", fileDescriptor_f604621c8da1a6f3) } var fileDescriptor_f604621c8da1a6f3 = []byte{ - // 481 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x41, 0x6b, 0xd4, 0x40, - 0x14, 0xc7, 0x33, 0xad, 0x5d, 0x71, 0x04, 0x0f, 0x63, 0x2d, 0x25, 0x4a, 0x94, 0x91, 0xb6, 0x22, - 0x38, 0x63, 0xaa, 0xe0, 0xb9, 0x82, 0x16, 0x15, 0xca, 0x9a, 0xa3, 0x17, 0x99, 0xc4, 0x21, 0x86, - 0x66, 0xf3, 0xd2, 0xcc, 0xac, 0xb6, 0x88, 0x20, 0xde, 0xbc, 0x15, 0x3c, 0xf8, 0x19, 0xfc, 0x26, - 0x3d, 0x16, 0xbc, 0x78, 0x12, 0xd9, 0xf5, 0x83, 0x48, 0x66, 0xa6, 0x9a, 0xa4, 0x9b, 0x6e, 0x6f, - 0x9b, 0xf9, 0xff, 0xdf, 0xff, 0xfd, 0xe6, 0xcd, 0x5b, 0xec, 0xcb, 0x7d, 0x48, 0xa0, 0x92, 0x1c, - 0x2a, 0x91, 0xe4, 0x92, 0xef, 0x8d, 0x65, 0x75, 0xc0, 0xca, 0x0a, 0x34, 0x90, 0x2b, 0x4e, 0x63, - 0x56, 0xf3, 0x97, 0x53, 0x48, 0xc1, 0x48, 0xbc, 0xfe, 0x65, 0x5d, 0xfe, 0x8d, 0x14, 0x20, 0xcd, - 0x25, 0x17, 0x65, 0xc6, 0x45, 0x51, 0x80, 0x16, 0x3a, 0x83, 0x42, 0x39, 0xf5, 0x6e, 0x02, 0x6a, - 0x04, 0x8a, 0xc7, 0x42, 0xb9, 0x70, 0xfe, 0x2e, 0x8c, 0xa5, 0x16, 0x21, 0x2f, 0x45, 0x9a, 0x15, - 0xc6, 0xec, 0xbc, 0xd7, 0x3b, 0x2c, 0xa5, 0xa8, 0xc4, 0x48, 0xf5, 0x89, 0x55, 0x96, 0x48, 0x27, - 0xd2, 0x65, 0x4c, 0x5e, 0xd6, 0xd9, 0x43, 0x53, 0x11, 0xc9, 0xbd, 0xb1, 0x54, 0x9a, 0xbe, 0xc0, - 0x57, 0x5b, 0xa7, 0xaa, 0x84, 0x42, 0x49, 0xf2, 0x10, 0x0f, 0x6c, 0xf2, 0x2a, 0xba, 0x85, 0xee, - 0x5c, 0xde, 0x5c, 0x61, 0xed, 0x7b, 0x32, 0xeb, 0x7f, 0x7c, 0xe1, 0xe8, 0xd7, 0x4d, 0x2f, 0x72, - 0x5e, 0x1a, 0xe2, 0x6b, 0x26, 0x6c, 0x5b, 0xea, 0xa1, 0x69, 0xed, 0xba, 0x90, 0x55, 0x7c, 0x51, - 0xc3, 0xae, 0x2c, 0x9e, 0xbd, 0x31, 0x79, 0x4b, 0xd1, 0xc9, 0x27, 0xdd, 0xc1, 0x2b, 0xdd, 0x92, - 0x06, 0x82, 0x39, 0xe9, 0x45, 0x30, 0xea, 0x3f, 0x04, 0xf3, 0x45, 0x5f, 0x3b, 0x84, 0xad, 0x3c, - 0x6f, 0x23, 0x3c, 0xc5, 0xf8, 0xff, 0x30, 0x5d, 0xe4, 0x3a, 0xb3, 0x93, 0x67, 0xf5, 0xe4, 0x99, - 0x7d, 0x56, 0x37, 0x79, 0x36, 0x14, 0xa9, 0x74, 0xb5, 0x51, 0xa3, 0x92, 0x7e, 0x43, 0x8e, 0xb8, - 0xd1, 0x61, 0x06, 0xf1, 0xe2, 0x79, 0x89, 0xc9, 0x76, 0x0b, 0x6c, 0xc1, 0x80, 0x6d, 0xcc, 0x05, - 0xb3, 0x2d, 0x9b, 0x64, 0x9b, 0xdf, 0x17, 0xf1, 0x92, 0x21, 0x23, 0x9f, 0x10, 0x1e, 0xd8, 0x07, - 0x22, 0xb4, 0xcb, 0x70, 0x7a, 0x07, 0xfc, 0xdb, 0x67, 0x7a, 0x6c, 0x27, 0x7a, 0xef, 0xf3, 0x8f, - 0x3f, 0x5f, 0x17, 0x36, 0xc8, 0x1a, 0x7f, 0x62, 0xcd, 0x3b, 0x52, 0xbf, 0x87, 0x6a, 0x97, 0xcf, - 0x5c, 0x48, 0x72, 0x58, 0x23, 0xd8, 0x0b, 0xae, 0xcd, 0x8c, 0xef, 0xee, 0x88, 0xbf, 0x3e, 0xcf, - 0xe6, 0x40, 0x1e, 0x19, 0x90, 0x90, 0xf0, 0x79, 0x20, 0xa6, 0x8c, 0x7f, 0x70, 0x9b, 0xf6, 0x91, - 0x7c, 0x41, 0xf8, 0x92, 0xcd, 0xda, 0xca, 0xf3, 0x1e, 0xaa, 0xee, 0xda, 0xf4, 0x50, 0x9d, 0x7a, - 0xfb, 0xf3, 0x8f, 0xc7, 0xae, 0xc0, 0xf3, 0xa3, 0x49, 0x80, 0x8e, 0x27, 0x01, 0xfa, 0x3d, 0x09, - 0xd0, 0xe1, 0x34, 0xf0, 0x8e, 0xa7, 0x81, 0xf7, 0x73, 0x1a, 0x78, 0xaf, 0xee, 0xa7, 0x99, 0x7e, - 0x3b, 0x8e, 0x59, 0x02, 0xa3, 0xbe, 0xa8, 0xfd, 0x93, 0x30, 0x7d, 0x50, 0x4a, 0x15, 0x0f, 0xcc, - 0xff, 0xfb, 0xc1, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x80, 0x04, 0x70, 0x59, 0xa7, 0x04, 0x00, - 0x00, + // 555 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xc1, 0x6b, 0xd4, 0x40, + 0x14, 0xc6, 0x37, 0xb5, 0x5d, 0x71, 0x04, 0x0f, 0x63, 0x2d, 0x35, 0x95, 0x54, 0x22, 0x6d, 0x6d, + 0xc5, 0x8c, 0x5b, 0x05, 0xaf, 0xb6, 0xa0, 0x45, 0x85, 0xb2, 0xee, 0xc1, 0x83, 0x07, 0x65, 0x36, + 0x1d, 0x62, 0x68, 0x36, 0x2f, 0xcd, 0xcc, 0xd6, 0x16, 0x11, 0xc4, 0x9b, 0xb7, 0x82, 0xa0, 0xff, + 0x8f, 0xa7, 0x1e, 0x0b, 0x5e, 0x3c, 0x89, 0xec, 0xfa, 0x87, 0xc8, 0xce, 0xbc, 0x74, 0x93, 0xec, + 0xa6, 0xbb, 0xb7, 0xcd, 0x7c, 0xdf, 0x7c, 0xef, 0x97, 0xf7, 0xde, 0x86, 0xd8, 0xe2, 0x08, 0x7c, + 0x48, 0x05, 0x83, 0x94, 0xfb, 0x91, 0x60, 0x07, 0x5d, 0x91, 0x1e, 0x7b, 0x49, 0x0a, 0x0a, 0xe8, + 0x35, 0xd4, 0x3c, 0xa3, 0xd9, 0xf3, 0x01, 0x04, 0xa0, 0x25, 0x36, 0xf8, 0x65, 0x5c, 0xf6, 0xad, + 0x00, 0x20, 0x88, 0x04, 0xe3, 0x49, 0xc8, 0x78, 0x1c, 0x83, 0xe2, 0x2a, 0x84, 0x58, 0xa2, 0xba, + 0xe1, 0x83, 0xec, 0x80, 0x64, 0x6d, 0x2e, 0x31, 0x9c, 0x1d, 0x36, 0xda, 0x42, 0xf1, 0x06, 0x4b, + 0x78, 0x10, 0xc6, 0xda, 0x8c, 0xde, 0xa5, 0x12, 0x4b, 0xc2, 0x53, 0xde, 0x91, 0x55, 0x62, 0x1a, + 0xfa, 0x22, 0x13, 0x97, 0x4b, 0xe2, 0x21, 0x8f, 0xc2, 0x3d, 0xae, 0x20, 0x45, 0x83, 0x3b, 0x4f, + 0xe8, 0xab, 0x41, 0xf1, 0xa6, 0x8e, 0x6c, 0x89, 0x83, 0xae, 0x90, 0xca, 0x7d, 0x49, 0xae, 0x17, + 0x4e, 0x65, 0x02, 0xb1, 0x14, 0xf4, 0x11, 0xa9, 0x9b, 0xd2, 0x8b, 0xd6, 0x6d, 0xeb, 0xee, 0xd5, + 0xcd, 0x05, 0xaf, 0xd8, 0x08, 0xcf, 0xf8, 0xb7, 0x67, 0x4f, 0xff, 0x2c, 0xd7, 0x5a, 0xe8, 0x75, + 0x1b, 0xe4, 0x86, 0x0e, 0xdb, 0x11, 0xaa, 0xa9, 0xd9, 0xb0, 0x0a, 0x5d, 0x24, 0x97, 0x15, 0xec, + 0x8b, 0xf8, 0xf9, 0x9e, 0xce, 0x9b, 0x6b, 0x65, 0x8f, 0xee, 0x2e, 0x59, 0x28, 0x5f, 0xc9, 0x21, + 0xe8, 0x93, 0x4a, 0x04, 0xad, 0x9e, 0x23, 0xe8, 0x27, 0xf7, 0x1d, 0x22, 0x6c, 0x45, 0x51, 0x11, + 0xe1, 0x19, 0x21, 0xc3, 0x6e, 0x63, 0xe4, 0xaa, 0x67, 0x46, 0xe3, 0x0d, 0x46, 0xe3, 0x99, 0xb9, + 0xe3, 0x68, 0xbc, 0x26, 0x0f, 0x04, 0xde, 0x6d, 0xe5, 0x6e, 0xba, 0x3f, 0x2c, 0x24, 0xce, 0x55, + 0x18, 0x43, 0x7c, 0x69, 0x5a, 0x62, 0xba, 0x53, 0x00, 0x9b, 0xd1, 0x60, 0x6b, 0x13, 0xc1, 0x4c, + 0xc9, 0x02, 0xd9, 0x12, 0xb9, 0x99, 0xb5, 0xf2, 0xf5, 0xf9, 0xf0, 0xb3, 0x39, 0xbf, 0x25, 0xf6, + 0x38, 0x11, 0xc9, 0x9f, 0x10, 0x32, 0x3c, 0xc5, 0xe6, 0xd8, 0x65, 0xfa, 0xa1, 0x03, 0xdf, 0x20, + 0x77, 0x67, 0xf3, 0xe7, 0x2c, 0x99, 0xd3, 0x05, 0xe8, 0x67, 0x8b, 0xd4, 0xcd, 0x76, 0x50, 0xb7, + 0x1c, 0x31, 0xba, 0x80, 0xf6, 0x9d, 0x0b, 0x3d, 0x86, 0xcf, 0xbd, 0xff, 0xe5, 0xd7, 0xbf, 0x6f, + 0x33, 0x6b, 0x74, 0x85, 0x3d, 0x35, 0xe6, 0x5d, 0xa1, 0x3e, 0x40, 0xba, 0xcf, 0xc6, 0xfe, 0x5d, + 0xe8, 0xc9, 0x00, 0xc1, 0x74, 0x77, 0x65, 0x6c, 0x7c, 0x79, 0x41, 0xed, 0xd5, 0x49, 0x36, 0x04, + 0x79, 0xac, 0x41, 0x1a, 0x94, 0x4d, 0x02, 0xd1, 0xd7, 0xd8, 0x47, 0x5c, 0xf3, 0x4f, 0xf4, 0xab, + 0x45, 0xae, 0x98, 0xac, 0xad, 0x28, 0xaa, 0xa0, 0x2a, 0xef, 0x6c, 0x05, 0xd5, 0xc8, 0xe2, 0x4d, + 0xdf, 0x1e, 0xd3, 0x93, 0xef, 0x56, 0x7e, 0xdc, 0x74, 0xbd, 0xea, 0xdd, 0x47, 0xb6, 0xc8, 0xde, + 0x98, 0xc6, 0x8a, 0x50, 0x0d, 0x0d, 0x75, 0x8f, 0xae, 0x4f, 0x80, 0x1a, 0x7e, 0xa8, 0xb6, 0x5f, + 0x9c, 0xf6, 0x1c, 0xeb, 0xac, 0xe7, 0x58, 0x7f, 0x7b, 0x8e, 0x75, 0xd2, 0x77, 0x6a, 0x67, 0x7d, + 0xa7, 0xf6, 0xbb, 0xef, 0xd4, 0xde, 0x3c, 0x08, 0x42, 0xf5, 0xbe, 0xdb, 0xf6, 0x7c, 0xe8, 0x54, + 0xc5, 0x1d, 0x65, 0x81, 0xea, 0x38, 0x11, 0xb2, 0x5d, 0xd7, 0x5f, 0xbd, 0x87, 0xff, 0x03, 0x00, + 0x00, 0xff, 0xff, 0xbf, 0xc1, 0xa4, 0xe2, 0xde, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -360,6 +446,8 @@ type QueryClient interface { // Queries a list of Prices items. Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) PricesAll(ctx context.Context, in *QueryAllPricesRequest, opts ...grpc.CallOption) (*QueryAllPricesResponse, error) + // Queries a Validators by index. + Validators(ctx context.Context, in *QueryGetValidatorsRequest, opts ...grpc.CallOption) (*QueryGetValidatorsResponse, error) } type queryClient struct { @@ -397,6 +485,15 @@ func (c *queryClient) PricesAll(ctx context.Context, in *QueryAllPricesRequest, return out, nil } +func (c *queryClient) Validators(ctx context.Context, in *QueryGetValidatorsRequest, opts ...grpc.CallOption) (*QueryGetValidatorsResponse, error) { + out := new(QueryGetValidatorsResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/Validators", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -404,6 +501,8 @@ type QueryServer interface { // Queries a list of Prices items. Prices(context.Context, *QueryGetPricesRequest) (*QueryGetPricesResponse, error) PricesAll(context.Context, *QueryAllPricesRequest) (*QueryAllPricesResponse, error) + // Queries a Validators by index. + Validators(context.Context, *QueryGetValidatorsRequest) (*QueryGetValidatorsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -419,6 +518,9 @@ func (*UnimplementedQueryServer) Prices(ctx context.Context, req *QueryGetPrices func (*UnimplementedQueryServer) PricesAll(ctx context.Context, req *QueryAllPricesRequest) (*QueryAllPricesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PricesAll not implemented") } +func (*UnimplementedQueryServer) Validators(ctx context.Context, req *QueryGetValidatorsRequest) (*QueryGetValidatorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Validators not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -478,6 +580,24 @@ func _Query_PricesAll_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Query_Validators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetValidatorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Validators(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/Validators", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Validators(ctx, req.(*QueryGetValidatorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "exocore.oracle.Query", HandlerType: (*QueryServer)(nil), @@ -494,6 +614,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "PricesAll", Handler: _Query_PricesAll_Handler, }, + { + MethodName: "Validators", + Handler: _Query_Validators_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "exocore/oracle/query.proto", @@ -700,6 +824,62 @@ func (m *QueryAllPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *QueryGetValidatorsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryGetValidatorsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Validators.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -786,6 +966,26 @@ func (m *QueryAllPricesResponse) Size() (n int) { return n } +func (m *QueryGetValidatorsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryGetValidatorsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Validators.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1283,6 +1483,139 @@ func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryGetValidatorsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetValidatorsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetValidatorsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetValidatorsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Validators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index 872eb9da9..9fdf27306 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -141,6 +141,24 @@ func local_request_Query_PricesAll_0(ctx context.Context, marshaler runtime.Mars } +func request_Query_Validators_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetValidatorsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Validators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Validators_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetValidatorsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Validators(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -216,6 +234,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_Validators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Validators_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Validators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -317,6 +358,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_Validators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Validators_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Validators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -326,6 +387,8 @@ var ( pattern_Query_Prices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "prices", "tokenId"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_PricesAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "prices"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Validators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "validators"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -334,4 +397,6 @@ var ( forward_Query_Prices_0 = runtime.ForwardResponseMessage forward_Query_PricesAll_0 = runtime.ForwardResponseMessage + + forward_Query_Validators_0 = runtime.ForwardResponseMessage ) diff --git a/x/oracle/types/validators.pb.go b/x/oracle/types/validators.pb.go new file mode 100644 index 000000000..8e8117825 --- /dev/null +++ b/x/oracle/types/validators.pb.go @@ -0,0 +1,586 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/validators.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Validators struct { + Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` + ValidatorList []*Validator `protobuf:"bytes,2,rep,name=validator_list,json=validatorList,proto3" json:"validator_list,omitempty"` +} + +func (m *Validators) Reset() { *m = Validators{} } +func (m *Validators) String() string { return proto.CompactTextString(m) } +func (*Validators) ProtoMessage() {} +func (*Validators) Descriptor() ([]byte, []int) { + return fileDescriptor_4264e9827808bf71, []int{0} +} +func (m *Validators) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Validators) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Validators.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Validators) XXX_Merge(src proto.Message) { + xxx_messageInfo_Validators.Merge(m, src) +} +func (m *Validators) XXX_Size() int { + return m.Size() +} +func (m *Validators) XXX_DiscardUnknown() { + xxx_messageInfo_Validators.DiscardUnknown(m) +} + +var xxx_messageInfo_Validators proto.InternalMessageInfo + +func (m *Validators) GetBlock() uint64 { + if m != nil { + return m.Block + } + return 0 +} + +func (m *Validators) GetValidatorList() []*Validator { + if m != nil { + return m.ValidatorList + } + return nil +} + +type Validator struct { + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` + Power string `protobuf:"bytes,2,opt,name=power,proto3" json:"power,omitempty"` +} + +func (m *Validator) Reset() { *m = Validator{} } +func (m *Validator) String() string { return proto.CompactTextString(m) } +func (*Validator) ProtoMessage() {} +func (*Validator) Descriptor() ([]byte, []int) { + return fileDescriptor_4264e9827808bf71, []int{1} +} +func (m *Validator) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Validator.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Validator) XXX_Merge(src proto.Message) { + xxx_messageInfo_Validator.Merge(m, src) +} +func (m *Validator) XXX_Size() int { + return m.Size() +} +func (m *Validator) XXX_DiscardUnknown() { + xxx_messageInfo_Validator.DiscardUnknown(m) +} + +var xxx_messageInfo_Validator proto.InternalMessageInfo + +func (m *Validator) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *Validator) GetPower() string { + if m != nil { + return m.Power + } + return "" +} + +func init() { + proto.RegisterType((*Validators)(nil), "exocore.oracle.Validators") + proto.RegisterType((*Validator)(nil), "exocore.oracle.Validator") +} + +func init() { proto.RegisterFile("exocore/oracle/validators.proto", fileDescriptor_4264e9827808bf71) } + +var fileDescriptor_4264e9827808bf71 = []byte{ + // 225 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x4b, 0xcc, 0xc9, 0x4c, + 0x49, 0x2c, 0xc9, 0x2f, 0x2a, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x2a, 0xd0, + 0x83, 0x28, 0x50, 0x4a, 0xe1, 0xe2, 0x0a, 0x83, 0xab, 0x11, 0x12, 0xe1, 0x62, 0x4d, 0xca, 0xc9, + 0x4f, 0xce, 0x96, 0x60, 0x54, 0x60, 0xd4, 0x60, 0x09, 0x82, 0x70, 0x84, 0x1c, 0xb8, 0xf8, 0xe0, + 0xe6, 0xc4, 0xe7, 0x64, 0x16, 0x97, 0x48, 0x30, 0x29, 0x30, 0x6b, 0x70, 0x1b, 0x49, 0xea, 0xa1, + 0x1a, 0xa6, 0x07, 0x37, 0x29, 0x88, 0x17, 0xae, 0xc1, 0x27, 0xb3, 0xb8, 0x44, 0xc9, 0x96, 0x8b, + 0x13, 0x2e, 0x27, 0x24, 0xc5, 0xc5, 0x91, 0x5f, 0x90, 0x5a, 0x04, 0x62, 0x83, 0xed, 0xe1, 0x0c, + 0x82, 0xf3, 0x41, 0x0e, 0x28, 0xc8, 0x2f, 0x4f, 0x2d, 0x92, 0x60, 0x02, 0x4b, 0x40, 0x38, 0x4e, + 0x5e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, + 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x90, 0x9e, 0x59, 0x92, + 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0xef, 0x0a, 0x71, 0x8c, 0x5f, 0x6a, 0x49, 0x79, 0x7e, + 0x51, 0xb6, 0x3e, 0x2c, 0x24, 0x2a, 0x60, 0x61, 0x51, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, + 0x0e, 0x07, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x17, 0x61, 0x71, 0xf1, 0x2a, 0x01, 0x00, + 0x00, +} + +func (m *Validators) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Validators) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Validators) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorList) > 0 { + for iNdEx := len(m.ValidatorList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ValidatorList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintValidators(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Block != 0 { + i = encodeVarintValidators(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Validator) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Validator) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Power) > 0 { + i -= len(m.Power) + copy(dAtA[i:], m.Power) + i = encodeVarintValidators(dAtA, i, uint64(len(m.Power))) + i-- + dAtA[i] = 0x12 + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintValidators(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintValidators(dAtA []byte, offset int, v uint64) int { + offset -= sovValidators(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Validators) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Block != 0 { + n += 1 + sovValidators(uint64(m.Block)) + } + if len(m.ValidatorList) > 0 { + for _, e := range m.ValidatorList { + l = e.Size() + n += 1 + l + sovValidators(uint64(l)) + } + } + return n +} + +func (m *Validator) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovValidators(uint64(l)) + } + l = len(m.Power) + if l > 0 { + n += 1 + l + sovValidators(uint64(l)) + } + return n +} + +func sovValidators(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozValidators(x uint64) (n int) { + return sovValidators(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Validators) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidators + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Validators: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Validators: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + m.Block = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidators + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Block |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidators + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthValidators + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthValidators + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorList = append(m.ValidatorList, &Validator{}) + if err := m.ValidatorList[len(m.ValidatorList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipValidators(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthValidators + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Validator) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidators + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Validator: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Validator: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidators + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthValidators + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthValidators + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Power", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidators + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthValidators + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthValidators + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Power = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipValidators(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthValidators + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipValidators(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidators + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidators + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidators + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthValidators + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupValidators + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthValidators + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthValidators = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowValidators = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupValidators = fmt.Errorf("proto: unexpected end of group") +) From 1b1e17f1d2b3bf9a5a4b873bbf733c53f32dca29 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Mon, 11 Mar 2024 23:43:24 +0800 Subject: [PATCH 18/37] feat(oracle-keeper): add recache logic --- x/oracle/keeper/aggregator.go | 8 -- x/oracle/keeper/caches.go | 124 ++++++++++++++++++++- x/oracle/keeper/msg_server_create_price.go | 21 +--- 3 files changed, 122 insertions(+), 31 deletions(-) diff --git a/x/oracle/keeper/aggregator.go b/x/oracle/keeper/aggregator.go index 10804ea65..bb9693d0f 100644 --- a/x/oracle/keeper/aggregator.go +++ b/x/oracle/keeper/aggregator.go @@ -307,11 +307,3 @@ func (agC *aggregatorContext) prepareRound(ctx sdk.Context, block uint64) { } } } - -func (agc *aggregatorContext) recache(from, to uint64, k Keeper) { - //block_from'endblocker --> from_to'endblock - //f.prepare->(f+1).msgs->(f+1).seal - //...(to-2).prepare->(to-1).msgs->(to-1).seal - //to.prepare-> return - validatorsPower := k.GetValidators -} diff --git a/x/oracle/keeper/caches.go b/x/oracle/keeper/caches.go index 925fcba79..0a5263e2e 100644 --- a/x/oracle/keeper/caches.go +++ b/x/oracle/keeper/caches.go @@ -5,6 +5,7 @@ import ( "github.com/ExocoreNetwork/exocore/x/oracle/types" sdk "github.com/cosmos/cosmos-sdk/types" + stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) type cacheItem struct { @@ -14,13 +15,31 @@ type cacheItem struct { // power *big.Int } +// used to track validator change +type cacheValidator struct { + validators []*types.Validator + update bool +} + +// used to track params change +type cacheParams struct { + params *params + update bool +} + // memory cache func (k *Keeper) addCache(item *cacheItem) { } // memory cache -func (k *Keeper) removeCache(item *cacheItem) +func (k *Keeper) removeCache(item *cacheItem) { + +} + +func (k *Keeper) commitCache() { + +} // persist cache into KV func (k *Keeper) updateRecentTxs() { @@ -29,13 +48,19 @@ func (k *Keeper) updateRecentTxs() { //TODO: delete, use map in the KVStore, so actually dont need to implement the exactly 'delete' at firt, just remove all blocks before maxDistance } -// commit memory cache to KVStore -func (k *Keeper) commitCache() { - +func (k *Keeper) updateCacheValidators() bool { + return false +} +func (k *Keeper) updateCacheParams() bool { + return false } // from KVStore -func (k *Keeper) getCaches(ctx sdk.Context) map[uint64]*cacheItem { +func (k *Keeper) getCaches(ctx sdk.Context) map[uint64][]*cacheItem { + return nil +} + +func (k *Keeper) getParams4CacheRecover(ctx sdk.Context) map[uint64]*params { return nil } @@ -47,3 +72,92 @@ func (k *Keeper) clearCaches(ctx sdk.Context) { func (k *Keeper) getCacheValidators(ctx sdk.Context) map[string]*big.Int { return nil } + +func (k *Keeper) recacheAggregatorContext(ctx sdk.Context, agc *aggregatorContext) bool { + + from := uint64(ctx.BlockHeight()) - maxNonce + to := uint64(ctx.BlockHeight()) - 1 + + //fill validators + validators, ok := k.GetValidators(ctx) + recenetParams := k.getParams4CacheRecover(ctx) + if !ok || recenetParams == nil { + //no cache, this is the very first running, so go to initial proces instead + return false + } + h := validators.Block + if h > from { + from = h + } + for _, v := range validators.ValidatorList { + agc.validatorsPower[v.Operator], _ = new(big.Int).SetString(v.Power, 10) + } + + recentMsgs := k.getCaches(ctx) + + for ; from < to; from++ { + //fill params + for h, p := range recenetParams { + prev := uint64(0) + if h <= from && h > prev { + pTmp := params(*p) + agc.params = &pTmp + if prev > 0 { + //TODO: safe delete + delete(recenetParams, prev) + } + prev = h + } + } + + agc.prepareRound(ctx, from) + + if msgs := recentMsgs[from+1]; msgs != nil { + for _, msg := range msgs { + //these messages are retreived for recache, just skip the validation check and fill the memory cache + agc.fillPrice(&types.MsgCreatePrice{ + Creator: msg.validator, + FeederId: msg.feederId, + Prices: msg.pSources, + }) + } + } + agc.sealRound(ctx) + } + + agc.prepareRound(ctx, to) + + return true +} + +func (k *Keeper) initAggregatorContext(ctx sdk.Context, agc *aggregatorContext) error { + //set params + p := k.GetParams(ctx) + m := make(map[uint64]*types.Params) + m[uint64(ctx.BlockHeight())] = &p + k.setParams4CacheRecover(m) //used to trace tokenFeeder's update during cache recover + pTmp := params(p) + agc.params = &pTmp + + totalPower := big.NewInt(0) + vList := make([]*types.Validator, 0) + k.stakingKeeper.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingTypes.ValidatorI) bool { + power := big.NewInt(validator.GetConsensusPower(validator.GetBondedTokens())) + addr := string(validator.GetOperator()) + agc.validatorsPower[addr] = power + totalPower = new(big.Int).Add(totalPower, power) + vList = append(vList, &types.Validator{Operator: addr, Power: power.String()}) + return false + }) + agc.totalPower = totalPower + k.SetValidators(ctx, types.Validators{ + Block: uint64(ctx.BlockHeight()), + ValidatorList: vList, + }) + + agc.prepareRound(ctx, uint64(ctx.BlockHeight())-1) + return nil +} + +// this is a mock serves as a placeholder +func (k *Keeper) setParams4CacheRecover(p map[uint64]*types.Params) {} diff --git a/x/oracle/keeper/msg_server_create_price.go b/x/oracle/keeper/msg_server_create_price.go index b15f13c20..e074ab587 100644 --- a/x/oracle/keeper/msg_server_create_price.go +++ b/x/oracle/keeper/msg_server_create_price.go @@ -47,25 +47,10 @@ func getAggregatorContext(ctx sdk.Context, k Keeper) *aggregatorContext { rounds: make(map[int32]*roundInfo), aggregators: make(map[int32]*worker), } - if validators := k.getCacheValidators(ctx); validators != nil { - agc.validatorsPower = validators - for _, v := range validators { - agc.totalPower = new(big.Int).Add(agc.totalPower, v) - } - } - - p := params(k.GetParams(ctx)) - agc.params = &p - - //replay the recentMsgs to recover the cache - agc.prepareRound(ctx, uint64(ctx.BlockHeight())-uint64(maxNonce)) - agc.recache(uint64(ctx.BlockHeight())-uint64(maxNonce), uint64(ctx.BlockHeight())-1, k) - - //TODO: 1. prepare roundInfo with feeder and ctx, prepare response for status: 2->1 - recentItems := k.getCaches(ctx) - - for _, item := range recentItems { + if ok := k.recacheAggregatorContext(ctx, agc); !ok { + //this is the very first time oracle has been started, fill relalted info as initialization + k.initAggregatorContext(ctx, agc) } return agc From 3fbf0a91b45b448955b35eb1981a0a49dc257de7 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Tue, 12 Mar 2024 15:09:48 +0800 Subject: [PATCH 19/37] feat(oracle-proto): udpate state for recache to keep recent history data --- proto/exocore/oracle/genesis.proto | 14 +- proto/exocore/oracle/index_recent_msg.proto | 8 + .../exocore/oracle/index_recent_params.proto | 8 + proto/exocore/oracle/query.proto | 95 + proto/exocore/oracle/recent_msg.proto | 16 + proto/exocore/oracle/recent_params.proto | 12 + .../oracle/validator_update_block.proto | 8 + x/oracle/client/cli/query.go | 7 + x/oracle/client/cli/query_index_recent_msg.go | 38 + .../client/cli/query_index_recent_msg_test.go | 71 + .../client/cli/query_index_recent_params.go | 38 + .../cli/query_index_recent_params_test.go | 71 + x/oracle/client/cli/query_recent_msg.go | 82 + x/oracle/client/cli/query_recent_msg_test.go | 160 + x/oracle/client/cli/query_recent_params.go | 82 + .../client/cli/query_recent_params_test.go | 160 + .../cli/query_validator_update_block.go | 38 + .../cli/query_validator_update_block_test.go | 71 + x/oracle/genesis.go | 37 + x/oracle/genesis_test.go | 24 + x/oracle/keeper/index_recent_msg.go | 33 + x/oracle/keeper/index_recent_msg_test.go | 38 + x/oracle/keeper/index_recent_params.go | 33 + x/oracle/keeper/index_recent_params_test.go | 38 + x/oracle/keeper/query_index_recent_msg.go | 24 + .../keeper/query_index_recent_msg_test.go | 50 + x/oracle/keeper/query_index_recent_params.go | 24 + .../keeper/query_index_recent_params_test.go | 50 + x/oracle/keeper/query_recent_msg.go | 57 + x/oracle/keeper/query_recent_msg_test.go | 127 + x/oracle/keeper/query_recent_params.go | 57 + x/oracle/keeper/query_recent_params_test.go | 127 + .../keeper/query_validator_update_block.go | 24 + .../query_validator_update_block_test.go | 50 + x/oracle/keeper/recent_msg.go | 63 + x/oracle/keeper/recent_msg_test.go | 63 + x/oracle/keeper/recent_params.go | 63 + x/oracle/keeper/recent_params_test.go | 63 + x/oracle/keeper/validator_update_block.go | 33 + .../keeper/validator_update_block_test.go | 38 + x/oracle/types/genesis.go | 29 +- x/oracle/types/genesis.pb.go | 352 +- x/oracle/types/genesis_test.go | 47 + x/oracle/types/index_recent_msg.pb.go | 375 ++ x/oracle/types/index_recent_params.pb.go | 375 ++ x/oracle/types/key_recent_msg.go | 24 + x/oracle/types/key_recent_params.go | 24 + x/oracle/types/keys.go | 12 + x/oracle/types/query.pb.go | 3674 ++++++++++++++--- x/oracle/types/query.pb.gw.go | 563 +++ x/oracle/types/recent_msg.pb.go | 451 ++ x/oracle/types/recent_params.pb.go | 362 ++ x/oracle/types/validator_update_block.pb.go | 301 ++ 53 files changed, 8152 insertions(+), 532 deletions(-) create mode 100644 proto/exocore/oracle/index_recent_msg.proto create mode 100644 proto/exocore/oracle/index_recent_params.proto create mode 100644 proto/exocore/oracle/recent_msg.proto create mode 100644 proto/exocore/oracle/recent_params.proto create mode 100644 proto/exocore/oracle/validator_update_block.proto create mode 100644 x/oracle/client/cli/query_index_recent_msg.go create mode 100644 x/oracle/client/cli/query_index_recent_msg_test.go create mode 100644 x/oracle/client/cli/query_index_recent_params.go create mode 100644 x/oracle/client/cli/query_index_recent_params_test.go create mode 100644 x/oracle/client/cli/query_recent_msg.go create mode 100644 x/oracle/client/cli/query_recent_msg_test.go create mode 100644 x/oracle/client/cli/query_recent_params.go create mode 100644 x/oracle/client/cli/query_recent_params_test.go create mode 100644 x/oracle/client/cli/query_validator_update_block.go create mode 100644 x/oracle/client/cli/query_validator_update_block_test.go create mode 100644 x/oracle/keeper/index_recent_msg.go create mode 100644 x/oracle/keeper/index_recent_msg_test.go create mode 100644 x/oracle/keeper/index_recent_params.go create mode 100644 x/oracle/keeper/index_recent_params_test.go create mode 100644 x/oracle/keeper/query_index_recent_msg.go create mode 100644 x/oracle/keeper/query_index_recent_msg_test.go create mode 100644 x/oracle/keeper/query_index_recent_params.go create mode 100644 x/oracle/keeper/query_index_recent_params_test.go create mode 100644 x/oracle/keeper/query_recent_msg.go create mode 100644 x/oracle/keeper/query_recent_msg_test.go create mode 100644 x/oracle/keeper/query_recent_params.go create mode 100644 x/oracle/keeper/query_recent_params_test.go create mode 100644 x/oracle/keeper/query_validator_update_block.go create mode 100644 x/oracle/keeper/query_validator_update_block_test.go create mode 100644 x/oracle/keeper/recent_msg.go create mode 100644 x/oracle/keeper/recent_msg_test.go create mode 100644 x/oracle/keeper/recent_params.go create mode 100644 x/oracle/keeper/recent_params_test.go create mode 100644 x/oracle/keeper/validator_update_block.go create mode 100644 x/oracle/keeper/validator_update_block_test.go create mode 100644 x/oracle/types/index_recent_msg.pb.go create mode 100644 x/oracle/types/index_recent_params.pb.go create mode 100644 x/oracle/types/key_recent_msg.go create mode 100644 x/oracle/types/key_recent_params.go create mode 100644 x/oracle/types/recent_msg.pb.go create mode 100644 x/oracle/types/recent_params.pb.go create mode 100644 x/oracle/types/validator_update_block.pb.go diff --git a/proto/exocore/oracle/genesis.proto b/proto/exocore/oracle/genesis.proto index b7ae6007f..2382d1d25 100644 --- a/proto/exocore/oracle/genesis.proto +++ b/proto/exocore/oracle/genesis.proto @@ -6,6 +6,11 @@ import "gogoproto/gogo.proto"; import "exocore/oracle/params.proto"; import "exocore/oracle/prices.proto"; import "exocore/oracle/validators.proto"; +import "exocore/oracle/validator_update_block.proto"; +import "exocore/oracle/index_recent_params.proto"; +import "exocore/oracle/index_recent_msg.proto"; +import "exocore/oracle/recent_msg.proto"; +import "exocore/oracle/recent_params.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; @@ -13,8 +18,13 @@ option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; repeated Prices pricesList = 2 [(gogoproto.nullable) = false]; - + //TODO: userDefinedTokenFeeder - Validators validators = 3; + Validators validators = 3; + ValidatorUpdateBlock validatorUpdateBlock = 4; + IndexRecentParams indexRecentParams = 5; + IndexRecentMsg indexRecentMsg = 6; + repeated RecentMsg recentMsgList = 7 [(gogoproto.nullable) = false]; + repeated RecentParams recentParamsList = 8 [(gogoproto.nullable) = false]; } diff --git a/proto/exocore/oracle/index_recent_msg.proto b/proto/exocore/oracle/index_recent_msg.proto new file mode 100644 index 000000000..feaa90eb2 --- /dev/null +++ b/proto/exocore/oracle/index_recent_msg.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package exocore.oracle; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message IndexRecentMsg { + repeated uint64 index = 1; +} diff --git a/proto/exocore/oracle/index_recent_params.proto b/proto/exocore/oracle/index_recent_params.proto new file mode 100644 index 000000000..2612adcf8 --- /dev/null +++ b/proto/exocore/oracle/index_recent_params.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package exocore.oracle; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message IndexRecentParams { + repeated uint64 index = 1; +} diff --git a/proto/exocore/oracle/query.proto b/proto/exocore/oracle/query.proto index 28b644aaa..8777a58e2 100644 --- a/proto/exocore/oracle/query.proto +++ b/proto/exocore/oracle/query.proto @@ -8,6 +8,11 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "exocore/oracle/params.proto"; import "exocore/oracle/prices.proto"; import "exocore/oracle/validators.proto"; +import "exocore/oracle/validator_update_block.proto"; +import "exocore/oracle/index_recent_params.proto"; +import "exocore/oracle/index_recent_msg.proto"; +import "exocore/oracle/recent_msg.proto"; +import "exocore/oracle/recent_params.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; @@ -35,6 +40,44 @@ service Query { option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/validators"; } + + // Queries a ValidatorUpdateBlock by index. + rpc ValidatorUpdateBlock (QueryGetValidatorUpdateBlockRequest) returns (QueryGetValidatorUpdateBlockResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/validator_update_block"; + + } + + // Queries a IndexRecentParams by index. + rpc IndexRecentParams (QueryGetIndexRecentParamsRequest) returns (QueryGetIndexRecentParamsResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/index_recent_params"; + + } + + // Queries a IndexRecentMsg by index. + rpc IndexRecentMsg (QueryGetIndexRecentMsgRequest) returns (QueryGetIndexRecentMsgResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/index_recent_msg"; + + } + + // Queries a list of RecentMsg items. + rpc RecentMsg (QueryGetRecentMsgRequest) returns (QueryGetRecentMsgResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/recent_msg/{block}"; + + } + rpc RecentMsgAll (QueryAllRecentMsgRequest) returns (QueryAllRecentMsgResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/recent_msg"; + + } + + // Queries a list of RecentParams items. + rpc RecentParams (QueryGetRecentParamsRequest) returns (QueryGetRecentParamsResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/recent_params/{block}"; + + } + rpc RecentParamsAll (QueryAllRecentParamsRequest) returns (QueryAllRecentParamsResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/recent_params"; + + } } // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} @@ -69,3 +112,55 @@ message QueryGetValidatorsResponse { Validators Validators = 1 [(gogoproto.nullable) = false]; } +message QueryGetValidatorUpdateBlockRequest {} + +message QueryGetValidatorUpdateBlockResponse { + ValidatorUpdateBlock ValidatorUpdateBlock = 1 [(gogoproto.nullable) = false]; +} + +message QueryGetIndexRecentParamsRequest {} + +message QueryGetIndexRecentParamsResponse { + IndexRecentParams IndexRecentParams = 1 [(gogoproto.nullable) = false]; +} + +message QueryGetIndexRecentMsgRequest {} + +message QueryGetIndexRecentMsgResponse { + IndexRecentMsg IndexRecentMsg = 1 [(gogoproto.nullable) = false]; +} + +message QueryGetRecentMsgRequest { + uint64 block = 1; +} + +message QueryGetRecentMsgResponse { + RecentMsg recentMsg = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllRecentMsgRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllRecentMsgResponse { + repeated RecentMsg recentMsg = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetRecentParamsRequest { + uint64 block = 1; +} + +message QueryGetRecentParamsResponse { + RecentParams recentParams = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllRecentParamsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllRecentParamsResponse { + repeated RecentParams recentParams = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + diff --git a/proto/exocore/oracle/recent_msg.proto b/proto/exocore/oracle/recent_msg.proto new file mode 100644 index 000000000..bd2f4b711 --- /dev/null +++ b/proto/exocore/oracle/recent_msg.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package exocore.oracle; + +import "exocore/oracle/price.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message RecentMsg { + uint64 block = 1; + int32 feeder_id = 2; + PriceWithSource p_sources = 3; + string validator = 4; +} + + + diff --git a/proto/exocore/oracle/recent_params.proto b/proto/exocore/oracle/recent_params.proto new file mode 100644 index 000000000..ec260a68c --- /dev/null +++ b/proto/exocore/oracle/recent_params.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package exocore.oracle; + +import "exocore/oracle/params.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message RecentParams { + uint64 block = 1; + Params params = 2; +} + diff --git a/proto/exocore/oracle/validator_update_block.proto b/proto/exocore/oracle/validator_update_block.proto new file mode 100644 index 000000000..85f011dc9 --- /dev/null +++ b/proto/exocore/oracle/validator_update_block.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package exocore.oracle; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message ValidatorUpdateBlock { + uint64 block = 1; +} diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go index ec6cf184c..5203d94ac 100644 --- a/x/oracle/client/cli/query.go +++ b/x/oracle/client/cli/query.go @@ -28,6 +28,13 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdListPrices()) cmd.AddCommand(CmdShowPrices()) cmd.AddCommand(CmdShowValidators()) + cmd.AddCommand(CmdShowValidatorUpdateBlock()) + cmd.AddCommand(CmdShowIndexRecentParams()) + cmd.AddCommand(CmdShowIndexRecentMsg()) + cmd.AddCommand(CmdListRecentMsg()) + cmd.AddCommand(CmdShowRecentMsg()) + cmd.AddCommand(CmdListRecentParams()) + cmd.AddCommand(CmdShowRecentParams()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/oracle/client/cli/query_index_recent_msg.go b/x/oracle/client/cli/query_index_recent_msg.go new file mode 100644 index 000000000..26d62a767 --- /dev/null +++ b/x/oracle/client/cli/query_index_recent_msg.go @@ -0,0 +1,38 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func CmdShowIndexRecentMsg() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-index-recent-msg", + Short: "shows indexRecentMsg", + 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) + + params := &types.QueryGetIndexRecentMsgRequest{} + + res, err := queryClient.IndexRecentMsg(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_index_recent_msg_test.go b/x/oracle/client/cli/query_index_recent_msg_test.go new file mode 100644 index 000000000..bed12b0cc --- /dev/null +++ b/x/oracle/client/cli/query_index_recent_msg_test.go @@ -0,0 +1,71 @@ +package cli_test + +import ( + "fmt" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func networkWithIndexRecentMsgObjects(t *testing.T) (*network.Network, types.IndexRecentMsg) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + indexRecentMsg := &types.IndexRecentMsg{} + nullify.Fill(&indexRecentMsg) + state.IndexRecentMsg = indexRecentMsg + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), *state.IndexRecentMsg +} + +func TestShowIndexRecentMsg(t *testing.T) { + net, obj := networkWithIndexRecentMsgObjects(t) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + args []string + err error + obj types.IndexRecentMsg + }{ + { + desc: "get", + args: common, + obj: obj, + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + var args []string + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowIndexRecentMsg(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetIndexRecentMsgResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.IndexRecentMsg) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.IndexRecentMsg), + ) + } + }) + } +} diff --git a/x/oracle/client/cli/query_index_recent_params.go b/x/oracle/client/cli/query_index_recent_params.go new file mode 100644 index 000000000..15a9a6575 --- /dev/null +++ b/x/oracle/client/cli/query_index_recent_params.go @@ -0,0 +1,38 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func CmdShowIndexRecentParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-index-recent-params", + Short: "shows indexRecentParams", + 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) + + params := &types.QueryGetIndexRecentParamsRequest{} + + res, err := queryClient.IndexRecentParams(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_index_recent_params_test.go b/x/oracle/client/cli/query_index_recent_params_test.go new file mode 100644 index 000000000..3d61343a5 --- /dev/null +++ b/x/oracle/client/cli/query_index_recent_params_test.go @@ -0,0 +1,71 @@ +package cli_test + +import ( + "fmt" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func networkWithIndexRecentParamsObjects(t *testing.T) (*network.Network, types.IndexRecentParams) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + indexRecentParams := &types.IndexRecentParams{} + nullify.Fill(&indexRecentParams) + state.IndexRecentParams = indexRecentParams + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), *state.IndexRecentParams +} + +func TestShowIndexRecentParams(t *testing.T) { + net, obj := networkWithIndexRecentParamsObjects(t) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + args []string + err error + obj types.IndexRecentParams + }{ + { + desc: "get", + args: common, + obj: obj, + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + var args []string + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowIndexRecentParams(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetIndexRecentParamsResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.IndexRecentParams) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.IndexRecentParams), + ) + } + }) + } +} diff --git a/x/oracle/client/cli/query_recent_msg.go b/x/oracle/client/cli/query_recent_msg.go new file mode 100644 index 000000000..bdad4a8b1 --- /dev/null +++ b/x/oracle/client/cli/query_recent_msg.go @@ -0,0 +1,82 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/spf13/cast" +) + +func CmdListRecentMsg() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-recent-msg", + Short: "list all recentMsg", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllRecentMsgRequest{ + Pagination: pageReq, + } + + res, err := queryClient.RecentMsgAll(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowRecentMsg() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-recent-msg [block]", + Short: "shows a recentMsg", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + argBlock, err := cast.ToUint64E(args[0]) + if err != nil { + return err + } + + params := &types.QueryGetRecentMsgRequest{ + Block: argBlock, + } + + res, err := queryClient.RecentMsg(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_recent_msg_test.go b/x/oracle/client/cli/query_recent_msg_test.go new file mode 100644 index 000000000..4d2623958 --- /dev/null +++ b/x/oracle/client/cli/query_recent_msg_test.go @@ -0,0 +1,160 @@ +package cli_test + +import ( + "fmt" + "strconv" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func networkWithRecentMsgObjects(t *testing.T, n int) (*network.Network, []types.RecentMsg) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + for i := 0; i < n; i++ { + recentMsg := types.RecentMsg{ + Block: uint64(i), + } + nullify.Fill(&recentMsg) + state.RecentMsgList = append(state.RecentMsgList, recentMsg) + } + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.RecentMsgList +} + +func TestShowRecentMsg(t *testing.T) { + net, objs := networkWithRecentMsgObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + idBlock uint64 + + args []string + err error + obj types.RecentMsg + }{ + { + desc: "found", + idBlock: objs[0].Block, + + args: common, + obj: objs[0], + }, + { + desc: "not found", + idBlock: 100000, + + args: common, + err: status.Error(codes.NotFound, "not found"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + args := []string{ + strconv.Itoa(int(tc.idBlock)), + } + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowRecentMsg(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetRecentMsgResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.RecentMsg) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.RecentMsg), + ) + } + }) + } +} + +func TestListRecentMsg(t *testing.T) { + net, objs := networkWithRecentMsgObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(objs); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRecentMsg(), args) + require.NoError(t, err) + var resp types.QueryAllRecentMsgResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.RecentMsg), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.RecentMsg), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRecentMsg(), args) + require.NoError(t, err) + var resp types.QueryAllRecentMsgResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.RecentMsg), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.RecentMsg), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(objs)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRecentMsg(), args) + require.NoError(t, err) + var resp types.QueryAllRecentMsgResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(objs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(objs), + nullify.Fill(resp.RecentMsg), + ) + }) +} diff --git a/x/oracle/client/cli/query_recent_params.go b/x/oracle/client/cli/query_recent_params.go new file mode 100644 index 000000000..04f848658 --- /dev/null +++ b/x/oracle/client/cli/query_recent_params.go @@ -0,0 +1,82 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/spf13/cast" +) + +func CmdListRecentParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-recent-params", + Short: "list all recentParams", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllRecentParamsRequest{ + Pagination: pageReq, + } + + res, err := queryClient.RecentParamsAll(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowRecentParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-recent-params [block]", + Short: "shows a recentParams", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + argBlock, err := cast.ToUint64E(args[0]) + if err != nil { + return err + } + + params := &types.QueryGetRecentParamsRequest{ + Block: argBlock, + } + + res, err := queryClient.RecentParams(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_recent_params_test.go b/x/oracle/client/cli/query_recent_params_test.go new file mode 100644 index 000000000..332910d90 --- /dev/null +++ b/x/oracle/client/cli/query_recent_params_test.go @@ -0,0 +1,160 @@ +package cli_test + +import ( + "fmt" + "strconv" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func networkWithRecentParamsObjects(t *testing.T, n int) (*network.Network, []types.RecentParams) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + for i := 0; i < n; i++ { + recentParams := types.RecentParams{ + Block: uint64(i), + } + nullify.Fill(&recentParams) + state.RecentParamsList = append(state.RecentParamsList, recentParams) + } + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.RecentParamsList +} + +func TestShowRecentParams(t *testing.T) { + net, objs := networkWithRecentParamsObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + idBlock uint64 + + args []string + err error + obj types.RecentParams + }{ + { + desc: "found", + idBlock: objs[0].Block, + + args: common, + obj: objs[0], + }, + { + desc: "not found", + idBlock: 100000, + + args: common, + err: status.Error(codes.NotFound, "not found"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + args := []string{ + strconv.Itoa(int(tc.idBlock)), + } + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowRecentParams(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetRecentParamsResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.RecentParams) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.RecentParams), + ) + } + }) + } +} + +func TestListRecentParams(t *testing.T) { + net, objs := networkWithRecentParamsObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(objs); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRecentParams(), args) + require.NoError(t, err) + var resp types.QueryAllRecentParamsResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.RecentParams), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.RecentParams), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRecentParams(), args) + require.NoError(t, err) + var resp types.QueryAllRecentParamsResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.RecentParams), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.RecentParams), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(objs)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRecentParams(), args) + require.NoError(t, err) + var resp types.QueryAllRecentParamsResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(objs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(objs), + nullify.Fill(resp.RecentParams), + ) + }) +} diff --git a/x/oracle/client/cli/query_validator_update_block.go b/x/oracle/client/cli/query_validator_update_block.go new file mode 100644 index 000000000..c6ed7ff9d --- /dev/null +++ b/x/oracle/client/cli/query_validator_update_block.go @@ -0,0 +1,38 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func CmdShowValidatorUpdateBlock() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-validator-update-block", + Short: "shows validatorUpdateBlock", + 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) + + params := &types.QueryGetValidatorUpdateBlockRequest{} + + res, err := queryClient.ValidatorUpdateBlock(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_validator_update_block_test.go b/x/oracle/client/cli/query_validator_update_block_test.go new file mode 100644 index 000000000..02ed90808 --- /dev/null +++ b/x/oracle/client/cli/query_validator_update_block_test.go @@ -0,0 +1,71 @@ +package cli_test + +import ( + "fmt" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func networkWithValidatorUpdateBlockObjects(t *testing.T) (*network.Network, types.ValidatorUpdateBlock) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + validatorUpdateBlock := &types.ValidatorUpdateBlock{} + nullify.Fill(&validatorUpdateBlock) + state.ValidatorUpdateBlock = validatorUpdateBlock + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), *state.ValidatorUpdateBlock +} + +func TestShowValidatorUpdateBlock(t *testing.T) { + net, obj := networkWithValidatorUpdateBlockObjects(t) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + args []string + err error + obj types.ValidatorUpdateBlock + }{ + { + desc: "get", + args: common, + obj: obj, + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + var args []string + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowValidatorUpdateBlock(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetValidatorUpdateBlockResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.ValidatorUpdateBlock) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.ValidatorUpdateBlock), + ) + } + }) + } +} diff --git a/x/oracle/genesis.go b/x/oracle/genesis.go index 297162385..8681cd2cf 100644 --- a/x/oracle/genesis.go +++ b/x/oracle/genesis.go @@ -16,6 +16,26 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) if genState.Validators != nil { k.SetValidators(ctx, *genState.Validators) } + // Set if defined + if genState.ValidatorUpdateBlock != nil { + k.SetValidatorUpdateBlock(ctx, *genState.ValidatorUpdateBlock) + } + // Set if defined + if genState.IndexRecentParams != nil { + k.SetIndexRecentParams(ctx, *genState.IndexRecentParams) + } + // Set if defined + if genState.IndexRecentMsg != nil { + k.SetIndexRecentMsg(ctx, *genState.IndexRecentMsg) + } + // Set all the recentMsg + for _, elem := range genState.RecentMsgList { + k.SetRecentMsg(ctx, elem) + } + // Set all the recentParams + for _, elem := range genState.RecentParamsList { + k.SetRecentParams(ctx, elem) + } // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, genState.Params) } @@ -31,6 +51,23 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { if found { genesis.Validators = &validators } + // Get all validatorUpdateBlock + validatorUpdateBlock, found := k.GetValidatorUpdateBlock(ctx) + if found { + genesis.ValidatorUpdateBlock = &validatorUpdateBlock + } + // Get all indexRecentParams + indexRecentParams, found := k.GetIndexRecentParams(ctx) + if found { + genesis.IndexRecentParams = &indexRecentParams + } + // Get all indexRecentMsg + indexRecentMsg, found := k.GetIndexRecentMsg(ctx) + if found { + genesis.IndexRecentMsg = &indexRecentMsg + } + genesis.RecentMsgList = k.GetAllRecentMsg(ctx) + genesis.RecentParamsList = k.GetAllRecentParams(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/oracle/genesis_test.go b/x/oracle/genesis_test.go index 1c2e97025..cb7f13414 100644 --- a/x/oracle/genesis_test.go +++ b/x/oracle/genesis_test.go @@ -25,6 +25,25 @@ func TestGenesis(t *testing.T) { Validators: &types.Validators{ Block: 42, }, + ValidatorUpdateBlock: &types.ValidatorUpdateBlock{}, + IndexRecentParams: &types.IndexRecentParams{}, + IndexRecentMsg: &types.IndexRecentMsg{}, + RecentMsgList: []types.RecentMsg{ + { + Block: 0, + }, + { + Block: 1, + }, + }, + RecentParamsList: []types.RecentParams{ + { + Block: 0, + }, + { + Block: 1, + }, + }, // this line is used by starport scaffolding # genesis/test/state } @@ -38,5 +57,10 @@ func TestGenesis(t *testing.T) { require.ElementsMatch(t, genesisState.PricesList, got.PricesList) require.Equal(t, genesisState.Validators, got.Validators) + require.Equal(t, genesisState.ValidatorUpdateBlock, got.ValidatorUpdateBlock) + require.Equal(t, genesisState.IndexRecentParams, got.IndexRecentParams) + require.Equal(t, genesisState.IndexRecentMsg, got.IndexRecentMsg) + require.ElementsMatch(t, genesisState.RecentMsgList, got.RecentMsgList) + require.ElementsMatch(t, genesisState.RecentParamsList, got.RecentParamsList) // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/oracle/keeper/index_recent_msg.go b/x/oracle/keeper/index_recent_msg.go new file mode 100644 index 000000000..b12dc77f7 --- /dev/null +++ b/x/oracle/keeper/index_recent_msg.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetIndexRecentMsg set indexRecentMsg in the store +func (k Keeper) SetIndexRecentMsg(ctx sdk.Context, indexRecentMsg types.IndexRecentMsg) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.IndexRecentMsgKey)) + b := k.cdc.MustMarshal(&indexRecentMsg) + store.Set([]byte{0}, b) +} + +// GetIndexRecentMsg returns indexRecentMsg +func (k Keeper) GetIndexRecentMsg(ctx sdk.Context) (val types.IndexRecentMsg, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.IndexRecentMsgKey)) + + b := store.Get([]byte{0}) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveIndexRecentMsg removes indexRecentMsg from the store +func (k Keeper) RemoveIndexRecentMsg(ctx sdk.Context) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.IndexRecentMsgKey)) + store.Delete([]byte{0}) +} diff --git a/x/oracle/keeper/index_recent_msg_test.go b/x/oracle/keeper/index_recent_msg_test.go new file mode 100644 index 000000000..9f7db965c --- /dev/null +++ b/x/oracle/keeper/index_recent_msg_test.go @@ -0,0 +1,38 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func createTestIndexRecentMsg(keeper *keeper.Keeper, ctx sdk.Context) types.IndexRecentMsg { + item := types.IndexRecentMsg{} + keeper.SetIndexRecentMsg(ctx, item) + return item +} + +func TestIndexRecentMsgGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + item := createTestIndexRecentMsg(keeper, ctx) + rst, found := keeper.GetIndexRecentMsg(ctx) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) +} + +func TestIndexRecentMsgRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + createTestIndexRecentMsg(keeper, ctx) + keeper.RemoveIndexRecentMsg(ctx) + _, found := keeper.GetIndexRecentMsg(ctx) + require.False(t, found) +} diff --git a/x/oracle/keeper/index_recent_params.go b/x/oracle/keeper/index_recent_params.go new file mode 100644 index 000000000..8bf433e79 --- /dev/null +++ b/x/oracle/keeper/index_recent_params.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetIndexRecentParams set indexRecentParams in the store +func (k Keeper) SetIndexRecentParams(ctx sdk.Context, indexRecentParams types.IndexRecentParams) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.IndexRecentParamsKey)) + b := k.cdc.MustMarshal(&indexRecentParams) + store.Set([]byte{0}, b) +} + +// GetIndexRecentParams returns indexRecentParams +func (k Keeper) GetIndexRecentParams(ctx sdk.Context) (val types.IndexRecentParams, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.IndexRecentParamsKey)) + + b := store.Get([]byte{0}) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveIndexRecentParams removes indexRecentParams from the store +func (k Keeper) RemoveIndexRecentParams(ctx sdk.Context) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.IndexRecentParamsKey)) + store.Delete([]byte{0}) +} diff --git a/x/oracle/keeper/index_recent_params_test.go b/x/oracle/keeper/index_recent_params_test.go new file mode 100644 index 000000000..89f5f2a7c --- /dev/null +++ b/x/oracle/keeper/index_recent_params_test.go @@ -0,0 +1,38 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func createTestIndexRecentParams(keeper *keeper.Keeper, ctx sdk.Context) types.IndexRecentParams { + item := types.IndexRecentParams{} + keeper.SetIndexRecentParams(ctx, item) + return item +} + +func TestIndexRecentParamsGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + item := createTestIndexRecentParams(keeper, ctx) + rst, found := keeper.GetIndexRecentParams(ctx) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) +} + +func TestIndexRecentParamsRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + createTestIndexRecentParams(keeper, ctx) + keeper.RemoveIndexRecentParams(ctx) + _, found := keeper.GetIndexRecentParams(ctx) + require.False(t, found) +} diff --git a/x/oracle/keeper/query_index_recent_msg.go b/x/oracle/keeper/query_index_recent_msg.go new file mode 100644 index 000000000..ab769f077 --- /dev/null +++ b/x/oracle/keeper/query_index_recent_msg.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) IndexRecentMsg(goCtx context.Context, req *types.QueryGetIndexRecentMsgRequest) (*types.QueryGetIndexRecentMsgResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetIndexRecentMsg(ctx) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetIndexRecentMsgResponse{IndexRecentMsg: val}, nil +} diff --git a/x/oracle/keeper/query_index_recent_msg_test.go b/x/oracle/keeper/query_index_recent_msg_test.go new file mode 100644 index 000000000..060c3ef07 --- /dev/null +++ b/x/oracle/keeper/query_index_recent_msg_test.go @@ -0,0 +1,50 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func TestIndexRecentMsgQuery(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + item := createTestIndexRecentMsg(keeper, ctx) + tests := []struct { + desc string + request *types.QueryGetIndexRecentMsgRequest + response *types.QueryGetIndexRecentMsgResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetIndexRecentMsgRequest{}, + response: &types.QueryGetIndexRecentMsgResponse{IndexRecentMsg: item}, + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.IndexRecentMsg(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} diff --git a/x/oracle/keeper/query_index_recent_params.go b/x/oracle/keeper/query_index_recent_params.go new file mode 100644 index 000000000..012e6f0fe --- /dev/null +++ b/x/oracle/keeper/query_index_recent_params.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) IndexRecentParams(goCtx context.Context, req *types.QueryGetIndexRecentParamsRequest) (*types.QueryGetIndexRecentParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetIndexRecentParams(ctx) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetIndexRecentParamsResponse{IndexRecentParams: val}, nil +} diff --git a/x/oracle/keeper/query_index_recent_params_test.go b/x/oracle/keeper/query_index_recent_params_test.go new file mode 100644 index 000000000..f934a4ba2 --- /dev/null +++ b/x/oracle/keeper/query_index_recent_params_test.go @@ -0,0 +1,50 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func TestIndexRecentParamsQuery(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + item := createTestIndexRecentParams(keeper, ctx) + tests := []struct { + desc string + request *types.QueryGetIndexRecentParamsRequest + response *types.QueryGetIndexRecentParamsResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetIndexRecentParamsRequest{}, + response: &types.QueryGetIndexRecentParamsResponse{IndexRecentParams: item}, + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.IndexRecentParams(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} diff --git a/x/oracle/keeper/query_recent_msg.go b/x/oracle/keeper/query_recent_msg.go new file mode 100644 index 000000000..7f8e34d3f --- /dev/null +++ b/x/oracle/keeper/query_recent_msg.go @@ -0,0 +1,57 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) RecentMsgAll(goCtx context.Context, req *types.QueryAllRecentMsgRequest) (*types.QueryAllRecentMsgResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var recentMsgs []types.RecentMsg + ctx := sdk.UnwrapSDKContext(goCtx) + + store := ctx.KVStore(k.storeKey) + recentMsgStore := prefix.NewStore(store, types.KeyPrefix(types.RecentMsgKeyPrefix)) + + pageRes, err := query.Paginate(recentMsgStore, req.Pagination, func(key []byte, value []byte) error { + var recentMsg types.RecentMsg + if err := k.cdc.Unmarshal(value, &recentMsg); err != nil { + return err + } + + recentMsgs = append(recentMsgs, recentMsg) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllRecentMsgResponse{RecentMsg: recentMsgs, Pagination: pageRes}, nil +} + +func (k Keeper) RecentMsg(goCtx context.Context, req *types.QueryGetRecentMsgRequest) (*types.QueryGetRecentMsgResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetRecentMsg( + ctx, + req.Block, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetRecentMsgResponse{RecentMsg: val}, nil +} diff --git a/x/oracle/keeper/query_recent_msg_test.go b/x/oracle/keeper/query_recent_msg_test.go new file mode 100644 index 000000000..ba8538963 --- /dev/null +++ b/x/oracle/keeper/query_recent_msg_test.go @@ -0,0 +1,127 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestRecentMsgQuerySingle(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNRecentMsg(keeper, ctx, 2) + tests := []struct { + desc string + request *types.QueryGetRecentMsgRequest + response *types.QueryGetRecentMsgResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetRecentMsgRequest{ + Block: msgs[0].Block, + }, + response: &types.QueryGetRecentMsgResponse{RecentMsg: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetRecentMsgRequest{ + Block: msgs[1].Block, + }, + response: &types.QueryGetRecentMsgResponse{RecentMsg: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetRecentMsgRequest{ + Block: 100000, + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.RecentMsg(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} + +func TestRecentMsgQueryPaginated(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNRecentMsg(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllRecentMsgRequest { + return &types.QueryAllRecentMsgRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := keeper.RecentMsgAll(wctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.RecentMsg), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.RecentMsg), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.RecentMsgAll(wctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.RecentMsg), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.RecentMsg), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.RecentMsgAll(wctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(msgs), + nullify.Fill(resp.RecentMsg), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.RecentMsgAll(wctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/oracle/keeper/query_recent_params.go b/x/oracle/keeper/query_recent_params.go new file mode 100644 index 000000000..bb831d6d7 --- /dev/null +++ b/x/oracle/keeper/query_recent_params.go @@ -0,0 +1,57 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) RecentParamsAll(goCtx context.Context, req *types.QueryAllRecentParamsRequest) (*types.QueryAllRecentParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var recentParamss []types.RecentParams + ctx := sdk.UnwrapSDKContext(goCtx) + + store := ctx.KVStore(k.storeKey) + recentParamsStore := prefix.NewStore(store, types.KeyPrefix(types.RecentParamsKeyPrefix)) + + pageRes, err := query.Paginate(recentParamsStore, req.Pagination, func(key []byte, value []byte) error { + var recentParams types.RecentParams + if err := k.cdc.Unmarshal(value, &recentParams); err != nil { + return err + } + + recentParamss = append(recentParamss, recentParams) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllRecentParamsResponse{RecentParams: recentParamss, Pagination: pageRes}, nil +} + +func (k Keeper) RecentParams(goCtx context.Context, req *types.QueryGetRecentParamsRequest) (*types.QueryGetRecentParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetRecentParams( + ctx, + req.Block, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetRecentParamsResponse{RecentParams: val}, nil +} diff --git a/x/oracle/keeper/query_recent_params_test.go b/x/oracle/keeper/query_recent_params_test.go new file mode 100644 index 000000000..f7969f3e5 --- /dev/null +++ b/x/oracle/keeper/query_recent_params_test.go @@ -0,0 +1,127 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestRecentParamsQuerySingle(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNRecentParams(keeper, ctx, 2) + tests := []struct { + desc string + request *types.QueryGetRecentParamsRequest + response *types.QueryGetRecentParamsResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetRecentParamsRequest{ + Block: msgs[0].Block, + }, + response: &types.QueryGetRecentParamsResponse{RecentParams: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetRecentParamsRequest{ + Block: msgs[1].Block, + }, + response: &types.QueryGetRecentParamsResponse{RecentParams: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetRecentParamsRequest{ + Block: 100000, + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.RecentParams(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} + +func TestRecentParamsQueryPaginated(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNRecentParams(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllRecentParamsRequest { + return &types.QueryAllRecentParamsRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := keeper.RecentParamsAll(wctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.RecentParams), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.RecentParams), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.RecentParamsAll(wctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.RecentParams), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.RecentParams), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.RecentParamsAll(wctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(msgs), + nullify.Fill(resp.RecentParams), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.RecentParamsAll(wctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/oracle/keeper/query_validator_update_block.go b/x/oracle/keeper/query_validator_update_block.go new file mode 100644 index 000000000..241b409dc --- /dev/null +++ b/x/oracle/keeper/query_validator_update_block.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) ValidatorUpdateBlock(goCtx context.Context, req *types.QueryGetValidatorUpdateBlockRequest) (*types.QueryGetValidatorUpdateBlockResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetValidatorUpdateBlock(ctx) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetValidatorUpdateBlockResponse{ValidatorUpdateBlock: val}, nil +} diff --git a/x/oracle/keeper/query_validator_update_block_test.go b/x/oracle/keeper/query_validator_update_block_test.go new file mode 100644 index 000000000..27cc458e0 --- /dev/null +++ b/x/oracle/keeper/query_validator_update_block_test.go @@ -0,0 +1,50 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func TestValidatorUpdateBlockQuery(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + item := createTestValidatorUpdateBlock(keeper, ctx) + tests := []struct { + desc string + request *types.QueryGetValidatorUpdateBlockRequest + response *types.QueryGetValidatorUpdateBlockResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetValidatorUpdateBlockRequest{}, + response: &types.QueryGetValidatorUpdateBlockResponse{ValidatorUpdateBlock: item}, + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.ValidatorUpdateBlock(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} diff --git a/x/oracle/keeper/recent_msg.go b/x/oracle/keeper/recent_msg.go new file mode 100644 index 000000000..5b24213b4 --- /dev/null +++ b/x/oracle/keeper/recent_msg.go @@ -0,0 +1,63 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetRecentMsg set a specific recentMsg in the store from its index +func (k Keeper) SetRecentMsg(ctx sdk.Context, recentMsg types.RecentMsg) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentMsgKeyPrefix)) + b := k.cdc.MustMarshal(&recentMsg) + store.Set(types.RecentMsgKey( + recentMsg.Block, + ), b) +} + +// GetRecentMsg returns a recentMsg from its index +func (k Keeper) GetRecentMsg( + ctx sdk.Context, + block uint64, + +) (val types.RecentMsg, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentMsgKeyPrefix)) + + b := store.Get(types.RecentMsgKey( + block, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveRecentMsg removes a recentMsg from the store +func (k Keeper) RemoveRecentMsg( + ctx sdk.Context, + block uint64, + +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentMsgKeyPrefix)) + store.Delete(types.RecentMsgKey( + block, + )) +} + +// GetAllRecentMsg returns all recentMsg +func (k Keeper) GetAllRecentMsg(ctx sdk.Context) (list []types.RecentMsg) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentMsgKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.RecentMsg + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/oracle/keeper/recent_msg_test.go b/x/oracle/keeper/recent_msg_test.go new file mode 100644 index 000000000..5304b976f --- /dev/null +++ b/x/oracle/keeper/recent_msg_test.go @@ -0,0 +1,63 @@ +package keeper_test + +import ( + "strconv" + "testing" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNRecentMsg(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.RecentMsg { + items := make([]types.RecentMsg, n) + for i := range items { + items[i].Block = uint64(i) + + keeper.SetRecentMsg(ctx, items[i]) + } + return items +} + +func TestRecentMsgGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRecentMsg(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetRecentMsg(ctx, + item.Block, + ) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) + } +} +func TestRecentMsgRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRecentMsg(keeper, ctx, 10) + for _, item := range items { + keeper.RemoveRecentMsg(ctx, + item.Block, + ) + _, found := keeper.GetRecentMsg(ctx, + item.Block, + ) + require.False(t, found) + } +} + +func TestRecentMsgGetAll(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRecentMsg(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllRecentMsg(ctx)), + ) +} diff --git a/x/oracle/keeper/recent_params.go b/x/oracle/keeper/recent_params.go new file mode 100644 index 000000000..04c9afa9a --- /dev/null +++ b/x/oracle/keeper/recent_params.go @@ -0,0 +1,63 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetRecentParams set a specific recentParams in the store from its index +func (k Keeper) SetRecentParams(ctx sdk.Context, recentParams types.RecentParams) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentParamsKeyPrefix)) + b := k.cdc.MustMarshal(&recentParams) + store.Set(types.RecentParamsKey( + recentParams.Block, + ), b) +} + +// GetRecentParams returns a recentParams from its index +func (k Keeper) GetRecentParams( + ctx sdk.Context, + block uint64, + +) (val types.RecentParams, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentParamsKeyPrefix)) + + b := store.Get(types.RecentParamsKey( + block, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveRecentParams removes a recentParams from the store +func (k Keeper) RemoveRecentParams( + ctx sdk.Context, + block uint64, + +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentParamsKeyPrefix)) + store.Delete(types.RecentParamsKey( + block, + )) +} + +// GetAllRecentParams returns all recentParams +func (k Keeper) GetAllRecentParams(ctx sdk.Context) (list []types.RecentParams) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentParamsKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.RecentParams + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/oracle/keeper/recent_params_test.go b/x/oracle/keeper/recent_params_test.go new file mode 100644 index 000000000..26ee1a8d9 --- /dev/null +++ b/x/oracle/keeper/recent_params_test.go @@ -0,0 +1,63 @@ +package keeper_test + +import ( + "strconv" + "testing" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNRecentParams(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.RecentParams { + items := make([]types.RecentParams, n) + for i := range items { + items[i].Block = uint64(i) + + keeper.SetRecentParams(ctx, items[i]) + } + return items +} + +func TestRecentParamsGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRecentParams(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetRecentParams(ctx, + item.Block, + ) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) + } +} +func TestRecentParamsRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRecentParams(keeper, ctx, 10) + for _, item := range items { + keeper.RemoveRecentParams(ctx, + item.Block, + ) + _, found := keeper.GetRecentParams(ctx, + item.Block, + ) + require.False(t, found) + } +} + +func TestRecentParamsGetAll(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRecentParams(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllRecentParams(ctx)), + ) +} diff --git a/x/oracle/keeper/validator_update_block.go b/x/oracle/keeper/validator_update_block.go new file mode 100644 index 000000000..86d83af1b --- /dev/null +++ b/x/oracle/keeper/validator_update_block.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetValidatorUpdateBlock set validatorUpdateBlock in the store +func (k Keeper) SetValidatorUpdateBlock(ctx sdk.Context, validatorUpdateBlock types.ValidatorUpdateBlock) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorUpdateBlockKey)) + b := k.cdc.MustMarshal(&validatorUpdateBlock) + store.Set([]byte{0}, b) +} + +// GetValidatorUpdateBlock returns validatorUpdateBlock +func (k Keeper) GetValidatorUpdateBlock(ctx sdk.Context) (val types.ValidatorUpdateBlock, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorUpdateBlockKey)) + + b := store.Get([]byte{0}) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveValidatorUpdateBlock removes validatorUpdateBlock from the store +func (k Keeper) RemoveValidatorUpdateBlock(ctx sdk.Context) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorUpdateBlockKey)) + store.Delete([]byte{0}) +} diff --git a/x/oracle/keeper/validator_update_block_test.go b/x/oracle/keeper/validator_update_block_test.go new file mode 100644 index 000000000..56bd66356 --- /dev/null +++ b/x/oracle/keeper/validator_update_block_test.go @@ -0,0 +1,38 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func createTestValidatorUpdateBlock(keeper *keeper.Keeper, ctx sdk.Context) types.ValidatorUpdateBlock { + item := types.ValidatorUpdateBlock{} + keeper.SetValidatorUpdateBlock(ctx, item) + return item +} + +func TestValidatorUpdateBlockGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + item := createTestValidatorUpdateBlock(keeper, ctx) + rst, found := keeper.GetValidatorUpdateBlock(ctx) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) +} + +func TestValidatorUpdateBlockRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + createTestValidatorUpdateBlock(keeper, ctx) + keeper.RemoveValidatorUpdateBlock(ctx) + _, found := keeper.GetValidatorUpdateBlock(ctx) + require.False(t, found) +} diff --git a/x/oracle/types/genesis.go b/x/oracle/types/genesis.go index 24003d88b..39a0bdd60 100644 --- a/x/oracle/types/genesis.go +++ b/x/oracle/types/genesis.go @@ -10,8 +10,13 @@ const DefaultIndex uint64 = 1 // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - PricesList: []Prices{}, - Validators: nil, + PricesList: []Prices{}, + Validators: nil, + ValidatorUpdateBlock: nil, + IndexRecentParams: nil, + IndexRecentMsg: nil, + RecentMsgList: []RecentMsg{}, + RecentParamsList: []RecentParams{}, // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } @@ -30,6 +35,26 @@ func (gs GenesisState) Validate() error { } pricesIndexMap[index] = struct{}{} } + // Check for duplicated index in recentMsg + recentMsgIndexMap := make(map[string]struct{}) + + for _, elem := range gs.RecentMsgList { + index := string(RecentMsgKey(elem.Block)) + if _, ok := recentMsgIndexMap[index]; ok { + return fmt.Errorf("duplicated index for recentMsg") + } + recentMsgIndexMap[index] = struct{}{} + } + // Check for duplicated index in recentParams + recentParamsIndexMap := make(map[string]struct{}) + + for _, elem := range gs.RecentParamsList { + index := string(RecentParamsKey(elem.Block)) + if _, ok := recentParamsIndexMap[index]; ok { + return fmt.Errorf("duplicated index for recentParams") + } + recentParamsIndexMap[index] = struct{}{} + } // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go index 0da8b4a5c..36d367c03 100644 --- a/x/oracle/types/genesis.pb.go +++ b/x/oracle/types/genesis.pb.go @@ -28,7 +28,12 @@ type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` PricesList []Prices `protobuf:"bytes,2,rep,name=pricesList,proto3" json:"pricesList"` //TODO: userDefinedTokenFeeder - Validators *Validators `protobuf:"bytes,3,opt,name=validators,proto3" json:"validators,omitempty"` + Validators *Validators `protobuf:"bytes,3,opt,name=validators,proto3" json:"validators,omitempty"` + ValidatorUpdateBlock *ValidatorUpdateBlock `protobuf:"bytes,4,opt,name=validatorUpdateBlock,proto3" json:"validatorUpdateBlock,omitempty"` + IndexRecentParams *IndexRecentParams `protobuf:"bytes,5,opt,name=indexRecentParams,proto3" json:"indexRecentParams,omitempty"` + IndexRecentMsg *IndexRecentMsg `protobuf:"bytes,6,opt,name=indexRecentMsg,proto3" json:"indexRecentMsg,omitempty"` + RecentMsgList []RecentMsg `protobuf:"bytes,7,rep,name=recentMsgList,proto3" json:"recentMsgList"` + RecentParamsList []RecentParams `protobuf:"bytes,8,rep,name=recentParamsList,proto3" json:"recentParamsList"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -85,6 +90,41 @@ func (m *GenesisState) GetValidators() *Validators { return nil } +func (m *GenesisState) GetValidatorUpdateBlock() *ValidatorUpdateBlock { + if m != nil { + return m.ValidatorUpdateBlock + } + return nil +} + +func (m *GenesisState) GetIndexRecentParams() *IndexRecentParams { + if m != nil { + return m.IndexRecentParams + } + return nil +} + +func (m *GenesisState) GetIndexRecentMsg() *IndexRecentMsg { + if m != nil { + return m.IndexRecentMsg + } + return nil +} + +func (m *GenesisState) GetRecentMsgList() []RecentMsg { + if m != nil { + return m.RecentMsgList + } + return nil +} + +func (m *GenesisState) GetRecentParamsList() []RecentParams { + if m != nil { + return m.RecentParamsList + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "exocore.oracle.GenesisState") } @@ -92,24 +132,34 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/genesis.proto", fileDescriptor_dbe067676c4dc0de) } var fileDescriptor_dbe067676c4dc0de = []byte{ - // 260 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xad, 0xc8, 0x4f, - 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, - 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xca, 0xea, 0x41, 0x64, 0xa5, - 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x94, 0x34, 0x9a, 0x19, - 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0xb8, 0x24, 0x8b, 0x32, 0x93, 0x53, 0x61, 0x92, 0xf2, 0x68, - 0x92, 0x65, 0x89, 0x39, 0x99, 0x29, 0x89, 0x25, 0xf9, 0x45, 0x50, 0x05, 0x4a, 0xfb, 0x18, 0xb9, - 0x78, 0xdc, 0x21, 0x4e, 0x0a, 0x2e, 0x49, 0x2c, 0x49, 0x15, 0x32, 0xe1, 0x62, 0x83, 0x18, 0x2f, - 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa6, 0x87, 0xea, 0x44, 0xbd, 0x00, 0xb0, 0xac, 0x13, - 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, 0x50, 0xb5, 0x42, 0x36, 0x5c, 0x5c, 0x10, 0x7b, 0x7d, 0x32, - 0x8b, 0x4b, 0x24, 0x98, 0x14, 0x98, 0xb1, 0xea, 0x04, 0xab, 0x80, 0xea, 0x44, 0x52, 0x2f, 0x64, - 0xc5, 0xc5, 0x85, 0x70, 0x98, 0x04, 0x33, 0xd8, 0x5e, 0x29, 0x74, 0xdd, 0x61, 0x70, 0x15, 0x41, - 0x48, 0xaa, 0x9d, 0xbc, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, - 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x20, - 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0xdf, 0x15, 0x62, 0x96, 0x5f, 0x6a, - 0x49, 0x79, 0x7e, 0x51, 0xb6, 0x3e, 0x2c, 0x54, 0x2a, 0x60, 0xe1, 0x52, 0x52, 0x59, 0x90, 0x5a, - 0x9c, 0xc4, 0x06, 0x0e, 0x13, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x6b, 0x02, 0xf0, - 0xb4, 0x01, 0x00, 0x00, + // 418 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0x5f, 0x4b, 0xeb, 0x30, + 0x1c, 0x86, 0xdb, 0xb3, 0x9d, 0x9d, 0x43, 0xd4, 0xa1, 0x61, 0x48, 0x9d, 0xa3, 0x9b, 0x43, 0x61, + 0x20, 0xb4, 0xa2, 0x5e, 0x89, 0x57, 0x83, 0x29, 0x8a, 0x9b, 0x52, 0x51, 0xc4, 0x9b, 0xd2, 0x75, + 0xa1, 0x96, 0xfd, 0x49, 0x49, 0x32, 0x9d, 0xdf, 0xc2, 0x8f, 0xb5, 0xcb, 0x5d, 0x7a, 0x25, 0xb2, + 0x7d, 0x11, 0x59, 0xda, 0xce, 0x36, 0x6b, 0x77, 0xd7, 0xf4, 0xf7, 0xbc, 0x4f, 0xd2, 0xb7, 0x01, + 0x25, 0x34, 0xc2, 0x36, 0x26, 0x48, 0xc7, 0xc4, 0xb2, 0x7b, 0x48, 0x77, 0xd0, 0x00, 0x51, 0x97, + 0x6a, 0x1e, 0xc1, 0x0c, 0xc3, 0x7c, 0x30, 0xd5, 0xfc, 0x69, 0xb1, 0xe0, 0x60, 0x07, 0xf3, 0x91, + 0x3e, 0x7f, 0xf2, 0xa9, 0xe2, 0xae, 0xe0, 0xf0, 0x2c, 0x62, 0xf5, 0x69, 0xda, 0x90, 0xb8, 0x36, + 0x0a, 0x87, 0x65, 0x61, 0xf8, 0x6a, 0xf5, 0xdc, 0x8e, 0xc5, 0x30, 0x09, 0x81, 0xc3, 0x34, 0xc0, + 0x1c, 0x7a, 0x1d, 0x8b, 0x21, 0xb3, 0xdd, 0xc3, 0x76, 0x37, 0x80, 0x6b, 0x02, 0xec, 0x0e, 0x3a, + 0x68, 0x64, 0x12, 0x64, 0xa3, 0x01, 0x33, 0x63, 0x87, 0x3a, 0x58, 0x45, 0xf6, 0xa9, 0x93, 0x72, + 0xbc, 0x25, 0xa0, 0x9a, 0x0c, 0x44, 0xf7, 0xaa, 0x8e, 0xb3, 0x60, 0xfd, 0xd2, 0x6f, 0xf5, 0x9e, + 0x59, 0x0c, 0xc1, 0x53, 0x90, 0xf3, 0x01, 0x45, 0xae, 0xc8, 0xb5, 0xb5, 0xe3, 0x6d, 0x2d, 0xde, + 0xb2, 0x76, 0xc7, 0xa7, 0xf5, 0xec, 0xf8, 0xab, 0x2c, 0x19, 0x01, 0x0b, 0xcf, 0x01, 0xf0, 0xab, + 0xbb, 0x71, 0x29, 0x53, 0xfe, 0x54, 0x32, 0x89, 0x49, 0x4e, 0x04, 0xc9, 0x08, 0x0f, 0xcf, 0x00, + 0xf8, 0xed, 0x56, 0xc9, 0xf0, 0x7d, 0x8b, 0x62, 0xfa, 0x71, 0x41, 0x18, 0x11, 0x1a, 0x3e, 0x81, + 0xc2, 0x62, 0xf5, 0xc0, 0x5b, 0xaf, 0xcf, 0x4b, 0x57, 0xb2, 0xdc, 0xb2, 0x9f, 0x6a, 0x89, 0xb0, + 0x46, 0xa2, 0x01, 0xde, 0x82, 0x2d, 0xde, 0xbc, 0xc1, 0x6b, 0xf3, 0x3f, 0x5b, 0xf9, 0xcb, 0xb5, + 0x7b, 0xa2, 0xf6, 0x4a, 0x04, 0x8d, 0xe5, 0x2c, 0xbc, 0x00, 0xf9, 0xc8, 0xcb, 0x26, 0x75, 0x94, + 0x1c, 0xb7, 0xa9, 0x2b, 0x6c, 0x4d, 0xea, 0x18, 0x42, 0x0a, 0x36, 0xc0, 0x06, 0x09, 0x17, 0xbc, + 0xef, 0x7f, 0xbc, 0xef, 0x1d, 0x51, 0xb3, 0x48, 0x04, 0x95, 0xc7, 0x53, 0xb0, 0x05, 0x36, 0x49, + 0xe4, 0x78, 0xdc, 0xf4, 0x9f, 0x9b, 0x4a, 0xc9, 0xa6, 0xd8, 0x9f, 0x5f, 0xca, 0xd6, 0xaf, 0xc7, + 0x53, 0x55, 0x9e, 0x4c, 0x55, 0xf9, 0x7b, 0xaa, 0xca, 0x1f, 0x33, 0x55, 0x9a, 0xcc, 0x54, 0xe9, + 0x73, 0xa6, 0x4a, 0xcf, 0x47, 0x8e, 0xcb, 0x5e, 0x86, 0x6d, 0xcd, 0xc6, 0x7d, 0xbd, 0xe1, 0x9b, + 0x5b, 0x88, 0xbd, 0x61, 0xd2, 0xd5, 0xc3, 0x2b, 0x3a, 0x0a, 0x2f, 0x29, 0x7b, 0xf7, 0x10, 0x6d, + 0xe7, 0xf8, 0xed, 0x3c, 0xf9, 0x09, 0x00, 0x00, 0xff, 0xff, 0x1d, 0x8f, 0xf7, 0xc1, 0x01, 0x04, + 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -132,6 +182,70 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.RecentParamsList) > 0 { + for iNdEx := len(m.RecentParamsList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RecentParamsList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if len(m.RecentMsgList) > 0 { + for iNdEx := len(m.RecentMsgList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RecentMsgList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if m.IndexRecentMsg != nil { + { + size, err := m.IndexRecentMsg.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.IndexRecentParams != nil { + { + size, err := m.IndexRecentParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.ValidatorUpdateBlock != nil { + { + size, err := m.ValidatorUpdateBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } if m.Validators != nil { { size, err := m.Validators.MarshalToSizedBuffer(dAtA[:i]) @@ -200,6 +314,30 @@ func (m *GenesisState) Size() (n int) { l = m.Validators.Size() n += 1 + l + sovGenesis(uint64(l)) } + if m.ValidatorUpdateBlock != nil { + l = m.ValidatorUpdateBlock.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.IndexRecentParams != nil { + l = m.IndexRecentParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.IndexRecentMsg != nil { + l = m.IndexRecentMsg.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.RecentMsgList) > 0 { + for _, e := range m.RecentMsgList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.RecentParamsList) > 0 { + for _, e := range m.RecentParamsList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -341,6 +479,182 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorUpdateBlock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorUpdateBlock == nil { + m.ValidatorUpdateBlock = &ValidatorUpdateBlock{} + } + if err := m.ValidatorUpdateBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IndexRecentParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IndexRecentParams == nil { + m.IndexRecentParams = &IndexRecentParams{} + } + if err := m.IndexRecentParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IndexRecentMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IndexRecentMsg == nil { + m.IndexRecentMsg = &IndexRecentMsg{} + } + if err := m.IndexRecentMsg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecentMsgList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RecentMsgList = append(m.RecentMsgList, RecentMsg{}) + if err := m.RecentMsgList[len(m.RecentMsgList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecentParamsList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RecentParamsList = append(m.RecentParamsList, RecentParams{}) + if err := m.RecentParamsList[len(m.RecentParamsList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/oracle/types/genesis_test.go b/x/oracle/types/genesis_test.go index 085e9708b..d04c2ad20 100644 --- a/x/oracle/types/genesis_test.go +++ b/x/oracle/types/genesis_test.go @@ -33,6 +33,25 @@ func TestGenesisState_Validate(t *testing.T) { Validators: &types.Validators{ Block: 45, }, + ValidatorUpdateBlock: &types.ValidatorUpdateBlock{}, + IndexRecentParams: &types.IndexRecentParams{}, + IndexRecentMsg: &types.IndexRecentMsg{}, + RecentMsgList: []types.RecentMsg{ + { + Block: 0, + }, + { + Block: 1, + }, + }, + RecentParamsList: []types.RecentParams{ + { + Block: 0, + }, + { + Block: 1, + }, + }, // this line is used by starport scaffolding # types/genesis/validField }, valid: true, @@ -51,6 +70,34 @@ func TestGenesisState_Validate(t *testing.T) { }, valid: false, }, + { + desc: "duplicated recentMsg", + genState: &types.GenesisState{ + RecentMsgList: []types.RecentMsg{ + { + Block: 0, + }, + { + Block: 0, + }, + }, + }, + valid: false, + }, + { + desc: "duplicated recentParams", + genState: &types.GenesisState{ + RecentParamsList: []types.RecentParams{ + { + Block: 0, + }, + { + Block: 0, + }, + }, + }, + valid: false, + }, // this line is used by starport scaffolding # types/genesis/testcase } for _, tc := range tests { diff --git a/x/oracle/types/index_recent_msg.pb.go b/x/oracle/types/index_recent_msg.pb.go new file mode 100644 index 000000000..379fbdc5d --- /dev/null +++ b/x/oracle/types/index_recent_msg.pb.go @@ -0,0 +1,375 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/index_recent_msg.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type IndexRecentMsg struct { + Index []uint64 `protobuf:"varint,1,rep,packed,name=index,proto3" json:"index,omitempty"` +} + +func (m *IndexRecentMsg) Reset() { *m = IndexRecentMsg{} } +func (m *IndexRecentMsg) String() string { return proto.CompactTextString(m) } +func (*IndexRecentMsg) ProtoMessage() {} +func (*IndexRecentMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_5de0367cab17dc5d, []int{0} +} +func (m *IndexRecentMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IndexRecentMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IndexRecentMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IndexRecentMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndexRecentMsg.Merge(m, src) +} +func (m *IndexRecentMsg) XXX_Size() int { + return m.Size() +} +func (m *IndexRecentMsg) XXX_DiscardUnknown() { + xxx_messageInfo_IndexRecentMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_IndexRecentMsg proto.InternalMessageInfo + +func (m *IndexRecentMsg) GetIndex() []uint64 { + if m != nil { + return m.Index + } + return nil +} + +func init() { + proto.RegisterType((*IndexRecentMsg)(nil), "exocore.oracle.IndexRecentMsg") +} + +func init() { + proto.RegisterFile("exocore/oracle/index_recent_msg.proto", fileDescriptor_5de0367cab17dc5d) +} + +var fileDescriptor_5de0367cab17dc5d = []byte{ + // 165 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0xcf, 0xcc, 0x4b, 0x49, 0xad, + 0x88, 0x2f, 0x4a, 0x4d, 0x4e, 0xcd, 0x2b, 0x89, 0xcf, 0x2d, 0x4e, 0xd7, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0xe2, 0x83, 0x2a, 0xd3, 0x83, 0x28, 0x53, 0x52, 0xe3, 0xe2, 0xf3, 0x04, 0xa9, 0x0c, + 0x02, 0x2b, 0xf4, 0x2d, 0x4e, 0x17, 0x12, 0xe1, 0x62, 0x05, 0xeb, 0x95, 0x60, 0x54, 0x60, 0xd6, + 0x60, 0x09, 0x82, 0x70, 0x9c, 0xbc, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, + 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, + 0xca, 0x20, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0xdf, 0x15, 0x62, 0xb8, + 0x5f, 0x6a, 0x49, 0x79, 0x7e, 0x51, 0xb6, 0x3e, 0xcc, 0x49, 0x15, 0x30, 0x47, 0x95, 0x54, 0x16, + 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x9d, 0x62, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xaf, 0xa3, 0x86, + 0x65, 0xb3, 0x00, 0x00, 0x00, +} + +func (m *IndexRecentMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IndexRecentMsg) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IndexRecentMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Index) > 0 { + dAtA2 := make([]byte, len(m.Index)*10) + var j1 int + for _, num := range m.Index { + for num >= 1<<7 { + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA2[j1] = uint8(num) + j1++ + } + i -= j1 + copy(dAtA[i:], dAtA2[:j1]) + i = encodeVarintIndexRecentMsg(dAtA, i, uint64(j1)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintIndexRecentMsg(dAtA []byte, offset int, v uint64) int { + offset -= sovIndexRecentMsg(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *IndexRecentMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Index) > 0 { + l = 0 + for _, e := range m.Index { + l += sovIndexRecentMsg(uint64(e)) + } + n += 1 + sovIndexRecentMsg(uint64(l)) + l + } + return n +} + +func sovIndexRecentMsg(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozIndexRecentMsg(x uint64) (n int) { + return sovIndexRecentMsg(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *IndexRecentMsg) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIndexRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IndexRecentMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IndexRecentMsg: 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 ErrIntOverflowIndexRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Index = append(m.Index, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIndexRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthIndexRecentMsg + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthIndexRecentMsg + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Index) == 0 { + m.Index = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIndexRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Index = append(m.Index, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipIndexRecentMsg(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIndexRecentMsg + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipIndexRecentMsg(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowIndexRecentMsg + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowIndexRecentMsg + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowIndexRecentMsg + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthIndexRecentMsg + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupIndexRecentMsg + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthIndexRecentMsg + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthIndexRecentMsg = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowIndexRecentMsg = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupIndexRecentMsg = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/index_recent_params.pb.go b/x/oracle/types/index_recent_params.pb.go new file mode 100644 index 000000000..e718b1a85 --- /dev/null +++ b/x/oracle/types/index_recent_params.pb.go @@ -0,0 +1,375 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/index_recent_params.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type IndexRecentParams struct { + Index []uint64 `protobuf:"varint,1,rep,packed,name=index,proto3" json:"index,omitempty"` +} + +func (m *IndexRecentParams) Reset() { *m = IndexRecentParams{} } +func (m *IndexRecentParams) String() string { return proto.CompactTextString(m) } +func (*IndexRecentParams) ProtoMessage() {} +func (*IndexRecentParams) Descriptor() ([]byte, []int) { + return fileDescriptor_1e3da2c92dc64d5c, []int{0} +} +func (m *IndexRecentParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IndexRecentParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IndexRecentParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IndexRecentParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndexRecentParams.Merge(m, src) +} +func (m *IndexRecentParams) XXX_Size() int { + return m.Size() +} +func (m *IndexRecentParams) XXX_DiscardUnknown() { + xxx_messageInfo_IndexRecentParams.DiscardUnknown(m) +} + +var xxx_messageInfo_IndexRecentParams proto.InternalMessageInfo + +func (m *IndexRecentParams) GetIndex() []uint64 { + if m != nil { + return m.Index + } + return nil +} + +func init() { + proto.RegisterType((*IndexRecentParams)(nil), "exocore.oracle.IndexRecentParams") +} + +func init() { + proto.RegisterFile("exocore/oracle/index_recent_params.proto", fileDescriptor_1e3da2c92dc64d5c) +} + +var fileDescriptor_1e3da2c92dc64d5c = []byte{ + // 168 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x48, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0xcf, 0xcc, 0x4b, 0x49, 0xad, + 0x88, 0x2f, 0x4a, 0x4d, 0x4e, 0xcd, 0x2b, 0x89, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xaa, 0xd4, 0x83, 0xa8, 0x54, 0xd2, 0xe4, 0x12, 0xf4, + 0x04, 0x29, 0x0e, 0x02, 0xab, 0x0d, 0x00, 0x2b, 0x15, 0x12, 0xe1, 0x62, 0x05, 0x9b, 0x20, 0xc1, + 0xa8, 0xc0, 0xac, 0xc1, 0x12, 0x04, 0xe1, 0x38, 0x79, 0x9d, 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, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0xbe, + 0x2b, 0xc4, 0x7c, 0xbf, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x98, 0xc3, 0x2a, 0x60, 0x4e, + 0x2b, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0xbb, 0xc6, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, + 0x47, 0xfe, 0xbc, 0x91, 0xb9, 0x00, 0x00, 0x00, +} + +func (m *IndexRecentParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IndexRecentParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IndexRecentParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Index) > 0 { + dAtA2 := make([]byte, len(m.Index)*10) + var j1 int + for _, num := range m.Index { + for num >= 1<<7 { + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA2[j1] = uint8(num) + j1++ + } + i -= j1 + copy(dAtA[i:], dAtA2[:j1]) + i = encodeVarintIndexRecentParams(dAtA, i, uint64(j1)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintIndexRecentParams(dAtA []byte, offset int, v uint64) int { + offset -= sovIndexRecentParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *IndexRecentParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Index) > 0 { + l = 0 + for _, e := range m.Index { + l += sovIndexRecentParams(uint64(e)) + } + n += 1 + sovIndexRecentParams(uint64(l)) + l + } + return n +} + +func sovIndexRecentParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozIndexRecentParams(x uint64) (n int) { + return sovIndexRecentParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *IndexRecentParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIndexRecentParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IndexRecentParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IndexRecentParams: 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 ErrIntOverflowIndexRecentParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Index = append(m.Index, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIndexRecentParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthIndexRecentParams + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthIndexRecentParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Index) == 0 { + m.Index = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIndexRecentParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Index = append(m.Index, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipIndexRecentParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIndexRecentParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipIndexRecentParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowIndexRecentParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowIndexRecentParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowIndexRecentParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthIndexRecentParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupIndexRecentParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthIndexRecentParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthIndexRecentParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowIndexRecentParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupIndexRecentParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/key_recent_msg.go b/x/oracle/types/key_recent_msg.go new file mode 100644 index 000000000..54b0cf28e --- /dev/null +++ b/x/oracle/types/key_recent_msg.go @@ -0,0 +1,24 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // RecentMsgKeyPrefix is the prefix to retrieve all RecentMsg + RecentMsgKeyPrefix = "RecentMsg/value/" +) + +// RecentMsgKey returns the store key to retrieve a RecentMsg from the index fields +func RecentMsgKey( + block uint64, +) []byte { + var key []byte + + blockBytes := make([]byte, 8) + binary.BigEndian.PutUint64(blockBytes, block) + key = append(key, blockBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/oracle/types/key_recent_params.go b/x/oracle/types/key_recent_params.go new file mode 100644 index 000000000..ad82f1cbe --- /dev/null +++ b/x/oracle/types/key_recent_params.go @@ -0,0 +1,24 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // RecentParamsKeyPrefix is the prefix to retrieve all RecentParams + RecentParamsKeyPrefix = "RecentParams/value/" +) + +// RecentParamsKey returns the store key to retrieve a RecentParams from the index fields +func RecentParamsKey( + block uint64, +) []byte { + var key []byte + + blockBytes := make([]byte, 8) + binary.BigEndian.PutUint64(blockBytes, block) + key = append(key, blockBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/oracle/types/keys.go b/x/oracle/types/keys.go index 051f87814..c80ab4aa1 100644 --- a/x/oracle/types/keys.go +++ b/x/oracle/types/keys.go @@ -21,3 +21,15 @@ func KeyPrefix(p string) []byte { const ( ValidatorsKey = "Validators/value/" ) + +const ( + ValidatorUpdateBlockKey = "ValidatorUpdateBlock/value/" +) + +const ( + IndexRecentParamsKey = "IndexRecentParams/value/" +) + +const ( + IndexRecentMsgKey = "IndexRecentMsg/value/" +) diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index fbc675be8..e86bfc5c1 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -377,622 +377,3053 @@ func (m *QueryGetValidatorsResponse) GetValidators() Validators { return Validators{} } -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "exocore.oracle.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "exocore.oracle.QueryParamsResponse") - proto.RegisterType((*QueryGetPricesRequest)(nil), "exocore.oracle.QueryGetPricesRequest") - proto.RegisterType((*QueryGetPricesResponse)(nil), "exocore.oracle.QueryGetPricesResponse") - proto.RegisterType((*QueryAllPricesRequest)(nil), "exocore.oracle.QueryAllPricesRequest") - proto.RegisterType((*QueryAllPricesResponse)(nil), "exocore.oracle.QueryAllPricesResponse") - proto.RegisterType((*QueryGetValidatorsRequest)(nil), "exocore.oracle.QueryGetValidatorsRequest") - proto.RegisterType((*QueryGetValidatorsResponse)(nil), "exocore.oracle.QueryGetValidatorsResponse") +type QueryGetValidatorUpdateBlockRequest struct { } -func init() { proto.RegisterFile("exocore/oracle/query.proto", fileDescriptor_f604621c8da1a6f3) } - -var fileDescriptor_f604621c8da1a6f3 = []byte{ - // 555 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xc1, 0x6b, 0xd4, 0x40, - 0x14, 0xc6, 0x37, 0xb5, 0x5d, 0x71, 0x04, 0x0f, 0x63, 0x2d, 0x35, 0x95, 0x54, 0x22, 0x6d, 0x6d, - 0xc5, 0x8c, 0x5b, 0x05, 0xaf, 0xb6, 0xa0, 0x45, 0x85, 0xb2, 0xee, 0xc1, 0x83, 0x07, 0x65, 0x36, - 0x1d, 0x62, 0x68, 0x36, 0x2f, 0xcd, 0xcc, 0xd6, 0x16, 0x11, 0xc4, 0x9b, 0xb7, 0x82, 0xa0, 0xff, - 0x8f, 0xa7, 0x1e, 0x0b, 0x5e, 0x3c, 0x89, 0xec, 0xfa, 0x87, 0xc8, 0xce, 0xbc, 0x74, 0x93, 0xec, - 0xa6, 0xbb, 0xb7, 0xcd, 0x7c, 0xdf, 0x7c, 0xef, 0x97, 0xf7, 0xde, 0x86, 0xd8, 0xe2, 0x08, 0x7c, - 0x48, 0x05, 0x83, 0x94, 0xfb, 0x91, 0x60, 0x07, 0x5d, 0x91, 0x1e, 0x7b, 0x49, 0x0a, 0x0a, 0xe8, - 0x35, 0xd4, 0x3c, 0xa3, 0xd9, 0xf3, 0x01, 0x04, 0xa0, 0x25, 0x36, 0xf8, 0x65, 0x5c, 0xf6, 0xad, - 0x00, 0x20, 0x88, 0x04, 0xe3, 0x49, 0xc8, 0x78, 0x1c, 0x83, 0xe2, 0x2a, 0x84, 0x58, 0xa2, 0xba, - 0xe1, 0x83, 0xec, 0x80, 0x64, 0x6d, 0x2e, 0x31, 0x9c, 0x1d, 0x36, 0xda, 0x42, 0xf1, 0x06, 0x4b, - 0x78, 0x10, 0xc6, 0xda, 0x8c, 0xde, 0xa5, 0x12, 0x4b, 0xc2, 0x53, 0xde, 0x91, 0x55, 0x62, 0x1a, - 0xfa, 0x22, 0x13, 0x97, 0x4b, 0xe2, 0x21, 0x8f, 0xc2, 0x3d, 0xae, 0x20, 0x45, 0x83, 0x3b, 0x4f, - 0xe8, 0xab, 0x41, 0xf1, 0xa6, 0x8e, 0x6c, 0x89, 0x83, 0xae, 0x90, 0xca, 0x7d, 0x49, 0xae, 0x17, - 0x4e, 0x65, 0x02, 0xb1, 0x14, 0xf4, 0x11, 0xa9, 0x9b, 0xd2, 0x8b, 0xd6, 0x6d, 0xeb, 0xee, 0xd5, - 0xcd, 0x05, 0xaf, 0xd8, 0x08, 0xcf, 0xf8, 0xb7, 0x67, 0x4f, 0xff, 0x2c, 0xd7, 0x5a, 0xe8, 0x75, - 0x1b, 0xe4, 0x86, 0x0e, 0xdb, 0x11, 0xaa, 0xa9, 0xd9, 0xb0, 0x0a, 0x5d, 0x24, 0x97, 0x15, 0xec, - 0x8b, 0xf8, 0xf9, 0x9e, 0xce, 0x9b, 0x6b, 0x65, 0x8f, 0xee, 0x2e, 0x59, 0x28, 0x5f, 0xc9, 0x21, - 0xe8, 0x93, 0x4a, 0x04, 0xad, 0x9e, 0x23, 0xe8, 0x27, 0xf7, 0x1d, 0x22, 0x6c, 0x45, 0x51, 0x11, - 0xe1, 0x19, 0x21, 0xc3, 0x6e, 0x63, 0xe4, 0xaa, 0x67, 0x46, 0xe3, 0x0d, 0x46, 0xe3, 0x99, 0xb9, - 0xe3, 0x68, 0xbc, 0x26, 0x0f, 0x04, 0xde, 0x6d, 0xe5, 0x6e, 0xba, 0x3f, 0x2c, 0x24, 0xce, 0x55, - 0x18, 0x43, 0x7c, 0x69, 0x5a, 0x62, 0xba, 0x53, 0x00, 0x9b, 0xd1, 0x60, 0x6b, 0x13, 0xc1, 0x4c, - 0xc9, 0x02, 0xd9, 0x12, 0xb9, 0x99, 0xb5, 0xf2, 0xf5, 0xf9, 0xf0, 0xb3, 0x39, 0xbf, 0x25, 0xf6, - 0x38, 0x11, 0xc9, 0x9f, 0x10, 0x32, 0x3c, 0xc5, 0xe6, 0xd8, 0x65, 0xfa, 0xa1, 0x03, 0xdf, 0x20, - 0x77, 0x67, 0xf3, 0xe7, 0x2c, 0x99, 0xd3, 0x05, 0xe8, 0x67, 0x8b, 0xd4, 0xcd, 0x76, 0x50, 0xb7, - 0x1c, 0x31, 0xba, 0x80, 0xf6, 0x9d, 0x0b, 0x3d, 0x86, 0xcf, 0xbd, 0xff, 0xe5, 0xd7, 0xbf, 0x6f, - 0x33, 0x6b, 0x74, 0x85, 0x3d, 0x35, 0xe6, 0x5d, 0xa1, 0x3e, 0x40, 0xba, 0xcf, 0xc6, 0xfe, 0x5d, - 0xe8, 0xc9, 0x00, 0xc1, 0x74, 0x77, 0x65, 0x6c, 0x7c, 0x79, 0x41, 0xed, 0xd5, 0x49, 0x36, 0x04, - 0x79, 0xac, 0x41, 0x1a, 0x94, 0x4d, 0x02, 0xd1, 0xd7, 0xd8, 0x47, 0x5c, 0xf3, 0x4f, 0xf4, 0xab, - 0x45, 0xae, 0x98, 0xac, 0xad, 0x28, 0xaa, 0xa0, 0x2a, 0xef, 0x6c, 0x05, 0xd5, 0xc8, 0xe2, 0x4d, - 0xdf, 0x1e, 0xd3, 0x93, 0xef, 0x56, 0x7e, 0xdc, 0x74, 0xbd, 0xea, 0xdd, 0x47, 0xb6, 0xc8, 0xde, - 0x98, 0xc6, 0x8a, 0x50, 0x0d, 0x0d, 0x75, 0x8f, 0xae, 0x4f, 0x80, 0x1a, 0x7e, 0xa8, 0xb6, 0x5f, - 0x9c, 0xf6, 0x1c, 0xeb, 0xac, 0xe7, 0x58, 0x7f, 0x7b, 0x8e, 0x75, 0xd2, 0x77, 0x6a, 0x67, 0x7d, - 0xa7, 0xf6, 0xbb, 0xef, 0xd4, 0xde, 0x3c, 0x08, 0x42, 0xf5, 0xbe, 0xdb, 0xf6, 0x7c, 0xe8, 0x54, - 0xc5, 0x1d, 0x65, 0x81, 0xea, 0x38, 0x11, 0xb2, 0x5d, 0xd7, 0x5f, 0xbd, 0x87, 0xff, 0x03, 0x00, - 0x00, 0xff, 0xff, 0xbf, 0xc1, 0xa4, 0xe2, 0xde, 0x05, 0x00, 0x00, +func (m *QueryGetValidatorUpdateBlockRequest) Reset() { *m = QueryGetValidatorUpdateBlockRequest{} } +func (m *QueryGetValidatorUpdateBlockRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetValidatorUpdateBlockRequest) ProtoMessage() {} +func (*QueryGetValidatorUpdateBlockRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{8} +} +func (m *QueryGetValidatorUpdateBlockRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetValidatorUpdateBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetValidatorUpdateBlockRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetValidatorUpdateBlockRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetValidatorUpdateBlockRequest.Merge(m, src) +} +func (m *QueryGetValidatorUpdateBlockRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetValidatorUpdateBlockRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetValidatorUpdateBlockRequest.DiscardUnknown(m) } -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn +var xxx_messageInfo_QueryGetValidatorUpdateBlockRequest proto.InternalMessageInfo -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +type QueryGetValidatorUpdateBlockResponse struct { + ValidatorUpdateBlock ValidatorUpdateBlock `protobuf:"bytes,1,opt,name=ValidatorUpdateBlock,proto3" json:"ValidatorUpdateBlock"` +} -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - // Parameters queries the parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Queries a list of Prices items. - Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) - PricesAll(ctx context.Context, in *QueryAllPricesRequest, opts ...grpc.CallOption) (*QueryAllPricesResponse, error) - // Queries a Validators by index. - Validators(ctx context.Context, in *QueryGetValidatorsRequest, opts ...grpc.CallOption) (*QueryGetValidatorsResponse, error) +func (m *QueryGetValidatorUpdateBlockResponse) Reset() { *m = QueryGetValidatorUpdateBlockResponse{} } +func (m *QueryGetValidatorUpdateBlockResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetValidatorUpdateBlockResponse) ProtoMessage() {} +func (*QueryGetValidatorUpdateBlockResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{9} +} +func (m *QueryGetValidatorUpdateBlockResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetValidatorUpdateBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetValidatorUpdateBlockResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetValidatorUpdateBlockResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetValidatorUpdateBlockResponse.Merge(m, src) +} +func (m *QueryGetValidatorUpdateBlockResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetValidatorUpdateBlockResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetValidatorUpdateBlockResponse.DiscardUnknown(m) } -type queryClient struct { - cc grpc1.ClientConn +var xxx_messageInfo_QueryGetValidatorUpdateBlockResponse proto.InternalMessageInfo + +func (m *QueryGetValidatorUpdateBlockResponse) GetValidatorUpdateBlock() ValidatorUpdateBlock { + if m != nil { + return m.ValidatorUpdateBlock + } + return ValidatorUpdateBlock{} } -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} +type QueryGetIndexRecentParamsRequest struct { } -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/exocore.oracle.Query/Params", in, out, opts...) - if err != nil { - return nil, err +func (m *QueryGetIndexRecentParamsRequest) Reset() { *m = QueryGetIndexRecentParamsRequest{} } +func (m *QueryGetIndexRecentParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetIndexRecentParamsRequest) ProtoMessage() {} +func (*QueryGetIndexRecentParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{10} +} +func (m *QueryGetIndexRecentParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetIndexRecentParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetIndexRecentParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QueryGetIndexRecentParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetIndexRecentParamsRequest.Merge(m, src) +} +func (m *QueryGetIndexRecentParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetIndexRecentParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetIndexRecentParamsRequest.DiscardUnknown(m) } -func (c *queryClient) Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) { - out := new(QueryGetPricesResponse) - err := c.cc.Invoke(ctx, "/exocore.oracle.Query/Prices", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +var xxx_messageInfo_QueryGetIndexRecentParamsRequest proto.InternalMessageInfo + +type QueryGetIndexRecentParamsResponse struct { + IndexRecentParams IndexRecentParams `protobuf:"bytes,1,opt,name=IndexRecentParams,proto3" json:"IndexRecentParams"` } -func (c *queryClient) PricesAll(ctx context.Context, in *QueryAllPricesRequest, opts ...grpc.CallOption) (*QueryAllPricesResponse, error) { - out := new(QueryAllPricesResponse) - err := c.cc.Invoke(ctx, "/exocore.oracle.Query/PricesAll", in, out, opts...) - if err != nil { - return nil, err +func (m *QueryGetIndexRecentParamsResponse) Reset() { *m = QueryGetIndexRecentParamsResponse{} } +func (m *QueryGetIndexRecentParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetIndexRecentParamsResponse) ProtoMessage() {} +func (*QueryGetIndexRecentParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{11} +} +func (m *QueryGetIndexRecentParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetIndexRecentParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetIndexRecentParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QueryGetIndexRecentParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetIndexRecentParamsResponse.Merge(m, src) +} +func (m *QueryGetIndexRecentParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetIndexRecentParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetIndexRecentParamsResponse.DiscardUnknown(m) } -func (c *queryClient) Validators(ctx context.Context, in *QueryGetValidatorsRequest, opts ...grpc.CallOption) (*QueryGetValidatorsResponse, error) { - out := new(QueryGetValidatorsResponse) - err := c.cc.Invoke(ctx, "/exocore.oracle.Query/Validators", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QueryGetIndexRecentParamsResponse proto.InternalMessageInfo + +func (m *QueryGetIndexRecentParamsResponse) GetIndexRecentParams() IndexRecentParams { + if m != nil { + return m.IndexRecentParams } - return out, nil + return IndexRecentParams{} } -// QueryServer is the server API for Query service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries a list of Prices items. - Prices(context.Context, *QueryGetPricesRequest) (*QueryGetPricesResponse, error) - PricesAll(context.Context, *QueryAllPricesRequest) (*QueryAllPricesResponse, error) - // Queries a Validators by index. - Validators(context.Context, *QueryGetValidatorsRequest) (*QueryGetValidatorsResponse, error) +type QueryGetIndexRecentMsgRequest struct { } -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { +func (m *QueryGetIndexRecentMsgRequest) Reset() { *m = QueryGetIndexRecentMsgRequest{} } +func (m *QueryGetIndexRecentMsgRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetIndexRecentMsgRequest) ProtoMessage() {} +func (*QueryGetIndexRecentMsgRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{12} } - -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +func (m *QueryGetIndexRecentMsgRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } -func (*UnimplementedQueryServer) Prices(ctx context.Context, req *QueryGetPricesRequest) (*QueryGetPricesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Prices not implemented") +func (m *QueryGetIndexRecentMsgRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetIndexRecentMsgRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } -func (*UnimplementedQueryServer) PricesAll(ctx context.Context, req *QueryAllPricesRequest) (*QueryAllPricesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PricesAll not implemented") +func (m *QueryGetIndexRecentMsgRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetIndexRecentMsgRequest.Merge(m, src) } -func (*UnimplementedQueryServer) Validators(ctx context.Context, req *QueryGetValidatorsRequest) (*QueryGetValidatorsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Validators not implemented") +func (m *QueryGetIndexRecentMsgRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetIndexRecentMsgRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetIndexRecentMsgRequest.DiscardUnknown(m) } -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) +var xxx_messageInfo_QueryGetIndexRecentMsgRequest proto.InternalMessageInfo + +type QueryGetIndexRecentMsgResponse struct { + IndexRecentMsg IndexRecentMsg `protobuf:"bytes,1,opt,name=IndexRecentMsg,proto3" json:"IndexRecentMsg"` } -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: "/exocore.oracle.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) +func (m *QueryGetIndexRecentMsgResponse) Reset() { *m = QueryGetIndexRecentMsgResponse{} } +func (m *QueryGetIndexRecentMsgResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetIndexRecentMsgResponse) ProtoMessage() {} +func (*QueryGetIndexRecentMsgResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{13} +} +func (m *QueryGetIndexRecentMsgResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetIndexRecentMsgResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetIndexRecentMsgResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *QueryGetIndexRecentMsgResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetIndexRecentMsgResponse.Merge(m, src) +} +func (m *QueryGetIndexRecentMsgResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetIndexRecentMsgResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetIndexRecentMsgResponse.DiscardUnknown(m) } -func _Query_Prices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetPricesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Prices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.oracle.Query/Prices", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Prices(ctx, req.(*QueryGetPricesRequest)) +var xxx_messageInfo_QueryGetIndexRecentMsgResponse proto.InternalMessageInfo + +func (m *QueryGetIndexRecentMsgResponse) GetIndexRecentMsg() IndexRecentMsg { + if m != nil { + return m.IndexRecentMsg } - return interceptor(ctx, in, info, handler) + return IndexRecentMsg{} } -func _Query_PricesAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllPricesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).PricesAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.oracle.Query/PricesAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).PricesAll(ctx, req.(*QueryAllPricesRequest)) - } - return interceptor(ctx, in, info, handler) +type QueryGetRecentMsgRequest struct { + Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` } -func _Query_Validators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetValidatorsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Validators(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.oracle.Query/Validators", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Validators(ctx, req.(*QueryGetValidatorsRequest)) +func (m *QueryGetRecentMsgRequest) Reset() { *m = QueryGetRecentMsgRequest{} } +func (m *QueryGetRecentMsgRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetRecentMsgRequest) ProtoMessage() {} +func (*QueryGetRecentMsgRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{14} +} +func (m *QueryGetRecentMsgRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRecentMsgRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRecentMsgRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *QueryGetRecentMsgRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRecentMsgRequest.Merge(m, src) +} +func (m *QueryGetRecentMsgRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRecentMsgRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRecentMsgRequest.DiscardUnknown(m) } -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "exocore.oracle.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Prices", - Handler: _Query_Prices_Handler, - }, - { - MethodName: "PricesAll", - Handler: _Query_PricesAll_Handler, - }, - { - MethodName: "Validators", - Handler: _Query_Validators_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "exocore/oracle/query.proto", -} +var xxx_messageInfo_QueryGetRecentMsgRequest proto.InternalMessageInfo -func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryGetRecentMsgRequest) GetBlock() uint64 { + if m != nil { + return m.Block } - return dAtA[:n], nil + return 0 } -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type QueryGetRecentMsgResponse struct { + RecentMsg RecentMsg `protobuf:"bytes,1,opt,name=recentMsg,proto3" json:"recentMsg"` } -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +func (m *QueryGetRecentMsgResponse) Reset() { *m = QueryGetRecentMsgResponse{} } +func (m *QueryGetRecentMsgResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetRecentMsgResponse) ProtoMessage() {} +func (*QueryGetRecentMsgResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{15} +} +func (m *QueryGetRecentMsgResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRecentMsgResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRecentMsgResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetRecentMsgResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRecentMsgResponse.Merge(m, src) +} +func (m *QueryGetRecentMsgResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRecentMsgResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRecentMsgResponse.DiscardUnknown(m) } -func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_QueryGetRecentMsgResponse proto.InternalMessageInfo + +func (m *QueryGetRecentMsgResponse) GetRecentMsg() RecentMsg { + if m != nil { + return m.RecentMsg } - return dAtA[:n], nil + return RecentMsg{} } -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type QueryAllRecentMsgRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) +func (m *QueryAllRecentMsgRequest) Reset() { *m = QueryAllRecentMsgRequest{} } +func (m *QueryAllRecentMsgRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllRecentMsgRequest) ProtoMessage() {} +func (*QueryAllRecentMsgRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{16} +} +func (m *QueryAllRecentMsgRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRecentMsgRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRecentMsgRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) if err != nil { - return 0, err + return nil, err } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + return b[:n], nil } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil +} +func (m *QueryAllRecentMsgRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRecentMsgRequest.Merge(m, src) +} +func (m *QueryAllRecentMsgRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRecentMsgRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRecentMsgRequest.DiscardUnknown(m) } -func (m *QueryGetPricesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_QueryAllRecentMsgRequest proto.InternalMessageInfo + +func (m *QueryAllRecentMsgRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination } - return dAtA[:n], nil + return nil } -func (m *QueryGetPricesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type QueryAllRecentMsgResponse struct { + RecentMsg []RecentMsg `protobuf:"bytes,1,rep,name=recentMsg,proto3" json:"recentMsg"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryGetPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TokenId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.TokenId)) - i-- - dAtA[i] = 0x8 +func (m *QueryAllRecentMsgResponse) Reset() { *m = QueryAllRecentMsgResponse{} } +func (m *QueryAllRecentMsgResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllRecentMsgResponse) ProtoMessage() {} +func (*QueryAllRecentMsgResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{17} +} +func (m *QueryAllRecentMsgResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRecentMsgResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRecentMsgResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return len(dAtA) - i, nil +} +func (m *QueryAllRecentMsgResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRecentMsgResponse.Merge(m, src) +} +func (m *QueryAllRecentMsgResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRecentMsgResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRecentMsgResponse.DiscardUnknown(m) } -func (m *QueryGetPricesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_QueryAllRecentMsgResponse proto.InternalMessageInfo + +func (m *QueryAllRecentMsgResponse) GetRecentMsg() []RecentMsg { + if m != nil { + return m.RecentMsg } - return dAtA[:n], nil + return nil } -func (m *QueryGetPricesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *QueryAllRecentMsgResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil } -func (m *QueryGetPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Prices.MarshalToSizedBuffer(dAtA[:i]) +type QueryGetRecentParamsRequest struct { + Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` +} + +func (m *QueryGetRecentParamsRequest) Reset() { *m = QueryGetRecentParamsRequest{} } +func (m *QueryGetRecentParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetRecentParamsRequest) ProtoMessage() {} +func (*QueryGetRecentParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{18} +} +func (m *QueryGetRecentParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRecentParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRecentParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) if err != nil { - return 0, err + return nil, err } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + return b[:n], nil } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil +} +func (m *QueryGetRecentParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRecentParamsRequest.Merge(m, src) +} +func (m *QueryGetRecentParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRecentParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRecentParamsRequest.DiscardUnknown(m) } -func (m *QueryAllPricesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_QueryGetRecentParamsRequest proto.InternalMessageInfo + +func (m *QueryGetRecentParamsRequest) GetBlock() uint64 { + if m != nil { + return m.Block } - return dAtA[:n], nil + return 0 } -func (m *QueryAllPricesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type QueryGetRecentParamsResponse struct { + RecentParams RecentParams `protobuf:"bytes,1,opt,name=recentParams,proto3" json:"recentParams"` } -func (m *QueryAllPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) +func (m *QueryGetRecentParamsResponse) Reset() { *m = QueryGetRecentParamsResponse{} } +func (m *QueryGetRecentParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetRecentParamsResponse) ProtoMessage() {} +func (*QueryGetRecentParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{19} +} +func (m *QueryGetRecentParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRecentParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRecentParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - i-- - dAtA[i] = 0xa + return b[:n], nil } - return len(dAtA) - i, nil +} +func (m *QueryGetRecentParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRecentParamsResponse.Merge(m, src) +} +func (m *QueryGetRecentParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRecentParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRecentParamsResponse.DiscardUnknown(m) } -func (m *QueryAllPricesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_QueryGetRecentParamsResponse proto.InternalMessageInfo + +func (m *QueryGetRecentParamsResponse) GetRecentParams() RecentParams { + if m != nil { + return m.RecentParams } - return dAtA[:n], nil + return RecentParams{} } -func (m *QueryAllPricesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type QueryAllRecentParamsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryAllPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Prices) > 0 { - for iNdEx := len(m.Prices) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Prices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa +func (m *QueryAllRecentParamsRequest) Reset() { *m = QueryAllRecentParamsRequest{} } +func (m *QueryAllRecentParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllRecentParamsRequest) ProtoMessage() {} +func (*QueryAllRecentParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{20} +} +func (m *QueryAllRecentParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRecentParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRecentParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } - return len(dAtA) - i, nil } - -func (m *QueryGetValidatorsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (m *QueryAllRecentParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRecentParamsRequest.Merge(m, src) } - -func (m *QueryGetValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *QueryAllRecentParamsRequest) XXX_Size() int { + return m.Size() } - -func (m *QueryGetValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +func (m *QueryAllRecentParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRecentParamsRequest.DiscardUnknown(m) } -func (m *QueryGetValidatorsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_QueryAllRecentParamsRequest proto.InternalMessageInfo + +func (m *QueryAllRecentParamsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination } - return dAtA[:n], nil + return nil } -func (m *QueryGetValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type QueryAllRecentParamsResponse struct { + RecentParams []RecentParams `protobuf:"bytes,1,rep,name=recentParams,proto3" json:"recentParams"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryGetValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Validators.MarshalToSizedBuffer(dAtA[:i]) +func (m *QueryAllRecentParamsResponse) Reset() { *m = QueryAllRecentParamsResponse{} } +func (m *QueryAllRecentParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllRecentParamsResponse) ProtoMessage() {} +func (*QueryAllRecentParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{21} +} +func (m *QueryAllRecentParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRecentParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRecentParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) if err != nil { - return 0, err + return nil, err } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + return b[:n], nil } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil +} +func (m *QueryAllRecentParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRecentParamsResponse.Merge(m, src) +} +func (m *QueryAllRecentParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRecentParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRecentParamsResponse.DiscardUnknown(m) } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +var xxx_messageInfo_QueryAllRecentParamsResponse proto.InternalMessageInfo + +func (m *QueryAllRecentParamsResponse) GetRecentParams() []RecentParams { + if m != nil { + return m.RecentParams } - dAtA[offset] = uint8(v) - return base + return nil } -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 + +func (m *QueryAllRecentParamsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination } - var l int - _ = l - return n + return nil } -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "exocore.oracle.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "exocore.oracle.QueryParamsResponse") + proto.RegisterType((*QueryGetPricesRequest)(nil), "exocore.oracle.QueryGetPricesRequest") + proto.RegisterType((*QueryGetPricesResponse)(nil), "exocore.oracle.QueryGetPricesResponse") + proto.RegisterType((*QueryAllPricesRequest)(nil), "exocore.oracle.QueryAllPricesRequest") + proto.RegisterType((*QueryAllPricesResponse)(nil), "exocore.oracle.QueryAllPricesResponse") + proto.RegisterType((*QueryGetValidatorsRequest)(nil), "exocore.oracle.QueryGetValidatorsRequest") + proto.RegisterType((*QueryGetValidatorsResponse)(nil), "exocore.oracle.QueryGetValidatorsResponse") + proto.RegisterType((*QueryGetValidatorUpdateBlockRequest)(nil), "exocore.oracle.QueryGetValidatorUpdateBlockRequest") + proto.RegisterType((*QueryGetValidatorUpdateBlockResponse)(nil), "exocore.oracle.QueryGetValidatorUpdateBlockResponse") + proto.RegisterType((*QueryGetIndexRecentParamsRequest)(nil), "exocore.oracle.QueryGetIndexRecentParamsRequest") + proto.RegisterType((*QueryGetIndexRecentParamsResponse)(nil), "exocore.oracle.QueryGetIndexRecentParamsResponse") + proto.RegisterType((*QueryGetIndexRecentMsgRequest)(nil), "exocore.oracle.QueryGetIndexRecentMsgRequest") + proto.RegisterType((*QueryGetIndexRecentMsgResponse)(nil), "exocore.oracle.QueryGetIndexRecentMsgResponse") + proto.RegisterType((*QueryGetRecentMsgRequest)(nil), "exocore.oracle.QueryGetRecentMsgRequest") + proto.RegisterType((*QueryGetRecentMsgResponse)(nil), "exocore.oracle.QueryGetRecentMsgResponse") + proto.RegisterType((*QueryAllRecentMsgRequest)(nil), "exocore.oracle.QueryAllRecentMsgRequest") + proto.RegisterType((*QueryAllRecentMsgResponse)(nil), "exocore.oracle.QueryAllRecentMsgResponse") + proto.RegisterType((*QueryGetRecentParamsRequest)(nil), "exocore.oracle.QueryGetRecentParamsRequest") + proto.RegisterType((*QueryGetRecentParamsResponse)(nil), "exocore.oracle.QueryGetRecentParamsResponse") + proto.RegisterType((*QueryAllRecentParamsRequest)(nil), "exocore.oracle.QueryAllRecentParamsRequest") + proto.RegisterType((*QueryAllRecentParamsResponse)(nil), "exocore.oracle.QueryAllRecentParamsResponse") } -func (m *QueryGetPricesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TokenId != 0 { - n += 1 + sovQuery(uint64(m.TokenId)) +func init() { proto.RegisterFile("exocore/oracle/query.proto", fileDescriptor_f604621c8da1a6f3) } + +var fileDescriptor_f604621c8da1a6f3 = []byte{ + // 1022 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0x41, 0x6f, 0xdc, 0x44, + 0x14, 0xc7, 0x33, 0x4d, 0x13, 0x94, 0x47, 0x29, 0x62, 0x08, 0x55, 0xea, 0x84, 0x4d, 0x3b, 0x6d, + 0xda, 0xa4, 0x69, 0xed, 0x6c, 0xb2, 0x50, 0x81, 0xa8, 0x44, 0x22, 0xd1, 0xaa, 0x40, 0xab, 0xb0, + 0x52, 0x39, 0xf4, 0xd0, 0x95, 0x77, 0x33, 0x98, 0x55, 0x1c, 0xcf, 0xd6, 0x76, 0x4a, 0x4a, 0x55, + 0x09, 0x71, 0x40, 0xe2, 0x56, 0x09, 0x09, 0x0e, 0xdc, 0xe0, 0x00, 0x37, 0x2e, 0x7c, 0x00, 0x8e, + 0x3d, 0x46, 0xe2, 0xc2, 0x09, 0xa1, 0x84, 0x2b, 0xdf, 0x01, 0x79, 0xfc, 0xbc, 0xb6, 0xc7, 0x9e, + 0x5d, 0x6f, 0xb5, 0xb7, 0xb5, 0xdf, 0xff, 0xbd, 0xf7, 0x9b, 0x37, 0xef, 0xe9, 0x79, 0xc1, 0xe0, + 0x07, 0xa2, 0x23, 0x7c, 0x6e, 0x09, 0xdf, 0xee, 0xb8, 0xdc, 0x7a, 0xb8, 0xcf, 0xfd, 0xc7, 0x66, + 0xcf, 0x17, 0xa1, 0xa0, 0xa7, 0xd1, 0x66, 0xc6, 0x36, 0x63, 0xd6, 0x11, 0x8e, 0x90, 0x26, 0x2b, + 0xfa, 0x15, 0xab, 0x8c, 0x05, 0x47, 0x08, 0xc7, 0xe5, 0x96, 0xdd, 0xeb, 0x5a, 0xb6, 0xe7, 0x89, + 0xd0, 0x0e, 0xbb, 0xc2, 0x0b, 0xd0, 0x7a, 0xa5, 0x23, 0x82, 0x3d, 0x11, 0x58, 0x6d, 0x3b, 0xc0, + 0xe0, 0xd6, 0xa3, 0x7a, 0x9b, 0x87, 0x76, 0xdd, 0xea, 0xd9, 0x4e, 0xd7, 0x93, 0x62, 0xd4, 0xce, + 0x2b, 0x2c, 0x3d, 0xdb, 0xb7, 0xf7, 0x02, 0x9d, 0xd1, 0xef, 0x76, 0x78, 0x62, 0x5c, 0x54, 0x8c, + 0x8f, 0x6c, 0xb7, 0xbb, 0x63, 0x87, 0xc2, 0x4f, 0x04, 0xab, 0x3a, 0x41, 0x6b, 0xbf, 0xb7, 0x63, + 0x87, 0xbc, 0xd5, 0x76, 0x45, 0x67, 0x17, 0xc5, 0xcb, 0x8a, 0xb8, 0xeb, 0xed, 0xf0, 0x83, 0x96, + 0xcf, 0x3b, 0xdc, 0x0b, 0x5b, 0x39, 0xa8, 0xa5, 0x41, 0xca, 0xbd, 0xc0, 0xd1, 0xe0, 0x15, 0x04, + 0xac, 0x5c, 0x90, 0xcd, 0xc5, 0x66, 0x81, 0x7e, 0x12, 0xd5, 0x6f, 0x5b, 0xbe, 0x6c, 0xf2, 0x87, + 0xfb, 0x3c, 0x08, 0xd9, 0x47, 0xf0, 0x7a, 0xee, 0x6d, 0xd0, 0x13, 0x5e, 0xc0, 0x69, 0x03, 0xa6, + 0x63, 0xe7, 0x39, 0x72, 0x8e, 0x2c, 0xbf, 0xbc, 0x7e, 0xc6, 0xcc, 0xdf, 0xa5, 0x19, 0xeb, 0xb7, + 0x4e, 0x3e, 0xff, 0x7b, 0x71, 0xa2, 0x89, 0x5a, 0x56, 0x87, 0x37, 0x64, 0xb0, 0x5b, 0x3c, 0xdc, + 0x96, 0xe5, 0xc5, 0x2c, 0x74, 0x0e, 0x5e, 0x0a, 0xc5, 0x2e, 0xf7, 0x6e, 0xef, 0xc8, 0x78, 0x53, + 0xcd, 0xe4, 0x91, 0xdd, 0x85, 0x33, 0xaa, 0x4b, 0x06, 0x41, 0xbe, 0xd1, 0x22, 0x48, 0x6b, 0x1f, + 0x41, 0x3e, 0xb1, 0x16, 0x22, 0x6c, 0xba, 0x6e, 0x1e, 0xe1, 0x26, 0x40, 0xda, 0x30, 0x18, 0xf2, + 0x92, 0x19, 0x77, 0x97, 0x19, 0x75, 0x97, 0x19, 0xb7, 0x2e, 0x76, 0x97, 0xb9, 0x6d, 0x3b, 0x1c, + 0x7d, 0x9b, 0x19, 0x4f, 0xf6, 0x03, 0x41, 0xe2, 0x4c, 0x86, 0x12, 0xe2, 0xc9, 0xaa, 0xc4, 0xf4, + 0x56, 0x0e, 0xec, 0x84, 0x04, 0xbb, 0x3c, 0x14, 0x2c, 0x4e, 0x99, 0x23, 0x9b, 0x87, 0xb3, 0x49, + 0x29, 0x3f, 0xed, 0xf7, 0x6f, 0x72, 0xcf, 0x0f, 0xc0, 0x28, 0x33, 0x22, 0xf9, 0xfb, 0x00, 0xe9, + 0x5b, 0x2c, 0x8e, 0xa1, 0xd2, 0xa7, 0x0a, 0x3c, 0x41, 0xc6, 0x87, 0x2d, 0xc1, 0x85, 0x42, 0xfc, + 0x7b, 0x72, 0x34, 0xb6, 0xa2, 0xc9, 0x48, 0x30, 0xbe, 0x21, 0x70, 0x71, 0xb0, 0x0e, 0x89, 0x1e, + 0xc0, 0x6c, 0x99, 0x1d, 0xd9, 0x2e, 0x6a, 0xd9, 0x32, 0x5a, 0xa4, 0x2c, 0x8d, 0xc3, 0x18, 0x9c, + 0x4b, 0x38, 0x6e, 0x47, 0x43, 0xd7, 0x94, 0x13, 0x93, 0x9f, 0x8d, 0x2f, 0xe1, 0xfc, 0x00, 0x0d, + 0x82, 0xde, 0x83, 0xd7, 0x0a, 0x46, 0xa4, 0x3c, 0xaf, 0x52, 0x16, 0x84, 0x88, 0x58, 0x8c, 0xc0, + 0x16, 0xe1, 0xcd, 0x92, 0xdc, 0x77, 0x02, 0x27, 0x81, 0xf3, 0xa0, 0xa6, 0x13, 0x20, 0xd9, 0xc7, + 0x70, 0x3a, 0x6f, 0x41, 0xac, 0xda, 0x00, 0xac, 0x3b, 0x81, 0x83, 0x4c, 0x8a, 0x2f, 0x5b, 0x83, + 0xb9, 0x24, 0x9f, 0xca, 0x42, 0x67, 0x61, 0xaa, 0xdd, 0xbf, 0x9d, 0x93, 0xcd, 0xf8, 0x81, 0xdd, + 0x4f, 0xfb, 0xb1, 0x08, 0x77, 0x03, 0x66, 0x7c, 0x85, 0xeb, 0xac, 0xca, 0xa5, 0x22, 0xa5, 0x1e, + 0xac, 0x8d, 0x34, 0x9b, 0xae, 0x5b, 0xa0, 0x19, 0xd7, 0xa4, 0xff, 0x4c, 0xf0, 0x00, 0xf9, 0x24, + 0xe5, 0x07, 0x98, 0x1c, 0xed, 0x00, 0xe3, 0x9b, 0xfa, 0x0d, 0x98, 0xcf, 0x57, 0x39, 0xd7, 0xc3, + 0x9a, 0xab, 0xf9, 0x0c, 0x16, 0xca, 0x9d, 0xf0, 0x70, 0x37, 0xe1, 0x94, 0x5f, 0xec, 0xe7, 0x85, + 0xf2, 0xf3, 0xe5, 0x5a, 0x39, 0xe7, 0xc7, 0x38, 0xc2, 0xf5, 0x2b, 0x98, 0x87, 0x1b, 0xd7, 0x4d, + 0xfd, 0x46, 0xf0, 0x3c, 0x85, 0x3c, 0xda, 0xf3, 0x4c, 0xbe, 0xc8, 0x79, 0xc6, 0x76, 0x6b, 0xeb, + 0xff, 0xbd, 0x02, 0x53, 0x92, 0x98, 0x7e, 0x45, 0x60, 0x1a, 0xa3, 0x33, 0x95, 0xa7, 0xb8, 0xaf, + 0x8d, 0x0b, 0x03, 0x35, 0x71, 0x26, 0x76, 0xed, 0xeb, 0x3f, 0xff, 0xfd, 0xee, 0xc4, 0x65, 0xba, + 0x64, 0x7d, 0x10, 0x8b, 0xef, 0xf2, 0xf0, 0x0b, 0xe1, 0xef, 0x5a, 0xa5, 0x1f, 0x48, 0xf4, 0x59, + 0x84, 0x10, 0x2f, 0xa3, 0xa5, 0xd2, 0xf0, 0xea, 0x3e, 0x37, 0x2e, 0x0d, 0x93, 0x21, 0xc8, 0x75, + 0x09, 0x52, 0xa7, 0xd6, 0x30, 0x10, 0xe9, 0x66, 0x3d, 0xc1, 0xaf, 0x82, 0xa7, 0xf4, 0x5b, 0x02, + 0x33, 0x71, 0xac, 0x4d, 0xd7, 0xd5, 0x50, 0xa9, 0x2b, 0x5e, 0x43, 0x55, 0xd8, 0xd3, 0xd5, 0xcb, + 0x13, 0xd7, 0xe4, 0x7b, 0x92, 0xdd, 0x8e, 0x74, 0x45, 0x77, 0xf6, 0xc2, 0xd2, 0x35, 0xae, 0x54, + 0x91, 0x22, 0x54, 0x5d, 0x42, 0xad, 0xd2, 0x95, 0x21, 0x50, 0xe9, 0xa7, 0x29, 0xfd, 0x83, 0x94, + 0x2f, 0x49, 0xba, 0x31, 0x34, 0x6f, 0x71, 0x35, 0x1b, 0x8d, 0xd1, 0x9c, 0x10, 0xfb, 0x86, 0xc4, + 0xbe, 0x4e, 0xdf, 0xaa, 0x8a, 0x9d, 0xfb, 0x60, 0xa6, 0xbf, 0x93, 0x92, 0xf5, 0x49, 0xd7, 0x74, + 0x28, 0xba, 0x55, 0x6d, 0xd4, 0x47, 0xf0, 0x40, 0xf2, 0x77, 0x25, 0x79, 0x83, 0xae, 0x0f, 0x21, + 0x2f, 0xf9, 0x7a, 0xa7, 0xbf, 0x12, 0x75, 0xb7, 0xd2, 0x6b, 0x15, 0x08, 0xd2, 0x25, 0x65, 0x98, + 0x55, 0xe5, 0x23, 0x4e, 0x92, 0xfa, 0x0f, 0x82, 0xfe, 0x48, 0x60, 0x26, 0xa5, 0x5c, 0xd6, 0xa5, + 0x2d, 0x00, 0xae, 0x54, 0x50, 0x22, 0xdb, 0x3b, 0x92, 0x6d, 0x83, 0xd6, 0x87, 0xb0, 0xa5, 0x54, + 0xd6, 0x13, 0x79, 0xfd, 0x4f, 0xa3, 0xd9, 0x3a, 0xd5, 0x0f, 0x18, 0x8d, 0xfa, 0xb2, 0x6e, 0x86, + 0x2b, 0x02, 0x96, 0xed, 0xea, 0xca, 0xb3, 0x95, 0x29, 0xdb, 0x2f, 0x7d, 0x30, 0xec, 0xc9, 0xd5, + 0xc1, 0xf5, 0xc8, 0xb7, 0xe3, 0xd5, 0x6a, 0x62, 0xc4, 0x7b, 0x4f, 0xe2, 0xbd, 0x4d, 0x1b, 0xd5, + 0xf0, 0xe2, 0x1e, 0xec, 0x97, 0xf0, 0x27, 0x02, 0xaf, 0x66, 0xc3, 0x46, 0x55, 0x5c, 0x1d, 0x5c, + 0x9b, 0x2a, 0xb0, 0x9a, 0x55, 0xca, 0x1a, 0x12, 0xd6, 0xa4, 0x57, 0x47, 0x81, 0xdd, 0xfa, 0xf0, + 0xf9, 0x51, 0x8d, 0x1c, 0x1e, 0xd5, 0xc8, 0x3f, 0x47, 0x35, 0xf2, 0xec, 0xb8, 0x36, 0x71, 0x78, + 0x5c, 0x9b, 0xf8, 0xeb, 0xb8, 0x36, 0x71, 0x7f, 0xcd, 0xe9, 0x86, 0x9f, 0xef, 0xb7, 0xcd, 0x8e, + 0xd8, 0xd3, 0x45, 0x3c, 0x48, 0x62, 0x86, 0x8f, 0x7b, 0x3c, 0x68, 0x4f, 0xcb, 0xff, 0xb3, 0x1b, + 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xbf, 0xbe, 0x76, 0x39, 0x7b, 0x10, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Queries a list of Prices items. + Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) + PricesAll(ctx context.Context, in *QueryAllPricesRequest, opts ...grpc.CallOption) (*QueryAllPricesResponse, error) + // Queries a Validators by index. + Validators(ctx context.Context, in *QueryGetValidatorsRequest, opts ...grpc.CallOption) (*QueryGetValidatorsResponse, error) + // Queries a ValidatorUpdateBlock by index. + ValidatorUpdateBlock(ctx context.Context, in *QueryGetValidatorUpdateBlockRequest, opts ...grpc.CallOption) (*QueryGetValidatorUpdateBlockResponse, error) + // Queries a IndexRecentParams by index. + IndexRecentParams(ctx context.Context, in *QueryGetIndexRecentParamsRequest, opts ...grpc.CallOption) (*QueryGetIndexRecentParamsResponse, error) + // Queries a IndexRecentMsg by index. + IndexRecentMsg(ctx context.Context, in *QueryGetIndexRecentMsgRequest, opts ...grpc.CallOption) (*QueryGetIndexRecentMsgResponse, error) + // Queries a list of RecentMsg items. + RecentMsg(ctx context.Context, in *QueryGetRecentMsgRequest, opts ...grpc.CallOption) (*QueryGetRecentMsgResponse, error) + RecentMsgAll(ctx context.Context, in *QueryAllRecentMsgRequest, opts ...grpc.CallOption) (*QueryAllRecentMsgResponse, error) + // Queries a list of RecentParams items. + RecentParams(ctx context.Context, in *QueryGetRecentParamsRequest, opts ...grpc.CallOption) (*QueryGetRecentParamsResponse, error) + RecentParamsAll(ctx context.Context, in *QueryAllRecentParamsRequest, opts ...grpc.CallOption) (*QueryAllRecentParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) 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, "/exocore.oracle.Query/Params", in, out, opts...) + if err != nil { + return nil, err } - return n + return out, nil } -func (m *QueryGetPricesResponse) Size() (n int) { - if m == nil { - return 0 +func (c *queryClient) Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) { + out := new(QueryGetPricesResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/Prices", in, out, opts...) + if err != nil { + return nil, err } - var l int - _ = l - l = m.Prices.Size() - n += 1 + l + sovQuery(uint64(l)) - return n + return out, nil } -func (m *QueryAllPricesRequest) Size() (n int) { - if m == nil { - return 0 +func (c *queryClient) PricesAll(ctx context.Context, in *QueryAllPricesRequest, opts ...grpc.CallOption) (*QueryAllPricesResponse, error) { + out := new(QueryAllPricesResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/PricesAll", in, out, opts...) + if err != nil { + return nil, err } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + return out, nil +} + +func (c *queryClient) Validators(ctx context.Context, in *QueryGetValidatorsRequest, opts ...grpc.CallOption) (*QueryGetValidatorsResponse, error) { + out := new(QueryGetValidatorsResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/Validators", in, out, opts...) + if err != nil { + return nil, err } - return n + return out, nil } -func (m *QueryAllPricesResponse) Size() (n int) { - if m == nil { - return 0 +func (c *queryClient) ValidatorUpdateBlock(ctx context.Context, in *QueryGetValidatorUpdateBlockRequest, opts ...grpc.CallOption) (*QueryGetValidatorUpdateBlockResponse, error) { + out := new(QueryGetValidatorUpdateBlockResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/ValidatorUpdateBlock", in, out, opts...) + if err != nil { + return nil, err } - var l int - _ = l - if len(m.Prices) > 0 { - for _, e := range m.Prices { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } + return out, nil +} + +func (c *queryClient) IndexRecentParams(ctx context.Context, in *QueryGetIndexRecentParamsRequest, opts ...grpc.CallOption) (*QueryGetIndexRecentParamsResponse, error) { + out := new(QueryGetIndexRecentParamsResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/IndexRecentParams", in, out, opts...) + if err != nil { + return nil, err } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + return out, nil +} + +func (c *queryClient) IndexRecentMsg(ctx context.Context, in *QueryGetIndexRecentMsgRequest, opts ...grpc.CallOption) (*QueryGetIndexRecentMsgResponse, error) { + out := new(QueryGetIndexRecentMsgResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/IndexRecentMsg", in, out, opts...) + if err != nil { + return nil, err } - return n + return out, nil } -func (m *QueryGetValidatorsRequest) Size() (n int) { - if m == nil { - return 0 +func (c *queryClient) RecentMsg(ctx context.Context, in *QueryGetRecentMsgRequest, opts ...grpc.CallOption) (*QueryGetRecentMsgResponse, error) { + out := new(QueryGetRecentMsgResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RecentMsg", in, out, opts...) + if err != nil { + return nil, err } - var l int - _ = l - return n + return out, nil } -func (m *QueryGetValidatorsResponse) Size() (n int) { - if m == nil { - return 0 +func (c *queryClient) RecentMsgAll(ctx context.Context, in *QueryAllRecentMsgRequest, opts ...grpc.CallOption) (*QueryAllRecentMsgResponse, error) { + out := new(QueryAllRecentMsgResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RecentMsgAll", in, out, opts...) + if err != nil { + return nil, err } - var l int - _ = l - l = m.Validators.Size() - n += 1 + l + sovQuery(uint64(l)) - return n + return out, nil } -func sovQuery(x uint64) (n int) { +func (c *queryClient) RecentParams(ctx context.Context, in *QueryGetRecentParamsRequest, opts ...grpc.CallOption) (*QueryGetRecentParamsResponse, error) { + out := new(QueryGetRecentParamsResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RecentParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RecentParamsAll(ctx context.Context, in *QueryAllRecentParamsRequest, opts ...grpc.CallOption) (*QueryAllRecentParamsResponse, error) { + out := new(QueryAllRecentParamsResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RecentParamsAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a list of Prices items. + Prices(context.Context, *QueryGetPricesRequest) (*QueryGetPricesResponse, error) + PricesAll(context.Context, *QueryAllPricesRequest) (*QueryAllPricesResponse, error) + // Queries a Validators by index. + Validators(context.Context, *QueryGetValidatorsRequest) (*QueryGetValidatorsResponse, error) + // Queries a ValidatorUpdateBlock by index. + ValidatorUpdateBlock(context.Context, *QueryGetValidatorUpdateBlockRequest) (*QueryGetValidatorUpdateBlockResponse, error) + // Queries a IndexRecentParams by index. + IndexRecentParams(context.Context, *QueryGetIndexRecentParamsRequest) (*QueryGetIndexRecentParamsResponse, error) + // Queries a IndexRecentMsg by index. + IndexRecentMsg(context.Context, *QueryGetIndexRecentMsgRequest) (*QueryGetIndexRecentMsgResponse, error) + // Queries a list of RecentMsg items. + RecentMsg(context.Context, *QueryGetRecentMsgRequest) (*QueryGetRecentMsgResponse, error) + RecentMsgAll(context.Context, *QueryAllRecentMsgRequest) (*QueryAllRecentMsgResponse, error) + // Queries a list of RecentParams items. + RecentParams(context.Context, *QueryGetRecentParamsRequest) (*QueryGetRecentParamsResponse, error) + RecentParamsAll(context.Context, *QueryAllRecentParamsRequest) (*QueryAllRecentParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) Prices(ctx context.Context, req *QueryGetPricesRequest) (*QueryGetPricesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Prices not implemented") +} +func (*UnimplementedQueryServer) PricesAll(ctx context.Context, req *QueryAllPricesRequest) (*QueryAllPricesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PricesAll not implemented") +} +func (*UnimplementedQueryServer) Validators(ctx context.Context, req *QueryGetValidatorsRequest) (*QueryGetValidatorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Validators not implemented") +} +func (*UnimplementedQueryServer) ValidatorUpdateBlock(ctx context.Context, req *QueryGetValidatorUpdateBlockRequest) (*QueryGetValidatorUpdateBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorUpdateBlock not implemented") +} +func (*UnimplementedQueryServer) IndexRecentParams(ctx context.Context, req *QueryGetIndexRecentParamsRequest) (*QueryGetIndexRecentParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IndexRecentParams not implemented") +} +func (*UnimplementedQueryServer) IndexRecentMsg(ctx context.Context, req *QueryGetIndexRecentMsgRequest) (*QueryGetIndexRecentMsgResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IndexRecentMsg not implemented") +} +func (*UnimplementedQueryServer) RecentMsg(ctx context.Context, req *QueryGetRecentMsgRequest) (*QueryGetRecentMsgResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RecentMsg not implemented") +} +func (*UnimplementedQueryServer) RecentMsgAll(ctx context.Context, req *QueryAllRecentMsgRequest) (*QueryAllRecentMsgResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RecentMsgAll not implemented") +} +func (*UnimplementedQueryServer) RecentParams(ctx context.Context, req *QueryGetRecentParamsRequest) (*QueryGetRecentParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RecentParams not implemented") +} +func (*UnimplementedQueryServer) RecentParamsAll(ctx context.Context, req *QueryAllRecentParamsRequest) (*QueryAllRecentParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RecentParamsAll not implemented") +} + +func RegisterQueryServer(s grpc1.Server, 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: "/exocore.oracle.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Prices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetPricesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Prices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/Prices", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Prices(ctx, req.(*QueryGetPricesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_PricesAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllPricesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).PricesAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/PricesAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PricesAll(ctx, req.(*QueryAllPricesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Validators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetValidatorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Validators(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/Validators", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Validators(ctx, req.(*QueryGetValidatorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ValidatorUpdateBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetValidatorUpdateBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ValidatorUpdateBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/ValidatorUpdateBlock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ValidatorUpdateBlock(ctx, req.(*QueryGetValidatorUpdateBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_IndexRecentParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetIndexRecentParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).IndexRecentParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/IndexRecentParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).IndexRecentParams(ctx, req.(*QueryGetIndexRecentParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_IndexRecentMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetIndexRecentMsgRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).IndexRecentMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/IndexRecentMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).IndexRecentMsg(ctx, req.(*QueryGetIndexRecentMsgRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RecentMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetRecentMsgRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RecentMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/RecentMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RecentMsg(ctx, req.(*QueryGetRecentMsgRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RecentMsgAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllRecentMsgRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RecentMsgAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/RecentMsgAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RecentMsgAll(ctx, req.(*QueryAllRecentMsgRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RecentParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetRecentParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RecentParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/RecentParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RecentParams(ctx, req.(*QueryGetRecentParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RecentParamsAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllRecentParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RecentParamsAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/RecentParamsAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RecentParamsAll(ctx, req.(*QueryAllRecentParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "exocore.oracle.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Prices", + Handler: _Query_Prices_Handler, + }, + { + MethodName: "PricesAll", + Handler: _Query_PricesAll_Handler, + }, + { + MethodName: "Validators", + Handler: _Query_Validators_Handler, + }, + { + MethodName: "ValidatorUpdateBlock", + Handler: _Query_ValidatorUpdateBlock_Handler, + }, + { + MethodName: "IndexRecentParams", + Handler: _Query_IndexRecentParams_Handler, + }, + { + MethodName: "IndexRecentMsg", + Handler: _Query_IndexRecentMsg_Handler, + }, + { + MethodName: "RecentMsg", + Handler: _Query_RecentMsg_Handler, + }, + { + MethodName: "RecentMsgAll", + Handler: _Query_RecentMsgAll_Handler, + }, + { + MethodName: "RecentParams", + Handler: _Query_RecentParams_Handler, + }, + { + MethodName: "RecentParamsAll", + Handler: _Query_RecentParamsAll_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "exocore/oracle/query.proto", +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetPricesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetPricesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TokenId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.TokenId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryGetPricesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetPricesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Prices.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAllPricesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllPricesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllPricesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllPricesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Prices) > 0 { + for iNdEx := len(m.Prices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Prices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryGetValidatorsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryGetValidatorsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Validators.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetValidatorUpdateBlockRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetValidatorUpdateBlockRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetValidatorUpdateBlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryGetValidatorUpdateBlockResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetValidatorUpdateBlockResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetValidatorUpdateBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ValidatorUpdateBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetIndexRecentParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetIndexRecentParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetIndexRecentParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryGetIndexRecentParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetIndexRecentParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetIndexRecentParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.IndexRecentParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetIndexRecentMsgRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetIndexRecentMsgRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetIndexRecentMsgRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryGetIndexRecentMsgResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetIndexRecentMsgResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetIndexRecentMsgResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.IndexRecentMsg.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetRecentMsgRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetRecentMsgRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRecentMsgRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Block != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryGetRecentMsgResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetRecentMsgResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRecentMsgResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.RecentMsg.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAllRecentMsgRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllRecentMsgRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRecentMsgRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllRecentMsgResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllRecentMsgResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRecentMsgResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.RecentMsg) > 0 { + for iNdEx := len(m.RecentMsg) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RecentMsg[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryGetRecentParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetRecentParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRecentParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Block != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryGetRecentParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetRecentParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRecentParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.RecentParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAllRecentParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllRecentParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRecentParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllRecentParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllRecentParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRecentParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.RecentParams) > 0 { + for iNdEx := len(m.RecentParams) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RecentParams[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetPricesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovQuery(uint64(m.TokenId)) + } + return n +} + +func (m *QueryGetPricesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Prices.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllPricesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllPricesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Prices) > 0 { + for _, e := range m.Prices { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetValidatorsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryGetValidatorsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Validators.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetValidatorUpdateBlockRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryGetValidatorUpdateBlockResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ValidatorUpdateBlock.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetIndexRecentParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryGetIndexRecentParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.IndexRecentParams.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetIndexRecentMsgRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryGetIndexRecentMsgResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.IndexRecentMsg.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetRecentMsgRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Block != 0 { + n += 1 + sovQuery(uint64(m.Block)) + } + return n +} + +func (m *QueryGetRecentMsgResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.RecentMsg.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllRecentMsgRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllRecentMsgResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RecentMsg) > 0 { + for _, e := range m.RecentMsg { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetRecentParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Block != 0 { + n += 1 + sovQuery(uint64(m.Block)) + } + return n +} + +func (m *QueryGetRecentParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.RecentParams.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllRecentParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllRecentParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RecentParams) > 0 { + for _, e := range m.RecentParams { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetPricesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + } + m.TokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TokenId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetPricesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Prices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllPricesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllPricesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prices = append(m.Prices, Prices{}) + if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetValidatorsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetValidatorsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetValidatorsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetValidatorsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Validators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetValidatorUpdateBlockRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetValidatorUpdateBlockRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetValidatorUpdateBlockRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetValidatorUpdateBlockResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetValidatorUpdateBlockResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetValidatorUpdateBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorUpdateBlock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ValidatorUpdateBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetIndexRecentParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetIndexRecentParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetIndexRecentParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetIndexRecentParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetIndexRecentParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetIndexRecentParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IndexRecentParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.IndexRecentParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetIndexRecentMsgRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1015,10 +3446,10 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetIndexRecentMsgRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetIndexRecentMsgRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1042,7 +3473,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetIndexRecentMsgResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1065,15 +3496,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetIndexRecentMsgResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetIndexRecentMsgResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IndexRecentMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1100,7 +3531,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.IndexRecentMsg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1125,7 +3556,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetRecentMsgRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1148,17 +3579,17 @@ func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetPricesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRecentMsgRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRecentMsgRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) } - m.TokenId = 0 + m.Block = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1168,7 +3599,7 @@ func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TokenId |= int32(b&0x7F) << shift + m.Block |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1194,7 +3625,7 @@ func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetRecentMsgResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1217,15 +3648,15 @@ func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetPricesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRecentMsgResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRecentMsgResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RecentMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1252,7 +3683,7 @@ func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Prices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RecentMsg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1277,7 +3708,7 @@ func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllRecentMsgRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1300,10 +3731,10 @@ func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllPricesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllRecentMsgRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllRecentMsgRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1363,7 +3794,7 @@ func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllRecentMsgResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1386,15 +3817,15 @@ func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllPricesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllRecentMsgResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllRecentMsgResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RecentMsg", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1421,8 +3852,8 @@ func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Prices = append(m.Prices, Prices{}) - if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.RecentMsg = append(m.RecentMsg, RecentMsg{}) + if err := m.RecentMsg[len(m.RecentMsg)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1483,7 +3914,7 @@ func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetValidatorsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetRecentParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1506,12 +3937,31 @@ func (m *QueryGetValidatorsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetValidatorsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRecentParamsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRecentParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + m.Block = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Block |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1533,7 +3983,7 @@ func (m *QueryGetValidatorsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetValidatorsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetRecentParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1556,15 +4006,15 @@ func (m *QueryGetValidatorsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetValidatorsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRecentParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRecentParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RecentParams", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1591,7 +4041,213 @@ func (m *QueryGetValidatorsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Validators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RecentParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllRecentParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllRecentParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllRecentParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllRecentParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllRecentParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllRecentParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecentParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RecentParams = append(m.RecentParams, RecentParams{}) + if err := m.RecentParams[len(m.RecentParams)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index 9fdf27306..3f5b39649 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -159,6 +159,240 @@ func local_request_Query_Validators_0(ctx context.Context, marshaler runtime.Mar } +func request_Query_ValidatorUpdateBlock_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetValidatorUpdateBlockRequest + var metadata runtime.ServerMetadata + + msg, err := client.ValidatorUpdateBlock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ValidatorUpdateBlock_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetValidatorUpdateBlockRequest + var metadata runtime.ServerMetadata + + msg, err := server.ValidatorUpdateBlock(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_IndexRecentParams_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetIndexRecentParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.IndexRecentParams(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_IndexRecentParams_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetIndexRecentParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.IndexRecentParams(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_IndexRecentMsg_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetIndexRecentMsgRequest + var metadata runtime.ServerMetadata + + msg, err := client.IndexRecentMsg(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_IndexRecentMsg_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetIndexRecentMsgRequest + var metadata runtime.ServerMetadata + + msg, err := server.IndexRecentMsg(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_RecentMsg_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRecentMsgRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["block"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "block") + } + + protoReq.Block, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "block", err) + } + + msg, err := client.RecentMsg(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RecentMsg_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRecentMsgRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["block"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "block") + } + + protoReq.Block, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "block", err) + } + + msg, err := server.RecentMsg(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_RecentMsgAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_RecentMsgAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRecentMsgRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RecentMsgAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RecentMsgAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RecentMsgAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRecentMsgRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RecentMsgAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RecentMsgAll(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_RecentParams_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRecentParamsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["block"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "block") + } + + protoReq.Block, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "block", err) + } + + msg, err := client.RecentParams(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RecentParams_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRecentParamsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["block"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "block") + } + + protoReq.Block, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "block", err) + } + + msg, err := server.RecentParams(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_RecentParamsAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_RecentParamsAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRecentParamsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RecentParamsAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RecentParamsAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RecentParamsAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRecentParamsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RecentParamsAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RecentParamsAll(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -257,6 +491,167 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_ValidatorUpdateBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ValidatorUpdateBlock_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ValidatorUpdateBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IndexRecentParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_IndexRecentParams_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IndexRecentParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IndexRecentMsg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_IndexRecentMsg_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IndexRecentMsg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentMsg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RecentMsg_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentMsg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentMsgAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RecentMsgAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentMsgAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RecentParams_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentParamsAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RecentParamsAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentParamsAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -378,6 +773,146 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_ValidatorUpdateBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ValidatorUpdateBlock_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ValidatorUpdateBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IndexRecentParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_IndexRecentParams_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IndexRecentParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IndexRecentMsg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_IndexRecentMsg_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IndexRecentMsg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentMsg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RecentMsg_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentMsg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentMsgAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RecentMsgAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentMsgAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RecentParams_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentParamsAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RecentParamsAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentParamsAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -389,6 +924,20 @@ var ( pattern_Query_PricesAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "prices"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_Validators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "validators"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_ValidatorUpdateBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "validator_update_block"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_IndexRecentParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "index_recent_params"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_IndexRecentMsg_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "index_recent_msg"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RecentMsg_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "recent_msg", "block"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RecentMsgAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "recent_msg"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RecentParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "recent_params", "block"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RecentParamsAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "recent_params"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -399,4 +948,18 @@ var ( forward_Query_PricesAll_0 = runtime.ForwardResponseMessage forward_Query_Validators_0 = runtime.ForwardResponseMessage + + forward_Query_ValidatorUpdateBlock_0 = runtime.ForwardResponseMessage + + forward_Query_IndexRecentParams_0 = runtime.ForwardResponseMessage + + forward_Query_IndexRecentMsg_0 = runtime.ForwardResponseMessage + + forward_Query_RecentMsg_0 = runtime.ForwardResponseMessage + + forward_Query_RecentMsgAll_0 = runtime.ForwardResponseMessage + + forward_Query_RecentParams_0 = runtime.ForwardResponseMessage + + forward_Query_RecentParamsAll_0 = runtime.ForwardResponseMessage ) diff --git a/x/oracle/types/recent_msg.pb.go b/x/oracle/types/recent_msg.pb.go new file mode 100644 index 000000000..14b2e3a62 --- /dev/null +++ b/x/oracle/types/recent_msg.pb.go @@ -0,0 +1,451 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/recent_msg.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type RecentMsg struct { + Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` + FeederId int32 `protobuf:"varint,2,opt,name=feeder_id,json=feederId,proto3" json:"feeder_id,omitempty"` + PSources *PriceWithSource `protobuf:"bytes,3,opt,name=p_sources,json=pSources,proto3" json:"p_sources,omitempty"` + Validator string `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` +} + +func (m *RecentMsg) Reset() { *m = RecentMsg{} } +func (m *RecentMsg) String() string { return proto.CompactTextString(m) } +func (*RecentMsg) ProtoMessage() {} +func (*RecentMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_fa7a51ad934a6cc3, []int{0} +} +func (m *RecentMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RecentMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RecentMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RecentMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_RecentMsg.Merge(m, src) +} +func (m *RecentMsg) XXX_Size() int { + return m.Size() +} +func (m *RecentMsg) XXX_DiscardUnknown() { + xxx_messageInfo_RecentMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_RecentMsg proto.InternalMessageInfo + +func (m *RecentMsg) GetBlock() uint64 { + if m != nil { + return m.Block + } + return 0 +} + +func (m *RecentMsg) GetFeederId() int32 { + if m != nil { + return m.FeederId + } + return 0 +} + +func (m *RecentMsg) GetPSources() *PriceWithSource { + if m != nil { + return m.PSources + } + return nil +} + +func (m *RecentMsg) GetValidator() string { + if m != nil { + return m.Validator + } + return "" +} + +func init() { + proto.RegisterType((*RecentMsg)(nil), "exocore.oracle.RecentMsg") +} + +func init() { proto.RegisterFile("exocore/oracle/recent_msg.proto", fileDescriptor_fa7a51ad934a6cc3) } + +var fileDescriptor_fa7a51ad934a6cc3 = []byte{ + // 260 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x4a, 0x4d, 0x4e, 0xcd, + 0x2b, 0x89, 0xcf, 0x2d, 0x4e, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x2a, 0xd0, + 0x83, 0x28, 0x90, 0x92, 0x42, 0xd3, 0x50, 0x50, 0x94, 0x99, 0x9c, 0x0a, 0x51, 0xab, 0x34, 0x8b, + 0x91, 0x8b, 0x33, 0x08, 0x6c, 0x80, 0x6f, 0x71, 0xba, 0x90, 0x08, 0x17, 0x6b, 0x52, 0x4e, 0x7e, + 0x72, 0xb6, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x4b, 0x10, 0x84, 0x23, 0x24, 0xcd, 0xc5, 0x99, 0x96, + 0x9a, 0x9a, 0x92, 0x5a, 0x14, 0x9f, 0x99, 0x22, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x1a, 0xc4, 0x01, + 0x11, 0xf0, 0x4c, 0x11, 0xb2, 0xe1, 0xe2, 0x2c, 0x88, 0x2f, 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0x2d, + 0x96, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd7, 0x43, 0x75, 0x80, 0x5e, 0x00, 0xc8, 0xc2, + 0xf0, 0xcc, 0x92, 0x8c, 0x60, 0xb0, 0xba, 0x20, 0x8e, 0x02, 0x08, 0xa3, 0x58, 0x48, 0x86, 0x8b, + 0xb3, 0x2c, 0x31, 0x27, 0x33, 0x25, 0xb1, 0x24, 0xbf, 0x48, 0x82, 0x45, 0x81, 0x51, 0x83, 0x33, + 0x08, 0x21, 0xe0, 0xe4, 0x75, 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, 0x06, + 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xae, 0x10, 0xcb, 0xfc, 0x52, + 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0x61, 0x9e, 0xad, 0x80, 0x79, 0xb7, 0xa4, 0xb2, 0x20, 0xb5, + 0x38, 0x89, 0x0d, 0xec, 0x5f, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x08, 0x59, 0x72, + 0x3e, 0x01, 0x00, 0x00, +} + +func (m *RecentMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RecentMsg) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RecentMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Validator) > 0 { + i -= len(m.Validator) + copy(dAtA[i:], m.Validator) + i = encodeVarintRecentMsg(dAtA, i, uint64(len(m.Validator))) + i-- + dAtA[i] = 0x22 + } + if m.PSources != nil { + { + size, err := m.PSources.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRecentMsg(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.FeederId != 0 { + i = encodeVarintRecentMsg(dAtA, i, uint64(m.FeederId)) + i-- + dAtA[i] = 0x10 + } + if m.Block != 0 { + i = encodeVarintRecentMsg(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintRecentMsg(dAtA []byte, offset int, v uint64) int { + offset -= sovRecentMsg(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RecentMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Block != 0 { + n += 1 + sovRecentMsg(uint64(m.Block)) + } + if m.FeederId != 0 { + n += 1 + sovRecentMsg(uint64(m.FeederId)) + } + if m.PSources != nil { + l = m.PSources.Size() + n += 1 + l + sovRecentMsg(uint64(l)) + } + l = len(m.Validator) + if l > 0 { + n += 1 + l + sovRecentMsg(uint64(l)) + } + return n +} + +func sovRecentMsg(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRecentMsg(x uint64) (n int) { + return sovRecentMsg(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RecentMsg) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RecentMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RecentMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + m.Block = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Block |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FeederId", wireType) + } + m.FeederId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FeederId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PSources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRecentMsg + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRecentMsg + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PSources == nil { + m.PSources = &PriceWithSource{} + } + if err := m.PSources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRecentMsg + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecentMsg + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRecentMsg(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecentMsg + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRecentMsg(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthRecentMsg + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRecentMsg + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRecentMsg + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRecentMsg = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRecentMsg = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRecentMsg = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/recent_params.pb.go b/x/oracle/types/recent_params.pb.go new file mode 100644 index 000000000..1f4ffe2c2 --- /dev/null +++ b/x/oracle/types/recent_params.pb.go @@ -0,0 +1,362 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/recent_params.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type RecentParams struct { + Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (m *RecentParams) Reset() { *m = RecentParams{} } +func (m *RecentParams) String() string { return proto.CompactTextString(m) } +func (*RecentParams) ProtoMessage() {} +func (*RecentParams) Descriptor() ([]byte, []int) { + return fileDescriptor_3ba826a0c619fc62, []int{0} +} +func (m *RecentParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RecentParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RecentParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RecentParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_RecentParams.Merge(m, src) +} +func (m *RecentParams) XXX_Size() int { + return m.Size() +} +func (m *RecentParams) XXX_DiscardUnknown() { + xxx_messageInfo_RecentParams.DiscardUnknown(m) +} + +var xxx_messageInfo_RecentParams proto.InternalMessageInfo + +func (m *RecentParams) GetBlock() uint64 { + if m != nil { + return m.Block + } + return 0 +} + +func (m *RecentParams) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + +func init() { + proto.RegisterType((*RecentParams)(nil), "exocore.oracle.RecentParams") +} + +func init() { + proto.RegisterFile("exocore/oracle/recent_params.proto", fileDescriptor_3ba826a0c619fc62) +} + +var fileDescriptor_3ba826a0c619fc62 = []byte{ + // 192 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x4a, 0x4d, 0x4e, 0xcd, + 0x2b, 0x89, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, + 0x83, 0xaa, 0xd1, 0x83, 0xa8, 0x91, 0x92, 0x46, 0xd3, 0x83, 0xac, 0x58, 0x29, 0x84, 0x8b, 0x27, + 0x08, 0x6c, 0x46, 0x00, 0x58, 0x54, 0x48, 0x84, 0x8b, 0x35, 0x29, 0x27, 0x3f, 0x39, 0x5b, 0x82, + 0x51, 0x81, 0x51, 0x83, 0x25, 0x08, 0xc2, 0x11, 0xd2, 0xe3, 0x62, 0x83, 0xe8, 0x92, 0x60, 0x52, + 0x60, 0xd4, 0xe0, 0x36, 0x12, 0xd3, 0x43, 0xb5, 0x43, 0x0f, 0xa2, 0x3b, 0x08, 0xaa, 0xca, 0xc9, + 0xeb, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, + 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x0c, 0xd2, 0x33, 0x4b, 0x32, + 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x5d, 0x21, 0x66, 0xf8, 0xa5, 0x96, 0x94, 0xe7, 0x17, + 0x65, 0xeb, 0xc3, 0x9c, 0x59, 0x01, 0x73, 0x68, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, + 0xa1, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6a, 0xb1, 0x06, 0x17, 0xfb, 0x00, 0x00, 0x00, +} + +func (m *RecentParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RecentParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RecentParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRecentParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Block != 0 { + i = encodeVarintRecentParams(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintRecentParams(dAtA []byte, offset int, v uint64) int { + offset -= sovRecentParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RecentParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Block != 0 { + n += 1 + sovRecentParams(uint64(m.Block)) + } + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovRecentParams(uint64(l)) + } + return n +} + +func sovRecentParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRecentParams(x uint64) (n int) { + return sovRecentParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RecentParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RecentParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RecentParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + m.Block = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Block |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRecentParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRecentParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRecentParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecentParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRecentParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecentParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecentParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecentParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthRecentParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRecentParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRecentParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRecentParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRecentParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRecentParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/validator_update_block.pb.go b/x/oracle/types/validator_update_block.pb.go new file mode 100644 index 000000000..3be936b0d --- /dev/null +++ b/x/oracle/types/validator_update_block.pb.go @@ -0,0 +1,301 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/validator_update_block.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type ValidatorUpdateBlock struct { + Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` +} + +func (m *ValidatorUpdateBlock) Reset() { *m = ValidatorUpdateBlock{} } +func (m *ValidatorUpdateBlock) String() string { return proto.CompactTextString(m) } +func (*ValidatorUpdateBlock) ProtoMessage() {} +func (*ValidatorUpdateBlock) Descriptor() ([]byte, []int) { + return fileDescriptor_2ea66d5cc483dd28, []int{0} +} +func (m *ValidatorUpdateBlock) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorUpdateBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorUpdateBlock.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ValidatorUpdateBlock) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorUpdateBlock.Merge(m, src) +} +func (m *ValidatorUpdateBlock) XXX_Size() int { + return m.Size() +} +func (m *ValidatorUpdateBlock) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorUpdateBlock.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorUpdateBlock proto.InternalMessageInfo + +func (m *ValidatorUpdateBlock) GetBlock() uint64 { + if m != nil { + return m.Block + } + return 0 +} + +func init() { + proto.RegisterType((*ValidatorUpdateBlock)(nil), "exocore.oracle.ValidatorUpdateBlock") +} + +func init() { + proto.RegisterFile("exocore/oracle/validator_update_block.proto", fileDescriptor_2ea66d5cc483dd28) +} + +var fileDescriptor_2ea66d5cc483dd28 = []byte{ + // 171 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4e, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x4b, 0xcc, 0xc9, 0x4c, + 0x49, 0x2c, 0xc9, 0x2f, 0x8a, 0x2f, 0x2d, 0x48, 0x49, 0x2c, 0x49, 0x8d, 0x4f, 0xca, 0xc9, 0x4f, + 0xce, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x2a, 0xd6, 0x83, 0x28, 0x56, 0xd2, + 0xe1, 0x12, 0x09, 0x83, 0xa9, 0x0f, 0x05, 0x2b, 0x77, 0x02, 0xa9, 0x16, 0x12, 0xe1, 0x62, 0x05, + 0x6b, 0x93, 0x60, 0x54, 0x60, 0xd4, 0x60, 0x09, 0x82, 0x70, 0x9c, 0xbc, 0x4e, 0x3c, 0x92, 0x63, + 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, + 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x20, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, + 0x3f, 0x57, 0xdf, 0x15, 0x62, 0x85, 0x5f, 0x6a, 0x49, 0x79, 0x7e, 0x51, 0xb6, 0x3e, 0xcc, 0x79, + 0x15, 0x30, 0x07, 0x96, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x64, 0x0c, 0x08, 0x00, + 0x00, 0xff, 0xff, 0x27, 0x1f, 0x25, 0xe5, 0xbf, 0x00, 0x00, 0x00, +} + +func (m *ValidatorUpdateBlock) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidatorUpdateBlock) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorUpdateBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Block != 0 { + i = encodeVarintValidatorUpdateBlock(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintValidatorUpdateBlock(dAtA []byte, offset int, v uint64) int { + offset -= sovValidatorUpdateBlock(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ValidatorUpdateBlock) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Block != 0 { + n += 1 + sovValidatorUpdateBlock(uint64(m.Block)) + } + return n +} + +func sovValidatorUpdateBlock(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozValidatorUpdateBlock(x uint64) (n int) { + return sovValidatorUpdateBlock(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ValidatorUpdateBlock) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorUpdateBlock + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidatorUpdateBlock: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorUpdateBlock: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + m.Block = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorUpdateBlock + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Block |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipValidatorUpdateBlock(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthValidatorUpdateBlock + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipValidatorUpdateBlock(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidatorUpdateBlock + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidatorUpdateBlock + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidatorUpdateBlock + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthValidatorUpdateBlock + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupValidatorUpdateBlock + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthValidatorUpdateBlock + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthValidatorUpdateBlock = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowValidatorUpdateBlock = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupValidatorUpdateBlock = fmt.Errorf("proto: unexpected end of group") +) From 5df805d6667c610ddce6e819f4c5e4b0d88c5585 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Tue, 12 Mar 2024 15:53:36 +0800 Subject: [PATCH 20/37] feat(oracle-proto):udpate recentMsg --- proto/exocore/oracle/recent_msg.proto | 9 +- x/oracle/types/recent_msg.pb.go | 277 +++++++++++++++++++++----- 2 files changed, 239 insertions(+), 47 deletions(-) diff --git a/proto/exocore/oracle/recent_msg.proto b/proto/exocore/oracle/recent_msg.proto index bd2f4b711..60ac48436 100644 --- a/proto/exocore/oracle/recent_msg.proto +++ b/proto/exocore/oracle/recent_msg.proto @@ -7,8 +7,15 @@ option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; message RecentMsg { uint64 block = 1; + repeated MsgItem msgs = 2; +// int32 feeder_id = 2; + // repeated PriceWithSource p_sources = 3; + // string validator = 4; +} + +message MsgItem{ int32 feeder_id = 2; - PriceWithSource p_sources = 3; + repeated PriceWithSource p_sources = 3; string validator = 4; } diff --git a/x/oracle/types/recent_msg.pb.go b/x/oracle/types/recent_msg.pb.go index 14b2e3a62..bbd95c4ad 100644 --- a/x/oracle/types/recent_msg.pb.go +++ b/x/oracle/types/recent_msg.pb.go @@ -23,10 +23,8 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type RecentMsg struct { - Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` - FeederId int32 `protobuf:"varint,2,opt,name=feeder_id,json=feederId,proto3" json:"feeder_id,omitempty"` - PSources *PriceWithSource `protobuf:"bytes,3,opt,name=p_sources,json=pSources,proto3" json:"p_sources,omitempty"` - Validator string `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` + Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` + Msgs []*MsgItem `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"` } func (m *RecentMsg) Reset() { *m = RecentMsg{} } @@ -69,21 +67,67 @@ func (m *RecentMsg) GetBlock() uint64 { return 0 } -func (m *RecentMsg) GetFeederId() int32 { +func (m *RecentMsg) GetMsgs() []*MsgItem { + if m != nil { + return m.Msgs + } + return nil +} + +type MsgItem struct { + FeederId int32 `protobuf:"varint,2,opt,name=feeder_id,json=feederId,proto3" json:"feeder_id,omitempty"` + PSources []*PriceWithSource `protobuf:"bytes,3,rep,name=p_sources,json=pSources,proto3" json:"p_sources,omitempty"` + Validator string `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` +} + +func (m *MsgItem) Reset() { *m = MsgItem{} } +func (m *MsgItem) String() string { return proto.CompactTextString(m) } +func (*MsgItem) ProtoMessage() {} +func (*MsgItem) Descriptor() ([]byte, []int) { + return fileDescriptor_fa7a51ad934a6cc3, []int{1} +} +func (m *MsgItem) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgItem.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgItem.Merge(m, src) +} +func (m *MsgItem) XXX_Size() int { + return m.Size() +} +func (m *MsgItem) XXX_DiscardUnknown() { + xxx_messageInfo_MsgItem.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgItem proto.InternalMessageInfo + +func (m *MsgItem) GetFeederId() int32 { if m != nil { return m.FeederId } return 0 } -func (m *RecentMsg) GetPSources() *PriceWithSource { +func (m *MsgItem) GetPSources() []*PriceWithSource { if m != nil { return m.PSources } return nil } -func (m *RecentMsg) GetValidator() string { +func (m *MsgItem) GetValidator() string { if m != nil { return m.Validator } @@ -92,29 +136,32 @@ func (m *RecentMsg) GetValidator() string { func init() { proto.RegisterType((*RecentMsg)(nil), "exocore.oracle.RecentMsg") + proto.RegisterType((*MsgItem)(nil), "exocore.oracle.MsgItem") } func init() { proto.RegisterFile("exocore/oracle/recent_msg.proto", fileDescriptor_fa7a51ad934a6cc3) } var fileDescriptor_fa7a51ad934a6cc3 = []byte{ - // 260 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xad, 0xc8, 0x4f, - 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x4a, 0x4d, 0x4e, 0xcd, - 0x2b, 0x89, 0xcf, 0x2d, 0x4e, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x2a, 0xd0, - 0x83, 0x28, 0x90, 0x92, 0x42, 0xd3, 0x50, 0x50, 0x94, 0x99, 0x9c, 0x0a, 0x51, 0xab, 0x34, 0x8b, - 0x91, 0x8b, 0x33, 0x08, 0x6c, 0x80, 0x6f, 0x71, 0xba, 0x90, 0x08, 0x17, 0x6b, 0x52, 0x4e, 0x7e, - 0x72, 0xb6, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x4b, 0x10, 0x84, 0x23, 0x24, 0xcd, 0xc5, 0x99, 0x96, - 0x9a, 0x9a, 0x92, 0x5a, 0x14, 0x9f, 0x99, 0x22, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x1a, 0xc4, 0x01, - 0x11, 0xf0, 0x4c, 0x11, 0xb2, 0xe1, 0xe2, 0x2c, 0x88, 0x2f, 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0x2d, - 0x96, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd7, 0x43, 0x75, 0x80, 0x5e, 0x00, 0xc8, 0xc2, - 0xf0, 0xcc, 0x92, 0x8c, 0x60, 0xb0, 0xba, 0x20, 0x8e, 0x02, 0x08, 0xa3, 0x58, 0x48, 0x86, 0x8b, - 0xb3, 0x2c, 0x31, 0x27, 0x33, 0x25, 0xb1, 0x24, 0xbf, 0x48, 0x82, 0x45, 0x81, 0x51, 0x83, 0x33, - 0x08, 0x21, 0xe0, 0xe4, 0x75, 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, 0x06, - 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xae, 0x10, 0xcb, 0xfc, 0x52, - 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0x61, 0x9e, 0xad, 0x80, 0x79, 0xb7, 0xa4, 0xb2, 0x20, 0xb5, - 0x38, 0x89, 0x0d, 0xec, 0x5f, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x08, 0x59, 0x72, - 0x3e, 0x01, 0x00, 0x00, + // 290 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0x41, 0x4b, 0xc3, 0x40, + 0x10, 0x85, 0xbb, 0x6d, 0xaa, 0xcd, 0x0a, 0x1e, 0x16, 0xc1, 0x50, 0x65, 0x1b, 0x7a, 0x0a, 0x08, + 0x89, 0xe8, 0xd5, 0x93, 0xe0, 0xa1, 0x42, 0x8b, 0xac, 0x07, 0xc1, 0x4b, 0x48, 0x36, 0x63, 0x1a, + 0x9a, 0xb8, 0x61, 0x77, 0xab, 0xf5, 0xea, 0x2f, 0xf0, 0x67, 0x79, 0xec, 0xd1, 0xa3, 0x24, 0x7f, + 0x44, 0xdc, 0x6d, 0x11, 0x7b, 0x9b, 0x79, 0x7c, 0xef, 0xcd, 0xf0, 0xf0, 0x08, 0x56, 0x82, 0x0b, + 0x09, 0x91, 0x90, 0x09, 0x2f, 0x21, 0x92, 0xc0, 0xe1, 0x59, 0xc7, 0x95, 0xca, 0xc3, 0x5a, 0x0a, + 0x2d, 0xc8, 0xe1, 0x06, 0x08, 0x2d, 0x30, 0x1c, 0xee, 0x18, 0x6a, 0x59, 0x70, 0xb0, 0xec, 0x78, + 0x86, 0x5d, 0x66, 0xfc, 0x53, 0x95, 0x93, 0x23, 0xdc, 0x4f, 0x4b, 0xc1, 0x17, 0x1e, 0xf2, 0x51, + 0xe0, 0x30, 0xbb, 0x90, 0x33, 0xec, 0x54, 0x2a, 0x57, 0x5e, 0xd7, 0xef, 0x05, 0x07, 0x17, 0xc7, + 0xe1, 0xff, 0xf4, 0x70, 0xaa, 0xf2, 0x89, 0x86, 0x8a, 0x19, 0x68, 0xfc, 0x8e, 0xf0, 0xfe, 0x46, + 0x21, 0x27, 0xd8, 0x7d, 0x02, 0xc8, 0x40, 0xc6, 0x45, 0xe6, 0x75, 0x7d, 0x14, 0xf4, 0xd9, 0xc0, + 0x0a, 0x93, 0x8c, 0x5c, 0x61, 0xb7, 0x8e, 0x95, 0x58, 0x4a, 0x0e, 0xca, 0xeb, 0x99, 0xe8, 0xd1, + 0x6e, 0xf4, 0xdd, 0xef, 0xa3, 0x0f, 0x85, 0x9e, 0xdf, 0x1b, 0x8e, 0x0d, 0x6a, 0x3b, 0x28, 0x72, + 0x8a, 0xdd, 0x97, 0xa4, 0x2c, 0xb2, 0x44, 0x0b, 0xe9, 0x39, 0x3e, 0x0a, 0x5c, 0xf6, 0x27, 0x5c, + 0xdf, 0x7e, 0x36, 0x14, 0xad, 0x1b, 0x8a, 0xbe, 0x1b, 0x8a, 0x3e, 0x5a, 0xda, 0x59, 0xb7, 0xb4, + 0xf3, 0xd5, 0xd2, 0xce, 0xe3, 0x79, 0x5e, 0xe8, 0xf9, 0x32, 0x0d, 0xb9, 0xa8, 0xa2, 0x1b, 0x7b, + 0x6c, 0x06, 0xfa, 0x55, 0xc8, 0x45, 0xb4, 0x2d, 0x69, 0xb5, 0xad, 0x49, 0xbf, 0xd5, 0xa0, 0xd2, + 0x3d, 0xd3, 0xd3, 0xe5, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x33, 0x0b, 0xb0, 0xb3, 0x76, 0x01, + 0x00, 0x00, } func (m *RecentMsg) Marshal() (dAtA []byte, err error) { @@ -133,6 +180,48 @@ func (m *RecentMsg) MarshalTo(dAtA []byte) (int, error) { } func (m *RecentMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Msgs) > 0 { + for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRecentMsg(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Block != 0 { + i = encodeVarintRecentMsg(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgItem) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgItem) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -144,28 +233,25 @@ func (m *RecentMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if m.PSources != nil { - { - size, err := m.PSources.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.PSources) > 0 { + for iNdEx := len(m.PSources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PSources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRecentMsg(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintRecentMsg(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a } - i-- - dAtA[i] = 0x1a } if m.FeederId != 0 { i = encodeVarintRecentMsg(dAtA, i, uint64(m.FeederId)) i-- dAtA[i] = 0x10 } - if m.Block != 0 { - i = encodeVarintRecentMsg(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x8 - } return len(dAtA) - i, nil } @@ -189,12 +275,29 @@ func (m *RecentMsg) Size() (n int) { if m.Block != 0 { n += 1 + sovRecentMsg(uint64(m.Block)) } + if len(m.Msgs) > 0 { + for _, e := range m.Msgs { + l = e.Size() + n += 1 + l + sovRecentMsg(uint64(l)) + } + } + return n +} + +func (m *MsgItem) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l if m.FeederId != 0 { n += 1 + sovRecentMsg(uint64(m.FeederId)) } - if m.PSources != nil { - l = m.PSources.Size() - n += 1 + l + sovRecentMsg(uint64(l)) + if len(m.PSources) > 0 { + for _, e := range m.PSources { + l = e.Size() + n += 1 + l + sovRecentMsg(uint64(l)) + } } l = len(m.Validator) if l > 0 { @@ -257,6 +360,90 @@ func (m *RecentMsg) Unmarshal(dAtA []byte) error { break } } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msgs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRecentMsg + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRecentMsg + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msgs = append(m.Msgs, &MsgItem{}) + if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRecentMsg(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecentMsg + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgItem) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field FeederId", wireType) @@ -305,10 +492,8 @@ func (m *RecentMsg) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.PSources == nil { - m.PSources = &PriceWithSource{} - } - if err := m.PSources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.PSources = append(m.PSources, &PriceWithSource{}) + if err := m.PSources[len(m.PSources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex From 4208917cf07c152f91b5cc0fffd1afd317ce9977 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Wed, 13 Mar 2024 13:33:36 +0800 Subject: [PATCH 21/37] feat(oracle-keeper): update recache --- x/oracle/keeper/aggregator.go | 8 +- x/oracle/keeper/caches.go | 229 +++++++++++++++------ x/oracle/keeper/msg_server_create_price.go | 4 +- x/oracle/keeper/recent_msg.go | 16 ++ x/oracle/keeper/recent_params.go | 15 ++ x/oracle/keeper/types.go | 14 +- 6 files changed, 217 insertions(+), 69 deletions(-) diff --git a/x/oracle/keeper/aggregator.go b/x/oracle/keeper/aggregator.go index bb9693d0f..601e3421a 100644 --- a/x/oracle/keeper/aggregator.go +++ b/x/oracle/keeper/aggregator.go @@ -172,7 +172,7 @@ func (agc *aggregatorContext) checkMsg(msg *types.MsgCreatePrice) error { return nil } -func (agc *aggregatorContext) fillPrice(msg *types.MsgCreatePrice) (*priceItemKV, *cacheItem, error) { +func (agc *aggregatorContext) fillPrice(msg *types.MsgCreatePrice) (*priceItemKV, *cacheItemM, error) { feederWorker := agc.aggregators[msg.FeederId] //worker initialzed here reduce workload for Endblocker if feederWorker == nil { @@ -196,7 +196,7 @@ func (agc *aggregatorContext) fillPrice(msg *types.MsgCreatePrice) (*priceItemKV RoundId: agc.rounds[msg.FeederId].nextRoundId, }}, nil, nil } - return nil, &cacheItem{msg.FeederId, listFilled, msg.Creator}, nil + return nil, &cacheItemM{msg.FeederId, listFilled, msg.Creator}, nil } return nil, nil, errors.New("") @@ -204,7 +204,7 @@ func (agc *aggregatorContext) fillPrice(msg *types.MsgCreatePrice) (*priceItemKV // NewCreatePrice receives msgCreatePrice message, and goes process: filter->aggregator, filter->calculator->aggregator // non-deterministic data will goes directly into aggregator, and deterministic data will goes into calculator first to get consensus on the deterministic id. -func (agc *aggregatorContext) newCreatePrice(ctx sdk.Context, msg *types.MsgCreatePrice) (*priceItemKV, *cacheItem, error) { +func (agc *aggregatorContext) newCreatePrice(ctx sdk.Context, msg *types.MsgCreatePrice) (*priceItemKV, *cacheItemM, error) { if err := agc.checkMsg(msg); err != nil { return nil, nil, err @@ -270,7 +270,7 @@ func (agC *aggregatorContext) prepareRound(ctx sdk.Context, block uint64) { block = uint64(ctx.BlockHeight()) } - for feederId, feeder := range agc.params.TokenFeeders { + for feederId, feeder := range agc.params.getTokenFeeders() { if uint64(feeder.EndBlock) <= block || uint64(feeder.StartBaseBlock) > block { //this feeder is inactive continue diff --git a/x/oracle/keeper/caches.go b/x/oracle/keeper/caches.go index 0a5263e2e..52d79e6a2 100644 --- a/x/oracle/keeper/caches.go +++ b/x/oracle/keeper/caches.go @@ -8,16 +8,28 @@ import ( stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) -type cacheItem struct { +var zeroBig = big.NewInt(0) +var caches *cache + +type cacheItemV map[string]*big.Int +type cacheItemP *params +type cacheItemM struct { feederId int32 pSources []*types.PriceWithSource validator string - // power *big.Int } +type cache struct { + msg cacheMsgs + validators *cacheValidator + params *cacheParams +} + +type cacheMsgs map[int32][]*cacheItemM + // used to track validator change type cacheValidator struct { - validators []*types.Validator + validators map[string]*big.Int update bool } @@ -27,50 +39,139 @@ type cacheParams struct { update bool } -// memory cache -func (k *Keeper) addCache(item *cacheItem) { - +func (c cacheMsgs) add(item *cacheItemM) { + c[item.feederId] = append(c[item.feederId], item) } - -// memory cache -func (k *Keeper) removeCache(item *cacheItem) { - +func (c cacheMsgs) remove(item *cacheItemM) { + delete(c, item.feederId) } -func (k *Keeper) commitCache() { - +func (c cacheMsgs) commit(ctx sdk.Context, k *Keeper) { + block := uint64(ctx.BlockHeight()) + recentMsgs := types.RecentMsg{ + Block: block, + Msgs: make([]*types.MsgItem, 0), + } + for _, msgs4Feeder := range c { + for _, msg := range msgs4Feeder { + recentMsgs.Msgs = append(recentMsgs.Msgs, &types.MsgItem{ + FeederId: msg.feederId, + PSources: msg.pSources, + Validator: msg.validator, + }) + } + } + index, _ := k.GetIndexRecentMsg(ctx) + for i, b := range index.Index { + if b >= block-maxNonce { + index.Index = index.Index[i:] + break + } + k.RemoveRecentMsg(ctx, b) + } + k.SetRecentMsg(ctx, recentMsgs) + index.Index = append(index.Index, block) + k.SetIndexRecentMsg(ctx, index) } -// persist cache into KV -func (k *Keeper) updateRecentTxs() { - //TODO: add - - //TODO: delete, use map in the KVStore, so actually dont need to implement the exactly 'delete' at firt, just remove all blocks before maxDistance +func (c *cacheValidator) add(validators map[string]*big.Int) { + for operator, newPower := range validators { + if power, ok := c.validators[operator]; ok { + if newPower.Cmp(zeroBig) == 0 { + delete(c.validators, operator) + c.update = true + } else if power.Cmp(newPower) != 0 { + c.validators[operator].Set(newPower) + c.update = true + } + } else { + c.update = true + np := *newPower + c.validators[operator] = &np + } + } } -func (k *Keeper) updateCacheValidators() bool { - return false +func (c *cacheValidator) commit(ctx sdk.Context, k *Keeper) { + block := uint64(ctx.BlockHeight()) + k.SetValidatorUpdateBlock(ctx, types.ValidatorUpdateBlock{Block: block}) } -func (k *Keeper) updateCacheParams() bool { - return false + +func (c *cacheParams) add(p *params) { + //params' update is triggered when params is actually updated, so no need to do comparison here, just udpate and mark the flag + //TODO: add comparison check, that's something should be done for validation + c.params = p + c.update = true } -// from KVStore -func (k *Keeper) getCaches(ctx sdk.Context) map[uint64][]*cacheItem { - return nil +func (c *cacheParams) commit(ctx sdk.Context, k *Keeper) { + block := uint64(ctx.BlockHeight()) + index, _ := k.GetIndexRecentParams(ctx) + for i, b := range index.Index { + if b >= block-maxNonce { + index.Index = index.Index[i:] + break + } + k.RemoveRecentParams(ctx, b) + } + //remove and append for KVStore + k.SetIndexRecentParams(ctx, index) + index.Index = append(index.Index, block) + k.SetIndexRecentParams(ctx, index) } -func (k *Keeper) getParams4CacheRecover(ctx sdk.Context) map[uint64]*params { - return nil +// memory cache +func (k *Keeper) addCache(i any) { + switch item := i.(type) { + case *cacheItemM: + caches.msg.add(item) + // case *params: + case cacheItemP: + caches.params.add(item) + case cacheItemV: + caches.validators.add(item) + default: + panic("no other types are support") + } +} +func (k *Keeper) removeCache(i any) { + switch item := i.(type) { + case *cacheItemM: + caches.msg.remove(item) + default: + } } -func (k *Keeper) clearCaches(ctx sdk.Context) { +func (k *Keeper) commitCache(ctx sdk.Context, reset bool) { + if len(caches.msg) > 0 { + caches.msg.commit(ctx, k) + caches.msg = make(map[int32][]*cacheItemM) + } + if caches.validators.update { + caches.validators.commit(ctx, k) + caches.validators.update = false + } + + if caches.params.update { + caches.params.commit(ctx, k) + caches.params.update = false + } + if reset { + k.resetCaches(ctx) + } } -// from KVStore -func (k *Keeper) getCacheValidators(ctx sdk.Context) map[string]*big.Int { - return nil +func (k *Keeper) resetCaches(ctx sdk.Context) { + caches = &cache{ + msg: make(map[int32][]*cacheItemM), + validators: &cacheValidator{ + validators: make(map[string]*big.Int), + }, + params: &cacheParams{ + params: ¶ms{}, + }, + } } func (k *Keeper) recacheAggregatorContext(ctx sdk.Context, agc *aggregatorContext) bool { @@ -78,35 +179,48 @@ func (k *Keeper) recacheAggregatorContext(ctx sdk.Context, agc *aggregatorContex from := uint64(ctx.BlockHeight()) - maxNonce to := uint64(ctx.BlockHeight()) - 1 - //fill validators - validators, ok := k.GetValidators(ctx) - recenetParams := k.getParams4CacheRecover(ctx) - if !ok || recenetParams == nil { + h, ok := k.GetValidatorUpdateBlock(ctx) + recentParamsMap := k.GetAllRecentParamsAsMap(ctx) + if !ok || recentParamsMap == nil { //no cache, this is the very first running, so go to initial proces instead return false } - h := validators.Block - if h > from { - from = h + + if h.Block > from { + from = h.Block } - for _, v := range validators.ValidatorList { - agc.validatorsPower[v.Operator], _ = new(big.Int).SetString(v.Power, 10) + + totalPower := big.NewInt(0) + k.stakingKeeper.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingTypes.ValidatorI) bool { + power := big.NewInt(validator.GetConsensusPower(validator.GetBondedTokens())) + addr := string(validator.GetOperator()) + agc.validatorsPower[addr] = power + totalPower = new(big.Int).Add(totalPower, power) + return false + }) + agc.totalPower = k.stakingKeeper.GetLastTotalPower(ctx).BigInt() + //TODO: test only + if agc.totalPower.Cmp(totalPower) != 0 { + panic("something wrong when get validatorsPower from staking module") } - recentMsgs := k.getCaches(ctx) + //reset validators + k.addCache(cacheItemV(agc.validatorsPower)) + + recentMsgs := k.GetAllRecentMsgAsMap(ctx) for ; from < to; from++ { //fill params - for h, p := range recenetParams { + for b, recentParams := range recentParamsMap { prev := uint64(0) - if h <= from && h > prev { - pTmp := params(*p) + if b <= from && b > prev { + pTmp := params(*recentParams) agc.params = &pTmp if prev > 0 { //TODO: safe delete - delete(recenetParams, prev) + delete(recentParamsMap, prev) } - prev = h + prev = b } } @@ -116,15 +230,18 @@ func (k *Keeper) recacheAggregatorContext(ctx sdk.Context, agc *aggregatorContex for _, msg := range msgs { //these messages are retreived for recache, just skip the validation check and fill the memory cache agc.fillPrice(&types.MsgCreatePrice{ - Creator: msg.validator, - FeederId: msg.feederId, - Prices: msg.pSources, + Creator: msg.Validator, + FeederId: msg.FeederId, + Prices: msg.PSources, }) } } agc.sealRound(ctx) } + //fill params cache + k.addCache(cacheItemP(agc.params)) + agc.prepareRound(ctx, to) return true @@ -135,29 +252,25 @@ func (k *Keeper) initAggregatorContext(ctx sdk.Context, agc *aggregatorContext) p := k.GetParams(ctx) m := make(map[uint64]*types.Params) m[uint64(ctx.BlockHeight())] = &p - k.setParams4CacheRecover(m) //used to trace tokenFeeder's update during cache recover + // k.setParams4CacheRecover(m) //used to trace tokenFeeder's update during cache recover pTmp := params(p) agc.params = &pTmp + //set params cache + k.addCache(cacheItemP(agc.params)) totalPower := big.NewInt(0) - vList := make([]*types.Validator, 0) k.stakingKeeper.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingTypes.ValidatorI) bool { power := big.NewInt(validator.GetConsensusPower(validator.GetBondedTokens())) addr := string(validator.GetOperator()) agc.validatorsPower[addr] = power totalPower = new(big.Int).Add(totalPower, power) - vList = append(vList, &types.Validator{Operator: addr, Power: power.String()}) return false }) agc.totalPower = totalPower - k.SetValidators(ctx, types.Validators{ - Block: uint64(ctx.BlockHeight()), - ValidatorList: vList, - }) + + //set validatorPower cache + k.addCache(cacheItemV(agc.validatorsPower)) agc.prepareRound(ctx, uint64(ctx.BlockHeight())-1) return nil } - -// this is a mock serves as a placeholder -func (k *Keeper) setParams4CacheRecover(p map[uint64]*types.Params) {} diff --git a/x/oracle/keeper/msg_server_create_price.go b/x/oracle/keeper/msg_server_create_price.go index e074ab587..c27b8f727 100644 --- a/x/oracle/keeper/msg_server_create_price.go +++ b/x/oracle/keeper/msg_server_create_price.go @@ -28,7 +28,7 @@ func (k msgServer) CreatePrice(goCtx context.Context, msg *types.MsgCreatePrice) if newItem != nil { k.AppendPriceTR(ctx, newItem.tokenId, newItem.priceTR) //TODO: move related caches - k.removeCache(nil) + k.removeCache(caches) } return &types.MsgCreatePriceResponse{}, nil @@ -40,7 +40,7 @@ func getAggregatorContext(ctx sdk.Context, k Keeper) *aggregatorContext { } //initialize the aggregatorContext, normally triggered when node restart - k.clearCaches(ctx) + k.resetCaches(ctx) agc = &aggregatorContext{ validatorsPower: make(map[string]*big.Int), totalPower: big.NewInt(0), diff --git a/x/oracle/keeper/recent_msg.go b/x/oracle/keeper/recent_msg.go index 5b24213b4..1a56e745f 100644 --- a/x/oracle/keeper/recent_msg.go +++ b/x/oracle/keeper/recent_msg.go @@ -61,3 +61,19 @@ func (k Keeper) GetAllRecentMsg(ctx sdk.Context) (list []types.RecentMsg) { return } + +func (k Keeper) GetAllRecentMsgAsMap(ctx sdk.Context) (result map[uint64][]*types.MsgItem) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentMsgKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.RecentMsg + k.cdc.MustUnmarshal(iterator.Value(), &val) + // list = append(list, val) + result[val.Block] = val.Msgs + } + + return +} diff --git a/x/oracle/keeper/recent_params.go b/x/oracle/keeper/recent_params.go index 04c9afa9a..b2413d3cd 100644 --- a/x/oracle/keeper/recent_params.go +++ b/x/oracle/keeper/recent_params.go @@ -61,3 +61,18 @@ func (k Keeper) GetAllRecentParams(ctx sdk.Context) (list []types.RecentParams) return } + +func (k Keeper) GetAllRecentParamsAsMap(ctx sdk.Context) (result map[uint64]*types.Params) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentParamsKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.RecentParams + k.cdc.MustUnmarshal(iterator.Value(), &val) + result[val.Block] = val.Params + } + + return +} diff --git a/x/oracle/keeper/types.go b/x/oracle/keeper/types.go index f1f61a75d..b4a98475c 100644 --- a/x/oracle/keeper/types.go +++ b/x/oracle/keeper/types.go @@ -17,11 +17,15 @@ type priceWithTimeAndRound struct { type params types.Params -func (p *params) isDeterministicSource(sourceId int32) bool { +func (p params) getTokenFeeders() []*types.TokenFeeder { + return p.TokenFeeders +} + +func (p params) isDeterministicSource(sourceId int32) bool { return p.Sources[int(sourceId)].Deterministic } -func (p *params) isValidSource(sourceId int32) bool { +func (p params) isValidSource(sourceId int32) bool { if sourceId == 0 { //custom defined source return true @@ -29,7 +33,7 @@ func (p *params) isValidSource(sourceId int32) bool { return p.Sources[int(sourceId)].Valid } -func (p *params) getTokenFeeder(feederId int32) *types.TokenFeeder { +func (p params) getTokenFeeder(feederId int32) *types.TokenFeeder { for k, v := range p.TokenFeeders { if int32(k) == feederId { return v @@ -37,7 +41,7 @@ func (p *params) getTokenFeeder(feederId int32) *types.TokenFeeder { } return nil } -func (p *params) getTokenInfo(feederId int32) *types.Token { +func (p params) getTokenInfo(feederId int32) *types.Token { for k, v := range p.TokenFeeders { if int32(k) == feederId { return p.Tokens[v.TokenId] @@ -46,7 +50,7 @@ func (p *params) getTokenInfo(feederId int32) *types.Token { return nil } -func (p *params) checkRules(feederId int32, prices []*types.PriceWithSource) (bool, error) { +func (p params) checkRules(feederId int32, prices []*types.PriceWithSource) (bool, error) { feeder := p.TokenFeeders[feederId] rule := p.Rules[feeder.RuleId] //specified sources set, v1 use this rule to set `chainlink` as official source From c006454eae6ee8aa9d144cbcc70f963cb5789c3c Mon Sep 17 00:00:00 2001 From: leonz789 Date: Wed, 13 Mar 2024 16:50:43 +0800 Subject: [PATCH 22/37] feat(oracle-keeper):refactor keeper structure: aggregator, cache, common --- .../keeper/{ => aggregator}/aggregator.go | 157 ++++++------------ .../{ => aggregator}/aggregator_aggregator.go | 16 +- .../{ => aggregator}/aggregator_calculator.go | 9 +- .../{ => aggregator}/aggregator_filter.go | 19 ++- x/oracle/keeper/aggregator/worker.go | 69 ++++++++ x/oracle/keeper/{ => cache}/caches.go | 123 ++++++++------ x/oracle/keeper/common/expected_keepers.go | 35 ++++ x/oracle/keeper/{ => common}/types.go | 60 ++++--- x/oracle/keeper/keeper.go | 10 ++ x/oracle/keeper/msg_server_create_price.go | 42 +---- x/oracle/keeper/single.go | 34 ++++ 11 files changed, 339 insertions(+), 235 deletions(-) rename x/oracle/keeper/{ => aggregator}/aggregator.go (65%) rename x/oracle/keeper/{ => aggregator}/aggregator_aggregator.go (92%) rename x/oracle/keeper/{ => aggregator}/aggregator_calculator.go (94%) rename x/oracle/keeper/{ => aggregator}/aggregator_filter.go (83%) create mode 100644 x/oracle/keeper/aggregator/worker.go rename x/oracle/keeper/{ => cache}/caches.go (64%) create mode 100644 x/oracle/keeper/common/expected_keepers.go rename x/oracle/keeper/{ => common}/types.go (51%) create mode 100644 x/oracle/keeper/single.go diff --git a/x/oracle/keeper/aggregator.go b/x/oracle/keeper/aggregator/aggregator.go similarity index 65% rename from x/oracle/keeper/aggregator.go rename to x/oracle/keeper/aggregator/aggregator.go index 601e3421a..cdaf7cfdb 100644 --- a/x/oracle/keeper/aggregator.go +++ b/x/oracle/keeper/aggregator/aggregator.go @@ -1,83 +1,24 @@ -package keeper +package aggregator import ( "errors" "math/big" "time" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" "github.com/ExocoreNetwork/exocore/x/oracle/types" sdk "github.com/cosmos/cosmos-sdk/types" ) -// TODO: these consts should be defined in params -const ( - //maxNonce indicates how many messages a validator can submit in a single roudn to offer price - //current we use this as a mock distance - maxNonce = 3 - //these two threshold value used to set the threshold to tell when the price had come to consensus and was able to get a final price of that round - threshold_a = 2 - threshold_b = 3 - //maxDetId each validator can submit, so the calculator can cache maximum of maxDetId*count(validators) values, this is for resistance of malicious validator submmiting invalid detId - maxDetId = 5 - //consensus mode: v1: as soon as possbile - mode = 1 -) - -var agc *aggregatorContext - -type priceItemKV struct { - tokenId int32 - priceTR types.PriceWithTimeAndRound -} - -// worker is the actual instance used to calculate final price for each tokenFeeder's round. Which means, every tokenFeeder corresponds to a specified token, and for that tokenFeeder, each round we use a worker instance to calculate the final price -type worker struct { - sealed bool - price string - decimal int32 - //mainly used for deterministic source data to check conflics and validation - f *filter - //used to get to consensus on deterministic source's data - c *calculator - //when enough data(exceeds threshold) collected, aggregate to conduct the final price - a *aggregator - ctx *aggregatorContext -} - -func (w *worker) do(msg *types.MsgCreatePrice) []*types.PriceWithSource { - validator := msg.Creator - power := w.ctx.validatorsPower[validator] - list4Calculator, list4Aggregator := w.f.filtrate(msg) - if list4Aggregator != nil { - w.a.fillPrice(list4Aggregator, validator, power) - if confirmedRounds := w.c.fillPrice(list4Calculator, validator, power); confirmedRounds != nil { - w.a.confirmDSPrice(confirmedRounds) - } - } - return list4Aggregator -} - -func (w *worker) aggregate() *big.Int { - return w.a.aggregate() -} - -// not concurrency safe -func (w *worker) seal() { - if w.sealed { - return - } - w.sealed = true - w.price = w.a.aggregate().String() - w.f = nil - w.c = nil - w.a = nil +type cacheItemM struct { + feederId int32 + pSources []*types.PriceWithSource + validator string } -func (w *worker) getPrice() (string, int32) { - if w.sealed { - return w.price, w.decimal - } - return "", 0 +type priceItemKV struct { + TokenId int32 + PriceTR types.PriceWithTimeAndRound } type roundInfo struct { @@ -90,9 +31,9 @@ type roundInfo struct { status int32 } -// aggregatorContext keeps memory cache for state params, validatorset, and updatedthese values as they udpated on chain. And it keeps the infomation to track all tokenFeeders' status and data collection -type aggregatorContext struct { - params *params +// AggregatorContext keeps memory cache for state params, validatorset, and updatedthese values as they udpated on chain. And it keeps the infomation to track all tokenFeeders' status and data collection +type AggregatorContext struct { + params *common.Params //validator->power validatorsPower map[string]*big.Int @@ -105,7 +46,7 @@ type aggregatorContext struct { aggregators map[int32]*worker } -func (agc *aggregatorContext) sanityCheck(msg *types.MsgCreatePrice) error { +func (agc *AggregatorContext) sanityCheck(msg *types.MsgCreatePrice) error { //sanity check //TODO: check nonce [1,3] in anteHandler, related to params, may not able //TODO: check the msgCreatePrice's Decimal is correct with params setting @@ -115,7 +56,7 @@ func (agc *aggregatorContext) sanityCheck(msg *types.MsgCreatePrice) error { return errors.New("") } - if msg.Nonce < 1 || msg.Nonce > maxNonce { + if msg.Nonce < 1 || msg.Nonce > common.MaxNonce { return errors.New("") } @@ -125,11 +66,11 @@ func (agc *aggregatorContext) sanityCheck(msg *types.MsgCreatePrice) error { } for _, pSource := range msg.Prices { - if pSource.Prices == nil || len(pSource.Prices) == 0 || len(pSource.Prices) > maxDetId || !agc.params.isValidSource(pSource.SourceId) { + if pSource.Prices == nil || len(pSource.Prices) == 0 || len(pSource.Prices) > common.MaxDetId || !agc.params.IsValidSource(pSource.SourceId) { return errors.New("") } //check with params is coressponding source is deteministic - if agc.params.isDeterministicSource(pSource.SourceId) { + if agc.params.IsDeterministicSource(pSource.SourceId) { for _, pDetId := range pSource.Prices { //TODO: verify the format of DetId is correct, since this is string, and we will make consensus with validator's power, so it's ok not to verify the format //just make sure the DetId won't mess up with NS's placeholder id, the limitation of maximum count one validator can submit will be check by filter @@ -149,7 +90,7 @@ func (agc *aggregatorContext) sanityCheck(msg *types.MsgCreatePrice) error { return nil } -func (agc *aggregatorContext) checkMsg(msg *types.MsgCreatePrice) error { +func (agc *AggregatorContext) checkMsg(msg *types.MsgCreatePrice) error { if err := agc.sanityCheck(msg); err != nil { return err } @@ -166,17 +107,17 @@ func (agc *aggregatorContext) checkMsg(msg *types.MsgCreatePrice) error { } //check sources rule matches - if ok, err := agc.params.checkRules(msg.FeederId, msg.Prices); !ok { + if ok, err := agc.params.CheckRules(msg.FeederId, msg.Prices); !ok { return err } return nil } -func (agc *aggregatorContext) fillPrice(msg *types.MsgCreatePrice) (*priceItemKV, *cacheItemM, error) { +func (agc *AggregatorContext) FillPrice(msg *types.MsgCreatePrice) (*priceItemKV, *cacheItemM, error) { feederWorker := agc.aggregators[msg.FeederId] //worker initialzed here reduce workload for Endblocker if feederWorker == nil { - feederWorker = agc.newWorker(msg.FeederId) + feederWorker = newWorker(msg.FeederId, agc) agc.aggregators[msg.FeederId] = feederWorker } @@ -188,13 +129,13 @@ func (agc *aggregatorContext) fillPrice(msg *types.MsgCreatePrice) (*priceItemKV if finalPrice := feederWorker.aggregate(); finalPrice != nil { agc.rounds[msg.FeederId].status = 2 feederWorker.seal() - return &priceItemKV{agc.params.getTokenFeeder(msg.FeederId).TokenId, types.PriceWithTimeAndRound{ + return &priceItemKV{agc.params.GetTokenFeeder(msg.FeederId).TokenId, types.PriceWithTimeAndRound{ Price: finalPrice.String(), - Decimal: agc.params.getTokenInfo(msg.FeederId).Decimal, + Decimal: agc.params.GetTokenInfo(msg.FeederId).Decimal, //TODO: check the format Timestamp: time.Now().String(), RoundId: agc.rounds[msg.FeederId].nextRoundId, - }}, nil, nil + }}, &cacheItemM{feederId: msg.FeederId}, nil } return nil, &cacheItemM{msg.FeederId, listFilled, msg.Creator}, nil } @@ -204,43 +145,32 @@ func (agc *aggregatorContext) fillPrice(msg *types.MsgCreatePrice) (*priceItemKV // NewCreatePrice receives msgCreatePrice message, and goes process: filter->aggregator, filter->calculator->aggregator // non-deterministic data will goes directly into aggregator, and deterministic data will goes into calculator first to get consensus on the deterministic id. -func (agc *aggregatorContext) newCreatePrice(ctx sdk.Context, msg *types.MsgCreatePrice) (*priceItemKV, *cacheItemM, error) { +func (agc *AggregatorContext) NewCreatePrice(ctx sdk.Context, msg *types.MsgCreatePrice) (*priceItemKV, *cacheItemM, error) { if err := agc.checkMsg(msg); err != nil { return nil, nil, err } - return agc.fillPrice(msg) -} - -// newWorker new a instance for a tokenFeeder's specific round -func (agc *aggregatorContext) newWorker(feederId int32) *worker { - return &worker{ - f: newFilter(maxNonce, maxDetId), - c: newCalculator(len(agc.validatorsPower), agc.totalPower), - a: newAggregator(len(agc.validatorsPower), agc.totalPower), - decimal: agc.params.getTokenInfo(feederId).Decimal, - ctx: agc, - } + return agc.FillPrice(msg) } // prepare for new roundInfo, just update the status kept in memory // executed at EndBlock stage, seall all success or expired roundInfo // including possible aggregation and state update // returns: 1st successful sealed, need to be written to KVStore, 2nd: failed sealed tokenId, use previous price to write to KVStore -func (agc *aggregatorContext) sealRound(ctx sdk.Context) (success []*priceItemKV, failed []int32) { +func (agc *AggregatorContext) SealRound(ctx sdk.Context) (success []*priceItemKV, failed []int32) { //1. check validatorSet udpate //TODO: if validatoSet has been updated in current block, just seal all active rounds and return //1. for sealed worker, the KVStore has been updated for feederId, round := range agc.rounds { if round.status == 1 { - feeder := agc.params.getTokenFeeder(feederId) + feeder := agc.params.GetTokenFeeder(feederId) //TODO: for mode=1, we don't do aggregate() here, since if it donesn't success in the transaction execution stage, it won't success here //but it's not always the same for other modes, switch modes - switch mode { + switch common.Mode { case 1: expired := ctx.BlockHeight() >= feeder.EndBlock - outOfWindow := uint64(ctx.BlockHeight())-round.basedBlock >= uint64(maxNonce) + outOfWindow := uint64(ctx.BlockHeight())-round.basedBlock >= uint64(common.MaxNonce) if expired || outOfWindow { //TODO: WRITE TO KVSTORE with previous round data for this round failed = append(failed, feeder.TokenId) @@ -264,13 +194,13 @@ func (agc *aggregatorContext) sealRound(ctx sdk.Context) (success []*priceItemKV return } -func (agC *aggregatorContext) prepareRound(ctx sdk.Context, block uint64) { +func (agc *AggregatorContext) PrepareRound(ctx sdk.Context, block uint64) { //block>0 means recache initialization, all roundInfo is empty if block == 0 { block = uint64(ctx.BlockHeight()) } - for feederId, feeder := range agc.params.getTokenFeeders() { + for feederId, feeder := range agc.params.GetTokenFeeders() { if uint64(feeder.EndBlock) <= block || uint64(feeder.StartBaseBlock) > block { //this feeder is inactive continue @@ -289,7 +219,7 @@ func (agC *aggregatorContext) prepareRound(ctx sdk.Context, block uint64) { basedBlock: latestBasedblock, nextRoundId: latestNextRoundId, } - if left >= maxNonce { + if left >= common.MaxNonce { round.status = 2 } else { round.status = 1 @@ -307,3 +237,26 @@ func (agC *aggregatorContext) prepareRound(ctx sdk.Context, block uint64) { } } } + +func (agc *AggregatorContext) SetParams(p *common.Params) { + agc.params = p +} + +func (agc *AggregatorContext) SetValidatorPowers(vp map[string]*big.Int) { + for addr, power := range vp { + agc.validatorsPower[addr] = power + } +} + +func (agc *AggregatorContext) SetTotalPower(power *big.Int) { + agc.totalPower = power +} + +func NewAggregatorContext() *AggregatorContext { + return &AggregatorContext{ + validatorsPower: make(map[string]*big.Int), + totalPower: big.NewInt(0), + rounds: make(map[int32]*roundInfo), + aggregators: make(map[int32]*worker), + } +} diff --git a/x/oracle/keeper/aggregator_aggregator.go b/x/oracle/keeper/aggregator/aggregator_aggregator.go similarity index 92% rename from x/oracle/keeper/aggregator_aggregator.go rename to x/oracle/keeper/aggregator/aggregator_aggregator.go index 0c96421c3..cd128e6b9 100644 --- a/x/oracle/keeper/aggregator_aggregator.go +++ b/x/oracle/keeper/aggregator/aggregator_aggregator.go @@ -1,11 +1,19 @@ -package keeper +package aggregator import ( "math/big" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" "github.com/ExocoreNetwork/exocore/x/oracle/types" ) +type priceWithTimeAndRound struct { + price *big.Int + decimal int32 + timestamp string + detRoundId string //roundId from source if exists +} + type reportPrice struct { validator string //final price, set to -1 as initial @@ -23,7 +31,7 @@ func (r *reportPrice) aggregate() *big.Int { for _, p := range r.prices { tmp = append(tmp, p.price) } - r.price = bigIntList(tmp).median() + r.price = common.BigIntList(tmp).Median() return r.price } @@ -123,7 +131,7 @@ func (agg *aggregator) aggregate() *big.Int { //currently: use rule_1+MODE_1: {rule:specified source:`chainlink`, MODE: asap when power exceeds the threshold} //1. check OVA threshold //2. check IVA consensus with rule, TODO: for v1 we only implement with mode=1&rule=1 - if exceedsThreshold(agg.reportPower, agg.totalPower) { + if common.ExceedsThreshold(agg.reportPower, agg.totalPower) { //TODO: this is kind of a mock way to suite V1, need update to check with params.rule //check if IVA all reached consensus if len(agg.dsPrices) > 0 { @@ -133,7 +141,7 @@ func (agg *aggregator) aggregate() *big.Int { validatorPrices = append(validatorPrices, validatorReport.aggregate()) } //vTmp := bigIntList(validatorPrices) - agg.finalPrice = bigIntList(validatorPrices).median() + agg.finalPrice = common.BigIntList(validatorPrices).Median() //clear relative aggregator for this feeder, all the aggregator,calculator, filter can be removed since this round has been sealed } } diff --git a/x/oracle/keeper/aggregator_calculator.go b/x/oracle/keeper/aggregator/aggregator_calculator.go similarity index 94% rename from x/oracle/keeper/aggregator_calculator.go rename to x/oracle/keeper/aggregator/aggregator_calculator.go index 48b24ae89..79ebc0037 100644 --- a/x/oracle/keeper/aggregator_calculator.go +++ b/x/oracle/keeper/aggregator/aggregator_calculator.go @@ -1,8 +1,9 @@ -package keeper +package aggregator import ( "math/big" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" "github.com/ExocoreNetwork/exocore/x/oracle/types" ) @@ -38,7 +39,7 @@ func (r *roundPrices) updatePriceAndPower(pw *priceAndPower, totalPower *big.Int if item.price.Cmp(pw.price) == 0 { item.power = new(big.Int).Add(item.power, pw.power) updated = true - if exceedsThreshold(item.power, totalPower) { + if common.ExceedsThreshold(item.power, totalPower) { r.price = item.price confirmed = true } @@ -48,7 +49,7 @@ func (r *roundPrices) updatePriceAndPower(pw *priceAndPower, totalPower *big.Int if len(r.prices) < cap(r.prices) { r.prices = append(r.prices, pw) updated = true - if exceedsThreshold(pw.power, totalPower) { + if common.ExceedsThreshold(pw.power, totalPower) { r.price = pw.price confirmed = true } @@ -104,7 +105,7 @@ type calculator struct { func (c *calculator) newRoundPricesList() *roundPricesList { return &roundPricesList{ - roundPricesList: make([]*roundPrices, 0, maxDetId*c.validatorLength), + roundPricesList: make([]*roundPrices, 0, common.MaxDetId*c.validatorLength), //for each DS-roundId, the count of prices provided is the number of validators at most roundPricesCount: c.validatorLength, } diff --git a/x/oracle/keeper/aggregator_filter.go b/x/oracle/keeper/aggregator/aggregator_filter.go similarity index 83% rename from x/oracle/keeper/aggregator_filter.go rename to x/oracle/keeper/aggregator/aggregator_filter.go index 7a9b308aa..958ec6c99 100644 --- a/x/oracle/keeper/aggregator_filter.go +++ b/x/oracle/keeper/aggregator/aggregator_filter.go @@ -1,8 +1,9 @@ -package keeper +package aggregator import ( "strconv" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" "github.com/ExocoreNetwork/exocore/x/oracle/types" ) @@ -10,26 +11,26 @@ type filter struct { maxNonce int maxDetId int //nonce start from 1 - validatorNonce map[string]*set[int32] + validatorNonce map[string]*common.Set[int32] //validator_sourceId -> roundID, NS use 0 - validatorSource map[string]*set[string] + validatorSource map[string]*common.Set[string] } func newFilter(maxNonce, maxDetId int) *filter { return &filter{ maxNonce: maxNonce, maxDetId: maxDetId, - validatorNonce: make(map[string]*set[int32]), - validatorSource: make(map[string]*set[string]), + validatorNonce: make(map[string]*common.Set[int32]), + validatorSource: make(map[string]*common.Set[string]), } } -func (f *filter) newVNSet() *set[int32] { - return newSet[int32](f.maxNonce) +func (f *filter) newVNSet() *common.Set[int32] { + return common.NewSet[int32](f.maxNonce) } -func (f *filter) newVSSet() *set[string] { - return newSet[string](f.maxDetId) +func (f *filter) newVSSet() *common.Set[string] { + return common.NewSet[string](f.maxDetId) } // add priceWithSource into calculator list and aggregator list depends on the source type(deterministic/non-deterministic) diff --git a/x/oracle/keeper/aggregator/worker.go b/x/oracle/keeper/aggregator/worker.go new file mode 100644 index 000000000..6d3f4776b --- /dev/null +++ b/x/oracle/keeper/aggregator/worker.go @@ -0,0 +1,69 @@ +package aggregator + +import ( + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// worker is the actual instance used to calculate final price for each tokenFeeder's round. Which means, every tokenFeeder corresponds to a specified token, and for that tokenFeeder, each round we use a worker instance to calculate the final price +type worker struct { + sealed bool + price string + decimal int32 + //mainly used for deterministic source data to check conflics and validation + f *filter + //used to get to consensus on deterministic source's data + c *calculator + //when enough data(exceeds threshold) collected, aggregate to conduct the final price + a *aggregator + ctx *AggregatorContext +} + +func (w *worker) do(msg *types.MsgCreatePrice) []*types.PriceWithSource { + validator := msg.Creator + power := w.ctx.validatorsPower[validator] + list4Calculator, list4Aggregator := w.f.filtrate(msg) + if list4Aggregator != nil { + w.a.fillPrice(list4Aggregator, validator, power) + if confirmedRounds := w.c.fillPrice(list4Calculator, validator, power); confirmedRounds != nil { + w.a.confirmDSPrice(confirmedRounds) + } + } + return list4Aggregator +} + +func (w *worker) aggregate() *big.Int { + return w.a.aggregate() +} + +// not concurrency safe +func (w *worker) seal() { + if w.sealed { + return + } + w.sealed = true + w.price = w.a.aggregate().String() + w.f = nil + w.c = nil + w.a = nil +} + +func (w *worker) getPrice() (string, int32) { + if w.sealed { + return w.price, w.decimal + } + return "", 0 +} + +// newWorker new a instance for a tokenFeeder's specific round +func newWorker(feederId int32, agc *AggregatorContext) *worker { + return &worker{ + f: newFilter(common.MaxNonce, common.MaxDetId), + c: newCalculator(len(agc.validatorsPower), agc.totalPower), + a: newAggregator(len(agc.validatorsPower), agc.totalPower), + decimal: agc.params.GetTokenInfo(feederId).Decimal, + ctx: agc, + } +} diff --git a/x/oracle/keeper/caches.go b/x/oracle/keeper/cache/caches.go similarity index 64% rename from x/oracle/keeper/caches.go rename to x/oracle/keeper/cache/caches.go index 52d79e6a2..67e09a9b4 100644 --- a/x/oracle/keeper/caches.go +++ b/x/oracle/keeper/cache/caches.go @@ -1,25 +1,26 @@ -package keeper +package cache import ( "math/big" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/aggregator" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" "github.com/ExocoreNetwork/exocore/x/oracle/types" sdk "github.com/cosmos/cosmos-sdk/types" stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) var zeroBig = big.NewInt(0) -var caches *cache type cacheItemV map[string]*big.Int -type cacheItemP *params +type cacheItemP *common.Params type cacheItemM struct { feederId int32 pSources []*types.PriceWithSource validator string } -type cache struct { +type Cache struct { msg cacheMsgs validators *cacheValidator params *cacheParams @@ -35,7 +36,7 @@ type cacheValidator struct { // used to track params change type cacheParams struct { - params *params + params *common.Params update bool } @@ -46,7 +47,7 @@ func (c cacheMsgs) remove(item *cacheItemM) { delete(c, item.feederId) } -func (c cacheMsgs) commit(ctx sdk.Context, k *Keeper) { +func (c cacheMsgs) commit(ctx sdk.Context, k common.KeeperOracle) { block := uint64(ctx.BlockHeight()) recentMsgs := types.RecentMsg{ Block: block, @@ -63,7 +64,7 @@ func (c cacheMsgs) commit(ctx sdk.Context, k *Keeper) { } index, _ := k.GetIndexRecentMsg(ctx) for i, b := range index.Index { - if b >= block-maxNonce { + if b >= block-common.MaxNonce { index.Index = index.Index[i:] break } @@ -92,23 +93,23 @@ func (c *cacheValidator) add(validators map[string]*big.Int) { } } -func (c *cacheValidator) commit(ctx sdk.Context, k *Keeper) { +func (c *cacheValidator) commit(ctx sdk.Context, k common.KeeperOracle) { block := uint64(ctx.BlockHeight()) k.SetValidatorUpdateBlock(ctx, types.ValidatorUpdateBlock{Block: block}) } -func (c *cacheParams) add(p *params) { +func (c *cacheParams) add(p *common.Params) { //params' update is triggered when params is actually updated, so no need to do comparison here, just udpate and mark the flag //TODO: add comparison check, that's something should be done for validation c.params = p c.update = true } -func (c *cacheParams) commit(ctx sdk.Context, k *Keeper) { +func (c *cacheParams) commit(ctx sdk.Context, k common.KeeperOracle) { block := uint64(ctx.BlockHeight()) index, _ := k.GetIndexRecentParams(ctx) for i, b := range index.Index { - if b >= block-maxNonce { + if b >= block-common.MaxNonce { index.Index = index.Index[i:] break } @@ -121,62 +122,66 @@ func (c *cacheParams) commit(ctx sdk.Context, k *Keeper) { } // memory cache -func (k *Keeper) addCache(i any) { +func (c *Cache) AddCache(i any, k common.KeeperOracle) { switch item := i.(type) { case *cacheItemM: - caches.msg.add(item) + c.msg.add(item) // case *params: case cacheItemP: - caches.params.add(item) + c.params.add(item) case cacheItemV: - caches.validators.add(item) + c.validators.add(item) default: panic("no other types are support") } } -func (k *Keeper) removeCache(i any) { +func (c *Cache) RemoveCache(i any, k common.KeeperOracle) { switch item := i.(type) { case *cacheItemM: - caches.msg.remove(item) + c.msg.remove(item) default: } } -func (k *Keeper) commitCache(ctx sdk.Context, reset bool) { - if len(caches.msg) > 0 { - caches.msg.commit(ctx, k) - caches.msg = make(map[int32][]*cacheItemM) +func (c *Cache) CommitCache(ctx sdk.Context, reset bool, k common.KeeperOracle) { + if len(c.msg) > 0 { + c.msg.commit(ctx, k) + c.msg = make(map[int32][]*cacheItemM) } - if caches.validators.update { - caches.validators.commit(ctx, k) - caches.validators.update = false + if c.validators.update { + c.validators.commit(ctx, k) + c.validators.update = false } - if caches.params.update { - caches.params.commit(ctx, k) - caches.params.update = false + if c.params.update { + c.params.commit(ctx, k) + c.params.update = false } if reset { - k.resetCaches(ctx) + c.ResetCaches() } } -func (k *Keeper) resetCaches(ctx sdk.Context) { - caches = &cache{ +func (c *Cache) ResetCaches() { + *c = *(NewCache()) +} + +func NewCache() *Cache { + return &Cache{ msg: make(map[int32][]*cacheItemM), validators: &cacheValidator{ validators: make(map[string]*big.Int), }, params: &cacheParams{ - params: ¶ms{}, + params: &common.Params{}, }, } } -func (k *Keeper) recacheAggregatorContext(ctx sdk.Context, agc *aggregatorContext) bool { +func (c *Cache) RecacheAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k common.KeeperOracle) bool { - from := uint64(ctx.BlockHeight()) - maxNonce + from := uint64(ctx.BlockHeight()) - common.MaxNonce to := uint64(ctx.BlockHeight()) - 1 h, ok := k.GetValidatorUpdateBlock(ctx) @@ -191,31 +196,33 @@ func (k *Keeper) recacheAggregatorContext(ctx sdk.Context, agc *aggregatorContex } totalPower := big.NewInt(0) - k.stakingKeeper.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingTypes.ValidatorI) bool { + validatorPowers := make(map[string]*big.Int) + k.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingTypes.ValidatorI) bool { power := big.NewInt(validator.GetConsensusPower(validator.GetBondedTokens())) addr := string(validator.GetOperator()) - agc.validatorsPower[addr] = power + validatorPowers[addr] = power totalPower = new(big.Int).Add(totalPower, power) return false }) - agc.totalPower = k.stakingKeeper.GetLastTotalPower(ctx).BigInt() + agc.SetValidatorPowers(validatorPowers) + agc.SetTotalPower(totalPower) //TODO: test only - if agc.totalPower.Cmp(totalPower) != 0 { + if k.GetLastTotalPower(ctx).Cmp(totalPower) != 0 { panic("something wrong when get validatorsPower from staking module") } //reset validators - k.addCache(cacheItemV(agc.validatorsPower)) + c.AddCache(cacheItemV(validatorPowers), k) recentMsgs := k.GetAllRecentMsgAsMap(ctx) - + var pTmp common.Params for ; from < to; from++ { //fill params for b, recentParams := range recentParamsMap { prev := uint64(0) if b <= from && b > prev { - pTmp := params(*recentParams) - agc.params = &pTmp + pTmp = common.Params(*recentParams) + agc.SetParams(&pTmp) if prev > 0 { //TODO: safe delete delete(recentParamsMap, prev) @@ -224,53 +231,59 @@ func (k *Keeper) recacheAggregatorContext(ctx sdk.Context, agc *aggregatorContex } } - agc.prepareRound(ctx, from) + agc.PrepareRound(ctx, from) if msgs := recentMsgs[from+1]; msgs != nil { for _, msg := range msgs { //these messages are retreived for recache, just skip the validation check and fill the memory cache - agc.fillPrice(&types.MsgCreatePrice{ + agc.FillPrice(&types.MsgCreatePrice{ Creator: msg.Validator, FeederId: msg.FeederId, Prices: msg.PSources, }) } } - agc.sealRound(ctx) + agc.SealRound(ctx) } //fill params cache - k.addCache(cacheItemP(agc.params)) + c.AddCache(cacheItemP(&pTmp), k) - agc.prepareRound(ctx, to) + agc.PrepareRound(ctx, to) return true } -func (k *Keeper) initAggregatorContext(ctx sdk.Context, agc *aggregatorContext) error { +func (c *Cache) InitAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k common.KeeperOracle) error { //set params p := k.GetParams(ctx) m := make(map[uint64]*types.Params) m[uint64(ctx.BlockHeight())] = &p // k.setParams4CacheRecover(m) //used to trace tokenFeeder's update during cache recover - pTmp := params(p) - agc.params = &pTmp + pTmp := common.Params(p) + agc.SetParams(&pTmp) //set params cache - k.addCache(cacheItemP(agc.params)) + c.AddCache(cacheItemP(&pTmp), k) totalPower := big.NewInt(0) - k.stakingKeeper.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingTypes.ValidatorI) bool { + validatorPowers := make(map[string]*big.Int) + k.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingTypes.ValidatorI) bool { power := big.NewInt(validator.GetConsensusPower(validator.GetBondedTokens())) addr := string(validator.GetOperator()) - agc.validatorsPower[addr] = power + //agc.validatorsPower[addr] = power + validatorPowers[addr] = power totalPower = new(big.Int).Add(totalPower, power) return false }) - agc.totalPower = totalPower + agc.SetTotalPower(totalPower) + agc.SetValidatorPowers(validatorPowers) + if k.GetLastTotalPower(ctx).Cmp(totalPower) != 0 { + panic("-") + } //set validatorPower cache - k.addCache(cacheItemV(agc.validatorsPower)) + c.AddCache(cacheItemV(validatorPowers), k) - agc.prepareRound(ctx, uint64(ctx.BlockHeight())-1) + agc.PrepareRound(ctx, uint64(ctx.BlockHeight())-1) return nil } diff --git a/x/oracle/keeper/common/expected_keepers.go b/x/oracle/keeper/common/expected_keepers.go new file mode 100644 index 000000000..b6d4a6ac7 --- /dev/null +++ b/x/oracle/keeper/common/expected_keepers.go @@ -0,0 +1,35 @@ +package common + +import ( + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +type KeeperOracle interface { + GetParams(sdk.Context) types.Params + + IterateBondedValidatorsByPower(sdk.Context, func(index int64, validator stakingTypes.ValidatorI) bool) + GetLastTotalPower(sdk.Context) *big.Int + + GetIndexRecentMsg(sdk.Context) (types.IndexRecentMsg, bool) + GetAllRecentMsgAsMap(sdk.Context) map[uint64][]*types.MsgItem + + GetIndexRecentParams(sdk.Context) (types.IndexRecentParams, bool) + GetAllRecentParamsAsMap(sdk.Context) map[uint64]*types.Params + + GetValidatorUpdateBlock(sdk.Context) (types.ValidatorUpdateBlock, bool) + + SetIndexRecentMsg(sdk.Context, types.IndexRecentMsg) + SetRecentMsg(sdk.Context, types.RecentMsg) + + SetIndexRecentParams(sdk.Context, types.IndexRecentParams) + SetRecentParams(sdk.Context, types.RecentParams) + + SetValidatorUpdateBlock(sdk.Context, types.ValidatorUpdateBlock) + + RemoveRecentParams(sdk.Context, uint64) + RemoveRecentMsg(sdk.Context, uint64) +} diff --git a/x/oracle/keeper/types.go b/x/oracle/keeper/common/types.go similarity index 51% rename from x/oracle/keeper/types.go rename to x/oracle/keeper/common/types.go index b4a98475c..df22bd4f9 100644 --- a/x/oracle/keeper/types.go +++ b/x/oracle/keeper/common/types.go @@ -1,4 +1,4 @@ -package keeper +package common import ( "errors" @@ -8,24 +8,30 @@ import ( "github.com/ExocoreNetwork/exocore/x/oracle/types" ) -type priceWithTimeAndRound struct { - price *big.Int - decimal int32 - timestamp string - detRoundId string //roundId from source if exists -} +const ( + //maxNonce indicates how many messages a validator can submit in a single roudn to offer price + //current we use this as a mock distance + MaxNonce = 3 + //these two threshold value used to set the threshold to tell when the price had come to consensus and was able to get a final price of that round + Threshold_a = 2 + Threshold_b = 3 + //maxDetId each validator can submit, so the calculator can cache maximum of maxDetId*count(validators) values, this is for resistance of malicious validator submmiting invalid detId + MaxDetId = 5 + //consensus mode: v1: as soon as possbile + Mode = 1 +) -type params types.Params +type Params types.Params -func (p params) getTokenFeeders() []*types.TokenFeeder { +func (p Params) GetTokenFeeders() []*types.TokenFeeder { return p.TokenFeeders } -func (p params) isDeterministicSource(sourceId int32) bool { +func (p Params) IsDeterministicSource(sourceId int32) bool { return p.Sources[int(sourceId)].Deterministic } -func (p params) isValidSource(sourceId int32) bool { +func (p Params) IsValidSource(sourceId int32) bool { if sourceId == 0 { //custom defined source return true @@ -33,7 +39,7 @@ func (p params) isValidSource(sourceId int32) bool { return p.Sources[int(sourceId)].Valid } -func (p params) getTokenFeeder(feederId int32) *types.TokenFeeder { +func (p Params) GetTokenFeeder(feederId int32) *types.TokenFeeder { for k, v := range p.TokenFeeders { if int32(k) == feederId { return v @@ -41,7 +47,7 @@ func (p params) getTokenFeeder(feederId int32) *types.TokenFeeder { } return nil } -func (p params) getTokenInfo(feederId int32) *types.Token { +func (p Params) GetTokenInfo(feederId int32) *types.Token { for k, v := range p.TokenFeeders { if int32(k) == feederId { return p.Tokens[v.TokenId] @@ -50,7 +56,7 @@ func (p params) getTokenInfo(feederId int32) *types.Token { return nil } -func (p params) checkRules(feederId int32, prices []*types.PriceWithSource) (bool, error) { +func (p Params) CheckRules(feederId int32, prices []*types.PriceWithSource) (bool, error) { feeder := p.TokenFeeders[feederId] rule := p.Rules[feeder.RuleId] //specified sources set, v1 use this rule to set `chainlink` as official source @@ -73,12 +79,12 @@ func (p params) checkRules(feederId int32, prices []*types.PriceWithSource) (boo return true, nil } -type set[T comparable] struct { +type Set[T comparable] struct { size int slice []T } -func (s *set[T]) Add(value T) bool { +func (s *Set[T]) Add(value T) bool { if len(s.slice) == s.size { return false } @@ -92,7 +98,7 @@ func (s *set[T]) Add(value T) bool { return true } -func (s *set[T]) Has(value T) bool { +func (s *Set[T]) Has(value T) bool { for _, v := range s.slice { if v == value { return true @@ -101,34 +107,34 @@ func (s *set[T]) Has(value T) bool { return false } -func (s *set[T]) length() int { +func (s *Set[T]) Length() int { return s.size } -func newSet[T comparable](length int) *set[T] { - return &set[T]{ +func NewSet[T comparable](length int) *Set[T] { + return &Set[T]{ size: length, slice: make([]T, 0, length), } } -func exceedsThreshold(power *big.Int, totalPower *big.Int) bool { - return new(big.Int).Mul(power, big.NewInt(threshold_b)).Cmp(new(big.Int).Mul(totalPower, big.NewInt(threshold_a))) > 0 +func ExceedsThreshold(power *big.Int, totalPower *big.Int) bool { + return new(big.Int).Mul(power, big.NewInt(Threshold_b)).Cmp(new(big.Int).Mul(totalPower, big.NewInt(Threshold_a))) > 0 } -type bigIntList []*big.Int +type BigIntList []*big.Int -func (b bigIntList) Len() int { +func (b BigIntList) Len() int { return len(b) } -func (b bigIntList) Less(i, j int) bool { +func (b BigIntList) Less(i, j int) bool { return b[i].Cmp(b[j]) < 0 } -func (b bigIntList) Swap(i, j int) { +func (b BigIntList) Swap(i, j int) { b[i], b[j] = b[j], b[i] } -func (b bigIntList) median() *big.Int { +func (b BigIntList) Median() *big.Int { sort.Sort(b) l := len(b) if l%2 == 1 { diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index 00ad24470..e8b523ba9 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + "math/big" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" @@ -12,6 +13,7 @@ import ( "github.com/ExocoreNetwork/exocore/x/oracle/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) type ( @@ -47,3 +49,11 @@ func NewKeeper( func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } + +func (k Keeper) GetLastTotalPower(ctx sdk.Context) *big.Int { + return k.stakingKeeper.GetLastTotalPower(ctx).BigInt() +} + +func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, f func(index int64, validator stakingtypes.ValidatorI) bool) { + k.stakingKeeper.IterateBondedValidatorsByPower(ctx, f) +} diff --git a/x/oracle/keeper/msg_server_create_price.go b/x/oracle/keeper/msg_server_create_price.go index c27b8f727..eec99af8b 100644 --- a/x/oracle/keeper/msg_server_create_price.go +++ b/x/oracle/keeper/msg_server_create_price.go @@ -2,7 +2,6 @@ package keeper import ( "context" - "math/big" "github.com/ExocoreNetwork/exocore/x/oracle/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -10,48 +9,23 @@ import ( func (k msgServer) CreatePrice(goCtx context.Context, msg *types.MsgCreatePrice) (*types.MsgCreatePriceResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - // TODO: Handling the message - _ = ctx - /** 1. aggregator.rInfo.Tokenid->status == 0(1 ignore and return) 2. basedBlock is valid [roundInfo.basedBlock, *+5], each base only allow for one submit each validator, window for submition is 5 blocks while every validator only allowed to submit at most 3 transactions each round 3. check the rule fulfilled(sources check), check the decimal of the 1st mathc the params' definition(among prices the decimal had been checked in ante stage), timestamp:later than previous block's timestamp, [not future than now(+1s), this is checked in anteHandler], timestamp verification is not necessary **/ - newItem, caches, _ := getAggregatorContext(ctx, k.Keeper).newCreatePrice(ctx, msg) + newItem, caches, _ := GetAggregatorContext(ctx, k.Keeper).NewCreatePrice(ctx, msg) if caches != nil { - k.addCache(caches) - } - - if newItem != nil { - k.AppendPriceTR(ctx, newItem.tokenId, newItem.priceTR) - //TODO: move related caches - k.removeCache(caches) + if newItem != nil { + k.AppendPriceTR(ctx, newItem.TokenId, newItem.PriceTR) + //TODO: move related caches + cs.RemoveCache(caches, k) + } else { + cs.AddCache(caches, k) + } } return &types.MsgCreatePriceResponse{}, nil } - -func getAggregatorContext(ctx sdk.Context, k Keeper) *aggregatorContext { - if agc != nil { - return agc - } - - //initialize the aggregatorContext, normally triggered when node restart - k.resetCaches(ctx) - agc = &aggregatorContext{ - validatorsPower: make(map[string]*big.Int), - totalPower: big.NewInt(0), - rounds: make(map[int32]*roundInfo), - aggregators: make(map[int32]*worker), - } - - if ok := k.recacheAggregatorContext(ctx, agc); !ok { - //this is the very first time oracle has been started, fill relalted info as initialization - k.initAggregatorContext(ctx, agc) - } - - return agc -} diff --git a/x/oracle/keeper/single.go b/x/oracle/keeper/single.go new file mode 100644 index 000000000..cd2c18c5c --- /dev/null +++ b/x/oracle/keeper/single.go @@ -0,0 +1,34 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/aggregator" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/cache" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var cs *cache.Cache + +var agc *aggregator.AggregatorContext + +func GetCaches() *cache.Cache { + if cs != nil { + return cs + } + cs = cache.NewCache() + return cs +} + +func GetAggregatorContext(ctx sdk.Context, k Keeper) *aggregator.AggregatorContext { + if agc != nil { + return agc + } + + c := GetCaches() + c.ResetCaches() + agc = aggregator.NewAggregatorContext() + if ok := c.RecacheAggregatorContext(ctx, agc, k); !ok { + //this is the very first time oracle has been started, fill relalted info as initialization + c.InitAggregatorContext(ctx, agc, k) + } + return agc +} From a2aabfec06ca0ff4402ea523d64bc8ae33e83573 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Wed, 13 Mar 2024 16:58:16 +0800 Subject: [PATCH 23/37] feat(oracle-keeper): interface check --- x/oracle/keeper/keeper.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index e8b523ba9..24e7bb091 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -10,6 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" "github.com/ExocoreNetwork/exocore/x/oracle/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" @@ -26,6 +27,8 @@ type ( } ) +var _ common.KeeperOracle = Keeper{} + func NewKeeper( cdc codec.BinaryCodec, storeKey, From 4a19ace5fee639e379df009f72026de4d3ffe7ff Mon Sep 17 00:00:00 2001 From: leonz789 Date: Wed, 13 Mar 2024 17:03:35 +0800 Subject: [PATCH 24/37] feat(oracle-keeper): update proto, remove validtors for genesis state --- proto/exocore/oracle/genesis.proto | 2 - proto/exocore/oracle/query.proto | 13 - proto/exocore/oracle/validators.proto | 14 - x/oracle/client/cli/query.go | 1 - x/oracle/client/cli/query_validators.go | 38 -- x/oracle/client/cli/query_validators_test.go | 71 --- x/oracle/genesis.go | 9 - x/oracle/genesis_test.go | 4 - x/oracle/keeper/validators.go | 33 -- x/oracle/keeper/validators_test.go | 38 -- x/oracle/types/genesis.pb.go | 115 ++--- x/oracle/types/query.pb.go | 484 +++---------------- x/oracle/types/query.pb.gw.go | 65 --- 13 files changed, 103 insertions(+), 784 deletions(-) delete mode 100644 proto/exocore/oracle/validators.proto delete mode 100644 x/oracle/client/cli/query_validators.go delete mode 100644 x/oracle/client/cli/query_validators_test.go delete mode 100644 x/oracle/keeper/validators.go delete mode 100644 x/oracle/keeper/validators_test.go diff --git a/proto/exocore/oracle/genesis.proto b/proto/exocore/oracle/genesis.proto index 2382d1d25..173fd9372 100644 --- a/proto/exocore/oracle/genesis.proto +++ b/proto/exocore/oracle/genesis.proto @@ -5,7 +5,6 @@ package exocore.oracle; import "gogoproto/gogo.proto"; import "exocore/oracle/params.proto"; import "exocore/oracle/prices.proto"; -import "exocore/oracle/validators.proto"; import "exocore/oracle/validator_update_block.proto"; import "exocore/oracle/index_recent_params.proto"; import "exocore/oracle/index_recent_msg.proto"; @@ -20,7 +19,6 @@ message GenesisState { repeated Prices pricesList = 2 [(gogoproto.nullable) = false]; //TODO: userDefinedTokenFeeder - Validators validators = 3; ValidatorUpdateBlock validatorUpdateBlock = 4; IndexRecentParams indexRecentParams = 5; IndexRecentMsg indexRecentMsg = 6; diff --git a/proto/exocore/oracle/query.proto b/proto/exocore/oracle/query.proto index 8777a58e2..942e4faff 100644 --- a/proto/exocore/oracle/query.proto +++ b/proto/exocore/oracle/query.proto @@ -7,7 +7,6 @@ import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "exocore/oracle/params.proto"; import "exocore/oracle/prices.proto"; -import "exocore/oracle/validators.proto"; import "exocore/oracle/validator_update_block.proto"; import "exocore/oracle/index_recent_params.proto"; import "exocore/oracle/index_recent_msg.proto"; @@ -35,12 +34,6 @@ service Query { } - // Queries a Validators by index. - rpc Validators (QueryGetValidatorsRequest) returns (QueryGetValidatorsResponse) { - option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/validators"; - - } - // Queries a ValidatorUpdateBlock by index. rpc ValidatorUpdateBlock (QueryGetValidatorUpdateBlockRequest) returns (QueryGetValidatorUpdateBlockResponse) { option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/validator_update_block"; @@ -106,12 +99,6 @@ message QueryAllPricesResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } -message QueryGetValidatorsRequest {} - -message QueryGetValidatorsResponse { - Validators Validators = 1 [(gogoproto.nullable) = false]; -} - message QueryGetValidatorUpdateBlockRequest {} message QueryGetValidatorUpdateBlockResponse { diff --git a/proto/exocore/oracle/validators.proto b/proto/exocore/oracle/validators.proto deleted file mode 100644 index cbcfdfcc5..000000000 --- a/proto/exocore/oracle/validators.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; -package exocore.oracle; - -option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; - -message Validators { - uint64 block = 1; - repeated Validator validator_list = 2; -} - -message Validator{ - string operator = 1; - string power = 2; -} diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go index 5203d94ac..323eb82f9 100644 --- a/x/oracle/client/cli/query.go +++ b/x/oracle/client/cli/query.go @@ -27,7 +27,6 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryParams()) cmd.AddCommand(CmdListPrices()) cmd.AddCommand(CmdShowPrices()) - cmd.AddCommand(CmdShowValidators()) cmd.AddCommand(CmdShowValidatorUpdateBlock()) cmd.AddCommand(CmdShowIndexRecentParams()) cmd.AddCommand(CmdShowIndexRecentMsg()) diff --git a/x/oracle/client/cli/query_validators.go b/x/oracle/client/cli/query_validators.go deleted file mode 100644 index 846aacd25..000000000 --- a/x/oracle/client/cli/query_validators.go +++ /dev/null @@ -1,38 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/ExocoreNetwork/exocore/x/oracle/types" -) - -func CmdShowValidators() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-validators", - Short: "shows 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) - - params := &types.QueryGetValidatorsRequest{} - - res, err := queryClient.Validators(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/oracle/client/cli/query_validators_test.go b/x/oracle/client/cli/query_validators_test.go deleted file mode 100644 index aeac766fd..000000000 --- a/x/oracle/client/cli/query_validators_test.go +++ /dev/null @@ -1,71 +0,0 @@ -package cli_test - -import ( - "fmt" - "testing" - - tmcli "github.com/cometbft/cometbft/libs/cli" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/status" - - "github.com/ExocoreNetwork/exocore/testutil/network" - "github.com/ExocoreNetwork/exocore/testutil/nullify" - "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" - "github.com/ExocoreNetwork/exocore/x/oracle/types" -) - -func networkWithValidatorsObjects(t *testing.T) (*network.Network, types.Validators) { - t.Helper() - cfg := network.DefaultConfig() - state := types.GenesisState{} - validators := &types.Validators{} - nullify.Fill(&validators) - state.Validators = validators - buf, err := cfg.Codec.MarshalJSON(&state) - require.NoError(t, err) - cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), *state.Validators -} - -func TestShowValidators(t *testing.T) { - net, obj := networkWithValidatorsObjects(t) - - ctx := net.Validators[0].ClientCtx - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - tests := []struct { - desc string - args []string - err error - obj types.Validators - }{ - { - desc: "get", - args: common, - obj: obj, - }, - } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - var args []string - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowValidators(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - } else { - require.NoError(t, err) - var resp types.QueryGetValidatorsResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.Validators) - require.Equal(t, - nullify.Fill(&tc.obj), - nullify.Fill(&resp.Validators), - ) - } - }) - } -} diff --git a/x/oracle/genesis.go b/x/oracle/genesis.go index 8681cd2cf..d3037f960 100644 --- a/x/oracle/genesis.go +++ b/x/oracle/genesis.go @@ -13,10 +13,6 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) k.SetPrices(ctx, elem) } // Set if defined - if genState.Validators != nil { - k.SetValidators(ctx, *genState.Validators) - } - // Set if defined if genState.ValidatorUpdateBlock != nil { k.SetValidatorUpdateBlock(ctx, *genState.ValidatorUpdateBlock) } @@ -46,11 +42,6 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.Params = k.GetParams(ctx) genesis.PricesList = k.GetAllPrices(ctx) - // Get all validators - validators, found := k.GetValidators(ctx) - if found { - genesis.Validators = &validators - } // Get all validatorUpdateBlock validatorUpdateBlock, found := k.GetValidatorUpdateBlock(ctx) if found { diff --git a/x/oracle/genesis_test.go b/x/oracle/genesis_test.go index cb7f13414..6b5db6ce0 100644 --- a/x/oracle/genesis_test.go +++ b/x/oracle/genesis_test.go @@ -22,9 +22,6 @@ func TestGenesis(t *testing.T) { TokenId: 1, }, }, - Validators: &types.Validators{ - Block: 42, - }, ValidatorUpdateBlock: &types.ValidatorUpdateBlock{}, IndexRecentParams: &types.IndexRecentParams{}, IndexRecentMsg: &types.IndexRecentMsg{}, @@ -56,7 +53,6 @@ func TestGenesis(t *testing.T) { nullify.Fill(got) require.ElementsMatch(t, genesisState.PricesList, got.PricesList) - require.Equal(t, genesisState.Validators, got.Validators) require.Equal(t, genesisState.ValidatorUpdateBlock, got.ValidatorUpdateBlock) require.Equal(t, genesisState.IndexRecentParams, got.IndexRecentParams) require.Equal(t, genesisState.IndexRecentMsg, got.IndexRecentMsg) diff --git a/x/oracle/keeper/validators.go b/x/oracle/keeper/validators.go deleted file mode 100644 index ab2baa2bd..000000000 --- a/x/oracle/keeper/validators.go +++ /dev/null @@ -1,33 +0,0 @@ -package keeper - -import ( - "github.com/ExocoreNetwork/exocore/x/oracle/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// SetValidators set validators in the store -func (k Keeper) SetValidators(ctx sdk.Context, validators types.Validators) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorsKey)) - b := k.cdc.MustMarshal(&validators) - store.Set([]byte{0}, b) -} - -// GetValidators returns validators -func (k Keeper) GetValidators(ctx sdk.Context) (val types.Validators, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorsKey)) - - b := store.Get([]byte{0}) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshal(b, &val) - return val, true -} - -// RemoveValidators removes validators from the store -func (k Keeper) RemoveValidators(ctx sdk.Context) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorsKey)) - store.Delete([]byte{0}) -} diff --git a/x/oracle/keeper/validators_test.go b/x/oracle/keeper/validators_test.go deleted file mode 100644 index b02934aa2..000000000 --- a/x/oracle/keeper/validators_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package keeper_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - - keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" - "github.com/ExocoreNetwork/exocore/testutil/nullify" - "github.com/ExocoreNetwork/exocore/x/oracle/keeper" - "github.com/ExocoreNetwork/exocore/x/oracle/types" -) - -func createTestValidators(keeper *keeper.Keeper, ctx sdk.Context) types.Validators { - item := types.Validators{} - keeper.SetValidators(ctx, item) - return item -} - -func TestValidatorsGet(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - item := createTestValidators(keeper, ctx) - rst, found := keeper.GetValidators(ctx) - require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&rst), - ) -} - -func TestValidatorsRemove(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - createTestValidators(keeper, ctx) - keeper.RemoveValidators(ctx) - _, found := keeper.GetValidators(ctx) - require.False(t, found) -} diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go index 36d367c03..1006ad547 100644 --- a/x/oracle/types/genesis.pb.go +++ b/x/oracle/types/genesis.pb.go @@ -28,7 +28,6 @@ type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` PricesList []Prices `protobuf:"bytes,2,rep,name=pricesList,proto3" json:"pricesList"` //TODO: userDefinedTokenFeeder - Validators *Validators `protobuf:"bytes,3,opt,name=validators,proto3" json:"validators,omitempty"` ValidatorUpdateBlock *ValidatorUpdateBlock `protobuf:"bytes,4,opt,name=validatorUpdateBlock,proto3" json:"validatorUpdateBlock,omitempty"` IndexRecentParams *IndexRecentParams `protobuf:"bytes,5,opt,name=indexRecentParams,proto3" json:"indexRecentParams,omitempty"` IndexRecentMsg *IndexRecentMsg `protobuf:"bytes,6,opt,name=indexRecentMsg,proto3" json:"indexRecentMsg,omitempty"` @@ -83,13 +82,6 @@ func (m *GenesisState) GetPricesList() []Prices { return nil } -func (m *GenesisState) GetValidators() *Validators { - if m != nil { - return m.Validators - } - return nil -} - func (m *GenesisState) GetValidatorUpdateBlock() *ValidatorUpdateBlock { if m != nil { return m.ValidatorUpdateBlock @@ -132,34 +124,33 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/genesis.proto", fileDescriptor_dbe067676c4dc0de) } var fileDescriptor_dbe067676c4dc0de = []byte{ - // 418 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0x5f, 0x4b, 0xeb, 0x30, - 0x1c, 0x86, 0xdb, 0xb3, 0x9d, 0x9d, 0x43, 0xd4, 0xa1, 0x61, 0x48, 0x9d, 0xa3, 0x9b, 0x43, 0x61, - 0x20, 0xb4, 0xa2, 0x5e, 0x89, 0x57, 0x83, 0x29, 0x8a, 0x9b, 0x52, 0x51, 0xc4, 0x9b, 0xd2, 0x75, - 0xa1, 0x96, 0xfd, 0x49, 0x49, 0x32, 0x9d, 0xdf, 0xc2, 0x8f, 0xb5, 0xcb, 0x5d, 0x7a, 0x25, 0xb2, - 0x7d, 0x11, 0x59, 0xda, 0xce, 0x36, 0x6b, 0x77, 0xd7, 0xf4, 0xf7, 0xbc, 0x4f, 0xd2, 0xb7, 0x01, - 0x25, 0x34, 0xc2, 0x36, 0x26, 0x48, 0xc7, 0xc4, 0xb2, 0x7b, 0x48, 0x77, 0xd0, 0x00, 0x51, 0x97, - 0x6a, 0x1e, 0xc1, 0x0c, 0xc3, 0x7c, 0x30, 0xd5, 0xfc, 0x69, 0xb1, 0xe0, 0x60, 0x07, 0xf3, 0x91, - 0x3e, 0x7f, 0xf2, 0xa9, 0xe2, 0xae, 0xe0, 0xf0, 0x2c, 0x62, 0xf5, 0x69, 0xda, 0x90, 0xb8, 0x36, - 0x0a, 0x87, 0x65, 0x61, 0xf8, 0x6a, 0xf5, 0xdc, 0x8e, 0xc5, 0x30, 0x09, 0x81, 0xc3, 0x34, 0xc0, - 0x1c, 0x7a, 0x1d, 0x8b, 0x21, 0xb3, 0xdd, 0xc3, 0x76, 0x37, 0x80, 0x6b, 0x02, 0xec, 0x0e, 0x3a, - 0x68, 0x64, 0x12, 0x64, 0xa3, 0x01, 0x33, 0x63, 0x87, 0x3a, 0x58, 0x45, 0xf6, 0xa9, 0x93, 0x72, - 0xbc, 0x25, 0xa0, 0x9a, 0x0c, 0x44, 0xf7, 0xaa, 0x8e, 0xb3, 0x60, 0xfd, 0xd2, 0x6f, 0xf5, 0x9e, - 0x59, 0x0c, 0xc1, 0x53, 0x90, 0xf3, 0x01, 0x45, 0xae, 0xc8, 0xb5, 0xb5, 0xe3, 0x6d, 0x2d, 0xde, - 0xb2, 0x76, 0xc7, 0xa7, 0xf5, 0xec, 0xf8, 0xab, 0x2c, 0x19, 0x01, 0x0b, 0xcf, 0x01, 0xf0, 0xab, - 0xbb, 0x71, 0x29, 0x53, 0xfe, 0x54, 0x32, 0x89, 0x49, 0x4e, 0x04, 0xc9, 0x08, 0x0f, 0xcf, 0x00, - 0xf8, 0xed, 0x56, 0xc9, 0xf0, 0x7d, 0x8b, 0x62, 0xfa, 0x71, 0x41, 0x18, 0x11, 0x1a, 0x3e, 0x81, - 0xc2, 0x62, 0xf5, 0xc0, 0x5b, 0xaf, 0xcf, 0x4b, 0x57, 0xb2, 0xdc, 0xb2, 0x9f, 0x6a, 0x89, 0xb0, - 0x46, 0xa2, 0x01, 0xde, 0x82, 0x2d, 0xde, 0xbc, 0xc1, 0x6b, 0xf3, 0x3f, 0x5b, 0xf9, 0xcb, 0xb5, - 0x7b, 0xa2, 0xf6, 0x4a, 0x04, 0x8d, 0xe5, 0x2c, 0xbc, 0x00, 0xf9, 0xc8, 0xcb, 0x26, 0x75, 0x94, - 0x1c, 0xb7, 0xa9, 0x2b, 0x6c, 0x4d, 0xea, 0x18, 0x42, 0x0a, 0x36, 0xc0, 0x06, 0x09, 0x17, 0xbc, - 0xef, 0x7f, 0xbc, 0xef, 0x1d, 0x51, 0xb3, 0x48, 0x04, 0x95, 0xc7, 0x53, 0xb0, 0x05, 0x36, 0x49, - 0xe4, 0x78, 0xdc, 0xf4, 0x9f, 0x9b, 0x4a, 0xc9, 0xa6, 0xd8, 0x9f, 0x5f, 0xca, 0xd6, 0xaf, 0xc7, - 0x53, 0x55, 0x9e, 0x4c, 0x55, 0xf9, 0x7b, 0xaa, 0xca, 0x1f, 0x33, 0x55, 0x9a, 0xcc, 0x54, 0xe9, - 0x73, 0xa6, 0x4a, 0xcf, 0x47, 0x8e, 0xcb, 0x5e, 0x86, 0x6d, 0xcd, 0xc6, 0x7d, 0xbd, 0xe1, 0x9b, - 0x5b, 0x88, 0xbd, 0x61, 0xd2, 0xd5, 0xc3, 0x2b, 0x3a, 0x0a, 0x2f, 0x29, 0x7b, 0xf7, 0x10, 0x6d, - 0xe7, 0xf8, 0xed, 0x3c, 0xf9, 0x09, 0x00, 0x00, 0xff, 0xff, 0x1d, 0x8f, 0xf7, 0xc1, 0x01, 0x04, - 0x00, 0x00, + // 401 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xcf, 0x4a, 0xeb, 0x40, + 0x18, 0xc5, 0x93, 0x7b, 0x6b, 0x95, 0x51, 0x8b, 0x0e, 0x45, 0x62, 0x2d, 0x69, 0x2d, 0x0a, 0x05, + 0x21, 0x11, 0x75, 0xe9, 0xaa, 0x50, 0x45, 0xb1, 0x55, 0x22, 0x8a, 0xb8, 0x09, 0x69, 0x3a, 0xc4, + 0xd0, 0x3f, 0x13, 0x66, 0xa6, 0x5a, 0xdf, 0xc1, 0x85, 0x8f, 0xd5, 0x65, 0x97, 0xae, 0x44, 0xda, + 0x17, 0x91, 0xce, 0x24, 0x25, 0x99, 0xc6, 0xee, 0x92, 0x9c, 0xdf, 0x39, 0xf3, 0xe5, 0xcc, 0x07, + 0x8a, 0x68, 0x88, 0x5d, 0x4c, 0x90, 0x89, 0x89, 0xe3, 0x76, 0x91, 0xe9, 0xa1, 0x3e, 0xa2, 0x3e, + 0x35, 0x02, 0x82, 0x19, 0x86, 0xb9, 0x50, 0x35, 0x84, 0x5a, 0xc8, 0x7b, 0xd8, 0xc3, 0x5c, 0x32, + 0x67, 0x4f, 0x82, 0x2a, 0xec, 0x49, 0x19, 0x81, 0x43, 0x9c, 0x1e, 0xfd, 0x4b, 0x24, 0xbe, 0x8b, + 0x22, 0xf1, 0x48, 0x12, 0x5f, 0x9d, 0xae, 0xdf, 0x76, 0x18, 0x26, 0xf6, 0x20, 0x68, 0x3b, 0x0c, + 0xd9, 0xad, 0x2e, 0x76, 0x3b, 0x21, 0x5c, 0x95, 0x60, 0xbf, 0xdf, 0x46, 0x43, 0x9b, 0x20, 0x17, + 0xf5, 0x99, 0x9d, 0x38, 0xf3, 0x70, 0x19, 0xd9, 0xa3, 0x5e, 0x88, 0x95, 0x24, 0x6c, 0x01, 0xa8, + 0xa4, 0x03, 0xf1, 0xb3, 0x2a, 0x1f, 0x19, 0xb0, 0x71, 0x29, 0x4a, 0xbb, 0x67, 0x0e, 0x43, 0xf0, + 0x0c, 0x64, 0x05, 0xa0, 0xa9, 0x65, 0xb5, 0xba, 0x7e, 0xb2, 0x63, 0x24, 0x4b, 0x34, 0xee, 0xb8, + 0x5a, 0xcb, 0x8c, 0xbe, 0x4b, 0x8a, 0x15, 0xb2, 0xf0, 0x1c, 0x00, 0xd1, 0xcc, 0x8d, 0x4f, 0x99, + 0xf6, 0xaf, 0xfc, 0x3f, 0xd5, 0xc9, 0x89, 0xd0, 0x19, 0xe3, 0xe1, 0x13, 0xc8, 0xcf, 0xab, 0x7b, + 0xe0, 0xcd, 0xd5, 0x66, 0xc5, 0x69, 0x19, 0x3e, 0xc1, 0x81, 0x9c, 0xf3, 0x98, 0xc2, 0x5a, 0xa9, + 0x09, 0xf0, 0x16, 0x6c, 0xf3, 0xf6, 0x2c, 0xfe, 0xeb, 0x62, 0x74, 0x6d, 0x85, 0xc7, 0xee, 0xcb, + 0xb1, 0x57, 0x32, 0x68, 0x2d, 0x7a, 0xe1, 0x05, 0xc8, 0xc5, 0x3e, 0x36, 0xa8, 0xa7, 0x65, 0x79, + 0x9a, 0xbe, 0x24, 0xad, 0x41, 0x3d, 0x4b, 0x72, 0xc1, 0x3a, 0xd8, 0x24, 0xd1, 0x0b, 0xef, 0x6c, + 0x95, 0x77, 0xb6, 0x2b, 0xc7, 0xcc, 0x1d, 0x61, 0x6d, 0x49, 0x17, 0x6c, 0x82, 0x2d, 0x12, 0x1b, + 0x8f, 0x27, 0xad, 0xf1, 0xa4, 0x62, 0x7a, 0x52, 0xe2, 0xf6, 0x16, 0xbc, 0xb5, 0xeb, 0xd1, 0x44, + 0x57, 0xc7, 0x13, 0x5d, 0xfd, 0x99, 0xe8, 0xea, 0xe7, 0x54, 0x57, 0xc6, 0x53, 0x5d, 0xf9, 0x9a, + 0xea, 0xca, 0xf3, 0xb1, 0xe7, 0xb3, 0x97, 0x41, 0xcb, 0x70, 0x71, 0xcf, 0xac, 0x8b, 0xe4, 0x26, + 0x62, 0x6f, 0x98, 0x74, 0xcc, 0x68, 0xcd, 0x86, 0xd1, 0xa2, 0xb1, 0xf7, 0x00, 0xd1, 0x56, 0x96, + 0x6f, 0xd8, 0xe9, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x16, 0x5e, 0xb3, 0x10, 0xa4, 0x03, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -246,18 +237,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if m.Validators != nil { - { - size, err := m.Validators.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } if len(m.PricesList) > 0 { for iNdEx := len(m.PricesList) - 1; iNdEx >= 0; iNdEx-- { { @@ -310,10 +289,6 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - if m.Validators != nil { - l = m.Validators.Size() - n += 1 + l + sovGenesis(uint64(l)) - } if m.ValidatorUpdateBlock != nil { l = m.ValidatorUpdateBlock.Size() n += 1 + l + sovGenesis(uint64(l)) @@ -443,42 +418,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Validators == nil { - m.Validators = &Validators{} - } - if err := m.Validators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ValidatorUpdateBlock", wireType) diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index e86bfc5c1..b4fefb2bd 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -297,86 +297,6 @@ func (m *QueryAllPricesResponse) GetPagination() *query.PageResponse { return nil } -type QueryGetValidatorsRequest struct { -} - -func (m *QueryGetValidatorsRequest) Reset() { *m = QueryGetValidatorsRequest{} } -func (m *QueryGetValidatorsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetValidatorsRequest) ProtoMessage() {} -func (*QueryGetValidatorsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{6} -} -func (m *QueryGetValidatorsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetValidatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetValidatorsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryGetValidatorsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetValidatorsRequest.Merge(m, src) -} -func (m *QueryGetValidatorsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetValidatorsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetValidatorsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetValidatorsRequest proto.InternalMessageInfo - -type QueryGetValidatorsResponse struct { - Validators Validators `protobuf:"bytes,1,opt,name=Validators,proto3" json:"Validators"` -} - -func (m *QueryGetValidatorsResponse) Reset() { *m = QueryGetValidatorsResponse{} } -func (m *QueryGetValidatorsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetValidatorsResponse) ProtoMessage() {} -func (*QueryGetValidatorsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{7} -} -func (m *QueryGetValidatorsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetValidatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGetValidatorsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryGetValidatorsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetValidatorsResponse.Merge(m, src) -} -func (m *QueryGetValidatorsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetValidatorsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetValidatorsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetValidatorsResponse proto.InternalMessageInfo - -func (m *QueryGetValidatorsResponse) GetValidators() Validators { - if m != nil { - return m.Validators - } - return Validators{} -} - type QueryGetValidatorUpdateBlockRequest struct { } @@ -384,7 +304,7 @@ func (m *QueryGetValidatorUpdateBlockRequest) Reset() { *m = QueryGetVal func (m *QueryGetValidatorUpdateBlockRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetValidatorUpdateBlockRequest) ProtoMessage() {} func (*QueryGetValidatorUpdateBlockRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{8} + return fileDescriptor_f604621c8da1a6f3, []int{6} } func (m *QueryGetValidatorUpdateBlockRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -421,7 +341,7 @@ func (m *QueryGetValidatorUpdateBlockResponse) Reset() { *m = QueryGetVa func (m *QueryGetValidatorUpdateBlockResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetValidatorUpdateBlockResponse) ProtoMessage() {} func (*QueryGetValidatorUpdateBlockResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{9} + return fileDescriptor_f604621c8da1a6f3, []int{7} } func (m *QueryGetValidatorUpdateBlockResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -464,7 +384,7 @@ func (m *QueryGetIndexRecentParamsRequest) Reset() { *m = QueryGetIndexR func (m *QueryGetIndexRecentParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetIndexRecentParamsRequest) ProtoMessage() {} func (*QueryGetIndexRecentParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{10} + return fileDescriptor_f604621c8da1a6f3, []int{8} } func (m *QueryGetIndexRecentParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -501,7 +421,7 @@ func (m *QueryGetIndexRecentParamsResponse) Reset() { *m = QueryGetIndex func (m *QueryGetIndexRecentParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetIndexRecentParamsResponse) ProtoMessage() {} func (*QueryGetIndexRecentParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{11} + return fileDescriptor_f604621c8da1a6f3, []int{9} } func (m *QueryGetIndexRecentParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -544,7 +464,7 @@ func (m *QueryGetIndexRecentMsgRequest) Reset() { *m = QueryGetIndexRece func (m *QueryGetIndexRecentMsgRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetIndexRecentMsgRequest) ProtoMessage() {} func (*QueryGetIndexRecentMsgRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{12} + return fileDescriptor_f604621c8da1a6f3, []int{10} } func (m *QueryGetIndexRecentMsgRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -581,7 +501,7 @@ func (m *QueryGetIndexRecentMsgResponse) Reset() { *m = QueryGetIndexRec func (m *QueryGetIndexRecentMsgResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetIndexRecentMsgResponse) ProtoMessage() {} func (*QueryGetIndexRecentMsgResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{13} + return fileDescriptor_f604621c8da1a6f3, []int{11} } func (m *QueryGetIndexRecentMsgResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -625,7 +545,7 @@ func (m *QueryGetRecentMsgRequest) Reset() { *m = QueryGetRecentMsgReque func (m *QueryGetRecentMsgRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetRecentMsgRequest) ProtoMessage() {} func (*QueryGetRecentMsgRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{14} + return fileDescriptor_f604621c8da1a6f3, []int{12} } func (m *QueryGetRecentMsgRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -669,7 +589,7 @@ func (m *QueryGetRecentMsgResponse) Reset() { *m = QueryGetRecentMsgResp func (m *QueryGetRecentMsgResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetRecentMsgResponse) ProtoMessage() {} func (*QueryGetRecentMsgResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{15} + return fileDescriptor_f604621c8da1a6f3, []int{13} } func (m *QueryGetRecentMsgResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -713,7 +633,7 @@ func (m *QueryAllRecentMsgRequest) Reset() { *m = QueryAllRecentMsgReque func (m *QueryAllRecentMsgRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllRecentMsgRequest) ProtoMessage() {} func (*QueryAllRecentMsgRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{16} + return fileDescriptor_f604621c8da1a6f3, []int{14} } func (m *QueryAllRecentMsgRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -758,7 +678,7 @@ func (m *QueryAllRecentMsgResponse) Reset() { *m = QueryAllRecentMsgResp func (m *QueryAllRecentMsgResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllRecentMsgResponse) ProtoMessage() {} func (*QueryAllRecentMsgResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{17} + return fileDescriptor_f604621c8da1a6f3, []int{15} } func (m *QueryAllRecentMsgResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -809,7 +729,7 @@ func (m *QueryGetRecentParamsRequest) Reset() { *m = QueryGetRecentParam func (m *QueryGetRecentParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetRecentParamsRequest) ProtoMessage() {} func (*QueryGetRecentParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{18} + return fileDescriptor_f604621c8da1a6f3, []int{16} } func (m *QueryGetRecentParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -853,7 +773,7 @@ func (m *QueryGetRecentParamsResponse) Reset() { *m = QueryGetRecentPara func (m *QueryGetRecentParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetRecentParamsResponse) ProtoMessage() {} func (*QueryGetRecentParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{19} + return fileDescriptor_f604621c8da1a6f3, []int{17} } func (m *QueryGetRecentParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -897,7 +817,7 @@ func (m *QueryAllRecentParamsRequest) Reset() { *m = QueryAllRecentParam func (m *QueryAllRecentParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllRecentParamsRequest) ProtoMessage() {} func (*QueryAllRecentParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{20} + return fileDescriptor_f604621c8da1a6f3, []int{18} } func (m *QueryAllRecentParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -942,7 +862,7 @@ func (m *QueryAllRecentParamsResponse) Reset() { *m = QueryAllRecentPara func (m *QueryAllRecentParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllRecentParamsResponse) ProtoMessage() {} func (*QueryAllRecentParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f604621c8da1a6f3, []int{21} + return fileDescriptor_f604621c8da1a6f3, []int{19} } func (m *QueryAllRecentParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -992,8 +912,6 @@ func init() { proto.RegisterType((*QueryGetPricesResponse)(nil), "exocore.oracle.QueryGetPricesResponse") proto.RegisterType((*QueryAllPricesRequest)(nil), "exocore.oracle.QueryAllPricesRequest") proto.RegisterType((*QueryAllPricesResponse)(nil), "exocore.oracle.QueryAllPricesResponse") - proto.RegisterType((*QueryGetValidatorsRequest)(nil), "exocore.oracle.QueryGetValidatorsRequest") - proto.RegisterType((*QueryGetValidatorsResponse)(nil), "exocore.oracle.QueryGetValidatorsResponse") proto.RegisterType((*QueryGetValidatorUpdateBlockRequest)(nil), "exocore.oracle.QueryGetValidatorUpdateBlockRequest") proto.RegisterType((*QueryGetValidatorUpdateBlockResponse)(nil), "exocore.oracle.QueryGetValidatorUpdateBlockResponse") proto.RegisterType((*QueryGetIndexRecentParamsRequest)(nil), "exocore.oracle.QueryGetIndexRecentParamsRequest") @@ -1013,71 +931,68 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/query.proto", fileDescriptor_f604621c8da1a6f3) } var fileDescriptor_f604621c8da1a6f3 = []byte{ - // 1022 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0x41, 0x6f, 0xdc, 0x44, - 0x14, 0xc7, 0x33, 0x4d, 0x13, 0x94, 0x47, 0x29, 0x62, 0x08, 0x55, 0xea, 0x84, 0x4d, 0x3b, 0x6d, - 0xda, 0xa4, 0x69, 0xed, 0x6c, 0xb2, 0x50, 0x81, 0xa8, 0x44, 0x22, 0xd1, 0xaa, 0x40, 0xab, 0xb0, - 0x52, 0x39, 0xf4, 0xd0, 0x95, 0x77, 0x33, 0x98, 0x55, 0x1c, 0xcf, 0xd6, 0x76, 0x4a, 0x4a, 0x55, - 0x09, 0x71, 0x40, 0xe2, 0x56, 0x09, 0x09, 0x0e, 0xdc, 0xe0, 0x00, 0x37, 0x2e, 0x7c, 0x00, 0x8e, - 0x3d, 0x46, 0xe2, 0xc2, 0x09, 0xa1, 0x84, 0x2b, 0xdf, 0x01, 0x79, 0xfc, 0xbc, 0xb6, 0xc7, 0x9e, - 0x5d, 0x6f, 0xb5, 0xb7, 0xb5, 0xdf, 0xff, 0xbd, 0xf7, 0x9b, 0x37, 0xef, 0xe9, 0x79, 0xc1, 0xe0, - 0x07, 0xa2, 0x23, 0x7c, 0x6e, 0x09, 0xdf, 0xee, 0xb8, 0xdc, 0x7a, 0xb8, 0xcf, 0xfd, 0xc7, 0x66, - 0xcf, 0x17, 0xa1, 0xa0, 0xa7, 0xd1, 0x66, 0xc6, 0x36, 0x63, 0xd6, 0x11, 0x8e, 0x90, 0x26, 0x2b, - 0xfa, 0x15, 0xab, 0x8c, 0x05, 0x47, 0x08, 0xc7, 0xe5, 0x96, 0xdd, 0xeb, 0x5a, 0xb6, 0xe7, 0x89, - 0xd0, 0x0e, 0xbb, 0xc2, 0x0b, 0xd0, 0x7a, 0xa5, 0x23, 0x82, 0x3d, 0x11, 0x58, 0x6d, 0x3b, 0xc0, - 0xe0, 0xd6, 0xa3, 0x7a, 0x9b, 0x87, 0x76, 0xdd, 0xea, 0xd9, 0x4e, 0xd7, 0x93, 0x62, 0xd4, 0xce, - 0x2b, 0x2c, 0x3d, 0xdb, 0xb7, 0xf7, 0x02, 0x9d, 0xd1, 0xef, 0x76, 0x78, 0x62, 0x5c, 0x54, 0x8c, - 0x8f, 0x6c, 0xb7, 0xbb, 0x63, 0x87, 0xc2, 0x4f, 0x04, 0xab, 0x3a, 0x41, 0x6b, 0xbf, 0xb7, 0x63, - 0x87, 0xbc, 0xd5, 0x76, 0x45, 0x67, 0x17, 0xc5, 0xcb, 0x8a, 0xb8, 0xeb, 0xed, 0xf0, 0x83, 0x96, - 0xcf, 0x3b, 0xdc, 0x0b, 0x5b, 0x39, 0xa8, 0xa5, 0x41, 0xca, 0xbd, 0xc0, 0xd1, 0xe0, 0x15, 0x04, - 0xac, 0x5c, 0x90, 0xcd, 0xc5, 0x66, 0x81, 0x7e, 0x12, 0xd5, 0x6f, 0x5b, 0xbe, 0x6c, 0xf2, 0x87, - 0xfb, 0x3c, 0x08, 0xd9, 0x47, 0xf0, 0x7a, 0xee, 0x6d, 0xd0, 0x13, 0x5e, 0xc0, 0x69, 0x03, 0xa6, - 0x63, 0xe7, 0x39, 0x72, 0x8e, 0x2c, 0xbf, 0xbc, 0x7e, 0xc6, 0xcc, 0xdf, 0xa5, 0x19, 0xeb, 0xb7, - 0x4e, 0x3e, 0xff, 0x7b, 0x71, 0xa2, 0x89, 0x5a, 0x56, 0x87, 0x37, 0x64, 0xb0, 0x5b, 0x3c, 0xdc, - 0x96, 0xe5, 0xc5, 0x2c, 0x74, 0x0e, 0x5e, 0x0a, 0xc5, 0x2e, 0xf7, 0x6e, 0xef, 0xc8, 0x78, 0x53, - 0xcd, 0xe4, 0x91, 0xdd, 0x85, 0x33, 0xaa, 0x4b, 0x06, 0x41, 0xbe, 0xd1, 0x22, 0x48, 0x6b, 0x1f, - 0x41, 0x3e, 0xb1, 0x16, 0x22, 0x6c, 0xba, 0x6e, 0x1e, 0xe1, 0x26, 0x40, 0xda, 0x30, 0x18, 0xf2, - 0x92, 0x19, 0x77, 0x97, 0x19, 0x75, 0x97, 0x19, 0xb7, 0x2e, 0x76, 0x97, 0xb9, 0x6d, 0x3b, 0x1c, - 0x7d, 0x9b, 0x19, 0x4f, 0xf6, 0x03, 0x41, 0xe2, 0x4c, 0x86, 0x12, 0xe2, 0xc9, 0xaa, 0xc4, 0xf4, - 0x56, 0x0e, 0xec, 0x84, 0x04, 0xbb, 0x3c, 0x14, 0x2c, 0x4e, 0x99, 0x23, 0x9b, 0x87, 0xb3, 0x49, - 0x29, 0x3f, 0xed, 0xf7, 0x6f, 0x72, 0xcf, 0x0f, 0xc0, 0x28, 0x33, 0x22, 0xf9, 0xfb, 0x00, 0xe9, - 0x5b, 0x2c, 0x8e, 0xa1, 0xd2, 0xa7, 0x0a, 0x3c, 0x41, 0xc6, 0x87, 0x2d, 0xc1, 0x85, 0x42, 0xfc, - 0x7b, 0x72, 0x34, 0xb6, 0xa2, 0xc9, 0x48, 0x30, 0xbe, 0x21, 0x70, 0x71, 0xb0, 0x0e, 0x89, 0x1e, - 0xc0, 0x6c, 0x99, 0x1d, 0xd9, 0x2e, 0x6a, 0xd9, 0x32, 0x5a, 0xa4, 0x2c, 0x8d, 0xc3, 0x18, 0x9c, - 0x4b, 0x38, 0x6e, 0x47, 0x43, 0xd7, 0x94, 0x13, 0x93, 0x9f, 0x8d, 0x2f, 0xe1, 0xfc, 0x00, 0x0d, - 0x82, 0xde, 0x83, 0xd7, 0x0a, 0x46, 0xa4, 0x3c, 0xaf, 0x52, 0x16, 0x84, 0x88, 0x58, 0x8c, 0xc0, - 0x16, 0xe1, 0xcd, 0x92, 0xdc, 0x77, 0x02, 0x27, 0x81, 0xf3, 0xa0, 0xa6, 0x13, 0x20, 0xd9, 0xc7, - 0x70, 0x3a, 0x6f, 0x41, 0xac, 0xda, 0x00, 0xac, 0x3b, 0x81, 0x83, 0x4c, 0x8a, 0x2f, 0x5b, 0x83, - 0xb9, 0x24, 0x9f, 0xca, 0x42, 0x67, 0x61, 0xaa, 0xdd, 0xbf, 0x9d, 0x93, 0xcd, 0xf8, 0x81, 0xdd, - 0x4f, 0xfb, 0xb1, 0x08, 0x77, 0x03, 0x66, 0x7c, 0x85, 0xeb, 0xac, 0xca, 0xa5, 0x22, 0xa5, 0x1e, - 0xac, 0x8d, 0x34, 0x9b, 0xae, 0x5b, 0xa0, 0x19, 0xd7, 0xa4, 0xff, 0x4c, 0xf0, 0x00, 0xf9, 0x24, - 0xe5, 0x07, 0x98, 0x1c, 0xed, 0x00, 0xe3, 0x9b, 0xfa, 0x0d, 0x98, 0xcf, 0x57, 0x39, 0xd7, 0xc3, - 0x9a, 0xab, 0xf9, 0x0c, 0x16, 0xca, 0x9d, 0xf0, 0x70, 0x37, 0xe1, 0x94, 0x5f, 0xec, 0xe7, 0x85, - 0xf2, 0xf3, 0xe5, 0x5a, 0x39, 0xe7, 0xc7, 0x38, 0xc2, 0xf5, 0x2b, 0x98, 0x87, 0x1b, 0xd7, 0x4d, - 0xfd, 0x46, 0xf0, 0x3c, 0x85, 0x3c, 0xda, 0xf3, 0x4c, 0xbe, 0xc8, 0x79, 0xc6, 0x76, 0x6b, 0xeb, - 0xff, 0xbd, 0x02, 0x53, 0x92, 0x98, 0x7e, 0x45, 0x60, 0x1a, 0xa3, 0x33, 0x95, 0xa7, 0xb8, 0xaf, - 0x8d, 0x0b, 0x03, 0x35, 0x71, 0x26, 0x76, 0xed, 0xeb, 0x3f, 0xff, 0xfd, 0xee, 0xc4, 0x65, 0xba, - 0x64, 0x7d, 0x10, 0x8b, 0xef, 0xf2, 0xf0, 0x0b, 0xe1, 0xef, 0x5a, 0xa5, 0x1f, 0x48, 0xf4, 0x59, - 0x84, 0x10, 0x2f, 0xa3, 0xa5, 0xd2, 0xf0, 0xea, 0x3e, 0x37, 0x2e, 0x0d, 0x93, 0x21, 0xc8, 0x75, - 0x09, 0x52, 0xa7, 0xd6, 0x30, 0x10, 0xe9, 0x66, 0x3d, 0xc1, 0xaf, 0x82, 0xa7, 0xf4, 0x5b, 0x02, - 0x33, 0x71, 0xac, 0x4d, 0xd7, 0xd5, 0x50, 0xa9, 0x2b, 0x5e, 0x43, 0x55, 0xd8, 0xd3, 0xd5, 0xcb, - 0x13, 0xd7, 0xe4, 0x7b, 0x92, 0xdd, 0x8e, 0x74, 0x45, 0x77, 0xf6, 0xc2, 0xd2, 0x35, 0xae, 0x54, - 0x91, 0x22, 0x54, 0x5d, 0x42, 0xad, 0xd2, 0x95, 0x21, 0x50, 0xe9, 0xa7, 0x29, 0xfd, 0x83, 0x94, - 0x2f, 0x49, 0xba, 0x31, 0x34, 0x6f, 0x71, 0x35, 0x1b, 0x8d, 0xd1, 0x9c, 0x10, 0xfb, 0x86, 0xc4, - 0xbe, 0x4e, 0xdf, 0xaa, 0x8a, 0x9d, 0xfb, 0x60, 0xa6, 0xbf, 0x93, 0x92, 0xf5, 0x49, 0xd7, 0x74, - 0x28, 0xba, 0x55, 0x6d, 0xd4, 0x47, 0xf0, 0x40, 0xf2, 0x77, 0x25, 0x79, 0x83, 0xae, 0x0f, 0x21, - 0x2f, 0xf9, 0x7a, 0xa7, 0xbf, 0x12, 0x75, 0xb7, 0xd2, 0x6b, 0x15, 0x08, 0xd2, 0x25, 0x65, 0x98, - 0x55, 0xe5, 0x23, 0x4e, 0x92, 0xfa, 0x0f, 0x82, 0xfe, 0x48, 0x60, 0x26, 0xa5, 0x5c, 0xd6, 0xa5, - 0x2d, 0x00, 0xae, 0x54, 0x50, 0x22, 0xdb, 0x3b, 0x92, 0x6d, 0x83, 0xd6, 0x87, 0xb0, 0xa5, 0x54, - 0xd6, 0x13, 0x79, 0xfd, 0x4f, 0xa3, 0xd9, 0x3a, 0xd5, 0x0f, 0x18, 0x8d, 0xfa, 0xb2, 0x6e, 0x86, - 0x2b, 0x02, 0x96, 0xed, 0xea, 0xca, 0xb3, 0x95, 0x29, 0xdb, 0x2f, 0x7d, 0x30, 0xec, 0xc9, 0xd5, - 0xc1, 0xf5, 0xc8, 0xb7, 0xe3, 0xd5, 0x6a, 0x62, 0xc4, 0x7b, 0x4f, 0xe2, 0xbd, 0x4d, 0x1b, 0xd5, - 0xf0, 0xe2, 0x1e, 0xec, 0x97, 0xf0, 0x27, 0x02, 0xaf, 0x66, 0xc3, 0x46, 0x55, 0x5c, 0x1d, 0x5c, - 0x9b, 0x2a, 0xb0, 0x9a, 0x55, 0xca, 0x1a, 0x12, 0xd6, 0xa4, 0x57, 0x47, 0x81, 0xdd, 0xfa, 0xf0, - 0xf9, 0x51, 0x8d, 0x1c, 0x1e, 0xd5, 0xc8, 0x3f, 0x47, 0x35, 0xf2, 0xec, 0xb8, 0x36, 0x71, 0x78, - 0x5c, 0x9b, 0xf8, 0xeb, 0xb8, 0x36, 0x71, 0x7f, 0xcd, 0xe9, 0x86, 0x9f, 0xef, 0xb7, 0xcd, 0x8e, - 0xd8, 0xd3, 0x45, 0x3c, 0x48, 0x62, 0x86, 0x8f, 0x7b, 0x3c, 0x68, 0x4f, 0xcb, 0xff, 0xb3, 0x1b, - 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xbf, 0xbe, 0x76, 0x39, 0x7b, 0x10, 0x00, 0x00, + // 970 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0x41, 0x8f, 0xdb, 0x44, + 0x14, 0xc7, 0x33, 0xdd, 0xee, 0xa2, 0x1d, 0x56, 0x45, 0x0c, 0xa1, 0xda, 0xba, 0x8b, 0xb7, 0x9d, + 0x36, 0x6d, 0x4a, 0x5a, 0x7b, 0xb3, 0x09, 0x54, 0x20, 0x7a, 0xd8, 0x95, 0x68, 0x55, 0xa0, 0xd5, + 0x12, 0xa9, 0x1c, 0x7a, 0x20, 0x72, 0x92, 0xc1, 0x44, 0xeb, 0x78, 0x52, 0xdb, 0x29, 0x5b, 0xaa, + 0x4a, 0x88, 0x03, 0x12, 0xb7, 0x4a, 0x48, 0x70, 0xe0, 0x06, 0x07, 0xb8, 0x71, 0xe1, 0x03, 0x70, + 0xdc, 0xe3, 0x4a, 0x70, 0xe0, 0x84, 0xd0, 0x2e, 0x1f, 0x04, 0x79, 0xfc, 0x9c, 0xc4, 0xe3, 0xb1, + 0xe3, 0x54, 0xb9, 0xc5, 0x7e, 0xff, 0xf7, 0xde, 0xef, 0xbd, 0x79, 0xd6, 0x9b, 0x60, 0x8d, 0x1d, + 0xf0, 0x2e, 0xf7, 0x98, 0xc9, 0x3d, 0xab, 0xeb, 0x30, 0xf3, 0xd1, 0x88, 0x79, 0x4f, 0x8c, 0xa1, + 0xc7, 0x03, 0x4e, 0xce, 0x80, 0xcd, 0x88, 0x6c, 0x5a, 0xd9, 0xe6, 0x36, 0x17, 0x26, 0x33, 0xfc, + 0x15, 0xa9, 0xb4, 0x0d, 0x9b, 0x73, 0xdb, 0x61, 0xa6, 0x35, 0xec, 0x9b, 0x96, 0xeb, 0xf2, 0xc0, + 0x0a, 0xfa, 0xdc, 0xf5, 0xc1, 0xfa, 0x66, 0x97, 0xfb, 0x03, 0xee, 0x9b, 0x1d, 0xcb, 0x87, 0xe0, + 0xe6, 0xe3, 0x7a, 0x87, 0x05, 0x56, 0xdd, 0x1c, 0x5a, 0x76, 0xdf, 0x15, 0x62, 0xd0, 0x9e, 0x97, + 0x58, 0x86, 0x96, 0x67, 0x0d, 0xfc, 0x2c, 0xa3, 0xd7, 0xef, 0xb2, 0xd8, 0x58, 0x93, 0x8c, 0x8f, + 0x2d, 0xa7, 0xdf, 0xb3, 0x02, 0xee, 0xb5, 0x47, 0xc3, 0x9e, 0x15, 0xb0, 0x76, 0xc7, 0xe1, 0xdd, + 0x7d, 0x10, 0x57, 0x25, 0x71, 0xdf, 0xed, 0xb1, 0x83, 0xb6, 0xc7, 0xba, 0xcc, 0x0d, 0xda, 0x89, + 0x9c, 0x95, 0x3c, 0xe5, 0xc0, 0xb7, 0x41, 0xb6, 0x29, 0xc9, 0x52, 0x02, 0xaa, 0x16, 0x4c, 0xe7, + 0xa2, 0x65, 0x4c, 0x3e, 0x0e, 0xdb, 0xb3, 0x27, 0x5e, 0xb6, 0xd8, 0xa3, 0x11, 0xf3, 0x03, 0xfa, + 0x21, 0x7e, 0x2d, 0xf1, 0xd6, 0x1f, 0x72, 0xd7, 0x67, 0xa4, 0x89, 0x57, 0x22, 0xe7, 0x75, 0x74, + 0x01, 0x55, 0x5f, 0xde, 0x3e, 0x6b, 0x24, 0x8f, 0xca, 0x88, 0xf4, 0xbb, 0xa7, 0x0f, 0xff, 0xd9, + 0x2c, 0xb5, 0x40, 0x4b, 0xeb, 0xf8, 0x75, 0x11, 0xec, 0x0e, 0x0b, 0xf6, 0x44, 0xf7, 0x20, 0x0b, + 0x59, 0xc7, 0x2f, 0x05, 0x7c, 0x9f, 0xb9, 0x77, 0x7b, 0x22, 0xde, 0x72, 0x2b, 0x7e, 0xa4, 0xf7, + 0xf1, 0x59, 0xd9, 0x65, 0x0a, 0x41, 0xbc, 0xc9, 0x44, 0x10, 0xd6, 0x31, 0x82, 0x78, 0xa2, 0x6d, + 0x40, 0xd8, 0x71, 0x9c, 0x24, 0xc2, 0x6d, 0x8c, 0x27, 0xf3, 0x00, 0x21, 0xaf, 0x18, 0xd1, 0xf0, + 0x18, 0xe1, 0xf0, 0x18, 0xd1, 0x64, 0xc2, 0xf0, 0x18, 0x7b, 0x96, 0xcd, 0xc0, 0xb7, 0x35, 0xe5, + 0x49, 0x7f, 0x40, 0x40, 0x3c, 0x95, 0x41, 0x41, 0xbc, 0x54, 0x94, 0x98, 0xdc, 0x49, 0x80, 0x9d, + 0x12, 0x60, 0x57, 0x67, 0x82, 0x45, 0x29, 0x13, 0x64, 0x15, 0x7c, 0x29, 0x6e, 0xe5, 0x27, 0xf1, + 0x78, 0x3e, 0x10, 0xd3, 0xb9, 0x1b, 0x0e, 0x67, 0x7c, 0xe2, 0xdf, 0x20, 0x7c, 0x39, 0x5f, 0x07, + 0xe5, 0x7c, 0x8a, 0xcb, 0x2a, 0x3b, 0xf4, 0xee, 0xb2, 0x5c, 0x9c, 0x4a, 0x0b, 0xa5, 0x2a, 0xe3, + 0x50, 0x8a, 0x2f, 0xc4, 0x1c, 0x77, 0xc3, 0xb9, 0x6f, 0x89, 0xa1, 0x4d, 0x8e, 0xe7, 0x97, 0xf8, + 0x62, 0x8e, 0x06, 0x40, 0x1f, 0xe0, 0x57, 0x53, 0x46, 0xa0, 0xbc, 0x28, 0x53, 0xa6, 0x84, 0x80, + 0x98, 0x8e, 0x40, 0x37, 0xf1, 0x1b, 0x8a, 0xdc, 0xf7, 0x7c, 0x3b, 0x86, 0x73, 0xb1, 0x9e, 0x25, + 0x00, 0xb2, 0x8f, 0xf0, 0x99, 0xa4, 0x05, 0xb0, 0xf4, 0x1c, 0xac, 0x7b, 0xbe, 0x0d, 0x4c, 0x92, + 0x2f, 0xdd, 0xc2, 0xeb, 0x71, 0x3e, 0x99, 0x85, 0x94, 0xf1, 0x72, 0x67, 0x7c, 0x3a, 0xa7, 0x5b, + 0xd1, 0x03, 0x7d, 0x88, 0xcf, 0x29, 0x3c, 0x00, 0xee, 0x16, 0x5e, 0xf5, 0x24, 0xae, 0x73, 0x32, + 0x97, 0x8c, 0x34, 0xf1, 0xa0, 0x1d, 0xa0, 0xd9, 0x71, 0x9c, 0x14, 0xcd, 0xa2, 0x3e, 0xb6, 0x9f, + 0x11, 0x14, 0x90, 0x4c, 0xa2, 0x2e, 0x60, 0x69, 0xbe, 0x02, 0x16, 0xf7, 0xe1, 0x35, 0xf0, 0xf9, + 0x64, 0x97, 0x13, 0x33, 0x9c, 0x71, 0x34, 0x9f, 0xe1, 0x0d, 0xb5, 0x13, 0x14, 0x77, 0x1b, 0xaf, + 0x79, 0xe9, 0x79, 0xde, 0x50, 0xd7, 0x97, 0x18, 0xe5, 0x84, 0x1f, 0x65, 0x00, 0x37, 0xee, 0x60, + 0x12, 0x6e, 0x51, 0x27, 0xf5, 0x1b, 0x82, 0x7a, 0x52, 0x79, 0x32, 0xeb, 0x59, 0x7a, 0x91, 0x7a, + 0x16, 0x76, 0x6a, 0xdb, 0x7f, 0xad, 0xe1, 0x65, 0x41, 0x4c, 0xbe, 0x42, 0x78, 0x05, 0xa2, 0x53, + 0x99, 0x27, 0xbd, 0x32, 0xb5, 0x4b, 0xb9, 0x9a, 0x28, 0x13, 0xbd, 0xf1, 0xf5, 0x9f, 0xff, 0x7d, + 0x77, 0xea, 0x2a, 0xa9, 0x98, 0xef, 0x47, 0xe2, 0xfb, 0x2c, 0xf8, 0x82, 0x7b, 0xfb, 0xa6, 0xf2, + 0x0a, 0x42, 0x9e, 0x87, 0x08, 0xd1, 0x3e, 0xa8, 0x28, 0xc3, 0xcb, 0x2b, 0x55, 0xbb, 0x32, 0x4b, + 0x06, 0x20, 0x37, 0x05, 0x48, 0x9d, 0x98, 0xb3, 0x40, 0x84, 0x9b, 0xf9, 0x14, 0x16, 0xf3, 0x33, + 0xf2, 0x2d, 0xc2, 0xab, 0x51, 0xac, 0x1d, 0xc7, 0xc9, 0xa0, 0x92, 0xb7, 0x6c, 0x06, 0x55, 0x6a, + 0x55, 0x16, 0x6f, 0x4f, 0xd4, 0x93, 0x3f, 0x90, 0x7a, 0x17, 0x91, 0x46, 0x56, 0x17, 0x72, 0x36, + 0xa0, 0xd6, 0x9c, 0xcf, 0x09, 0x90, 0x6f, 0x09, 0xe4, 0x9b, 0xe4, 0xad, 0x19, 0xc8, 0xea, 0xab, + 0x21, 0xf9, 0x1d, 0x29, 0xb6, 0x14, 0xd9, 0xca, 0x42, 0xc9, 0xda, 0x88, 0x5a, 0x7d, 0x0e, 0x0f, + 0x20, 0x7f, 0x57, 0x90, 0x37, 0xc9, 0xf6, 0x0c, 0x72, 0xc5, 0x3d, 0x95, 0xfc, 0x8a, 0xe4, 0x15, + 0x46, 0x6e, 0x14, 0x20, 0x98, 0xec, 0x02, 0xcd, 0x28, 0x2a, 0x9f, 0x73, 0x60, 0xe5, 0xbb, 0x32, + 0xf9, 0x11, 0xe1, 0xd5, 0x09, 0x65, 0x35, 0x2b, 0x6d, 0x0a, 0xf0, 0x5a, 0x01, 0x25, 0xb0, 0xbd, + 0x23, 0xd8, 0x1a, 0xa4, 0x3e, 0x83, 0x6d, 0x42, 0x65, 0x3e, 0x15, 0xc7, 0xff, 0x8c, 0x7c, 0x8f, + 0xf0, 0xda, 0x38, 0x60, 0xf8, 0x45, 0x55, 0xb3, 0x3e, 0x95, 0x82, 0x80, 0xaa, 0x95, 0x48, 0xeb, + 0x02, 0xb0, 0x46, 0xae, 0x15, 0x06, 0x24, 0xbf, 0x8c, 0xc1, 0x60, 0x26, 0x6b, 0xf9, 0xfd, 0x48, + 0x8e, 0xe3, 0xf5, 0x62, 0x62, 0xc0, 0x7b, 0x4f, 0xe0, 0xbd, 0x4d, 0x9a, 0xc5, 0xf0, 0xa2, 0x19, + 0x1c, 0xb7, 0xf0, 0x27, 0x84, 0x5f, 0x99, 0x0e, 0x1b, 0x76, 0xb1, 0x96, 0xdf, 0x9b, 0x22, 0xb0, + 0x19, 0x1b, 0x8b, 0x36, 0x05, 0xac, 0x41, 0xae, 0xcf, 0x03, 0xbb, 0xfb, 0xc1, 0xe1, 0xb1, 0x8e, + 0x8e, 0x8e, 0x75, 0xf4, 0xef, 0xb1, 0x8e, 0x9e, 0x9f, 0xe8, 0xa5, 0xa3, 0x13, 0xbd, 0xf4, 0xf7, + 0x89, 0x5e, 0x7a, 0xb8, 0x65, 0xf7, 0x83, 0xcf, 0x47, 0x1d, 0xa3, 0xcb, 0x07, 0x59, 0x11, 0x0f, + 0xe2, 0x98, 0xc1, 0x93, 0x21, 0xf3, 0x3b, 0x2b, 0xe2, 0x9f, 0x5b, 0xe3, 0xff, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x79, 0x95, 0x81, 0x2c, 0x44, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1097,8 +1012,6 @@ type QueryClient interface { // Queries a list of Prices items. Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) PricesAll(ctx context.Context, in *QueryAllPricesRequest, opts ...grpc.CallOption) (*QueryAllPricesResponse, error) - // Queries a Validators by index. - Validators(ctx context.Context, in *QueryGetValidatorsRequest, opts ...grpc.CallOption) (*QueryGetValidatorsResponse, error) // Queries a ValidatorUpdateBlock by index. ValidatorUpdateBlock(ctx context.Context, in *QueryGetValidatorUpdateBlockRequest, opts ...grpc.CallOption) (*QueryGetValidatorUpdateBlockResponse, error) // Queries a IndexRecentParams by index. @@ -1148,15 +1061,6 @@ func (c *queryClient) PricesAll(ctx context.Context, in *QueryAllPricesRequest, return out, nil } -func (c *queryClient) Validators(ctx context.Context, in *QueryGetValidatorsRequest, opts ...grpc.CallOption) (*QueryGetValidatorsResponse, error) { - out := new(QueryGetValidatorsResponse) - err := c.cc.Invoke(ctx, "/exocore.oracle.Query/Validators", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) ValidatorUpdateBlock(ctx context.Context, in *QueryGetValidatorUpdateBlockRequest, opts ...grpc.CallOption) (*QueryGetValidatorUpdateBlockResponse, error) { out := new(QueryGetValidatorUpdateBlockResponse) err := c.cc.Invoke(ctx, "/exocore.oracle.Query/ValidatorUpdateBlock", in, out, opts...) @@ -1227,8 +1131,6 @@ type QueryServer interface { // Queries a list of Prices items. Prices(context.Context, *QueryGetPricesRequest) (*QueryGetPricesResponse, error) PricesAll(context.Context, *QueryAllPricesRequest) (*QueryAllPricesResponse, error) - // Queries a Validators by index. - Validators(context.Context, *QueryGetValidatorsRequest) (*QueryGetValidatorsResponse, error) // Queries a ValidatorUpdateBlock by index. ValidatorUpdateBlock(context.Context, *QueryGetValidatorUpdateBlockRequest) (*QueryGetValidatorUpdateBlockResponse, error) // Queries a IndexRecentParams by index. @@ -1256,9 +1158,6 @@ func (*UnimplementedQueryServer) Prices(ctx context.Context, req *QueryGetPrices func (*UnimplementedQueryServer) PricesAll(ctx context.Context, req *QueryAllPricesRequest) (*QueryAllPricesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PricesAll not implemented") } -func (*UnimplementedQueryServer) Validators(ctx context.Context, req *QueryGetValidatorsRequest) (*QueryGetValidatorsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Validators not implemented") -} func (*UnimplementedQueryServer) ValidatorUpdateBlock(ctx context.Context, req *QueryGetValidatorUpdateBlockRequest) (*QueryGetValidatorUpdateBlockResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ValidatorUpdateBlock not implemented") } @@ -1339,24 +1238,6 @@ func _Query_PricesAll_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } -func _Query_Validators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetValidatorsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Validators(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.oracle.Query/Validators", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Validators(ctx, req.(*QueryGetValidatorsRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_ValidatorUpdateBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryGetValidatorUpdateBlockRequest) if err := dec(in); err != nil { @@ -1499,10 +1380,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "PricesAll", Handler: _Query_PricesAll_Handler, }, - { - MethodName: "Validators", - Handler: _Query_Validators_Handler, - }, { MethodName: "ValidatorUpdateBlock", Handler: _Query_ValidatorUpdateBlock_Handler, @@ -1737,62 +1614,6 @@ func (m *QueryAllPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryGetValidatorsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryGetValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryGetValidatorsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryGetValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Validators.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *QueryGetValidatorUpdateBlockRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2337,26 +2158,6 @@ func (m *QueryAllPricesResponse) Size() (n int) { return n } -func (m *QueryGetValidatorsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryGetValidatorsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Validators.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - func (m *QueryGetValidatorUpdateBlockRequest) Size() (n int) { if m == nil { return 0 @@ -3024,139 +2825,6 @@ func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetValidatorsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGetValidatorsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetValidatorsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGetValidatorsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Validators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *QueryGetValidatorUpdateBlockRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index 3f5b39649..d87c74b38 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -141,24 +141,6 @@ func local_request_Query_PricesAll_0(ctx context.Context, marshaler runtime.Mars } -func request_Query_Validators_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetValidatorsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Validators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Validators_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetValidatorsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Validators(ctx, &protoReq) - return msg, metadata, err - -} - func request_Query_ValidatorUpdateBlock_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetValidatorUpdateBlockRequest var metadata runtime.ServerMetadata @@ -468,29 +450,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_Validators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Validators_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Validators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_ValidatorUpdateBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -753,26 +712,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_Validators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Validators_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Validators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_ValidatorUpdateBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -923,8 +862,6 @@ var ( pattern_Query_PricesAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "prices"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_Validators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "validators"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ValidatorUpdateBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "validator_update_block"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_IndexRecentParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "index_recent_params"}, "", runtime.AssumeColonVerbOpt(true))) @@ -947,8 +884,6 @@ var ( forward_Query_PricesAll_0 = runtime.ForwardResponseMessage - forward_Query_Validators_0 = runtime.ForwardResponseMessage - forward_Query_ValidatorUpdateBlock_0 = runtime.ForwardResponseMessage forward_Query_IndexRecentParams_0 = runtime.ForwardResponseMessage From 161f0813552e7443eba7f3160f4b1db04de6a796 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Mon, 18 Mar 2024 23:12:01 +0800 Subject: [PATCH 25/37] feat(oracle-proto):update caches with recache for aggregatorContext, refactor --- x/oracle/keeper/aggregator/aggregator.go | 20 ++- x/oracle/keeper/cache/caches.go | 180 ++++++--------------- x/oracle/keeper/common/expected_keepers.go | 4 + x/oracle/keeper/keeper.go | 10 ++ x/oracle/keeper/msg_server_create_price.go | 3 +- x/oracle/keeper/prices.go | 34 ++-- x/oracle/keeper/single.go | 119 +++++++++++++- x/oracle/module.go | 52 +++++- 8 files changed, 262 insertions(+), 160 deletions(-) diff --git a/x/oracle/keeper/aggregator/aggregator.go b/x/oracle/keeper/aggregator/aggregator.go index cdaf7cfdb..60a499510 100644 --- a/x/oracle/keeper/aggregator/aggregator.go +++ b/x/oracle/keeper/aggregator/aggregator.go @@ -5,6 +5,7 @@ import ( "math/big" "time" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/cache" "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" "github.com/ExocoreNetwork/exocore/x/oracle/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -113,7 +114,7 @@ func (agc *AggregatorContext) checkMsg(msg *types.MsgCreatePrice) error { return nil } -func (agc *AggregatorContext) FillPrice(msg *types.MsgCreatePrice) (*priceItemKV, *cacheItemM, error) { +func (agc *AggregatorContext) FillPrice(msg *types.MsgCreatePrice) (*priceItemKV, *cache.CacheItemM, error) { feederWorker := agc.aggregators[msg.FeederId] //worker initialzed here reduce workload for Endblocker if feederWorker == nil { @@ -135,9 +136,9 @@ func (agc *AggregatorContext) FillPrice(msg *types.MsgCreatePrice) (*priceItemKV //TODO: check the format Timestamp: time.Now().String(), RoundId: agc.rounds[msg.FeederId].nextRoundId, - }}, &cacheItemM{feederId: msg.FeederId}, nil + }}, &cache.CacheItemM{FeederId: msg.FeederId}, nil } - return nil, &cacheItemM{msg.FeederId, listFilled, msg.Creator}, nil + return nil, &cache.CacheItemM{msg.FeederId, listFilled, msg.Creator}, nil } return nil, nil, errors.New("") @@ -145,7 +146,7 @@ func (agc *AggregatorContext) FillPrice(msg *types.MsgCreatePrice) (*priceItemKV // NewCreatePrice receives msgCreatePrice message, and goes process: filter->aggregator, filter->calculator->aggregator // non-deterministic data will goes directly into aggregator, and deterministic data will goes into calculator first to get consensus on the deterministic id. -func (agc *AggregatorContext) NewCreatePrice(ctx sdk.Context, msg *types.MsgCreatePrice) (*priceItemKV, *cacheItemM, error) { +func (agc *AggregatorContext) NewCreatePrice(ctx sdk.Context, msg *types.MsgCreatePrice) (*priceItemKV, *cache.CacheItemM, error) { if err := agc.checkMsg(msg); err != nil { return nil, nil, err @@ -157,8 +158,9 @@ func (agc *AggregatorContext) NewCreatePrice(ctx sdk.Context, msg *types.MsgCrea // prepare for new roundInfo, just update the status kept in memory // executed at EndBlock stage, seall all success or expired roundInfo // including possible aggregation and state update +// when validatorSet update, set force to true, to seal all alive round // returns: 1st successful sealed, need to be written to KVStore, 2nd: failed sealed tokenId, use previous price to write to KVStore -func (agc *AggregatorContext) SealRound(ctx sdk.Context) (success []*priceItemKV, failed []int32) { +func (agc *AggregatorContext) SealRound(ctx sdk.Context, force bool) (success []*priceItemKV, failed []int32) { //1. check validatorSet udpate //TODO: if validatoSet has been updated in current block, just seal all active rounds and return //1. for sealed worker, the KVStore has been updated @@ -171,7 +173,7 @@ func (agc *AggregatorContext) SealRound(ctx sdk.Context) (success []*priceItemKV case 1: expired := ctx.BlockHeight() >= feeder.EndBlock outOfWindow := uint64(ctx.BlockHeight())-round.basedBlock >= uint64(common.MaxNonce) - if expired || outOfWindow { + if expired || outOfWindow || force { //TODO: WRITE TO KVSTORE with previous round data for this round failed = append(failed, feeder.TokenId) if expired { @@ -180,8 +182,6 @@ func (agc *AggregatorContext) SealRound(ctx sdk.Context) (success []*priceItemKV } else { round.status = 2 agc.aggregators[feederId] = nil - //TODO: WRITE TO KVSTORE with previous round data for this round - failed = append(failed, feeder.TokenId) } } } @@ -194,6 +194,10 @@ func (agc *AggregatorContext) SealRound(ctx sdk.Context) (success []*priceItemKV return } +//func (agc *AggregatorContext) ForceSeal(ctx sdk.Context) (success []*priceItemKV, failed []int32) { +// +//} + func (agc *AggregatorContext) PrepareRound(ctx sdk.Context, block uint64) { //block>0 means recache initialization, all roundInfo is empty if block == 0 { diff --git a/x/oracle/keeper/cache/caches.go b/x/oracle/keeper/cache/caches.go index 67e09a9b4..b3b3dec12 100644 --- a/x/oracle/keeper/cache/caches.go +++ b/x/oracle/keeper/cache/caches.go @@ -3,21 +3,19 @@ package cache import ( "math/big" - "github.com/ExocoreNetwork/exocore/x/oracle/keeper/aggregator" "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" "github.com/ExocoreNetwork/exocore/x/oracle/types" sdk "github.com/cosmos/cosmos-sdk/types" - stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) var zeroBig = big.NewInt(0) -type cacheItemV map[string]*big.Int -type cacheItemP *common.Params -type cacheItemM struct { - feederId int32 - pSources []*types.PriceWithSource - validator string +type CacheItemV map[string]*big.Int +type CacheItemP *common.Params +type CacheItemM struct { + FeederId int32 + PSources []*types.PriceWithSource + Validator string } type Cache struct { @@ -26,7 +24,7 @@ type Cache struct { params *cacheParams } -type cacheMsgs map[int32][]*cacheItemM +type cacheMsgs map[int32][]*CacheItemM // used to track validator change type cacheValidator struct { @@ -40,11 +38,11 @@ type cacheParams struct { update bool } -func (c cacheMsgs) add(item *cacheItemM) { - c[item.feederId] = append(c[item.feederId], item) +func (c cacheMsgs) add(item *CacheItemM) { + c[item.FeederId] = append(c[item.FeederId], item) } -func (c cacheMsgs) remove(item *cacheItemM) { - delete(c, item.feederId) +func (c cacheMsgs) remove(item *CacheItemM) { + delete(c, item.FeederId) } func (c cacheMsgs) commit(ctx sdk.Context, k common.KeeperOracle) { @@ -56,9 +54,9 @@ func (c cacheMsgs) commit(ctx sdk.Context, k common.KeeperOracle) { for _, msgs4Feeder := range c { for _, msg := range msgs4Feeder { recentMsgs.Msgs = append(recentMsgs.Msgs, &types.MsgItem{ - FeederId: msg.feederId, - PSources: msg.pSources, - Validator: msg.validator, + FeederId: msg.FeederId, + PSources: msg.PSources, + Validator: msg.Validator, }) } } @@ -124,12 +122,12 @@ func (c *cacheParams) commit(ctx sdk.Context, k common.KeeperOracle) { // memory cache func (c *Cache) AddCache(i any, k common.KeeperOracle) { switch item := i.(type) { - case *cacheItemM: + case *CacheItemM: c.msg.add(item) // case *params: - case cacheItemP: + case CacheItemP: c.params.add(item) - case cacheItemV: + case CacheItemV: c.validators.add(item) default: panic("no other types are support") @@ -137,16 +135,45 @@ func (c *Cache) AddCache(i any, k common.KeeperOracle) { } func (c *Cache) RemoveCache(i any, k common.KeeperOracle) { switch item := i.(type) { - case *cacheItemM: + case *CacheItemM: c.msg.remove(item) default: } } +func (c *Cache) GetCache(i any) bool { + switch item := i.(type) { + case CacheItemV: + if item == nil { + return false + } + for addr, power := range c.validators.validators { + item[addr] = power + } + case CacheItemP: + if item == nil { + return false + } + *item = *(c.params.params) + case *[]*CacheItemM: + if item == nil { + return false + } + tmp := make([]*CacheItemM, 0, len(c.msg)) + for _, msgs := range c.msg { + tmp = append(tmp, msgs...) + } + *item = tmp + default: + return false + } + return true +} + func (c *Cache) CommitCache(ctx sdk.Context, reset bool, k common.KeeperOracle) { if len(c.msg) > 0 { c.msg.commit(ctx, k) - c.msg = make(map[int32][]*cacheItemM) + c.msg = make(map[int32][]*CacheItemM) } if c.validators.update { @@ -169,7 +196,7 @@ func (c *Cache) ResetCaches() { func NewCache() *Cache { return &Cache{ - msg: make(map[int32][]*cacheItemM), + msg: make(map[int32][]*CacheItemM), validators: &cacheValidator{ validators: make(map[string]*big.Int), }, @@ -178,112 +205,3 @@ func NewCache() *Cache { }, } } - -func (c *Cache) RecacheAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k common.KeeperOracle) bool { - - from := uint64(ctx.BlockHeight()) - common.MaxNonce - to := uint64(ctx.BlockHeight()) - 1 - - h, ok := k.GetValidatorUpdateBlock(ctx) - recentParamsMap := k.GetAllRecentParamsAsMap(ctx) - if !ok || recentParamsMap == nil { - //no cache, this is the very first running, so go to initial proces instead - return false - } - - if h.Block > from { - from = h.Block - } - - totalPower := big.NewInt(0) - validatorPowers := make(map[string]*big.Int) - k.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingTypes.ValidatorI) bool { - power := big.NewInt(validator.GetConsensusPower(validator.GetBondedTokens())) - addr := string(validator.GetOperator()) - validatorPowers[addr] = power - totalPower = new(big.Int).Add(totalPower, power) - return false - }) - agc.SetValidatorPowers(validatorPowers) - agc.SetTotalPower(totalPower) - //TODO: test only - if k.GetLastTotalPower(ctx).Cmp(totalPower) != 0 { - panic("something wrong when get validatorsPower from staking module") - } - - //reset validators - c.AddCache(cacheItemV(validatorPowers), k) - - recentMsgs := k.GetAllRecentMsgAsMap(ctx) - var pTmp common.Params - for ; from < to; from++ { - //fill params - for b, recentParams := range recentParamsMap { - prev := uint64(0) - if b <= from && b > prev { - pTmp = common.Params(*recentParams) - agc.SetParams(&pTmp) - if prev > 0 { - //TODO: safe delete - delete(recentParamsMap, prev) - } - prev = b - } - } - - agc.PrepareRound(ctx, from) - - if msgs := recentMsgs[from+1]; msgs != nil { - for _, msg := range msgs { - //these messages are retreived for recache, just skip the validation check and fill the memory cache - agc.FillPrice(&types.MsgCreatePrice{ - Creator: msg.Validator, - FeederId: msg.FeederId, - Prices: msg.PSources, - }) - } - } - agc.SealRound(ctx) - } - - //fill params cache - c.AddCache(cacheItemP(&pTmp), k) - - agc.PrepareRound(ctx, to) - - return true -} - -func (c *Cache) InitAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k common.KeeperOracle) error { - //set params - p := k.GetParams(ctx) - m := make(map[uint64]*types.Params) - m[uint64(ctx.BlockHeight())] = &p - // k.setParams4CacheRecover(m) //used to trace tokenFeeder's update during cache recover - pTmp := common.Params(p) - agc.SetParams(&pTmp) - //set params cache - c.AddCache(cacheItemP(&pTmp), k) - - totalPower := big.NewInt(0) - validatorPowers := make(map[string]*big.Int) - k.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingTypes.ValidatorI) bool { - power := big.NewInt(validator.GetConsensusPower(validator.GetBondedTokens())) - addr := string(validator.GetOperator()) - //agc.validatorsPower[addr] = power - validatorPowers[addr] = power - totalPower = new(big.Int).Add(totalPower, power) - return false - }) - agc.SetTotalPower(totalPower) - agc.SetValidatorPowers(validatorPowers) - if k.GetLastTotalPower(ctx).Cmp(totalPower) != 0 { - panic("-") - } - - //set validatorPower cache - c.AddCache(cacheItemV(validatorPowers), k) - - agc.PrepareRound(ctx, uint64(ctx.BlockHeight())-1) - return nil -} diff --git a/x/oracle/keeper/common/expected_keepers.go b/x/oracle/keeper/common/expected_keepers.go index b6d4a6ac7..0eec0d1ff 100644 --- a/x/oracle/keeper/common/expected_keepers.go +++ b/x/oracle/keeper/common/expected_keepers.go @@ -3,7 +3,9 @@ package common import ( "math/big" + // "cosmossdk.io/api/tendermint/abci" "github.com/ExocoreNetwork/exocore/x/oracle/types" + abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -13,6 +15,8 @@ type KeeperOracle interface { IterateBondedValidatorsByPower(sdk.Context, func(index int64, validator stakingTypes.ValidatorI) bool) GetLastTotalPower(sdk.Context) *big.Int + GetValidatorUpdates(sdk.Context) []abci.ValidatorUpdate + GetValidatorByConsAddr(sdk.Context, sdk.ConsAddress) (stakingTypes.Validator, bool) GetIndexRecentMsg(sdk.Context) (types.IndexRecentMsg, bool) GetAllRecentMsgAsMap(sdk.Context) map[uint64][]*types.MsgItem diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index 24e7bb091..4247f0088 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -4,6 +4,8 @@ import ( "fmt" "math/big" + // "cosmossdk.io/api/tendermint/abci" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -60,3 +62,11 @@ func (k Keeper) GetLastTotalPower(ctx sdk.Context) *big.Int { func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, f func(index int64, validator stakingtypes.ValidatorI) bool) { k.stakingKeeper.IterateBondedValidatorsByPower(ctx, f) } + +func (k Keeper) GetValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { + return k.stakingKeeper.GetValidatorUpdates(ctx) +} + +func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) (stakingtypes.Validator, bool) { + return k.stakingKeeper.GetValidatorByConsAddr(ctx, addr) +} diff --git a/x/oracle/keeper/msg_server_create_price.go b/x/oracle/keeper/msg_server_create_price.go index eec99af8b..171d29e70 100644 --- a/x/oracle/keeper/msg_server_create_price.go +++ b/x/oracle/keeper/msg_server_create_price.go @@ -15,7 +15,8 @@ func (k msgServer) CreatePrice(goCtx context.Context, msg *types.MsgCreatePrice) 3. check the rule fulfilled(sources check), check the decimal of the 1st mathc the params' definition(among prices the decimal had been checked in ante stage), timestamp:later than previous block's timestamp, [not future than now(+1s), this is checked in anteHandler], timestamp verification is not necessary **/ - newItem, caches, _ := GetAggregatorContext(ctx, k.Keeper).NewCreatePrice(ctx, msg) + //newItem, caches, _ := k.GetAggregatorContext(ctx, k.Keeper).NewCreatePrice(ctx, msg) + newItem, caches, _ := GetAggregatorContext(ctx, &k.Keeper).NewCreatePrice(ctx, msg) if caches != nil { if newItem != nil { diff --git a/x/oracle/keeper/prices.go b/x/oracle/keeper/prices.go index 4f6c108ae..3550592ad 100644 --- a/x/oracle/keeper/prices.go +++ b/x/oracle/keeper/prices.go @@ -5,7 +5,6 @@ import ( "github.com/ExocoreNetwork/exocore/x/oracle/types" "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -26,9 +25,9 @@ func (k Keeper) GetPrices( tokenId int32, ) (val types.Prices, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) - store = prefix.NewStore(store, types.PricesKey(tokenId)) - + // store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) + // store = prefix.NewStore(store, types.PricesKey(tokenId)) + store := k.getPriceTRStore(ctx, tokenId) nextRoundIdB := store.Get(types.PricesNextRountIdKey) if nextRoundIdB == nil { return val, false @@ -59,8 +58,9 @@ func (k Keeper) RemovePrices( tokenId int32, ) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) - store = prefix.NewStore(store, types.PricesKey(tokenId)) + // store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) + // store = prefix.NewStore(store, types.PricesKey(tokenId)) + store := k.getPriceTRStore(ctx, tokenId) // iterator := sdk.KVStorePrefixIterator(store, []byte{}) iterator := store.Iterator(nil, nil) defer iterator.Close() @@ -90,7 +90,7 @@ func (k Keeper) AppendPriceTR(ctx sdk.Context, tokenId int32, priceTR types.Pric if nextRoundId != priceTR.RoundId { return } - store := getPriceTRStore(ctx, k.storeKey, tokenId) + store := k.getPriceTRStore(ctx, tokenId) b := k.cdc.MustMarshal(&priceTR) store.Set(types.PricesRoundKey(nextRoundId), b) } @@ -112,9 +112,9 @@ func (k Keeper) GetPriceTRRoundId(ctx sdk.Context, tokenId int32, roundId uint64 } func (k Keeper) GetPriceTRLatest(ctx sdk.Context, tokenId int32) (price types.PriceWithTimeAndRound, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) - store = prefix.NewStore(store, types.PricesKey(tokenId)) - + // store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) + // store = prefix.NewStore(store, types.PricesKey(tokenId)) + store := k.getPriceTRStore(ctx, tokenId) nextRoundIdB := store.Get(types.PricesNextRountIdKey) if nextRoundIdB == nil { return @@ -131,7 +131,8 @@ func (k Keeper) GetPriceTRLatest(ctx sdk.Context, tokenId int32) (price types.Pr func (k Keeper) GetNextRoundId(ctx sdk.Context, tokenId int32) (nextRoundId uint64) { nextRoundId = 1 - store := getPriceTRStore(ctx, k.storeKey, tokenId) + //store := getPriceTRStore(ctx, k.storeKey, tokenId) + store := k.getPriceTRStore(ctx, tokenId) nextRoundIdB := store.Get(types.PricesNextRountIdKey) if nextRoundIdB != nil { nextRoundId = binary.BigEndian.Uint64(nextRoundIdB) @@ -139,9 +140,12 @@ func (k Keeper) GetNextRoundId(ctx sdk.Context, tokenId int32) (nextRoundId uint return } -func getPriceTRStore(ctx sdk.Context, storeKey storetypes.StoreKey, tokenId int32) prefix.Store { - store := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(types.PricesKeyPrefix)) +//func getPriceTRStore(ctx sdk.Context, storeKey storetypes.StoreKey, tokenId int32) prefix.Store { +// store := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(types.PricesKeyPrefix)) +// return prefix.NewStore(store, types.PricesKey(tokenId)) +//} + +func (k Keeper) getPriceTRStore(ctx sdk.Context, tokenId int32) prefix.Store { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) return prefix.NewStore(store, types.PricesKey(tokenId)) } - -//TODO: Get(tokenId, roundId), GetLatestRound(tokenId), remove is not cared for now diff --git a/x/oracle/keeper/single.go b/x/oracle/keeper/single.go index cd2c18c5c..4ca489673 100644 --- a/x/oracle/keeper/single.go +++ b/x/oracle/keeper/single.go @@ -1,9 +1,14 @@ package keeper import ( + "math/big" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/aggregator" "github.com/ExocoreNetwork/exocore/x/oracle/keeper/cache" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + "github.com/ExocoreNetwork/exocore/x/oracle/types" sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) var cs *cache.Cache @@ -26,9 +31,119 @@ func GetAggregatorContext(ctx sdk.Context, k Keeper) *aggregator.AggregatorConte c := GetCaches() c.ResetCaches() agc = aggregator.NewAggregatorContext() - if ok := c.RecacheAggregatorContext(ctx, agc, k); !ok { + if ok := recacheAggregatorContext(ctx, agc, k, c); !ok { //this is the very first time oracle has been started, fill relalted info as initialization - c.InitAggregatorContext(ctx, agc, k) + initAggregatorContext(ctx, agc, k, c) } return agc } + +// func recacheAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k common.KeeperOracle, c *cache.Cache) bool { +func recacheAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k Keeper, c *cache.Cache) bool { + + from := uint64(ctx.BlockHeight()) - common.MaxNonce + to := uint64(ctx.BlockHeight()) - 1 + + h, ok := k.GetValidatorUpdateBlock(ctx) + recentParamsMap := k.GetAllRecentParamsAsMap(ctx) + if !ok || recentParamsMap == nil { + //no cache, this is the very first running, so go to initial proces instead + return false + } + + if h.Block > from { + from = h.Block + } + + totalPower := big.NewInt(0) + validatorPowers := make(map[string]*big.Int) + k.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingtypes.ValidatorI) bool { + power := big.NewInt(validator.GetConsensusPower(validator.GetBondedTokens())) + addr := string(validator.GetOperator()) + validatorPowers[addr] = power + totalPower = new(big.Int).Add(totalPower, power) + return false + }) + agc.SetValidatorPowers(validatorPowers) + agc.SetTotalPower(totalPower) + //TODO: test only + if k.GetLastTotalPower(ctx).Cmp(totalPower) != 0 { + panic("something wrong when get validatorsPower from staking module") + } + + //reset validators + c.AddCache(cache.CacheItemV(validatorPowers), k) + + recentMsgs := k.GetAllRecentMsgAsMap(ctx) + var pTmp common.Params + for ; from < to; from++ { + //fill params + for b, recentParams := range recentParamsMap { + prev := uint64(0) + if b <= from && b > prev { + pTmp = common.Params(*recentParams) + agc.SetParams(&pTmp) + if prev > 0 { + //TODO: safe delete + delete(recentParamsMap, prev) + } + prev = b + } + } + + agc.PrepareRound(ctx, from) + + if msgs := recentMsgs[from+1]; msgs != nil { + for _, msg := range msgs { + //these messages are retreived for recache, just skip the validation check and fill the memory cache + agc.FillPrice(&types.MsgCreatePrice{ + Creator: msg.Validator, + FeederId: msg.FeederId, + Prices: msg.PSources, + }) + } + } + agc.SealRound(ctx, false) + } + + //fill params cache + c.AddCache(cache.CacheItemP(&pTmp), k) + + agc.PrepareRound(ctx, to) + + return true +} + +func initAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k common.KeeperOracle, c *cache.Cache) error { + //set params + p := k.GetParams(ctx) + m := make(map[uint64]*types.Params) + m[uint64(ctx.BlockHeight())] = &p + // k.setParams4CacheRecover(m) //used to trace tokenFeeder's update during cache recover + pTmp := common.Params(p) + agc.SetParams(&pTmp) + //set params cache + c.AddCache(cache.CacheItemP(&pTmp), k) + + totalPower := big.NewInt(0) + validatorPowers := make(map[string]*big.Int) + k.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingtypes.ValidatorI) bool { + power := big.NewInt(validator.GetConsensusPower(validator.GetBondedTokens())) + addr := string(validator.GetOperator()) + //agc.validatorsPower[addr] = power + validatorPowers[addr] = power + totalPower = new(big.Int).Add(totalPower, power) + return false + }) + agc.SetTotalPower(totalPower) + agc.SetValidatorPowers(validatorPowers) + if k.GetLastTotalPower(ctx).Cmp(totalPower) != 0 { + panic("-") + } + + //set validatorPower cache + c.AddCache(cache.CacheItemV(validatorPowers), k) + + agc.PrepareRound(ctx, uint64(ctx.BlockHeight())-1) + return nil +} diff --git a/x/oracle/module.go b/x/oracle/module.go index 9e568dfdb..2b6b2aec3 100644 --- a/x/oracle/module.go +++ b/x/oracle/module.go @@ -4,20 +4,22 @@ import ( "context" "encoding/json" "fmt" + "math/big" // this line is used by starport scaffolding # 1 "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/cache" "github.com/ExocoreNetwork/exocore/x/oracle/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "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/module" ) @@ -144,12 +146,56 @@ func (AppModule) ConsensusVersion() uint64 { return 1 } func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} // EndBlock contains the logic that is automatically triggered at the end of each block -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { //TODO: //1. check validator update //if {validatorSetUpdate} -> update roundInfo(seal all active) //check roundInfo -> seal {success, fail} //{params} -> prepareRoundInfo //sealRounds() -> prepareRounds() + // am.keeper.GetCaches().CommitCache(ctx, true, am.keeper) + //TODO: udpate the validatorset first + cs := keeper.GetCaches() + validatorUpdates := am.keeper.GetValidatorUpdates(ctx) + forceSeal := false + agc := keeper.GetAggregatorContext(ctx, am.keeper) + + if len(validatorUpdates) > 0 { + //validatorUpdates := am.keeper.GetValidatorUpdates(ctx) + validatorList := make(map[string]*big.Int) + for _, vu := range validatorUpdates { + pubKey, _ := cryptocodec.FromTmProtoPublicKey(vu.PubKey) + validator, _ := am.keeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pubKey)) + validatorList[validator.OperatorAddress] = big.NewInt(vu.Power) + } + // cs.AddCache(validatorList, am.keeper) + validatorPowers := make(map[string]*big.Int) + cs.GetCache(cache.CacheItemV(validatorPowers)) + //update validatorPowerList in aggregatorContext + // keeper.GetAggregatorContext(ctx, am.keeper).SetValidatorPowers(validatorPowers) + // agc := keeper.GetAggregatorContext(ctx, am.keeper) + agc.SetValidatorPowers(validatorPowers) + //TODO: seal all alive round since validatorSet changed here + forceSeal = true + } + + //TODO: for v1 use mode==1, just check the failed feeders + _, failed := agc.SealRound(ctx, forceSeal) + //append new round with previous price for fail-seal token + for _, tokenId := range failed { + if pTR, ok := am.keeper.GetPriceTRLatest(ctx, tokenId); ok { + pTR.RoundId++ + am.keeper.AppendPriceTR(ctx, tokenId, pTR) + } else { + nextRoundId := am.keeper.GetNextRoundId(ctx, tokenId) + am.keeper.AppendPriceTR(ctx, tokenId, types.PriceWithTimeAndRound{ + RoundId: nextRoundId, + }) + } + } + + agc.PrepareRound(ctx, 0) + + cs.CommitCache(ctx, true, am.keeper) return []abci.ValidatorUpdate{} } From 6cb367755c5426343f09d5aba4f5088f92684240 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Mon, 25 Mar 2024 23:23:50 +0800 Subject: [PATCH 26/37] test(oracle-keeper): add test for keeper --- go.mod | 6 + go.sum | 8 + x/oracle/keeper/aggregator/aggregator.go | 21 +- .../aggregator/aggregator_aggregator.go | 39 ++- .../aggregator/aggregator_aggregator_test.go | 68 +++++ .../aggregator/aggregator_calculator.go | 7 +- .../aggregator/aggregator_calculator_test.go | 99 +++++++ .../aggregator/aggregator_filter_test.go | 105 +++++++ x/oracle/keeper/aggregator/aggregator_test.go | 88 ++++++ x/oracle/keeper/aggregator/helper_test.go | 19 ++ x/oracle/keeper/aggregator/info_test.go | 55 ++++ x/oracle/keeper/cache/caches.go | 24 +- x/oracle/keeper/cache/caches_test.go | 101 +++++++ x/oracle/keeper/cache/info_test.go | 11 + x/oracle/keeper/common/common_test.go | 27 ++ x/oracle/keeper/common/mock_interface.go | 270 ++++++++++++++++++ x/oracle/keeper/common/types.go | 1 - x/oracle/keeper/msg_server_create_price.go | 6 +- x/oracle/keeper/single.go | 12 +- x/oracle/types/genesis.go | 1 - 20 files changed, 936 insertions(+), 32 deletions(-) create mode 100644 x/oracle/keeper/aggregator/aggregator_aggregator_test.go create mode 100644 x/oracle/keeper/aggregator/aggregator_calculator_test.go create mode 100644 x/oracle/keeper/aggregator/aggregator_filter_test.go create mode 100644 x/oracle/keeper/aggregator/aggregator_test.go create mode 100644 x/oracle/keeper/aggregator/helper_test.go create mode 100644 x/oracle/keeper/aggregator/info_test.go create mode 100644 x/oracle/keeper/cache/caches_test.go create mode 100644 x/oracle/keeper/cache/info_test.go create mode 100644 x/oracle/keeper/common/common_test.go create mode 100644 x/oracle/keeper/common/mock_interface.go diff --git a/go.mod b/go.mod index 5a1e3b659..7d6d83c5e 100644 --- a/go.mod +++ b/go.mod @@ -25,6 +25,7 @@ require ( github.com/onsi/gomega v1.31.1 github.com/pkg/errors v0.9.1 github.com/rakyll/statik v0.1.7 + github.com/smartystreets/goconvey v1.6.4 github.com/spf13/cast v1.5.1 github.com/spf13/cobra v1.7.0 github.com/spf13/viper v1.16.0 @@ -57,6 +58,7 @@ require ( ) require ( + bou.ke/monkey v1.0.2 // indirect cloud.google.com/go v0.110.6 // indirect cloud.google.com/go/compute v1.23.0 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect @@ -128,6 +130,7 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect github.com/googleapis/gax-go/v2 v2.11.0 // indirect + github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect @@ -148,6 +151,7 @@ require ( github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect + github.com/jtolds/gls v4.20.0+incompatible // indirect github.com/klauspost/compress v1.16.7 // indirect github.com/lib/pq v1.10.9 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect @@ -178,6 +182,7 @@ require ( github.com/rs/zerolog v1.29.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect + github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect @@ -195,6 +200,7 @@ require ( github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/ledger-go v0.14.1 // indirect go.etcd.io/bbolt v1.3.7 // indirect + go.uber.org/mock v0.4.0 // indirect golang.org/x/oauth2 v0.8.0 // indirect golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.18.0 // indirect diff --git a/go.sum b/go.sum index 66ae7912b..1d55e9f97 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +bou.ke/monkey v1.0.2 h1:kWcnsrCNUatbxncxR/ThdYqbytgOIArtYWqcQLQzKLI= +bou.ke/monkey v1.0.2/go.mod h1:OqickVX3tNx6t33n1xvtTtu85YN5s6cKwVug+oHMaIA= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -1036,6 +1038,7 @@ github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cU github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= @@ -1154,6 +1157,7 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= 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= @@ -1420,7 +1424,9 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= 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 h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= @@ -1551,6 +1557,8 @@ 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.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.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= diff --git a/x/oracle/keeper/aggregator/aggregator.go b/x/oracle/keeper/aggregator/aggregator.go index 60a499510..d15613176 100644 --- a/x/oracle/keeper/aggregator/aggregator.go +++ b/x/oracle/keeper/aggregator/aggregator.go @@ -171,7 +171,7 @@ func (agc *AggregatorContext) SealRound(ctx sdk.Context, force bool) (success [] //but it's not always the same for other modes, switch modes switch common.Mode { case 1: - expired := ctx.BlockHeight() >= feeder.EndBlock + expired := feeder.EndBlock > 0 && ctx.BlockHeight() >= feeder.EndBlock outOfWindow := uint64(ctx.BlockHeight())-round.basedBlock >= uint64(common.MaxNonce) if expired || outOfWindow || force { //TODO: WRITE TO KVSTORE with previous round data for this round @@ -205,7 +205,10 @@ func (agc *AggregatorContext) PrepareRound(ctx sdk.Context, block uint64) { } for feederId, feeder := range agc.params.GetTokenFeeders() { - if uint64(feeder.EndBlock) <= block || uint64(feeder.StartBaseBlock) > block { + if feederId == 0 { + continue + } + if (feeder.EndBlock > 0 && uint64(feeder.EndBlock) <= block) || uint64(feeder.StartBaseBlock) > block { //this feeder is inactive continue } @@ -237,6 +240,10 @@ func (agc *AggregatorContext) PrepareRound(ctx sdk.Context, block uint64) { round.status = 1 //drop previous worker agc.aggregators[feederIdInt32] = nil + } else if round.status == 1 && left >= common.MaxNonce { + //this shouldn't happend, if do sealround properly before prepareRound, basically for test only + round.status = 2 + //TODO: just modify the status here, since sealRound should do all the related seal actios already when parepare invoked } } } @@ -247,14 +254,18 @@ func (agc *AggregatorContext) SetParams(p *common.Params) { } func (agc *AggregatorContext) SetValidatorPowers(vp map[string]*big.Int) { + // t := big.NewInt(0) + agc.totalPower = big.NewInt(0) + agc.validatorsPower = make(map[string]*big.Int) for addr, power := range vp { agc.validatorsPower[addr] = power + agc.totalPower = new(big.Int).Add(agc.totalPower, power) } } -func (agc *AggregatorContext) SetTotalPower(power *big.Int) { - agc.totalPower = power -} +//func (agc *AggregatorContext) SetTotalPower(power *big.Int) { +// agc.totalPower = power +//} func NewAggregatorContext() *AggregatorContext { return &AggregatorContext{ diff --git a/x/oracle/keeper/aggregator/aggregator_aggregator.go b/x/oracle/keeper/aggregator/aggregator_aggregator.go index cd128e6b9..18d65e6d1 100644 --- a/x/oracle/keeper/aggregator/aggregator_aggregator.go +++ b/x/oracle/keeper/aggregator/aggregator_aggregator.go @@ -27,7 +27,7 @@ func (r *reportPrice) aggregate() *big.Int { if r.price != nil { return r.price } - tmp := make([]*big.Int, len(r.prices)) + tmp := make([]*big.Int, 0, len(r.prices)) for _, p := range r.prices { tmp = append(tmp, p.price) } @@ -59,7 +59,7 @@ func (agg *aggregator) fillPrice(pSources []*types.PriceWithSource, validator st power: power, } agg.reports = append(agg.reports, report) - agg.reportPower = new(big.Int).Add(agg.totalPower, power) + agg.reportPower = new(big.Int).Add(agg.reportPower, power) } for _, pSource := range pSources { @@ -88,6 +88,15 @@ func (agg *aggregator) fillPrice(pSources []*types.PriceWithSource, validator st // timestamp: "", //detRoundId: "", } + if len(agg.dsPrices[pSource.SourceId]) > 0 { + for _, reportTmp := range agg.reports { + if priceTmp := reportTmp.prices[pSource.SourceId]; priceTmp != nil && priceTmp.price != nil { + pTR.price = new(big.Int).Set(priceTmp.price) + pTR.detRoundId = priceTmp.detRoundId + pTR.timestamp = priceTmp.timestamp + } + } + } report.prices[pSource.SourceId] = pTR } //skip if this DS's slot exists, DS's value only updated by calculator @@ -99,17 +108,21 @@ func (agg *aggregator) fillPrice(pSources []*types.PriceWithSource, validator st func (agg *aggregator) confirmDSPrice(confirmedRounds []*confirmedPrice) { for _, priceSourceRound := range confirmedRounds { //update the latest round-detId for DS, TODO: in v1 we only update this value once since calculator will just ignore any further value once a detId has reached consensus - agg.dsPrices[priceSourceRound.sourceId] = priceSourceRound.detId - for _, report := range agg.reports { - if report.price != nil { - //price of IVA has completed - continue + // agg.dsPrices[priceSourceRound.sourceId] = priceSourceRound.detId + //this id's comparision need to format id to make sure them be the same length + if id := agg.dsPrices[priceSourceRound.sourceId]; len(id) == 0 || (len(id) > 0 && id < priceSourceRound.detId) { + agg.dsPrices[priceSourceRound.sourceId] = priceSourceRound.detId + for _, report := range agg.reports { + if report.price != nil { + //price of IVA has completed + continue + } + if price := report.prices[priceSourceRound.sourceId]; price != nil { + price.detRoundId = priceSourceRound.detId + price.timestamp = priceSourceRound.timestamp + price.price = priceSourceRound.price + } //else TODO: panice in V1 } - if price := report.prices[priceSourceRound.sourceId]; price != nil { - price.detRoundId = priceSourceRound.detId - price.timestamp = priceSourceRound.timestamp - price.price = priceSourceRound.price - } //else TODO: panice in V1 } } } @@ -150,7 +163,7 @@ func (agg *aggregator) aggregate() *big.Int { func newAggregator(validatorSetLength int, totalPower *big.Int) *aggregator { return &aggregator{ - reports: make([]*reportPrice, validatorSetLength), + reports: make([]*reportPrice, 0, validatorSetLength), reportPower: big.NewInt(0), dsPrices: make(map[int32]string), totalPower: totalPower, diff --git a/x/oracle/keeper/aggregator/aggregator_aggregator_test.go b/x/oracle/keeper/aggregator/aggregator_aggregator_test.go new file mode 100644 index 000000000..e2e603ce8 --- /dev/null +++ b/x/oracle/keeper/aggregator/aggregator_aggregator_test.go @@ -0,0 +1,68 @@ +package aggregator + +import ( + "math/big" + "testing" + + . "github.com/smartystreets/goconvey/convey" +) + +func TestAggregator(t *testing.T) { + Convey("fill prices into aggregator", t, func() { + a := newAggregator(5, big.NewInt(4)) + //a.fillPrice(pS1, "v1", one) //v1:{1, 2} + + Convey("fill v1's report", func() { + a.fillPrice(pS1, "v1", one) //v1:{1, 2} + report := a.getReport("v1") + So(report.prices[1].price, ShouldBeNil) + Convey("fill v2's report", func() { + a.fillPrice(pS2, "v2", one) + report := a.getReport("v2") + So(report.prices[1].price, ShouldBeNil) + Convey("fill more v1's report", func() { + a.fillPrice(pS21, "v1", one) + report := a.getReport("v1") + So(report.prices[1].price, ShouldBeNil) + So(report.prices[2].price, ShouldBeNil) + Convey("confirm deterministic source_1 and source 2", func() { + a.confirmDSPrice([]*confirmedPrice{ + { + sourceId: 1, + detId: "9", + price: ten, + timestamp: "-", + }, + { + sourceId: 2, + detId: "3", + price: twenty, + timestamp: "-", + }, + }) + reportV1 := a.getReport("v1") + reportV2 := a.getReport("v2") + So(reportV1.prices[1].price, ShouldResemble, ten) + So(reportV1.prices[1].detRoundId, ShouldEqual, "9") + + So(reportV2.prices[1].price, ShouldResemble, ten) + So(reportV2.prices[1].detRoundId, ShouldEqual, "9") + + So(reportV1.prices[2].price, ShouldResemble, twenty) + So(reportV1.prices[2].detRoundId, ShouldEqual, "3") + + //current implementation only support v1's single source + Convey("aggregate after all source confirmed", func() { + a.fillPrice(pS6, "v3", one) + a.aggregate() //v1:{s1:9-10, s2:3-20}:15, v2:{s1:9-10}:10 + So(a.getReport("v1").price, ShouldResemble, fifteen) + So(a.getReport("v2").price, ShouldResemble, ten) + So(a.getReport("v3").price, ShouldResemble, twenty) + So(a.finalPrice, ShouldResemble, fifteen) + }) + }) + }) + }) + }) + }) +} diff --git a/x/oracle/keeper/aggregator/aggregator_calculator.go b/x/oracle/keeper/aggregator/aggregator_calculator.go index 79ebc0037..94fc5974f 100644 --- a/x/oracle/keeper/aggregator/aggregator_calculator.go +++ b/x/oracle/keeper/aggregator/aggregator_calculator.go @@ -26,6 +26,7 @@ type roundPrices struct { //0 means NS prices []*priceAndPower price *big.Int timestamp string + // confirmed bool } // udpate priceAndPower for a specific DSRoundID, if the price exists, increase its power with provided data @@ -51,6 +52,7 @@ func (r *roundPrices) updatePriceAndPower(pw *priceAndPower, totalPower *big.Int updated = true if common.ExceedsThreshold(pw.power, totalPower) { r.price = pw.price + // r.confirmed = true confirmed = true } } @@ -79,6 +81,9 @@ func (r *roundPricesList) hasConfirmedDetId() bool { func (r *roundPricesList) getOrNewRound(detId string, timestamp string) (round *roundPrices) { for _, round = range r.roundPricesList { if round.detId == detId { + if round.price != nil { + round = nil + } return } } @@ -86,7 +91,7 @@ func (r *roundPricesList) getOrNewRound(detId string, timestamp string) (round * if len(r.roundPricesList) < cap(r.roundPricesList) { round = &roundPrices{ detId: detId, - prices: make([]*priceAndPower, r.roundPricesCount), + prices: make([]*priceAndPower, 0, r.roundPricesCount), timestamp: timestamp, } r.roundPricesList = append(r.roundPricesList, round) diff --git a/x/oracle/keeper/aggregator/aggregator_calculator_test.go b/x/oracle/keeper/aggregator/aggregator_calculator_test.go new file mode 100644 index 000000000..b3c9697fa --- /dev/null +++ b/x/oracle/keeper/aggregator/aggregator_calculator_test.go @@ -0,0 +1,99 @@ +package aggregator + +import ( + "math/big" + "testing" + + . "github.com/smartystreets/goconvey/convey" +) + +/* + 1-10, 2-12, 3-15 + +ps1: 1-10, 2-12 +ps2: 2-12, 3-15 +ps3: 1-10, 2-11(m) +--- +ps4: 2-12, 3-19(m) +ps5: 1-10, 3-19(m) +---- +ps1, ps2, ps3, ps4 ---> 2-12 +ps2, ps2, ps3, ps5 ---> 1-10 +*/ +func TestCalculator(t *testing.T) { + //pTD1 := newPTD("1", "10") + //pTD2 := newPTD("2", "12") + //pTD3 := newPTD("3", "15") + //pTD2M := newPTD("2", "11") + //pTD3M := newPTD("3", "19") + ////1-10, 2-12 + //ps1 := []*types.PriceWithSource{newPS(1, pTD1, pTD2)} + ////2-12, 3-15 + //ps2 := []*types.PriceWithSource{newPS(1, pTD3, pTD2)} + ////1-10, 2-11(m) + //ps3 := []*types.PriceWithSource{newPS(1, pTD1, pTD2M)} + ////2-12, 3-19(m) + //ps4 := []*types.PriceWithSource{newPS(1, pTD2, pTD3M)} + ////1-10, 3-19(m) + //ps5 := []*types.PriceWithSource{newPS(1, pTD1, pTD3M)} + + ////1-10, 2-12 + //ps21 := []*types.PriceWithSource{newPS(1, pTD1, pTD2), newPS(2, pTD1, pTD3)} + ////2-12, 3-15 + //ps22 := []*types.PriceWithSource{newPS(1, pTD3, pTD2), newPS(2, pTD2, pTD3)} + ////1-10, 2-11(m) + //ps23 := []*types.PriceWithSource{newPS(1, pTD1, pTD2M), newPS(2, pTD2M, pTD1)} + ////2-12, 3-19(m) + //ps24 := []*types.PriceWithSource{newPS(1, pTD2, pTD3M), newPS(2, pTD3, pTD2M)} + ////1-10, 3-19(m) + //ps25 := []*types.PriceWithSource{newPS(1, pTD1, pTD3M), newPS(2, pTD2M, pTD3M)} + + one := big.NewInt(1) + Convey("fill prices into calculator", t, func() { + c := newCalculator(5, big.NewInt(4)) + Convey("fill prices from single deterministic source", func() { + c.fillPrice(pS1, "v1", one) //1-10, 2-12 + c.fillPrice(pS2, "v2", one) //2-12, 3-15 + c.fillPrice(pS3, "v3", one) //1-10, 2-11 + Convey("consensus on detid=2 and price=12", func() { + confirmed := c.fillPrice(pS4, "v4", one) //2-12, 3-19 + So(confirmed[0].detId, ShouldEqual, "2") + So(confirmed[0].price, ShouldResemble, big.NewInt(12)) + }) + Convey("consensus on detid=1 and price=10", func() { + confirmed := c.fillPrice(pS5, "v5", one) //1-10, 3-19 + So(confirmed[0].detId, ShouldEqual, "1") + So(confirmed[0].price, ShouldResemble, big.NewInt(10)) + + confirmed = c.fillPrice(pS4, "v4", one) + So(confirmed, ShouldBeNil) + }) + }) + Convey("fill prices from multiple deterministic sources", func() { + c.fillPrice(pS21, "v1", one) + c.fillPrice(pS22, "v2", one) + c.fillPrice(pS23, "v3", one) + Convey("consensus on both source 1 and source 2", func() { + confirmed := c.fillPrice(pS24, "v4", one) + So(len(confirmed), ShouldEqual, 2) + i := 0 + if confirmed[0].sourceId == 2 { + i = 1 + } + So(confirmed[i].detId, ShouldEqual, "2") + So(confirmed[i].price, ShouldResemble, big.NewInt(12)) + + So(confirmed[1-i].detId, ShouldEqual, "3") + So(confirmed[1-i].price, ShouldResemble, big.NewInt(15)) + + }) + Convey("consenus on source 1 only", func() { + confirmed := c.fillPrice(pS25, "v5", one) + So(len(confirmed), ShouldEqual, 1) + So(confirmed[0].detId, ShouldEqual, "1") + So(confirmed[0].price, ShouldResemble, big.NewInt(10)) + + }) + }) + }) +} diff --git a/x/oracle/keeper/aggregator/aggregator_filter_test.go b/x/oracle/keeper/aggregator/aggregator_filter_test.go new file mode 100644 index 000000000..9b14d2968 --- /dev/null +++ b/x/oracle/keeper/aggregator/aggregator_filter_test.go @@ -0,0 +1,105 @@ +package aggregator + +import ( + "testing" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + . "github.com/smartystreets/goconvey/convey" +) + +func TestFilter(t *testing.T) { + Convey("test aggregator_filter", t, func() { + f := newFilter(3, 5) + ptd1 := newPTD("1", "600000") + ptd2 := newPTD("2", "600050") + ptd3 := newPTD("3", "600070") + ptd4 := newPTD("4", "601000") + ptd5 := newPTD("5", "602000") + ptd6 := newPTD("6", "603000") + + ps1 := &types.PriceWithSource{ + SourceId: 1, + Prices: []*types.PriceWithTimeAndDetId{ + ptd1, + ptd2, + }, + } + + ps := []*types.PriceWithSource{ps1} + msg := &types.MsgCreatePrice{ + Creator: "v1", + FeederId: 1, + Prices: ps, + BasedBlock: 10, + Nonce: 1, + } + l4c, l4a := f.filtrate(msg) + + Convey("add first valid msg", func() { + So(l4c, ShouldResemble, ps) + So(l4a, ShouldResemble, ps) + }) + + Convey("add duplicate nonce msg", func() { + ps1.Prices[0] = ptd3 + l4c, l4a = f.filtrate(msg) + So(l4c, ShouldBeNil) + So(l4a, ShouldBeNil) + }) + + Convey("add duplicate detId", func() { + msg.Nonce = 2 + l4c, l4a = f.filtrate(msg) + Convey("add with new nonce", func() { + So(l4c, ShouldBeNil) + So(l4a, ShouldBeNil) + }) + Convey("update with new detId but use duplicate nonce", func() { + msg.Nonce = 2 + ps1.Prices[0] = ptd3 + l4c, l4a := f.filtrate(msg) + So(l4c, ShouldBeNil) + So(l4a, ShouldBeNil) + }) + }) + + Convey("add new detId with new nonce", func() { + msg.Nonce = 2 + ps1.Prices[0] = ptd3 + l4c, l4a = f.filtrate(msg) + ps1.Prices = ps1.Prices[:1] + ps1.Prices[0] = ptd3 + psReturn := []*types.PriceWithSource{ps1} + So(l4c, ShouldResemble, psReturn) + So(l4a, ShouldResemble, psReturn) + }) + + Convey("add too many nonce", func() { + msg.Nonce = 2 + ps1.Prices[0] = ptd3 + f.filtrate(msg) + + msg.Nonce = 3 + ps1.Prices[0] = ptd4 + l4c, _ = f.filtrate(msg) + So(l4c[0].Prices, ShouldContain, ptd4) + + msg.Nonce = 4 + ps1.Prices[0] = ptd5 + l4c, _ = f.filtrate(msg) + So(l4c, ShouldBeNil) + + }) + + Convey("add too many DetIds", func() { + msg.Nonce = 2 + ps1.Prices = []*types.PriceWithTimeAndDetId{ptd3, ptd4, ptd5, ptd6} + l4c, l4a = f.filtrate(msg) + So(l4c, ShouldResemble, l4a) + So(l4c[0].Prices, ShouldContain, ptd3) + So(l4c[0].Prices, ShouldContain, ptd4) + So(l4c[0].Prices, ShouldContain, ptd5) + So(l4c[0].Prices, ShouldNotContain, ptd6) + }) + }) +} diff --git a/x/oracle/keeper/aggregator/aggregator_test.go b/x/oracle/keeper/aggregator/aggregator_test.go new file mode 100644 index 000000000..689e0a0a4 --- /dev/null +++ b/x/oracle/keeper/aggregator/aggregator_test.go @@ -0,0 +1,88 @@ +package aggregator + +import ( + "math/big" + "reflect" + "testing" + + "bou.ke/monkey" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + sdk "github.com/cosmos/cosmos-sdk/types" + . "github.com/smartystreets/goconvey/convey" +) + +func TestAggregatorContext(t *testing.T) { + Convey("init aggregatorContext with default params", t, func() { + agc := initAggregatorContext() + var p *monkey.PatchGuard + var ctx sdk.Context + Convey("prepare round to gengerate round info of feeders for next block", func() { + // var ctx sdk.Context + // var p *monkey.PatchGuard + // agc := initAggregatorContext() + Convey("pepare within the window", func() { + p = patchBlockHeight(12) + agc.PrepareRound(ctx, 0) + Convey("for empty round list", func() { + So(*agc.rounds[1], ShouldResemble, roundInfo{10, 2, 1}) + }) + Convey("update already exist round info", func() { + p = patchBlockHeight(10 + common.MaxNonce) + agc.PrepareRound(ctx, 0) + So(agc.rounds[1].status, ShouldEqual, 2) + }) + }) + Convey("pepare outside the window", func() { + Convey("for empty round list", func() { + p = patchBlockHeight(10 + common.MaxNonce) + agc.PrepareRound(ctx, 0) + So(agc.rounds[1].status, ShouldEqual, 2) + }) + }) + }) + Convey("seal existed round without any msg recieved", func() { + p = patchBlockHeight(11) + agc.PrepareRound(ctx, 0) + Convey("seal when exceed the window", func() { + So(agc.rounds[1].status, ShouldEqual, 1) + p = patchBlockHeight(13) + agc.SealRound(ctx, false) + So(agc.rounds[1].status, ShouldEqual, 2) + }) + Convey("force seal by required", func() { + p = patchBlockHeight(12) + agc.SealRound(ctx, false) + So(agc.rounds[1].status, ShouldEqual, 1) + agc.SealRound(ctx, true) + So(agc.rounds[1].status, ShouldEqual, 2) + }) + }) + + if p != nil { + p.Unpatch() + } + }) +} + +func initAggregatorContext() *AggregatorContext { + agc := NewAggregatorContext() + + validatorPowers := map[string]*big.Int{ + "v1": big.NewInt(1), + "v2": big.NewInt(1), + "v3": big.NewInt(1), + } + + p := defaultParams + pWrapped := common.Params(p) + + agc.SetValidatorPowers(validatorPowers) + agc.SetParams(&pWrapped) + return agc +} + +func patchBlockHeight(h int64) *monkey.PatchGuard { + return monkey.PatchInstanceMethod(reflect.TypeOf(sdk.Context{}), "BlockHeight", func(sdk.Context) int64 { + return h + }) +} diff --git a/x/oracle/keeper/aggregator/helper_test.go b/x/oracle/keeper/aggregator/helper_test.go new file mode 100644 index 000000000..13ebd86f5 --- /dev/null +++ b/x/oracle/keeper/aggregator/helper_test.go @@ -0,0 +1,19 @@ +package aggregator + +import "github.com/ExocoreNetwork/exocore/x/oracle/types" + +func newPTD(detId, price string) *types.PriceWithTimeAndDetId { + return &types.PriceWithTimeAndDetId{ + Price: price, + Decimal: 1, + Timestamp: "-", + DetId: detId, + } +} + +func newPS(sourceId int32, prices ...*types.PriceWithTimeAndDetId) *types.PriceWithSource { + return &types.PriceWithSource{ + SourceId: sourceId, + Prices: prices, + } +} diff --git a/x/oracle/keeper/aggregator/info_test.go b/x/oracle/keeper/aggregator/info_test.go new file mode 100644 index 000000000..a05794105 --- /dev/null +++ b/x/oracle/keeper/aggregator/info_test.go @@ -0,0 +1,55 @@ +package aggregator + +import ( + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +var ( + one = big.NewInt(1) + zero = big.NewInt(0) + ten = big.NewInt(10) + eleven = big.NewInt(11) + fifteen = big.NewInt(15) + twenty = big.NewInt(20) +) + +var ( + pTD1 = newPTD("1", "10") + pTD2 = newPTD("2", "12") + pTD3 = newPTD("3", "15") + pTD2M = newPTD("2", "11") + pTD3M = newPTD("3", "19") + //1-10, 2-12 + pS1 = []*types.PriceWithSource{newPS(1, pTD1, pTD2)} + //2-12, 3-1 + pS2 = []*types.PriceWithSource{newPS(1, pTD3, pTD2)} + //1-10, 2-11(m) + pS3 = []*types.PriceWithSource{newPS(1, pTD1, pTD2M)} + //2-12, 3-19(m) + pS4 = []*types.PriceWithSource{newPS(1, pTD2, pTD3M)} + //1-10, 3-19(m) + pS5 = []*types.PriceWithSource{newPS(1, pTD1, pTD3M)} + + pS6 = []*types.PriceWithSource{newPS(2, pTD1)} + + //1-10, 2-12 + pS21 = []*types.PriceWithSource{newPS(1, pTD1, pTD2), newPS(2, pTD1, pTD3)} + //2-12, 3-15 + pS22 = []*types.PriceWithSource{newPS(1, pTD3, pTD2), newPS(2, pTD2, pTD3)} + //1-10, 2-11(m) + pS23 = []*types.PriceWithSource{newPS(1, pTD1, pTD2M), newPS(2, pTD2M, pTD1)} + //2-12, 3-19(m) + pS24 = []*types.PriceWithSource{newPS(1, pTD2, pTD3M), newPS(2, pTD3, pTD2M)} + //1-10, 3-19(m) + pS25 = []*types.PriceWithSource{newPS(1, pTD1, pTD3M), newPS(2, pTD2M, pTD3M)} +) + +var defaultParams = types.Params{ + Chains: []*types.Chain{{Name: "-", Desc: "-"}, {Name: "Ethereum", Desc: "-"}}, + Tokens: []*types.Token{{}, {Name: "eth", ChainId: 1, ContractAddress: "0xabc", Decimal: 18, Active: true}}, + Sources: []*types.Source{{}, {Name: "chainLink", Entry: &types.Endpoint{}, Valid: true, Deterministic: true}}, + Rules: []*types.RuleWithSource{{}, {SourceIds: []int32{1}}}, + TokenFeeders: []*types.TokenFeeder{{}, {TokenId: 1, RuleId: 1, StartRoundId: 1, StartBaseBlock: 0, Interval: 10, EndBlock: 0}}, +} diff --git a/x/oracle/keeper/cache/caches.go b/x/oracle/keeper/cache/caches.go index b3b3dec12..92181e1bc 100644 --- a/x/oracle/keeper/cache/caches.go +++ b/x/oracle/keeper/cache/caches.go @@ -39,8 +39,25 @@ type cacheParams struct { } func (c cacheMsgs) add(item *CacheItemM) { + if ims, ok := c[item.FeederId]; ok { + for _, im := range ims { + if im.Validator == item.Validator { + for _, p := range im.PSources { + for _, pInput := range item.PSources { + if p.SourceId == pInput.SourceId { + p.Prices = append(p.Prices, pInput.Prices...) + return + } + } + } + im.PSources = append(im.PSources, item.PSources...) + return + } + } + } c[item.FeederId] = append(c[item.FeederId], item) } + func (c cacheMsgs) remove(item *CacheItemM) { delete(c, item.FeederId) } @@ -120,7 +137,8 @@ func (c *cacheParams) commit(ctx sdk.Context, k common.KeeperOracle) { } // memory cache -func (c *Cache) AddCache(i any, k common.KeeperOracle) { +// func (c *Cache) AddCache(i any, k common.KeeperOracle) { +func (c *Cache) AddCache(i any) { switch item := i.(type) { case *CacheItemM: c.msg.add(item) @@ -133,7 +151,9 @@ func (c *Cache) AddCache(i any, k common.KeeperOracle) { panic("no other types are support") } } -func (c *Cache) RemoveCache(i any, k common.KeeperOracle) { + +// func (c *Cache) RemoveCache(i any, k common.KeeperOracle) { +func (c *Cache) RemoveCache(i any) { switch item := i.(type) { case *CacheItemM: c.msg.remove(item) diff --git a/x/oracle/keeper/cache/caches_test.go b/x/oracle/keeper/cache/caches_test.go new file mode 100644 index 000000000..6cd9eb183 --- /dev/null +++ b/x/oracle/keeper/cache/caches_test.go @@ -0,0 +1,101 @@ +package cache + +import ( + "math/big" + "testing" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + . "github.com/smartystreets/goconvey/convey" + // "go.uber.org/mock/gomock" +) + +func TestCache(t *testing.T) { + c := NewCache() + p := defaultParams + pWrapped := common.Params(p) + + // ctrl := gomock.NewController(t) + // defer ctrl.Finish() + //ko := common.NewMockKeeperOracle(ctrl) + //c.AddCache(CacheItemP(&pWrapped), ko) + + Convey("test cache", t, func() { + Convey("add pramams item", func() { + c.AddCache(CacheItemP(&pWrapped)) + pReturn := &common.Params{} + c.GetCache(CacheItemP(pReturn)) + So(*pReturn, ShouldResemble, pWrapped) + }) + + Convey("add validatorPower item", func() { + validatorPowers := map[string]*big.Int{ + "v1": big.NewInt(100), + "v2": big.NewInt(109), + "v3": big.NewInt(119), + } + c.AddCache(CacheItemV(validatorPowers)) + vpReturn := make(map[string]*big.Int) + Convey("for empty cache", func() { + c.GetCache(CacheItemV(vpReturn)) + So(vpReturn, ShouldResemble, validatorPowers) + }) + Convey("then update validatorPower item for this cache", func() { + validaotrPowers := map[string]*big.Int{ + //add v5 + "v5": big.NewInt(123), + //remove v1 + "v1": big.NewInt(0), + //update v2 + "v2": big.NewInt(199), + } + c.AddCache(CacheItemV(validaotrPowers)) + c.GetCache(CacheItemV(vpReturn)) + So(vpReturn, ShouldNotContainKey, "v1") + So(vpReturn, ShouldContainKey, "v5") + So(vpReturn["v2"], ShouldResemble, big.NewInt(199)) + }) + }) + + Convey("add msg item", func() { + msgItems := []*CacheItemM{ + { + FeederId: 1, + PSources: []*types.PriceWithSource{ + { + SourceId: 1, + Prices: []*types.PriceWithTimeAndDetId{ + {Price: "600000", Decimal: 1, Timestamp: "-", DetId: "1"}, {Price: "620000", Decimal: 1, Timestamp: "-", DetId: "2"}, + }, + }, + }, + Validator: "v1", + }, + { + FeederId: 1, + PSources: []*types.PriceWithSource{ + {SourceId: 1, Prices: []*types.PriceWithTimeAndDetId{{Price: "600000", Decimal: 1, Timestamp: "-", DetId: "4"}, {Price: "620000", Decimal: 1, Timestamp: "-", DetId: "3"}}}}, + Validator: "v1", + }, + { + FeederId: 2, + PSources: []*types.PriceWithSource{{SourceId: 1, Prices: []*types.PriceWithTimeAndDetId{{Price: "30000", Decimal: 1, Timestamp: "-", DetId: "4"}, {Price: "32000", Decimal: 1, Timestamp: "-", DetId: "3"}}}}, + Validator: "v2", + }, + } + c.AddCache(msgItems[0]) + msgItemsReturn := make([]*CacheItemM, 0, 3) + Convey("add single item", func() { + c.GetCache(&msgItemsReturn) + So(msgItemsReturn, ShouldContain, msgItems[0]) + }) + Convey("add more items", func() { + c.AddCache(msgItems[1]) + c.AddCache(msgItems[2]) + c.GetCache(&msgItemsReturn) + So(msgItemsReturn, ShouldContain, msgItems[2]) + So(msgItemsReturn, ShouldNotContain, msgItems[0]) + }) + }) + }) +} diff --git a/x/oracle/keeper/cache/info_test.go b/x/oracle/keeper/cache/info_test.go new file mode 100644 index 000000000..fb24f6ca6 --- /dev/null +++ b/x/oracle/keeper/cache/info_test.go @@ -0,0 +1,11 @@ +package cache + +import "github.com/ExocoreNetwork/exocore/x/oracle/types" + +var defaultParams = types.Params{ + Chains: []*types.Chain{{Name: "-", Desc: "-"}, {Name: "Ethereum", Desc: "-"}}, + Tokens: []*types.Token{{}, {Name: "eth", ChainId: 1, ContractAddress: "0xabc", Decimal: 18, Active: true}}, + Sources: []*types.Source{{}, {Name: "chainLink", Entry: &types.Endpoint{}, Valid: true, Deterministic: true}}, + Rules: []*types.RuleWithSource{{}, {SourceIds: []int32{1}}}, + TokenFeeders: []*types.TokenFeeder{{}, {TokenId: 1, RuleId: 1, StartRoundId: 1, StartBaseBlock: 0, Interval: 10, EndBlock: 0}}, +} diff --git a/x/oracle/keeper/common/common_test.go b/x/oracle/keeper/common/common_test.go new file mode 100644 index 000000000..b26cb4cbb --- /dev/null +++ b/x/oracle/keeper/common/common_test.go @@ -0,0 +1,27 @@ +package common + +import ( + "math/big" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + . "github.com/smartystreets/goconvey/convey" + "go.uber.org/mock/gomock" +) + +//go:generate mockgen -destination mock_test.go -package common github.com/ExocoreNetwork/exocore/x/oracle/keeper/common KeeperOracle + +func TestMock(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + ko := NewMockKeeperOracle(ctrl) + + ko.EXPECT().GetLastTotalPower(gomock.Any()).Return(big.NewInt(99)) + + x := ko.GetLastTotalPower(sdk.Context{}) + _ = x + + Convey("mock oracle keeper", t, func() { + Convey("GetLastTotalPower", func() { So(x, ShouldResemble, big.NewInt(99)) }) + }) +} diff --git a/x/oracle/keeper/common/mock_interface.go b/x/oracle/keeper/common/mock_interface.go new file mode 100644 index 000000000..cdad90fbb --- /dev/null +++ b/x/oracle/keeper/common/mock_interface.go @@ -0,0 +1,270 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/ExocoreNetwork/exocore/x/oracle/keeper/common (interfaces: KeeperOracle) +// +// Generated by this command: +// +// mockgen -destination mock_test.go -package common github.com/ExocoreNetwork/exocore/x/oracle/keeper/common KeeperOracle +// + +// Package common is a generated GoMock package. +package common + +import ( + big "math/big" + reflect "reflect" + + types "github.com/ExocoreNetwork/exocore/x/oracle/types" + types0 "github.com/cometbft/cometbft/abci/types" + types1 "github.com/cosmos/cosmos-sdk/types" + types2 "github.com/cosmos/cosmos-sdk/x/staking/types" + gomock "go.uber.org/mock/gomock" +) + +// MockKeeperOracle is a mock of KeeperOracle interface. +type MockKeeperOracle struct { + ctrl *gomock.Controller + recorder *MockKeeperOracleMockRecorder +} + +// MockKeeperOracleMockRecorder is the mock recorder for MockKeeperOracle. +type MockKeeperOracleMockRecorder struct { + mock *MockKeeperOracle +} + +// NewMockKeeperOracle creates a new mock instance. +func NewMockKeeperOracle(ctrl *gomock.Controller) *MockKeeperOracle { + mock := &MockKeeperOracle{ctrl: ctrl} + mock.recorder = &MockKeeperOracleMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockKeeperOracle) EXPECT() *MockKeeperOracleMockRecorder { + return m.recorder +} + +// GetAllRecentMsgAsMap mocks base method. +func (m *MockKeeperOracle) GetAllRecentMsgAsMap(arg0 types1.Context) map[uint64][]*types.MsgItem { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllRecentMsgAsMap", arg0) + ret0, _ := ret[0].(map[uint64][]*types.MsgItem) + return ret0 +} + +// GetAllRecentMsgAsMap indicates an expected call of GetAllRecentMsgAsMap. +func (mr *MockKeeperOracleMockRecorder) GetAllRecentMsgAsMap(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllRecentMsgAsMap", reflect.TypeOf((*MockKeeperOracle)(nil).GetAllRecentMsgAsMap), arg0) +} + +// GetAllRecentParamsAsMap mocks base method. +func (m *MockKeeperOracle) GetAllRecentParamsAsMap(arg0 types1.Context) map[uint64]*types.Params { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllRecentParamsAsMap", arg0) + ret0, _ := ret[0].(map[uint64]*types.Params) + return ret0 +} + +// GetAllRecentParamsAsMap indicates an expected call of GetAllRecentParamsAsMap. +func (mr *MockKeeperOracleMockRecorder) GetAllRecentParamsAsMap(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllRecentParamsAsMap", reflect.TypeOf((*MockKeeperOracle)(nil).GetAllRecentParamsAsMap), arg0) +} + +// GetIndexRecentMsg mocks base method. +func (m *MockKeeperOracle) GetIndexRecentMsg(arg0 types1.Context) (types.IndexRecentMsg, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetIndexRecentMsg", arg0) + ret0, _ := ret[0].(types.IndexRecentMsg) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetIndexRecentMsg indicates an expected call of GetIndexRecentMsg. +func (mr *MockKeeperOracleMockRecorder) GetIndexRecentMsg(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIndexRecentMsg", reflect.TypeOf((*MockKeeperOracle)(nil).GetIndexRecentMsg), arg0) +} + +// GetIndexRecentParams mocks base method. +func (m *MockKeeperOracle) GetIndexRecentParams(arg0 types1.Context) (types.IndexRecentParams, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetIndexRecentParams", arg0) + ret0, _ := ret[0].(types.IndexRecentParams) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetIndexRecentParams indicates an expected call of GetIndexRecentParams. +func (mr *MockKeeperOracleMockRecorder) GetIndexRecentParams(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIndexRecentParams", reflect.TypeOf((*MockKeeperOracle)(nil).GetIndexRecentParams), arg0) +} + +// GetLastTotalPower mocks base method. +func (m *MockKeeperOracle) GetLastTotalPower(arg0 types1.Context) *big.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetLastTotalPower", arg0) + ret0, _ := ret[0].(*big.Int) + return ret0 +} + +// GetLastTotalPower indicates an expected call of GetLastTotalPower. +func (mr *MockKeeperOracleMockRecorder) GetLastTotalPower(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLastTotalPower", reflect.TypeOf((*MockKeeperOracle)(nil).GetLastTotalPower), arg0) +} + +// GetParams mocks base method. +func (m *MockKeeperOracle) GetParams(arg0 types1.Context) types.Params { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetParams", arg0) + ret0, _ := ret[0].(types.Params) + return ret0 +} + +// GetParams indicates an expected call of GetParams. +func (mr *MockKeeperOracleMockRecorder) GetParams(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParams", reflect.TypeOf((*MockKeeperOracle)(nil).GetParams), arg0) +} + +// GetValidatorByConsAddr mocks base method. +func (m *MockKeeperOracle) GetValidatorByConsAddr(arg0 types1.Context, arg1 types1.ConsAddress) (types2.Validator, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetValidatorByConsAddr", arg0, arg1) + ret0, _ := ret[0].(types2.Validator) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetValidatorByConsAddr indicates an expected call of GetValidatorByConsAddr. +func (mr *MockKeeperOracleMockRecorder) GetValidatorByConsAddr(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorByConsAddr", reflect.TypeOf((*MockKeeperOracle)(nil).GetValidatorByConsAddr), arg0, arg1) +} + +// GetValidatorUpdateBlock mocks base method. +func (m *MockKeeperOracle) GetValidatorUpdateBlock(arg0 types1.Context) (types.ValidatorUpdateBlock, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetValidatorUpdateBlock", arg0) + ret0, _ := ret[0].(types.ValidatorUpdateBlock) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetValidatorUpdateBlock indicates an expected call of GetValidatorUpdateBlock. +func (mr *MockKeeperOracleMockRecorder) GetValidatorUpdateBlock(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorUpdateBlock", reflect.TypeOf((*MockKeeperOracle)(nil).GetValidatorUpdateBlock), arg0) +} + +// GetValidatorUpdates mocks base method. +func (m *MockKeeperOracle) GetValidatorUpdates(arg0 types1.Context) []types0.ValidatorUpdate { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetValidatorUpdates", arg0) + ret0, _ := ret[0].([]types0.ValidatorUpdate) + return ret0 +} + +// GetValidatorUpdates indicates an expected call of GetValidatorUpdates. +func (mr *MockKeeperOracleMockRecorder) GetValidatorUpdates(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorUpdates", reflect.TypeOf((*MockKeeperOracle)(nil).GetValidatorUpdates), arg0) +} + +// IterateBondedValidatorsByPower mocks base method. +func (m *MockKeeperOracle) IterateBondedValidatorsByPower(arg0 types1.Context, arg1 func(int64, types2.ValidatorI) bool) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IterateBondedValidatorsByPower", arg0, arg1) +} + +// IterateBondedValidatorsByPower indicates an expected call of IterateBondedValidatorsByPower. +func (mr *MockKeeperOracleMockRecorder) IterateBondedValidatorsByPower(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateBondedValidatorsByPower", reflect.TypeOf((*MockKeeperOracle)(nil).IterateBondedValidatorsByPower), arg0, arg1) +} + +// RemoveRecentMsg mocks base method. +func (m *MockKeeperOracle) RemoveRecentMsg(arg0 types1.Context, arg1 uint64) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RemoveRecentMsg", arg0, arg1) +} + +// RemoveRecentMsg indicates an expected call of RemoveRecentMsg. +func (mr *MockKeeperOracleMockRecorder) RemoveRecentMsg(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveRecentMsg", reflect.TypeOf((*MockKeeperOracle)(nil).RemoveRecentMsg), arg0, arg1) +} + +// RemoveRecentParams mocks base method. +func (m *MockKeeperOracle) RemoveRecentParams(arg0 types1.Context, arg1 uint64) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RemoveRecentParams", arg0, arg1) +} + +// RemoveRecentParams indicates an expected call of RemoveRecentParams. +func (mr *MockKeeperOracleMockRecorder) RemoveRecentParams(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveRecentParams", reflect.TypeOf((*MockKeeperOracle)(nil).RemoveRecentParams), arg0, arg1) +} + +// SetIndexRecentMsg mocks base method. +func (m *MockKeeperOracle) SetIndexRecentMsg(arg0 types1.Context, arg1 types.IndexRecentMsg) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetIndexRecentMsg", arg0, arg1) +} + +// SetIndexRecentMsg indicates an expected call of SetIndexRecentMsg. +func (mr *MockKeeperOracleMockRecorder) SetIndexRecentMsg(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetIndexRecentMsg", reflect.TypeOf((*MockKeeperOracle)(nil).SetIndexRecentMsg), arg0, arg1) +} + +// SetIndexRecentParams mocks base method. +func (m *MockKeeperOracle) SetIndexRecentParams(arg0 types1.Context, arg1 types.IndexRecentParams) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetIndexRecentParams", arg0, arg1) +} + +// SetIndexRecentParams indicates an expected call of SetIndexRecentParams. +func (mr *MockKeeperOracleMockRecorder) SetIndexRecentParams(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetIndexRecentParams", reflect.TypeOf((*MockKeeperOracle)(nil).SetIndexRecentParams), arg0, arg1) +} + +// SetRecentMsg mocks base method. +func (m *MockKeeperOracle) SetRecentMsg(arg0 types1.Context, arg1 types.RecentMsg) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetRecentMsg", arg0, arg1) +} + +// SetRecentMsg indicates an expected call of SetRecentMsg. +func (mr *MockKeeperOracleMockRecorder) SetRecentMsg(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetRecentMsg", reflect.TypeOf((*MockKeeperOracle)(nil).SetRecentMsg), arg0, arg1) +} + +// SetRecentParams mocks base method. +func (m *MockKeeperOracle) SetRecentParams(arg0 types1.Context, arg1 types.RecentParams) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetRecentParams", arg0, arg1) +} + +// SetRecentParams indicates an expected call of SetRecentParams. +func (mr *MockKeeperOracleMockRecorder) SetRecentParams(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetRecentParams", reflect.TypeOf((*MockKeeperOracle)(nil).SetRecentParams), arg0, arg1) +} + +// SetValidatorUpdateBlock mocks base method. +func (m *MockKeeperOracle) SetValidatorUpdateBlock(arg0 types1.Context, arg1 types.ValidatorUpdateBlock) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetValidatorUpdateBlock", arg0, arg1) +} + +// SetValidatorUpdateBlock indicates an expected call of SetValidatorUpdateBlock. +func (mr *MockKeeperOracleMockRecorder) SetValidatorUpdateBlock(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetValidatorUpdateBlock", reflect.TypeOf((*MockKeeperOracle)(nil).SetValidatorUpdateBlock), arg0, arg1) +} diff --git a/x/oracle/keeper/common/types.go b/x/oracle/keeper/common/types.go index df22bd4f9..5777242e2 100644 --- a/x/oracle/keeper/common/types.go +++ b/x/oracle/keeper/common/types.go @@ -94,7 +94,6 @@ func (s *Set[T]) Add(value T) bool { } } s.slice = append(s.slice, value) - s.size++ return true } diff --git a/x/oracle/keeper/msg_server_create_price.go b/x/oracle/keeper/msg_server_create_price.go index 171d29e70..6a626e65a 100644 --- a/x/oracle/keeper/msg_server_create_price.go +++ b/x/oracle/keeper/msg_server_create_price.go @@ -16,15 +16,15 @@ func (k msgServer) CreatePrice(goCtx context.Context, msg *types.MsgCreatePrice) **/ //newItem, caches, _ := k.GetAggregatorContext(ctx, k.Keeper).NewCreatePrice(ctx, msg) - newItem, caches, _ := GetAggregatorContext(ctx, &k.Keeper).NewCreatePrice(ctx, msg) + newItem, caches, _ := GetAggregatorContext(ctx, k.Keeper).NewCreatePrice(ctx, msg) if caches != nil { if newItem != nil { k.AppendPriceTR(ctx, newItem.TokenId, newItem.PriceTR) //TODO: move related caches - cs.RemoveCache(caches, k) + cs.RemoveCache(caches) } else { - cs.AddCache(caches, k) + cs.AddCache(caches) } } diff --git a/x/oracle/keeper/single.go b/x/oracle/keeper/single.go index 4ca489673..3091be3ed 100644 --- a/x/oracle/keeper/single.go +++ b/x/oracle/keeper/single.go @@ -65,14 +65,14 @@ func recacheAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext return false }) agc.SetValidatorPowers(validatorPowers) - agc.SetTotalPower(totalPower) + // agc.SetTotalPower(totalPower) //TODO: test only if k.GetLastTotalPower(ctx).Cmp(totalPower) != 0 { panic("something wrong when get validatorsPower from staking module") } //reset validators - c.AddCache(cache.CacheItemV(validatorPowers), k) + c.AddCache(cache.CacheItemV(validatorPowers)) recentMsgs := k.GetAllRecentMsgAsMap(ctx) var pTmp common.Params @@ -107,7 +107,7 @@ func recacheAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext } //fill params cache - c.AddCache(cache.CacheItemP(&pTmp), k) + c.AddCache(cache.CacheItemP(&pTmp)) agc.PrepareRound(ctx, to) @@ -123,7 +123,7 @@ func initAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k pTmp := common.Params(p) agc.SetParams(&pTmp) //set params cache - c.AddCache(cache.CacheItemP(&pTmp), k) + c.AddCache(cache.CacheItemP(&pTmp)) totalPower := big.NewInt(0) validatorPowers := make(map[string]*big.Int) @@ -135,14 +135,14 @@ func initAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k totalPower = new(big.Int).Add(totalPower, power) return false }) - agc.SetTotalPower(totalPower) + // agc.SetTotalPower(totalPower) agc.SetValidatorPowers(validatorPowers) if k.GetLastTotalPower(ctx).Cmp(totalPower) != 0 { panic("-") } //set validatorPower cache - c.AddCache(cache.CacheItemV(validatorPowers), k) + c.AddCache(cache.CacheItemV(validatorPowers)) agc.PrepareRound(ctx, uint64(ctx.BlockHeight())-1) return nil diff --git a/x/oracle/types/genesis.go b/x/oracle/types/genesis.go index 39a0bdd60..bec448bcc 100644 --- a/x/oracle/types/genesis.go +++ b/x/oracle/types/genesis.go @@ -11,7 +11,6 @@ const DefaultIndex uint64 = 1 func DefaultGenesis() *GenesisState { return &GenesisState{ PricesList: []Prices{}, - Validators: nil, ValidatorUpdateBlock: nil, IndexRecentParams: nil, IndexRecentMsg: nil, From f15339cf2d5a219ab54725858825ba80a943ce61 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Tue, 2 Apr 2024 23:16:37 +0800 Subject: [PATCH 27/37] test(oracle-keeper):tmp --- app/app.go | 15 +- proto/exocore/oracle/price.proto | 1 - proto/exocore/oracle/query.proto | 8 +- testutil/keeper/oracle.go | 4 +- x/oracle/genesis_test.go | 28 +- x/oracle/keeper/aggregator/aggregator.go | 31 +- .../aggregator/aggregator_aggregator.go | 2 + .../aggregator/aggregator_calculator.go | 3 + x/oracle/keeper/aggregator/worker.go | 2 + .../bak/msg_server_create_price_test.bak | 131 +++++++ x/oracle/keeper/cache/caches.go | 2 + x/oracle/keeper/common/common_test.go | 4 +- ...{mock_interface.go => mock_keeper_test.go} | 2 +- x/oracle/keeper/common/mock_validator_test.go | 343 ++++++++++++++++++ x/oracle/keeper/common/types.go | 40 +- x/oracle/keeper/keeper.go | 17 +- x/oracle/keeper/keeper_suite_test.go | 41 +++ x/oracle/keeper/mock_validator_test.go | 343 ++++++++++++++++++ x/oracle/keeper/msg_server_create_price.go | 2 +- .../keeper/msg_server_create_price_test.go | 131 +++++++ x/oracle/keeper/msg_server_test.go | 10 +- x/oracle/keeper/params.go | 33 +- x/oracle/keeper/prices.go | 80 ++-- x/oracle/keeper/prices_test.go | 44 ++- x/oracle/keeper/query_prices.go | 57 ++- x/oracle/keeper/query_prices_test.go | 111 +++--- x/oracle/keeper/query_validators.go | 24 -- x/oracle/keeper/query_validators_test.go | 50 --- x/oracle/keeper/single.go | 3 +- x/oracle/keeper/testdata/helper.go | 36 ++ x/oracle/keeper/testdata/info.go | 64 ++++ x/oracle/types/codec.go | 1 + x/oracle/types/key_prices.go | 2 +- x/oracle/types/keys.go | 4 + x/oracle/types/params.go | 71 +++- 35 files changed, 1500 insertions(+), 240 deletions(-) create mode 100644 x/oracle/keeper/bak/msg_server_create_price_test.bak rename x/oracle/keeper/common/{mock_interface.go => mock_keeper_test.go} (98%) create mode 100644 x/oracle/keeper/common/mock_validator_test.go create mode 100644 x/oracle/keeper/keeper_suite_test.go create mode 100644 x/oracle/keeper/mock_validator_test.go create mode 100644 x/oracle/keeper/msg_server_create_price_test.go delete mode 100644 x/oracle/keeper/query_validators.go delete mode 100644 x/oracle/keeper/query_validators_test.go create mode 100644 x/oracle/keeper/testdata/helper.go create mode 100644 x/oracle/keeper/testdata/info.go diff --git a/app/app.go b/app/app.go index 1fa133918..c67779efc 100644 --- a/app/app.go +++ b/app/app.go @@ -36,6 +36,11 @@ import ( depositKeeper "github.com/ExocoreNetwork/exocore/x/deposit/keeper" depositTypes "github.com/ExocoreNetwork/exocore/x/deposit/types" operatorTypes "github.com/ExocoreNetwork/exocore/x/operator/types" + + "github.com/ExocoreNetwork/exocore/x/oracle" + oracleKeeper "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + oracleTypes "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/ExocoreNetwork/exocore/x/reward" rewardKeeper "github.com/ExocoreNetwork/exocore/x/reward/keeper" rewardTypes "github.com/ExocoreNetwork/exocore/x/reward/types" @@ -267,6 +272,7 @@ var ( withdraw.AppModuleBasic{}, reward.AppModuleBasic{}, exoslash.AppModuleBasic{}, + oracle.AppModuleBasic{}, ) // module account permissions @@ -358,6 +364,7 @@ type ExocoreApp struct { WithdrawKeeper withdrawKeeper.Keeper RewardKeeper rewardKeeper.Keeper OperatorKeeper operatorKeeper.Keeper + OracleKeeper oracleKeeper.Keeper ExoSlashKeeper slashKeeper.Keeper // the module manager @@ -441,11 +448,12 @@ func NewExocoreApp( rewardTypes.StoreKey, exoslashTypes.StoreKey, operatorTypes.StoreKey, + oracleTypes.StoreKey, ) // Add the EVM transient store key tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey, oracleTypes.MemStoreKey) // load state streaming if enabled if _, _, err := streaming.LoadStreamingServices(bApp, appOpts, appCodec, logger, keys); err != nil { @@ -630,6 +638,7 @@ func NewExocoreApp( app.WithdrawKeeper = *withdrawKeeper.NewKeeper(appCodec, keys[withdrawTypes.StoreKey], app.AssetsKeeper, app.DepositKeeper) app.RewardKeeper = *rewardKeeper.NewKeeper(appCodec, keys[rewardTypes.StoreKey], app.AssetsKeeper) app.ExoSlashKeeper = slashKeeper.NewKeeper(appCodec, keys[exoslashTypes.StoreKey], app.AssetsKeeper) + app.OracleKeeper = oracleKeeper.NewKeeper(appCodec, keys[oracleTypes.StoreKey], memKeys[oracleTypes.MemStoreKey], app.GetSubspace(oracleTypes.ModuleName), app.StakingKeeper) // We call this after setting the hooks to ensure that the hooks are set on the keeper evmKeeper.WithPrecompiles( evmkeeper.AvailablePrecompiles( @@ -804,6 +813,7 @@ func NewExocoreApp( withdraw.NewAppModule(appCodec, app.WithdrawKeeper), reward.NewAppModule(appCodec, app.RewardKeeper), exoslash.NewAppModule(appCodec, app.ExoSlashKeeper), + oracle.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper), ) // During begin block slashing happens after distr.BeginBlocker so that @@ -851,6 +861,7 @@ func NewExocoreApp( withdrawTypes.ModuleName, rewardTypes.ModuleName, exoslashTypes.ModuleName, + oracleTypes.ModuleName, ) // NOTE: fee market module must go last in order to retrieve the block gas used. @@ -894,6 +905,7 @@ func NewExocoreApp( withdrawTypes.ModuleName, rewardTypes.ModuleName, exoslashTypes.ModuleName, + oracleTypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -935,6 +947,7 @@ func NewExocoreApp( withdrawTypes.ModuleName, rewardTypes.ModuleName, exoslashTypes.ModuleName, + oracleTypes.ModuleName, // Evmos modules vestingtypes.ModuleName, inflationtypes.ModuleName, diff --git a/proto/exocore/oracle/price.proto b/proto/exocore/oracle/price.proto index 92df523f4..7c728a606 100644 --- a/proto/exocore/oracle/price.proto +++ b/proto/exocore/oracle/price.proto @@ -31,4 +31,3 @@ message PriceWithTimeAndRound { string timestamp = 3; uint64 round_id = 4; } - diff --git a/proto/exocore/oracle/query.proto b/proto/exocore/oracle/query.proto index 942e4faff..411c7f234 100644 --- a/proto/exocore/oracle/query.proto +++ b/proto/exocore/oracle/query.proto @@ -29,10 +29,10 @@ service Query { option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/prices/{tokenId}"; } - rpc PricesAll (QueryAllPricesRequest) returns (QueryAllPricesResponse) { - option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/prices"; - - } +// rpc PricesAll (QueryAllPricesRequest) returns (QueryAllPricesResponse) { +// option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/prices"; +// +// } // Queries a ValidatorUpdateBlock by index. rpc ValidatorUpdateBlock (QueryGetValidatorUpdateBlockRequest) returns (QueryGetValidatorUpdateBlockResponse) { diff --git a/testutil/keeper/oracle.go b/testutil/keeper/oracle.go index 3b9232420..a0a65338f 100644 --- a/testutil/keeper/oracle.go +++ b/testutil/keeper/oracle.go @@ -14,6 +14,7 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" + stakingKeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/stretchr/testify/require" ) @@ -41,6 +42,7 @@ func OracleKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { storeKey, memStoreKey, paramsSubspace, + stakingKeeper.Keeper{}, ) ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) @@ -48,5 +50,5 @@ func OracleKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { // Initialize params k.SetParams(ctx, types.DefaultParams()) - return k, ctx + return &k, ctx } diff --git a/x/oracle/genesis_test.go b/x/oracle/genesis_test.go index 6b5db6ce0..23f63bbb6 100644 --- a/x/oracle/genesis_test.go +++ b/x/oracle/genesis_test.go @@ -16,10 +16,34 @@ func TestGenesis(t *testing.T) { PricesList: []types.Prices{ { - TokenId: 0, + TokenId: 1, + PriceList: []*types.PriceWithTimeAndRound{ + { + Price: "100", + Decimal: 1, + Timestamp: "-", + RoundId: 1, + }, + }, + NextRountId: 2, }, { - TokenId: 1, + TokenId: 2, + PriceList: []*types.PriceWithTimeAndRound{ + { + Price: "109", + Decimal: 1, + Timestamp: "-", + RoundId: 1, + }, + { + Price: "119", + Decimal: 1, + Timestamp: "-", + RoundId: 2, + }, + }, + NextRountId: 3, }, }, ValidatorUpdateBlock: &types.ValidatorUpdateBlock{}, diff --git a/x/oracle/keeper/aggregator/aggregator.go b/x/oracle/keeper/aggregator/aggregator.go index d15613176..95fbd4dfb 100644 --- a/x/oracle/keeper/aggregator/aggregator.go +++ b/x/oracle/keeper/aggregator/aggregator.go @@ -54,21 +54,21 @@ func (agc *AggregatorContext) sanityCheck(msg *types.MsgCreatePrice) error { //TODO: check len(price.prices)>0, len(price.prices._range_eachPriceWithSource.Prices)>0, at least has one source, and for each source has at least one price //TODO: check for each source, at most maxDetId count price (now in filter, ->anteHandler) if agc.validatorsPower[msg.Creator] == nil { - return errors.New("") + return errors.New("signer is not validator") } if msg.Nonce < 1 || msg.Nonce > common.MaxNonce { - return errors.New("") + return errors.New("nonce invalid") } //TODO: sanity check for price(no more than maxDetId count for each source, this should be take care in anteHandler) if msg.Prices == nil || len(msg.Prices) == 0 { - return errors.New("") + return errors.New("msg should provide at least one price") } for _, pSource := range msg.Prices { if pSource.Prices == nil || len(pSource.Prices) == 0 || len(pSource.Prices) > common.MaxDetId || !agc.params.IsValidSource(pSource.SourceId) { - return errors.New("") + return errors.New("source should be valid and provide at least one price") } //check with params is coressponding source is deteministic if agc.params.IsDeterministicSource(pSource.SourceId) { @@ -77,14 +77,14 @@ func (agc *AggregatorContext) sanityCheck(msg *types.MsgCreatePrice) error { //just make sure the DetId won't mess up with NS's placeholder id, the limitation of maximum count one validator can submit will be check by filter if len(pDetId.DetId) == 0 { //deterministic must have specified deterministicId - return errors.New("") + return errors.New("ds should have roundid") } //DS's price value will go through consensus process, so it's safe to skip the check here } } else { //sanity check: NS submit only one price with detId=="" if len(pSource.Prices) > 1 || len(pSource.Prices[0].DetId) > 0 { - return errors.New("") + return errors.New("ns should not have roundid") } } } @@ -100,11 +100,11 @@ func (agc *AggregatorContext) checkMsg(msg *types.MsgCreatePrice) error { feederContext := agc.rounds[msg.FeederId] if feederContext == nil || feederContext.status != 1 { //feederId does not exist or not alive - return errors.New("") + return errors.New("context not exist or not available") } //senity check on basedBlock if msg.BasedBlock != feederContext.basedBlock { - return errors.New("") + return errors.New("baseblock not match") } //check sources rule matches @@ -115,6 +115,7 @@ func (agc *AggregatorContext) checkMsg(msg *types.MsgCreatePrice) error { } func (agc *AggregatorContext) FillPrice(msg *types.MsgCreatePrice) (*priceItemKV, *cache.CacheItemM, error) { + // fmt.Println("debug agc fillprice") feederWorker := agc.aggregators[msg.FeederId] //worker initialzed here reduce workload for Endblocker if feederWorker == nil { @@ -147,11 +148,12 @@ func (agc *AggregatorContext) FillPrice(msg *types.MsgCreatePrice) (*priceItemKV // NewCreatePrice receives msgCreatePrice message, and goes process: filter->aggregator, filter->calculator->aggregator // non-deterministic data will goes directly into aggregator, and deterministic data will goes into calculator first to get consensus on the deterministic id. func (agc *AggregatorContext) NewCreatePrice(ctx sdk.Context, msg *types.MsgCreatePrice) (*priceItemKV, *cache.CacheItemM, error) { - + // fmt.Println("debug agc.newcreateprice") if err := agc.checkMsg(msg); err != nil { + // fmt.Println("debug agc.newcreateprice.error", err) return nil, nil, err } - + // fmt.Println("debug before agc.fillprice") return agc.FillPrice(msg) } @@ -204,15 +206,21 @@ func (agc *AggregatorContext) PrepareRound(ctx sdk.Context, block uint64) { block = uint64(ctx.BlockHeight()) } + // fmt.Println("debug agc.prepareround, height:", block) for feederId, feeder := range agc.params.GetTokenFeeders() { if feederId == 0 { continue } + // fmt.Println("debug agc.prepareround, feederId:", feederId) if (feeder.EndBlock > 0 && uint64(feeder.EndBlock) <= block) || uint64(feeder.StartBaseBlock) > block { + + // fmt.Println("debug agc.prepareround 2, feederId:", feederId, feeder.StartBaseBlock, block) //this feeder is inactive continue } + // fmt.Println("debug agc.prepareround 3, feederId:", feederId) + delta := (block - uint64(feeder.StartBaseBlock)) left := delta % uint64(feeder.Interval) count := delta / uint64(feeder.Interval) @@ -262,6 +270,9 @@ func (agc *AggregatorContext) SetValidatorPowers(vp map[string]*big.Int) { agc.totalPower = new(big.Int).Add(agc.totalPower, power) } } +func (agc *AggregatorContext) GetValidatorPowers() (vp map[string]*big.Int) { + return agc.validatorsPower +} //func (agc *AggregatorContext) SetTotalPower(power *big.Int) { // agc.totalPower = power diff --git a/x/oracle/keeper/aggregator/aggregator_aggregator.go b/x/oracle/keeper/aggregator/aggregator_aggregator.go index 18d65e6d1..5dccf33d6 100644 --- a/x/oracle/keeper/aggregator/aggregator_aggregator.go +++ b/x/oracle/keeper/aggregator/aggregator_aggregator.go @@ -140,6 +140,7 @@ func (agg *aggregator) aggregate() *big.Int { if agg.finalPrice != nil { return agg.finalPrice } + // fmt.Printf("debug aggregator.aggregate(), reportPower:%s, totalPower:%s\n", agg.reportPower.String(), agg.totalPower.String()) //TODO: implemetn different MODE for definition of consensus, //currently: use rule_1+MODE_1: {rule:specified source:`chainlink`, MODE: asap when power exceeds the threshold} //1. check OVA threshold @@ -147,6 +148,7 @@ func (agg *aggregator) aggregate() *big.Int { if common.ExceedsThreshold(agg.reportPower, agg.totalPower) { //TODO: this is kind of a mock way to suite V1, need update to check with params.rule //check if IVA all reached consensus + // fmt.Printf("debug aggregator.aggregate() len(dsPrice):%d\n", len(agg.dsPrices)) if len(agg.dsPrices) > 0 { validatorPrices := make([]*big.Int, 0, len(agg.reports)) //do the aggregation to find out the 'final price' diff --git a/x/oracle/keeper/aggregator/aggregator_calculator.go b/x/oracle/keeper/aggregator/aggregator_calculator.go index 94fc5974f..cc3fa5d2b 100644 --- a/x/oracle/keeper/aggregator/aggregator_calculator.go +++ b/x/oracle/keeper/aggregator/aggregator_calculator.go @@ -128,6 +128,7 @@ func (c *calculator) getOrNewSourceId(sourceId int32) *roundPricesList { // fillPrice called upon new MsgCreatPrice arrived, to trigger the calculation to get to consensus on the same roundID_of_deterministic_source // v1 use mode1, TODO: switch modes func (c *calculator) fillPrice(pSources []*types.PriceWithSource, validator string, power *big.Int) (confirmedRounds []*confirmedPrice) { + // fmt.Println("debug calculator.fillPrice, calculator.ds[1]", c.deterministicSource[1], pSources) for _, pSource := range pSources { rounds := c.getOrNewSourceId(pSource.SourceId) if rounds.hasConfirmedDetId() { @@ -144,6 +145,7 @@ func (c *calculator) fillPrice(pSources []*types.PriceWithSource, validator stri roundPrice, _ := new(big.Int).SetString(pDetId.Price, 10) + // fmt.Printf("debug calculator.fillPrice before updatePriceAndPower. power%s, price%s\n", power.String(), roundPrice.String()) updated, confirmed := round.updatePriceAndPower(&priceAndPower{roundPrice, power}, c.totalPower) if updated && confirmed { //sourceId, detId, price @@ -153,6 +155,7 @@ func (c *calculator) fillPrice(pSources []*types.PriceWithSource, validator stri } } } + // fmt.Println("debug calculator.fillPrice, after calculator.ds[1]", c.deterministicSource[1]) return } diff --git a/x/oracle/keeper/aggregator/worker.go b/x/oracle/keeper/aggregator/worker.go index 6d3f4776b..a30124412 100644 --- a/x/oracle/keeper/aggregator/worker.go +++ b/x/oracle/keeper/aggregator/worker.go @@ -27,7 +27,9 @@ func (w *worker) do(msg *types.MsgCreatePrice) []*types.PriceWithSource { list4Calculator, list4Aggregator := w.f.filtrate(msg) if list4Aggregator != nil { w.a.fillPrice(list4Aggregator, validator, power) + // fmt.Printf("debug worker.do after fill aggregator\n") if confirmedRounds := w.c.fillPrice(list4Calculator, validator, power); confirmedRounds != nil { + // fmt.Printf("debug worker.do after fill calculator and have confirmedRounds\n") w.a.confirmDSPrice(confirmedRounds) } } diff --git a/x/oracle/keeper/bak/msg_server_create_price_test.bak b/x/oracle/keeper/bak/msg_server_create_price_test.bak new file mode 100644 index 000000000..8b792f58f --- /dev/null +++ b/x/oracle/keeper/bak/msg_server_create_price_test.bak @@ -0,0 +1,131 @@ +func TestCreatePrice(t *testing.T) { + ms, ctx, k := setupMsgServer(t) + require.NotNil(t, ms) + require.NotNil(t, ctx) + + ctrl := gomock.NewController(t) + validatorC := NewMockValidatorI(ctrl) + validatorC.EXPECT().GetBondedTokens().Return(math.NewInt(1)) + validatorC.EXPECT().GetBondedTokens().Return(math.NewInt(1)) + validatorC.EXPECT().GetBondedTokens().Return(math.NewInt(1)) + + validatorC.EXPECT().GetConsensusPower(gomock.Any()).Return(int64(1)) + validatorC.EXPECT().GetConsensusPower(gomock.Any()).Return(int64(1)) + validatorC.EXPECT().GetConsensusPower(gomock.Any()).Return(int64(1)) + + privVal1 := mock.NewPV() + pubKey1, _ := privVal1.GetPubKey() + operator1 := sdk.ValAddress(pubKey1.Address()) + + privVal2 := mock.NewPV() + pubKey2, _ := privVal2.GetPubKey() + operator2 := sdk.ValAddress(pubKey2.Address()) + + privVal3 := mock.NewPV() + pubKey3, _ := privVal3.GetPubKey() + operator3 := sdk.ValAddress(pubKey3.Address()) + + validatorC.EXPECT().GetOperator().Return(operator1) + validatorC.EXPECT().GetOperator().Return(operator2) + validatorC.EXPECT().GetOperator().Return(operator3) + + monkey.PatchInstanceMethod(reflect.TypeOf(keeper.Keeper{}), "IterateBondedValidatorsByPower", func(k keeper.Keeper, ctx sdk.Context, f func(index int64, validator stakingtypes.ValidatorI) bool) { + f(0, validatorC) + f(0, validatorC) + f(0, validatorC) + }) + monkey.PatchInstanceMethod(reflect.TypeOf(keeper.Keeper{}), "GetLastTotalPower", func(k keeper.Keeper, ctx sdk.Context) *big.Int { return big.NewInt(3) }) + wCtx := sdk.UnwrapSDKContext(ctx) + h := wCtx.BlockHeight() + assert.Equal(t, int64(2), h) + vpRes := make(map[string]*big.Int) + c := keeper.GetCaches() + c.GetCache(cache.CacheItemV(vpRes)) + // fmt.Println("Caches get validatorPowers", vpRes) + ms.CreatePrice(ctx, &types.MsgCreatePrice{ + Creator: operator1.String(), + FeederId: 1, + Prices: []*types.PriceWithSource{ + { + SourceId: 1, + Prices: []*types.PriceWithTimeAndDetId{ + { + Price: "1000", + Decimal: 1, + Timestamp: "", + DetId: "5", + }, + }, + Desc: "", + }, + }, + BasedBlock: 1, + Nonce: 1, + }, + ) + + pRes := &common.Params{} + c.GetCache(cache.CacheItemP(pRes)) + // fmt.Println("Caches get params", pRes) + + iRes := make([]*cache.CacheItemM, 0) + c.GetCache(&iRes) + //fmt.Println("Caches get itemM", len(iRes), iRes[0]) + + ms.CreatePrice(ctx, &types.MsgCreatePrice{ + Creator: operator2.String(), + FeederId: 1, + Prices: []*types.PriceWithSource{ + { + SourceId: 1, + Prices: []*types.PriceWithTimeAndDetId{ + { + Price: "1090", + Decimal: 1, + Timestamp: "", + DetId: "6", + }, + { + Price: "1000", + Decimal: 1, + Timestamp: "", + DetId: "5", + }, + }, + Desc: "", + }, + }, + BasedBlock: 1, + Nonce: 1, + }, + ) + ms.CreatePrice(ctx, &types.MsgCreatePrice{}) + c.GetCache(&iRes) + //fmt.Println("Caches get itemM", len(iRes), iRes[0], iRes[1]) + ms.CreatePrice(ctx, &types.MsgCreatePrice{ + Creator: operator3.String(), + FeederId: 1, + Prices: []*types.PriceWithSource{ + { + SourceId: 1, + Prices: []*types.PriceWithTimeAndDetId{ + { + Price: "1000", + Decimal: 1, + Timestamp: "", + DetId: "5", + }, + }, + Desc: "", + }, + }, + BasedBlock: 1, + Nonce: 1, + }, + ) + + c.GetCache(&iRes) + //fmt.Println("Caches get itemM", len(iRes)) + fmt.Println(k.GetAllPrices(sdk.UnwrapSDKContext(ctx))) + +} diff --git a/x/oracle/keeper/cache/caches.go b/x/oracle/keeper/cache/caches.go index 92181e1bc..df8ae2867 100644 --- a/x/oracle/keeper/cache/caches.go +++ b/x/oracle/keeper/cache/caches.go @@ -171,6 +171,7 @@ func (c *Cache) GetCache(i any) bool { item[addr] = power } case CacheItemP: + //fmt.Println("debug ", c.params.params) if item == nil { return false } @@ -179,6 +180,7 @@ func (c *Cache) GetCache(i any) bool { if item == nil { return false } + // fmt.Println("debug getCacheM", c.msg) tmp := make([]*CacheItemM, 0, len(c.msg)) for _, msgs := range c.msg { tmp = append(tmp, msgs...) diff --git a/x/oracle/keeper/common/common_test.go b/x/oracle/keeper/common/common_test.go index b26cb4cbb..22fa257a5 100644 --- a/x/oracle/keeper/common/common_test.go +++ b/x/oracle/keeper/common/common_test.go @@ -9,7 +9,9 @@ import ( "go.uber.org/mock/gomock" ) -//go:generate mockgen -destination mock_test.go -package common github.com/ExocoreNetwork/exocore/x/oracle/keeper/common KeeperOracle +//go:generate mockgen -destination mock_keeper_test.go -package common github.com/ExocoreNetwork/exocore/x/oracle/keeper/common KeeperOracle + +//go:generate mockgen -destination mock_validator_test.go -package common github.com/cosmos/cosmos-sdk/x/staking/types ValidatorI func TestMock(t *testing.T) { ctrl := gomock.NewController(t) diff --git a/x/oracle/keeper/common/mock_interface.go b/x/oracle/keeper/common/mock_keeper_test.go similarity index 98% rename from x/oracle/keeper/common/mock_interface.go rename to x/oracle/keeper/common/mock_keeper_test.go index cdad90fbb..623336961 100644 --- a/x/oracle/keeper/common/mock_interface.go +++ b/x/oracle/keeper/common/mock_keeper_test.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination mock_test.go -package common github.com/ExocoreNetwork/exocore/x/oracle/keeper/common KeeperOracle +// mockgen -destination mock_keeper_test.go -package common github.com/ExocoreNetwork/exocore/x/oracle/keeper/common KeeperOracle // // Package common is a generated GoMock package. diff --git a/x/oracle/keeper/common/mock_validator_test.go b/x/oracle/keeper/common/mock_validator_test.go new file mode 100644 index 000000000..6e84bfe0a --- /dev/null +++ b/x/oracle/keeper/common/mock_validator_test.go @@ -0,0 +1,343 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/cosmos/cosmos-sdk/x/staking/types (interfaces: ValidatorI) +// +// Generated by this command: +// +// mockgen -destination mock_validator_test.go -package common github.com/cosmos/cosmos-sdk/x/staking/types ValidatorI +// + +// Package common is a generated GoMock package. +package common + +import ( + reflect "reflect" + + math "cosmossdk.io/math" + crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + types "github.com/cosmos/cosmos-sdk/crypto/types" + types0 "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/x/staking/types" + gomock "go.uber.org/mock/gomock" +) + +// MockValidatorI is a mock of ValidatorI interface. +type MockValidatorI struct { + ctrl *gomock.Controller + recorder *MockValidatorIMockRecorder +} + +// MockValidatorIMockRecorder is the mock recorder for MockValidatorI. +type MockValidatorIMockRecorder struct { + mock *MockValidatorI +} + +// NewMockValidatorI creates a new mock instance. +func NewMockValidatorI(ctrl *gomock.Controller) *MockValidatorI { + mock := &MockValidatorI{ctrl: ctrl} + mock.recorder = &MockValidatorIMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockValidatorI) EXPECT() *MockValidatorIMockRecorder { + return m.recorder +} + +// ConsPubKey mocks base method. +func (m *MockValidatorI) ConsPubKey() (types.PubKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ConsPubKey") + ret0, _ := ret[0].(types.PubKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ConsPubKey indicates an expected call of ConsPubKey. +func (mr *MockValidatorIMockRecorder) ConsPubKey() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsPubKey", reflect.TypeOf((*MockValidatorI)(nil).ConsPubKey)) +} + +// GetBondedTokens mocks base method. +func (m *MockValidatorI) GetBondedTokens() math.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBondedTokens") + ret0, _ := ret[0].(math.Int) + return ret0 +} + +// GetBondedTokens indicates an expected call of GetBondedTokens. +func (mr *MockValidatorIMockRecorder) GetBondedTokens() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBondedTokens", reflect.TypeOf((*MockValidatorI)(nil).GetBondedTokens)) +} + +// GetCommission mocks base method. +func (m *MockValidatorI) GetCommission() math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCommission") + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// GetCommission indicates an expected call of GetCommission. +func (mr *MockValidatorIMockRecorder) GetCommission() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCommission", reflect.TypeOf((*MockValidatorI)(nil).GetCommission)) +} + +// GetConsAddr mocks base method. +func (m *MockValidatorI) GetConsAddr() (types0.ConsAddress, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConsAddr") + ret0, _ := ret[0].(types0.ConsAddress) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetConsAddr indicates an expected call of GetConsAddr. +func (mr *MockValidatorIMockRecorder) GetConsAddr() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConsAddr", reflect.TypeOf((*MockValidatorI)(nil).GetConsAddr)) +} + +// GetConsensusPower mocks base method. +func (m *MockValidatorI) GetConsensusPower(arg0 math.Int) int64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConsensusPower", arg0) + ret0, _ := ret[0].(int64) + return ret0 +} + +// GetConsensusPower indicates an expected call of GetConsensusPower. +func (mr *MockValidatorIMockRecorder) GetConsensusPower(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConsensusPower", reflect.TypeOf((*MockValidatorI)(nil).GetConsensusPower), arg0) +} + +// GetDelegatorShares mocks base method. +func (m *MockValidatorI) GetDelegatorShares() math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDelegatorShares") + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// GetDelegatorShares indicates an expected call of GetDelegatorShares. +func (mr *MockValidatorIMockRecorder) GetDelegatorShares() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDelegatorShares", reflect.TypeOf((*MockValidatorI)(nil).GetDelegatorShares)) +} + +// GetMinSelfDelegation mocks base method. +func (m *MockValidatorI) GetMinSelfDelegation() math.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMinSelfDelegation") + ret0, _ := ret[0].(math.Int) + return ret0 +} + +// GetMinSelfDelegation indicates an expected call of GetMinSelfDelegation. +func (mr *MockValidatorIMockRecorder) GetMinSelfDelegation() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMinSelfDelegation", reflect.TypeOf((*MockValidatorI)(nil).GetMinSelfDelegation)) +} + +// GetMoniker mocks base method. +func (m *MockValidatorI) GetMoniker() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMoniker") + ret0, _ := ret[0].(string) + return ret0 +} + +// GetMoniker indicates an expected call of GetMoniker. +func (mr *MockValidatorIMockRecorder) GetMoniker() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMoniker", reflect.TypeOf((*MockValidatorI)(nil).GetMoniker)) +} + +// GetOperator mocks base method. +func (m *MockValidatorI) GetOperator() types0.ValAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOperator") + ret0, _ := ret[0].(types0.ValAddress) + return ret0 +} + +// GetOperator indicates an expected call of GetOperator. +func (mr *MockValidatorIMockRecorder) GetOperator() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperator", reflect.TypeOf((*MockValidatorI)(nil).GetOperator)) +} + +// GetStatus mocks base method. +func (m *MockValidatorI) GetStatus() types1.BondStatus { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetStatus") + ret0, _ := ret[0].(types1.BondStatus) + return ret0 +} + +// GetStatus indicates an expected call of GetStatus. +func (mr *MockValidatorIMockRecorder) GetStatus() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStatus", reflect.TypeOf((*MockValidatorI)(nil).GetStatus)) +} + +// GetTokens mocks base method. +func (m *MockValidatorI) GetTokens() math.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTokens") + ret0, _ := ret[0].(math.Int) + return ret0 +} + +// GetTokens indicates an expected call of GetTokens. +func (mr *MockValidatorIMockRecorder) GetTokens() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokens", reflect.TypeOf((*MockValidatorI)(nil).GetTokens)) +} + +// IsBonded mocks base method. +func (m *MockValidatorI) IsBonded() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsBonded") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsBonded indicates an expected call of IsBonded. +func (mr *MockValidatorIMockRecorder) IsBonded() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsBonded", reflect.TypeOf((*MockValidatorI)(nil).IsBonded)) +} + +// IsJailed mocks base method. +func (m *MockValidatorI) IsJailed() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsJailed") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsJailed indicates an expected call of IsJailed. +func (mr *MockValidatorIMockRecorder) IsJailed() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsJailed", reflect.TypeOf((*MockValidatorI)(nil).IsJailed)) +} + +// IsUnbonded mocks base method. +func (m *MockValidatorI) IsUnbonded() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsUnbonded") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsUnbonded indicates an expected call of IsUnbonded. +func (mr *MockValidatorIMockRecorder) IsUnbonded() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsUnbonded", reflect.TypeOf((*MockValidatorI)(nil).IsUnbonded)) +} + +// IsUnbonding mocks base method. +func (m *MockValidatorI) IsUnbonding() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsUnbonding") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsUnbonding indicates an expected call of IsUnbonding. +func (mr *MockValidatorIMockRecorder) IsUnbonding() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsUnbonding", reflect.TypeOf((*MockValidatorI)(nil).IsUnbonding)) +} + +// SharesFromTokens mocks base method. +func (m *MockValidatorI) SharesFromTokens(arg0 math.Int) (math.LegacyDec, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SharesFromTokens", arg0) + ret0, _ := ret[0].(math.LegacyDec) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SharesFromTokens indicates an expected call of SharesFromTokens. +func (mr *MockValidatorIMockRecorder) SharesFromTokens(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SharesFromTokens", reflect.TypeOf((*MockValidatorI)(nil).SharesFromTokens), arg0) +} + +// SharesFromTokensTruncated mocks base method. +func (m *MockValidatorI) SharesFromTokensTruncated(arg0 math.Int) (math.LegacyDec, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SharesFromTokensTruncated", arg0) + ret0, _ := ret[0].(math.LegacyDec) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SharesFromTokensTruncated indicates an expected call of SharesFromTokensTruncated. +func (mr *MockValidatorIMockRecorder) SharesFromTokensTruncated(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SharesFromTokensTruncated", reflect.TypeOf((*MockValidatorI)(nil).SharesFromTokensTruncated), arg0) +} + +// TmConsPublicKey mocks base method. +func (m *MockValidatorI) TmConsPublicKey() (crypto.PublicKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TmConsPublicKey") + ret0, _ := ret[0].(crypto.PublicKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// TmConsPublicKey indicates an expected call of TmConsPublicKey. +func (mr *MockValidatorIMockRecorder) TmConsPublicKey() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TmConsPublicKey", reflect.TypeOf((*MockValidatorI)(nil).TmConsPublicKey)) +} + +// TokensFromShares mocks base method. +func (m *MockValidatorI) TokensFromShares(arg0 math.LegacyDec) math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TokensFromShares", arg0) + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// TokensFromShares indicates an expected call of TokensFromShares. +func (mr *MockValidatorIMockRecorder) TokensFromShares(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromShares", reflect.TypeOf((*MockValidatorI)(nil).TokensFromShares), arg0) +} + +// TokensFromSharesRoundUp mocks base method. +func (m *MockValidatorI) TokensFromSharesRoundUp(arg0 math.LegacyDec) math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TokensFromSharesRoundUp", arg0) + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// TokensFromSharesRoundUp indicates an expected call of TokensFromSharesRoundUp. +func (mr *MockValidatorIMockRecorder) TokensFromSharesRoundUp(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromSharesRoundUp", reflect.TypeOf((*MockValidatorI)(nil).TokensFromSharesRoundUp), arg0) +} + +// TokensFromSharesTruncated mocks base method. +func (m *MockValidatorI) TokensFromSharesTruncated(arg0 math.LegacyDec) math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TokensFromSharesTruncated", arg0) + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// TokensFromSharesTruncated indicates an expected call of TokensFromSharesTruncated. +func (mr *MockValidatorIMockRecorder) TokensFromSharesTruncated(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromSharesTruncated", reflect.TypeOf((*MockValidatorI)(nil).TokensFromSharesTruncated), arg0) +} diff --git a/x/oracle/keeper/common/types.go b/x/oracle/keeper/common/types.go index 5777242e2..66db474ba 100644 --- a/x/oracle/keeper/common/types.go +++ b/x/oracle/keeper/common/types.go @@ -62,15 +62,45 @@ func (p Params) CheckRules(feederId int32, prices []*types.PriceWithSource) (boo //specified sources set, v1 use this rule to set `chainlink` as official source if rule.SourceIds != nil && len(rule.SourceIds) > 0 { if len(rule.SourceIds) != len(prices) { - return false, errors.New("") + return false, errors.New("count prices should match rule") } - for _, source := range rule.SourceIds { - for _, p := range prices { - if p.SourceId == source { + notFound := false + if rule.SourceIds[0] == 0 { + //match all sources listed + for sId, source := range p.Sources { + if sId == 0 { continue } + if source.Valid { + notFound = true + for _, p := range prices { + // fmt.Println("debug rules check _0, p.sourceid", p.SourceId) + if p.SourceId == int32(sId) { + notFound = false + // fmt.Println("debug rules match _0") + break + } + } + + } } - return false, errors.New("") + } else { + for _, source := range rule.SourceIds { + notFound = true + for _, p := range prices { + // fmt.Println("debug rules check, p.sourceid", p.SourceId) + if p.SourceId == source { + notFound = false + // fmt.Println("debug rules match") + break + } + } + //return false, errors.New("price source not match with rule") + } + } + if notFound { + // fmt.Println("debug rules check, rule.sources", rule.SourceIds) + return false, errors.New("price source not match with rule") } } diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index 4247f0088..a9fc27939 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -33,21 +33,22 @@ var _ common.KeeperOracle = Keeper{} func NewKeeper( cdc codec.BinaryCodec, - storeKey, + storeKey storetypes.StoreKey, memKey storetypes.StoreKey, ps paramtypes.Subspace, - -) *Keeper { + sKeeper stakingkeeper.Keeper, +) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { ps = ps.WithKeyTable(types.ParamKeyTable()) } - return &Keeper{ - cdc: cdc, - storeKey: storeKey, - memKey: memKey, - paramstore: ps, + return Keeper{ + cdc: cdc, + storeKey: storeKey, + memKey: memKey, + paramstore: ps, + stakingKeeper: sKeeper, } } diff --git a/x/oracle/keeper/keeper_suite_test.go b/x/oracle/keeper/keeper_suite_test.go new file mode 100644 index 000000000..19935f0e1 --- /dev/null +++ b/x/oracle/keeper/keeper_suite_test.go @@ -0,0 +1,41 @@ +package keeper_test + +import ( + "context" + "testing" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + gomock "go.uber.org/mock/gomock" +) + +type KeeperSuite struct { + t *testing.T + k keeper.Keeper + ctx sdk.Context + ms types.MsgServer + ctrl *gomock.Controller +} + +var ks *KeeperSuite + +func TestKeeper(t *testing.T) { + var ctxW context.Context + ks = &KeeperSuite{} + ks.ms, ctxW, ks.k = setupMsgServer(t) + ks.ctx = sdk.UnwrapSDKContext(ctxW) + ks.t = t + + RegisterFailHandler(Fail) + RunSpecs(t, "Keeper Suite") +} + +func (k *KeeperSuite) Reset() { + var ctxW context.Context + k.ms, ctxW, k.k = setupMsgServer(k.t) + k.ctx = sdk.UnwrapSDKContext(ctxW) + k.ctrl = gomock.NewController(k.t) +} diff --git a/x/oracle/keeper/mock_validator_test.go b/x/oracle/keeper/mock_validator_test.go new file mode 100644 index 000000000..927beef3d --- /dev/null +++ b/x/oracle/keeper/mock_validator_test.go @@ -0,0 +1,343 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/cosmos/cosmos-sdk/x/staking/types (interfaces: ValidatorI) +// +// Generated by this command: +// +// mockgen -destination mock_validator_test.go -package keeper_test github.com/cosmos/cosmos-sdk/x/staking/types ValidatorI +// + +// Package keeper_test is a generated GoMock package. +package keeper_test + +import ( + reflect "reflect" + + math "cosmossdk.io/math" + crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + types "github.com/cosmos/cosmos-sdk/crypto/types" + types0 "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/x/staking/types" + gomock "go.uber.org/mock/gomock" +) + +// MockValidatorI is a mock of ValidatorI interface. +type MockValidatorI struct { + ctrl *gomock.Controller + recorder *MockValidatorIMockRecorder +} + +// MockValidatorIMockRecorder is the mock recorder for MockValidatorI. +type MockValidatorIMockRecorder struct { + mock *MockValidatorI +} + +// NewMockValidatorI creates a new mock instance. +func NewMockValidatorI(ctrl *gomock.Controller) *MockValidatorI { + mock := &MockValidatorI{ctrl: ctrl} + mock.recorder = &MockValidatorIMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockValidatorI) EXPECT() *MockValidatorIMockRecorder { + return m.recorder +} + +// ConsPubKey mocks base method. +func (m *MockValidatorI) ConsPubKey() (types.PubKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ConsPubKey") + ret0, _ := ret[0].(types.PubKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ConsPubKey indicates an expected call of ConsPubKey. +func (mr *MockValidatorIMockRecorder) ConsPubKey() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsPubKey", reflect.TypeOf((*MockValidatorI)(nil).ConsPubKey)) +} + +// GetBondedTokens mocks base method. +func (m *MockValidatorI) GetBondedTokens() math.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBondedTokens") + ret0, _ := ret[0].(math.Int) + return ret0 +} + +// GetBondedTokens indicates an expected call of GetBondedTokens. +func (mr *MockValidatorIMockRecorder) GetBondedTokens() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBondedTokens", reflect.TypeOf((*MockValidatorI)(nil).GetBondedTokens)) +} + +// GetCommission mocks base method. +func (m *MockValidatorI) GetCommission() math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCommission") + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// GetCommission indicates an expected call of GetCommission. +func (mr *MockValidatorIMockRecorder) GetCommission() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCommission", reflect.TypeOf((*MockValidatorI)(nil).GetCommission)) +} + +// GetConsAddr mocks base method. +func (m *MockValidatorI) GetConsAddr() (types0.ConsAddress, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConsAddr") + ret0, _ := ret[0].(types0.ConsAddress) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetConsAddr indicates an expected call of GetConsAddr. +func (mr *MockValidatorIMockRecorder) GetConsAddr() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConsAddr", reflect.TypeOf((*MockValidatorI)(nil).GetConsAddr)) +} + +// GetConsensusPower mocks base method. +func (m *MockValidatorI) GetConsensusPower(arg0 math.Int) int64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConsensusPower", arg0) + ret0, _ := ret[0].(int64) + return ret0 +} + +// GetConsensusPower indicates an expected call of GetConsensusPower. +func (mr *MockValidatorIMockRecorder) GetConsensusPower(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConsensusPower", reflect.TypeOf((*MockValidatorI)(nil).GetConsensusPower), arg0) +} + +// GetDelegatorShares mocks base method. +func (m *MockValidatorI) GetDelegatorShares() math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDelegatorShares") + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// GetDelegatorShares indicates an expected call of GetDelegatorShares. +func (mr *MockValidatorIMockRecorder) GetDelegatorShares() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDelegatorShares", reflect.TypeOf((*MockValidatorI)(nil).GetDelegatorShares)) +} + +// GetMinSelfDelegation mocks base method. +func (m *MockValidatorI) GetMinSelfDelegation() math.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMinSelfDelegation") + ret0, _ := ret[0].(math.Int) + return ret0 +} + +// GetMinSelfDelegation indicates an expected call of GetMinSelfDelegation. +func (mr *MockValidatorIMockRecorder) GetMinSelfDelegation() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMinSelfDelegation", reflect.TypeOf((*MockValidatorI)(nil).GetMinSelfDelegation)) +} + +// GetMoniker mocks base method. +func (m *MockValidatorI) GetMoniker() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMoniker") + ret0, _ := ret[0].(string) + return ret0 +} + +// GetMoniker indicates an expected call of GetMoniker. +func (mr *MockValidatorIMockRecorder) GetMoniker() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMoniker", reflect.TypeOf((*MockValidatorI)(nil).GetMoniker)) +} + +// GetOperator mocks base method. +func (m *MockValidatorI) GetOperator() types0.ValAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOperator") + ret0, _ := ret[0].(types0.ValAddress) + return ret0 +} + +// GetOperator indicates an expected call of GetOperator. +func (mr *MockValidatorIMockRecorder) GetOperator() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperator", reflect.TypeOf((*MockValidatorI)(nil).GetOperator)) +} + +// GetStatus mocks base method. +func (m *MockValidatorI) GetStatus() types1.BondStatus { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetStatus") + ret0, _ := ret[0].(types1.BondStatus) + return ret0 +} + +// GetStatus indicates an expected call of GetStatus. +func (mr *MockValidatorIMockRecorder) GetStatus() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStatus", reflect.TypeOf((*MockValidatorI)(nil).GetStatus)) +} + +// GetTokens mocks base method. +func (m *MockValidatorI) GetTokens() math.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTokens") + ret0, _ := ret[0].(math.Int) + return ret0 +} + +// GetTokens indicates an expected call of GetTokens. +func (mr *MockValidatorIMockRecorder) GetTokens() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokens", reflect.TypeOf((*MockValidatorI)(nil).GetTokens)) +} + +// IsBonded mocks base method. +func (m *MockValidatorI) IsBonded() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsBonded") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsBonded indicates an expected call of IsBonded. +func (mr *MockValidatorIMockRecorder) IsBonded() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsBonded", reflect.TypeOf((*MockValidatorI)(nil).IsBonded)) +} + +// IsJailed mocks base method. +func (m *MockValidatorI) IsJailed() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsJailed") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsJailed indicates an expected call of IsJailed. +func (mr *MockValidatorIMockRecorder) IsJailed() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsJailed", reflect.TypeOf((*MockValidatorI)(nil).IsJailed)) +} + +// IsUnbonded mocks base method. +func (m *MockValidatorI) IsUnbonded() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsUnbonded") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsUnbonded indicates an expected call of IsUnbonded. +func (mr *MockValidatorIMockRecorder) IsUnbonded() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsUnbonded", reflect.TypeOf((*MockValidatorI)(nil).IsUnbonded)) +} + +// IsUnbonding mocks base method. +func (m *MockValidatorI) IsUnbonding() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsUnbonding") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsUnbonding indicates an expected call of IsUnbonding. +func (mr *MockValidatorIMockRecorder) IsUnbonding() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsUnbonding", reflect.TypeOf((*MockValidatorI)(nil).IsUnbonding)) +} + +// SharesFromTokens mocks base method. +func (m *MockValidatorI) SharesFromTokens(arg0 math.Int) (math.LegacyDec, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SharesFromTokens", arg0) + ret0, _ := ret[0].(math.LegacyDec) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SharesFromTokens indicates an expected call of SharesFromTokens. +func (mr *MockValidatorIMockRecorder) SharesFromTokens(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SharesFromTokens", reflect.TypeOf((*MockValidatorI)(nil).SharesFromTokens), arg0) +} + +// SharesFromTokensTruncated mocks base method. +func (m *MockValidatorI) SharesFromTokensTruncated(arg0 math.Int) (math.LegacyDec, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SharesFromTokensTruncated", arg0) + ret0, _ := ret[0].(math.LegacyDec) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SharesFromTokensTruncated indicates an expected call of SharesFromTokensTruncated. +func (mr *MockValidatorIMockRecorder) SharesFromTokensTruncated(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SharesFromTokensTruncated", reflect.TypeOf((*MockValidatorI)(nil).SharesFromTokensTruncated), arg0) +} + +// TmConsPublicKey mocks base method. +func (m *MockValidatorI) TmConsPublicKey() (crypto.PublicKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TmConsPublicKey") + ret0, _ := ret[0].(crypto.PublicKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// TmConsPublicKey indicates an expected call of TmConsPublicKey. +func (mr *MockValidatorIMockRecorder) TmConsPublicKey() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TmConsPublicKey", reflect.TypeOf((*MockValidatorI)(nil).TmConsPublicKey)) +} + +// TokensFromShares mocks base method. +func (m *MockValidatorI) TokensFromShares(arg0 math.LegacyDec) math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TokensFromShares", arg0) + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// TokensFromShares indicates an expected call of TokensFromShares. +func (mr *MockValidatorIMockRecorder) TokensFromShares(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromShares", reflect.TypeOf((*MockValidatorI)(nil).TokensFromShares), arg0) +} + +// TokensFromSharesRoundUp mocks base method. +func (m *MockValidatorI) TokensFromSharesRoundUp(arg0 math.LegacyDec) math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TokensFromSharesRoundUp", arg0) + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// TokensFromSharesRoundUp indicates an expected call of TokensFromSharesRoundUp. +func (mr *MockValidatorIMockRecorder) TokensFromSharesRoundUp(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromSharesRoundUp", reflect.TypeOf((*MockValidatorI)(nil).TokensFromSharesRoundUp), arg0) +} + +// TokensFromSharesTruncated mocks base method. +func (m *MockValidatorI) TokensFromSharesTruncated(arg0 math.LegacyDec) math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TokensFromSharesTruncated", arg0) + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// TokensFromSharesTruncated indicates an expected call of TokensFromSharesTruncated. +func (mr *MockValidatorIMockRecorder) TokensFromSharesTruncated(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromSharesTruncated", reflect.TypeOf((*MockValidatorI)(nil).TokensFromSharesTruncated), arg0) +} diff --git a/x/oracle/keeper/msg_server_create_price.go b/x/oracle/keeper/msg_server_create_price.go index 6a626e65a..ab6ba5a13 100644 --- a/x/oracle/keeper/msg_server_create_price.go +++ b/x/oracle/keeper/msg_server_create_price.go @@ -17,7 +17,7 @@ func (k msgServer) CreatePrice(goCtx context.Context, msg *types.MsgCreatePrice) //newItem, caches, _ := k.GetAggregatorContext(ctx, k.Keeper).NewCreatePrice(ctx, msg) newItem, caches, _ := GetAggregatorContext(ctx, k.Keeper).NewCreatePrice(ctx, msg) - + // fmt.Println("debug after NewCreatePrice", newItem, caches) if caches != nil { if newItem != nil { k.AppendPriceTR(ctx, newItem.TokenId, newItem.PriceTR) diff --git a/x/oracle/keeper/msg_server_create_price_test.go b/x/oracle/keeper/msg_server_create_price_test.go new file mode 100644 index 000000000..e1ac601af --- /dev/null +++ b/x/oracle/keeper/msg_server_create_price_test.go @@ -0,0 +1,131 @@ +package keeper_test + +import ( + "math/big" + reflect "reflect" + + "bou.ke/monkey" + math "cosmossdk.io/math" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/cache" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/testdata" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/testutil/mock" + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + gomock "go.uber.org/mock/gomock" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +//go:generate mockgen -destination mock_validator_test.go -package keeper_test github.com/cosmos/cosmos-sdk/x/staking/types ValidatorI + +var _ = Describe("MsgCreatePrice", func() { + var operator1, operator2, operator3 sdk.ValAddress + var c *cache.Cache + BeforeEach(func() { + ks.Reset() + Expect(ks.ms).ToNot(BeNil()) + + validatorC := NewMockValidatorI(ks.ctrl) + validatorC.EXPECT().GetBondedTokens().Return(math.NewInt(1)) + validatorC.EXPECT().GetBondedTokens().Return(math.NewInt(1)) + validatorC.EXPECT().GetBondedTokens().Return(math.NewInt(1)) + + validatorC.EXPECT().GetConsensusPower(gomock.Any()).Return(int64(1)) + validatorC.EXPECT().GetConsensusPower(gomock.Any()).Return(int64(1)) + validatorC.EXPECT().GetConsensusPower(gomock.Any()).Return(int64(1)) + + privVal1 := mock.NewPV() + pubKey1, _ := privVal1.GetPubKey() + operator1 = sdk.ValAddress(pubKey1.Address()) + + privVal2 := mock.NewPV() + pubKey2, _ := privVal2.GetPubKey() + operator2 = sdk.ValAddress(pubKey2.Address()) + + privVal3 := mock.NewPV() + pubKey3, _ := privVal3.GetPubKey() + operator3 = sdk.ValAddress(pubKey3.Address()) + + validatorC.EXPECT().GetOperator().Return(operator1) + validatorC.EXPECT().GetOperator().Return(operator2) + validatorC.EXPECT().GetOperator().Return(operator3) + + monkey.PatchInstanceMethod(reflect.TypeOf(keeper.Keeper{}), "IterateBondedValidatorsByPower", func(k keeper.Keeper, ctx sdk.Context, f func(index int64, validator stakingtypes.ValidatorI) bool) { + f(0, validatorC) + f(0, validatorC) + f(0, validatorC) + }) + monkey.PatchInstanceMethod(reflect.TypeOf(keeper.Keeper{}), "GetLastTotalPower", func(k keeper.Keeper, ctx sdk.Context) *big.Int { return big.NewInt(3) }) + + Expect(ks.ctx.BlockHeight()).To(Equal(int64(2))) + }) + + AfterEach(func() { + ks.ctrl.Finish() + }) + + Context("3 validators with 1 voting power each", func() { + BeforeEach(func() { + ks.ms.CreatePrice(ks.ctx, &types.MsgCreatePrice{ + Creator: operator1.String(), + FeederId: 1, + Prices: testdata.PS1, + BasedBlock: 1, + Nonce: 1, + }) + + c = keeper.GetCaches() + pRes := &common.Params{} + c.GetCache(cache.CacheItemP(pRes)) + Expect(*pRes).Should(BeEquivalentTo(types.DefaultParams())) + }) + + It("success on 3rd message", func() { + + iRes := make([]*cache.CacheItemM, 0) + c.GetCache(&iRes) + Expect(iRes[0].Validator).Should(Equal(operator1.String())) + + ks.ms.CreatePrice(ks.ctx, &types.MsgCreatePrice{ + Creator: operator2.String(), + FeederId: 1, + Prices: testdata.PS2, + BasedBlock: 1, + Nonce: 1, + }, + ) + ks.ms.CreatePrice(ks.ctx, &types.MsgCreatePrice{}) + c.GetCache(&iRes) + Expect(len(iRes)).Should(Equal(2)) + + ks.ms.CreatePrice(ks.ctx, &types.MsgCreatePrice{ + Creator: operator3.String(), + FeederId: 1, + Prices: testdata.PS4, + BasedBlock: 1, + Nonce: 1, + }, + ) + c.GetCache(&iRes) + Expect(len(iRes)).Should(Equal(0)) + prices := ks.k.GetAllPrices(sdk.UnwrapSDKContext(ks.ctx)) + //fmt.Println("GetAllPrices", prices[0]) + Expect(prices[0]).Should(BeEquivalentTo(types.Prices{ + TokenId: 1, + NextRountId: 2, + PriceList: []*types.PriceWithTimeAndRound{ + { + Price: testdata.PTD2.Price, + Decimal: testdata.PTD2.Decimal, + Timestamp: prices[0].PriceList[0].Timestamp, + RoundId: 1, + }, + }, + })) + }) + }) +}) diff --git a/x/oracle/keeper/msg_server_test.go b/x/oracle/keeper/msg_server_test.go index 6ebde0b24..b13973b15 100644 --- a/x/oracle/keeper/msg_server_test.go +++ b/x/oracle/keeper/msg_server_test.go @@ -8,16 +8,20 @@ import ( "github.com/ExocoreNetwork/exocore/x/oracle/keeper" "github.com/ExocoreNetwork/exocore/x/oracle/types" sdk "github.com/cosmos/cosmos-sdk/types" + + // "github.com/cosmos/ibc-go/testing/mock" + "github.com/stretchr/testify/require" ) -func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { +func setupMsgServer(t testing.TB) (types.MsgServer, context.Context, keeper.Keeper) { k, ctx := keepertest.OracleKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) + ctx = ctx.WithBlockHeight(2) + return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx), *k } func TestMsgServer(t *testing.T) { - ms, ctx := setupMsgServer(t) + ms, ctx, _ := setupMsgServer(t) require.NotNil(t, ms) require.NotNil(t, ctx) } diff --git a/x/oracle/keeper/params.go b/x/oracle/keeper/params.go index ff807b200..3c2e1f097 100644 --- a/x/oracle/keeper/params.go +++ b/x/oracle/keeper/params.go @@ -6,12 +6,35 @@ import ( ) // GetParams get all parameters as types.Params -func (k Keeper) GetParams(ctx sdk.Context) types.Params { - return types.NewParams() +//func (k Keeper) GetParams(ctx sdk.Context) types.Params { +// pRes := &types.Params{} +// k.paramstore.GetParamSet(ctx, pRes) +// return *pRes +// // return types.NewParams() +//} +// +//// SetParams set the params +//func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { +// //TODO: update the aggregator's params, call k.UpdateParams +// k.paramstore.SetParamSet(ctx, ¶ms) +//} + +func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ParamsKey) // return types.NewParams() + if bz != nil { + k.cdc.MustUnmarshal(bz, ¶ms) + } + return } // SetParams set the params -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - //TODO: update the aggregator's params, call k.UpdateParams - k.paramstore.SetParamSet(ctx, ¶ms) +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { + store := ctx.KVStore(k.storeKey) + bz, err := k.cdc.Marshal(¶ms) + if err != nil { + return err + } + store.Set(types.ParamsKey, bz) + return nil } diff --git a/x/oracle/keeper/prices.go b/x/oracle/keeper/prices.go index 3550592ad..ea98ddc86 100644 --- a/x/oracle/keeper/prices.go +++ b/x/oracle/keeper/prices.go @@ -10,13 +10,12 @@ import ( // SetPrices set a specific prices in the store from its index func (k Keeper) SetPrices(ctx sdk.Context, prices types.Prices) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) - store = prefix.NewStore(store, types.PricesKey(prices.TokenId)) + store := k.getPriceTRStore(ctx, prices.TokenId) for _, v := range prices.PriceList { b := k.cdc.MustMarshal(v) store.Set(types.PricesRoundKey(v.RoundId), b) } - store.Set(types.PricesNextRountIdKey, types.Uint64Bytes(uint64(prices.NextRountId))) + store.Set(types.PricesNextRountIdKey, types.Uint64Bytes(prices.NextRountId)) } // GetPrices returns a prices from its index @@ -25,20 +24,19 @@ func (k Keeper) GetPrices( tokenId int32, ) (val types.Prices, found bool) { - // store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) - // store = prefix.NewStore(store, types.PricesKey(tokenId)) store := k.getPriceTRStore(ctx, tokenId) - nextRoundIdB := store.Get(types.PricesNextRountIdKey) - if nextRoundIdB == nil { - return val, false - } + // nextRoundIdB := store.Get(types.PricesNextRountIdKey) + // if nextRoundIdB == nil { + // return val, false + // } - nextRoundId := binary.BigEndian.Uint64(nextRoundIdB) + // nextRoundId := binary.BigEndian.Uint64(nextRoundIdB) + nextRoundId := k.GetNextRoundId(ctx, tokenId) val.TokenId = tokenId val.NextRountId = nextRoundId val.PriceList = make([]*types.PriceWithTimeAndRound, nextRoundId) - //0 roundId is reserved + //0 roundId is reserved, expect the roundid corresponds to the slice index val.PriceList[0] = &types.PriceWithTimeAndRound{} for i := uint64(1); i < nextRoundId; i++ { b := store.Get(types.PricesRoundKey(i)) @@ -46,10 +44,11 @@ func (k Keeper) GetPrices( if b != nil { //should alwyas be true since we don't delete prices from history round k.cdc.MustUnmarshal(b, val.PriceList[i]) + found = true } } - return val, true + return } // RemovePrices removes a prices from the store @@ -58,8 +57,6 @@ func (k Keeper) RemovePrices( tokenId int32, ) { - // store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) - // store = prefix.NewStore(store, types.PricesKey(tokenId)) store := k.getPriceTRStore(ctx, tokenId) // iterator := sdk.KVStorePrefixIterator(store, []byte{}) iterator := store.Iterator(nil, nil) @@ -76,12 +73,31 @@ func (k Keeper) GetAllPrices(ctx sdk.Context) (list []types.Prices) { defer iterator.Close() + // prevTokenId := uint32(0) + // var val types.PriceWithTimeAndRound + var price types.Prices + prevTokenId := int32(0) for ; iterator.Valid(); iterator.Next() { - var val types.Prices - k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) + tokenId, _, nextRoundId := parseKey(iterator.Key()) + if prevTokenId == 0 { + prevTokenId = tokenId + price.TokenId = tokenId + } else if prevTokenId != tokenId && price.TokenId > 0 { + list = append(list, price) + prevTokenId = tokenId + price = types.Prices{TokenId: tokenId} + } + if nextRoundId { + price.NextRountId = binary.BigEndian.Uint64(iterator.Value()) + } else { + var val types.PriceWithTimeAndRound + k.cdc.Unmarshal(iterator.Value(), &val) + price.PriceList = append(price.PriceList, &val) + } + } + if price.TokenId > 0 { + list = append(list, price) } - return } @@ -93,13 +109,13 @@ func (k Keeper) AppendPriceTR(ctx sdk.Context, tokenId int32, priceTR types.Pric store := k.getPriceTRStore(ctx, tokenId) b := k.cdc.MustMarshal(&priceTR) store.Set(types.PricesRoundKey(nextRoundId), b) + k.IncreaseNextRoundId(ctx, tokenId) } //func(k Keeper) SetPriceTR(ctx sdk.Context, tokenId int32, priceTR){} func (k Keeper) GetPriceTRRoundId(ctx sdk.Context, tokenId int32, roundId uint64) (price types.PriceWithTimeAndRound, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) - store = prefix.NewStore(store, types.PricesKey(tokenId)) + store := k.getPriceTRStore(ctx, tokenId) b := store.Get(types.PricesRoundKey(roundId)) if b == nil { @@ -135,11 +151,23 @@ func (k Keeper) GetNextRoundId(ctx sdk.Context, tokenId int32) (nextRoundId uint store := k.getPriceTRStore(ctx, tokenId) nextRoundIdB := store.Get(types.PricesNextRountIdKey) if nextRoundIdB != nil { - nextRoundId = binary.BigEndian.Uint64(nextRoundIdB) + if nextRoundId = binary.BigEndian.Uint64(nextRoundIdB); nextRoundId == 0 { + nextRoundId = 1 + } } return } +func (k Keeper) IncreaseNextRoundId(ctx sdk.Context, tokenId int32) error { + //store := getPriceTRStore(ctx, k.storeKey, tokenId) + store := k.getPriceTRStore(ctx, tokenId) + nextRoundId := k.GetNextRoundId(ctx, tokenId) + b := make([]byte, 8) + binary.BigEndian.PutUint64(b, nextRoundId+1) + store.Set(types.PricesNextRountIdKey, b) + return nil +} + //func getPriceTRStore(ctx sdk.Context, storeKey storetypes.StoreKey, tokenId int32) prefix.Store { // store := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(types.PricesKeyPrefix)) // return prefix.NewStore(store, types.PricesKey(tokenId)) @@ -149,3 +177,13 @@ func (k Keeper) getPriceTRStore(ctx sdk.Context, tokenId int32) prefix.Store { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) return prefix.NewStore(store, types.PricesKey(tokenId)) } + +func parseKey(key []byte) (tokenId int32, roundId uint64, nextRoundId bool) { + tokenId = int32(binary.BigEndian.Uint32(key[:4])) + if len(key) == 17 { + nextRoundId = true + return + } + roundId = binary.BigEndian.Uint64(key[5:13]) + return +} diff --git a/x/oracle/keeper/prices_test.go b/x/oracle/keeper/prices_test.go index f5ca786f3..423deeec9 100644 --- a/x/oracle/keeper/prices_test.go +++ b/x/oracle/keeper/prices_test.go @@ -7,6 +7,7 @@ import ( keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" "github.com/ExocoreNetwork/exocore/testutil/nullify" "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/testdata" "github.com/ExocoreNetwork/exocore/x/oracle/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -18,8 +19,18 @@ var _ = strconv.IntSize func createNPrices(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.Prices { items := make([]types.Prices, n) for i := range items { - items[i].TokenId = int32(i) - + items[i].TokenId = int32(i + 1) + items[i] = types.Prices{ + TokenId: int32(i + 1), + NextRountId: 2, + PriceList: []*types.PriceWithTimeAndRound{ + testdata.PTR1, + testdata.PTR2, + testdata.PTR3, + testdata.PTR4, + testdata.PTR5, + }, + } keeper.SetPrices(ctx, items[i]) } return items @@ -27,17 +38,24 @@ func createNPrices(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.Prices func TestPricesGet(t *testing.T) { keeper, ctx := keepertest.OracleKeeper(t) - items := createNPrices(keeper, ctx, 10) - for _, item := range items { - rst, found := keeper.GetPrices(ctx, - item.TokenId, - ) - require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&rst), - ) - } + keeper.SetPrices(ctx, testdata.P1) + rst, found := keeper.GetPrices(ctx, 1) + require.True(t, found) + pRes := testdata.P1 + pRes.PriceList = append([]*types.PriceWithTimeAndRound{{}}, testdata.P1.PriceList...) + require.Equal(t, pRes, rst) + // items := createNPrices(keeper, ctx, 10) + // + // for _, item := range items { + // rst, found := keeper.GetPrices(ctx, + // item.TokenId, + // ) + // require.True(t, found) + // require.Equal(t, + // nullify.Fill(&item), + // nullify.Fill(&rst), + // ) + // } } func TestPricesRemove(t *testing.T) { keeper, ctx := keepertest.OracleKeeper(t) diff --git a/x/oracle/keeper/query_prices.go b/x/oracle/keeper/query_prices.go index a51effb04..cf1543b01 100644 --- a/x/oracle/keeper/query_prices.go +++ b/x/oracle/keeper/query_prices.go @@ -4,40 +4,39 @@ import ( "context" "github.com/ExocoreNetwork/exocore/x/oracle/types" - "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) -func (k Keeper) PricesAll(goCtx context.Context, req *types.QueryAllPricesRequest) (*types.QueryAllPricesResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - var pricess []types.Prices - ctx := sdk.UnwrapSDKContext(goCtx) - - store := ctx.KVStore(k.storeKey) - pricesStore := prefix.NewStore(store, types.KeyPrefix(types.PricesKeyPrefix)) - - pageRes, err := query.Paginate(pricesStore, req.Pagination, func(key []byte, value []byte) error { - var prices types.Prices - if err := k.cdc.Unmarshal(value, &prices); err != nil { - return err - } - - pricess = append(pricess, prices) - return nil - }) - - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllPricesResponse{Prices: pricess, Pagination: pageRes}, nil -} +//func (k Keeper) PricesAll(goCtx context.Context, req *types.QueryAllPricesRequest) (*types.QueryAllPricesResponse, error) { +// if req == nil { +// return nil, status.Error(codes.InvalidArgument, "invalid request") +// } +// +// var pricess []types.Prices +// ctx := sdk.UnwrapSDKContext(goCtx) +// +// store := ctx.KVStore(k.storeKey) +// pricesStore := prefix.NewStore(store, types.KeyPrefix(types.PricesKeyPrefix)) +// pricesTokenStore := prefix.NewStore(pricesStore, types.PricesKey(tokenId)) +// +// pageRes, err := query.Paginate(pricesTokenStore, req.Pagination, func(key []byte, value []byte) error { +// var prices types.Prices +// if err := k.cdc.Unmarshal(value, &prices); err != nil { +// return err +// } +// +// pricess = append(pricess, prices) +// return nil +// }) +// +// if err != nil { +// return nil, status.Error(codes.Internal, err.Error()) +// } +// +// return &types.QueryAllPricesResponse{Prices: pricess, Pagination: pageRes}, nil +//} func (k Keeper) Prices(goCtx context.Context, req *types.QueryGetPricesRequest) (*types.QueryGetPricesResponse, error) { if req == nil { diff --git a/x/oracle/keeper/query_prices_test.go b/x/oracle/keeper/query_prices_test.go index cf4ba6eca..b59930787 100644 --- a/x/oracle/keeper/query_prices_test.go +++ b/x/oracle/keeper/query_prices_test.go @@ -5,7 +5,6 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -70,58 +69,58 @@ func TestPricesQuerySingle(t *testing.T) { } } -func TestPricesQueryPaginated(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNPrices(keeper, ctx, 5) - - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllPricesRequest { - return &types.QueryAllPricesRequest{ - Pagination: &query.PageRequest{ - Key: next, - Offset: offset, - Limit: limit, - CountTotal: total, - }, - } - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(msgs); i += step { - resp, err := keeper.PricesAll(wctx, request(nil, uint64(i), uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.Prices), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.Prices), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(msgs); i += step { - resp, err := keeper.PricesAll(wctx, request(next, 0, uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.Prices), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.Prices), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - resp, err := keeper.PricesAll(wctx, request(nil, 0, 0, true)) - require.NoError(t, err) - require.Equal(t, len(msgs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(msgs), - nullify.Fill(resp.Prices), - ) - }) - t.Run("InvalidRequest", func(t *testing.T) { - _, err := keeper.PricesAll(wctx, nil) - require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) - }) -} +//func TestPricesQueryPaginated(t *testing.T) { +// keeper, ctx := keepertest.OracleKeeper(t) +// wctx := sdk.WrapSDKContext(ctx) +// msgs := createNPrices(keeper, ctx, 5) +// +// request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllPricesRequest { +// return &types.QueryAllPricesRequest{ +// Pagination: &query.PageRequest{ +// Key: next, +// Offset: offset, +// Limit: limit, +// CountTotal: total, +// }, +// } +// } +// t.Run("ByOffset", func(t *testing.T) { +// step := 2 +// for i := 0; i < len(msgs); i += step { +// resp, err := keeper.PricesAll(wctx, request(nil, uint64(i), uint64(step), false)) +// require.NoError(t, err) +// require.LessOrEqual(t, len(resp.Prices), step) +// require.Subset(t, +// nullify.Fill(msgs), +// nullify.Fill(resp.Prices), +// ) +// } +// }) +// t.Run("ByKey", func(t *testing.T) { +// step := 2 +// var next []byte +// for i := 0; i < len(msgs); i += step { +// resp, err := keeper.PricesAll(wctx, request(next, 0, uint64(step), false)) +// require.NoError(t, err) +// require.LessOrEqual(t, len(resp.Prices), step) +// require.Subset(t, +// nullify.Fill(msgs), +// nullify.Fill(resp.Prices), +// ) +// next = resp.Pagination.NextKey +// } +// }) +// t.Run("Total", func(t *testing.T) { +// resp, err := keeper.PricesAll(wctx, request(nil, 0, 0, true)) +// require.NoError(t, err) +// require.Equal(t, len(msgs), int(resp.Pagination.Total)) +// require.ElementsMatch(t, +// nullify.Fill(msgs), +// nullify.Fill(resp.Prices), +// ) +// }) +// t.Run("InvalidRequest", func(t *testing.T) { +// _, err := keeper.PricesAll(wctx, nil) +// require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) +// }) +//} diff --git a/x/oracle/keeper/query_validators.go b/x/oracle/keeper/query_validators.go deleted file mode 100644 index 959e7148c..000000000 --- a/x/oracle/keeper/query_validators.go +++ /dev/null @@ -1,24 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/ExocoreNetwork/exocore/x/oracle/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) Validators(goCtx context.Context, req *types.QueryGetValidatorsRequest) (*types.QueryGetValidatorsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(goCtx) - - val, found := k.GetValidators(ctx) - if !found { - return nil, status.Error(codes.NotFound, "not found") - } - - return &types.QueryGetValidatorsResponse{Validators: val}, nil -} diff --git a/x/oracle/keeper/query_validators_test.go b/x/oracle/keeper/query_validators_test.go deleted file mode 100644 index aa81a9dcb..000000000 --- a/x/oracle/keeper/query_validators_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package keeper_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" - "github.com/ExocoreNetwork/exocore/testutil/nullify" - "github.com/ExocoreNetwork/exocore/x/oracle/types" -) - -func TestValidatorsQuery(t *testing.T) { - keeper, ctx := keepertest.OracleKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - item := createTestValidators(keeper, ctx) - tests := []struct { - desc string - request *types.QueryGetValidatorsRequest - response *types.QueryGetValidatorsResponse - err error - }{ - { - desc: "First", - request: &types.QueryGetValidatorsRequest{}, - response: &types.QueryGetValidatorsResponse{Validators: item}, - }, - { - desc: "InvalidRequest", - err: status.Error(codes.InvalidArgument, "invalid request"), - }, - } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - response, err := keeper.Validators(wctx, tc.request) - if tc.err != nil { - require.ErrorIs(t, err, tc.err) - } else { - require.NoError(t, err) - require.Equal(t, - nullify.Fill(tc.response), - nullify.Fill(response), - ) - } - }) - } -} diff --git a/x/oracle/keeper/single.go b/x/oracle/keeper/single.go index 3091be3ed..4082b6068 100644 --- a/x/oracle/keeper/single.go +++ b/x/oracle/keeper/single.go @@ -129,7 +129,8 @@ func initAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k validatorPowers := make(map[string]*big.Int) k.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingtypes.ValidatorI) bool { power := big.NewInt(validator.GetConsensusPower(validator.GetBondedTokens())) - addr := string(validator.GetOperator()) + //addr := string(validator.GetOperator()) + addr := validator.GetOperator().String() //agc.validatorsPower[addr] = power validatorPowers[addr] = power totalPower = new(big.Int).Add(totalPower, power) diff --git a/x/oracle/keeper/testdata/helper.go b/x/oracle/keeper/testdata/helper.go new file mode 100644 index 000000000..d30da821d --- /dev/null +++ b/x/oracle/keeper/testdata/helper.go @@ -0,0 +1,36 @@ +package testdata + +import "github.com/ExocoreNetwork/exocore/x/oracle/types" + +func newPTD(detId, price string) *types.PriceWithTimeAndDetId { + return &types.PriceWithTimeAndDetId{ + Price: price, + Decimal: 18, + Timestamp: "-", + DetId: detId, + } +} + +func newPS(sourceId int32, prices ...*types.PriceWithTimeAndDetId) *types.PriceWithSource { + return &types.PriceWithSource{ + SourceId: sourceId, + Prices: prices, + } +} + +func newPTR(price string, roundId uint64) *types.PriceWithTimeAndRound { + return &types.PriceWithTimeAndRound{ + Price: price, + Decimal: 18, + Timestamp: "", + RoundId: roundId, + } +} + +func newPrices(tokenId int32, nextRoundId uint64, pList ...*types.PriceWithTimeAndRound) types.Prices { + return types.Prices{ + TokenId: tokenId, + NextRountId: nextRoundId, + PriceList: pList, + } +} diff --git a/x/oracle/keeper/testdata/info.go b/x/oracle/keeper/testdata/info.go new file mode 100644 index 000000000..ef5dc165c --- /dev/null +++ b/x/oracle/keeper/testdata/info.go @@ -0,0 +1,64 @@ +package testdata + +import ( + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +var ( + One = big.NewInt(1) + Zero = big.NewInt(0) + Ten = big.NewInt(10) + Eleven = big.NewInt(11) + Fifteen = big.NewInt(15) + Twenty = big.NewInt(20) +) + +var ( + PTD1 = newPTD("1", "10") + PTD2 = newPTD("2", "12") + PTD3 = newPTD("3", "15") + PTD2M = newPTD("2", "11") + PTD3M = newPTD("3", "19") + //1-10, 2-12 + PS1 = []*types.PriceWithSource{newPS(1, PTD1, PTD2)} + //2-12, 3-1 + PS2 = []*types.PriceWithSource{newPS(1, PTD3, PTD2)} + //1-10, 2-11(m) + PS3 = []*types.PriceWithSource{newPS(1, PTD1, PTD2M)} + //2-12, 3-19(m) + PS4 = []*types.PriceWithSource{newPS(1, PTD2, PTD3M)} + //1-10, 3-19(m) + PS5 = []*types.PriceWithSource{newPS(1, PTD1, PTD3M)} + + PS6 = []*types.PriceWithSource{newPS(2, PTD1)} + + //1-10, 2-12 + PS21 = []*types.PriceWithSource{newPS(1, PTD1, PTD2), newPS(2, PTD1, PTD3)} + //2-12, 3-15 + PS22 = []*types.PriceWithSource{newPS(1, PTD3, PTD2), newPS(2, PTD2, PTD3)} + //1-10, 2-11(m) + PS23 = []*types.PriceWithSource{newPS(1, PTD1, PTD2M), newPS(2, PTD2M, PTD1)} + //2-12, 3-19(m) + PS24 = []*types.PriceWithSource{newPS(1, PTD2, PTD3M), newPS(2, PTD3, PTD2M)} + //1-10, 3-19(m) + PS25 = []*types.PriceWithSource{newPS(1, PTD1, PTD3M), newPS(2, PTD2M, PTD3M)} +) + +var ( + PTR1 = newPTR("100", 1) + PTR2 = newPTR("109", 2) + PTR3 = newPTR("117", 3) + PTR4 = newPTR("129", 4) + PTR5 = newPTR("121", 5) + P1 = newPrices(1, 6, PTR1, PTR2, PTR3, PTR4, PTR5) +) + +var DefaultParams = types.Params{ + Chains: []*types.Chain{{Name: "-", Desc: "-"}, {Name: "Ethereum", Desc: "-"}}, + Tokens: []*types.Token{{}, {Name: "eth", ChainId: 1, ContractAddress: "0xabc", Decimal: 18, Active: true}}, + Sources: []*types.Source{{}, {Name: "chainLink", Entry: &types.Endpoint{}, Valid: true, Deterministic: true}}, + Rules: []*types.RuleWithSource{{}, {SourceIds: []int32{1}}}, + TokenFeeders: []*types.TokenFeeder{{}, {TokenId: 1, RuleId: 1, StartRoundId: 1, StartBaseBlock: 0, Interval: 10, EndBlock: 0}}, +} diff --git a/x/oracle/types/codec.go b/x/oracle/types/codec.go index 0571d71fa..d8e9b828d 100644 --- a/x/oracle/types/codec.go +++ b/x/oracle/types/codec.go @@ -9,6 +9,7 @@ import ( func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgCreatePrice{}, "oracle/CreatePrice", nil) + cdc.RegisterConcrete(Params{}, "exocore/x/oracle/Params", nil) // this line is used by starport scaffolding # 2 } diff --git a/x/oracle/types/key_prices.go b/x/oracle/types/key_prices.go index dc4f37718..02ecf8204 100644 --- a/x/oracle/types/key_prices.go +++ b/x/oracle/types/key_prices.go @@ -10,7 +10,7 @@ const ( ) // PricesNextRoundIdKey is the key set for each tokenId storeKV to store the next round id -var PricesNextRountIdKey = []byte("tokenId/") +var PricesNextRountIdKey = []byte("nextRoundId/") // PricesKey returns the store key to retrieve a Prices from the index fields // this key is actually used as the prefix for kvsotre, TODO: refactor to PriceTokenPrefix diff --git a/x/oracle/types/keys.go b/x/oracle/types/keys.go index c80ab4aa1..eba4197e8 100644 --- a/x/oracle/types/keys.go +++ b/x/oracle/types/keys.go @@ -14,6 +14,10 @@ const ( MemStoreKey = "mem_oracle" ) +var ( + ParamsKey = []byte{0x11} +) + func KeyPrefix(p string) []byte { return []byte(p) } diff --git a/x/oracle/types/params.go b/x/oracle/types/params.go index 77d7d59f4..df898a566 100644 --- a/x/oracle/types/params.go +++ b/x/oracle/types/params.go @@ -27,12 +27,79 @@ func NewParams() Params { // DefaultParams returns a default set of parameters func DefaultParams() Params { - return NewParams() + return Params{ + Chains: []*Chain{ + {Name: "-", Desc: "-"}, + {Name: "Ethereum", Desc: "-"}, + }, + Tokens: []*Token{ + { + Name: "ETH", + ChainId: 1, + ContractAddress: "0x", + Decimal: 18, + Active: true, + }, + { + Name: "SHIBA INU", + ChainId: 1, + ContractAddress: "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE", + Decimal: 18, + Active: true, + }, + }, + Sources: []*Source{ + { + Name: "0 position is reserved", + }, + { + Name: "Chainlink", + Entry: &Endpoint{ + Offchain: map[int32]string{0: ""}, + }, + Valid: true, + Deterministic: true, + }, + }, + Rules: []*RuleWithSource{ + //0 is reserved + { + SourceIds: []int32{-1}, + }, + { + //all sources math + SourceIds: []int32{0}, + }, + }, + TokenFeeders: []*TokenFeeder{ + {}, + { + TokenId: 1, + RuleId: 1, + StartRoundId: 1, + StartBaseBlock: 1, + Interval: 10, + }, + { + TokenId: 2, + RuleId: 1, + StartRoundId: 1, + StartBaseBlock: 5, + Interval: 10, + }, + }, + } } // ParamSetPairs get the params.ParamSet func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{} + return paramtypes.ParamSetPairs{ + paramtypes.NewParamSetPair([]byte("chains"), &p.Chains, func(_ interface{}) error { return nil }), + paramtypes.NewParamSetPair([]byte("tokens"), &p.Tokens, func(_ interface{}) error { return nil }), + paramtypes.NewParamSetPair([]byte("sources"), &p.Sources, func(_ interface{}) error { return nil }), + paramtypes.NewParamSetPair([]byte("rules"), &p.Rules, func(_ interface{}) error { return nil }), + paramtypes.NewParamSetPair([]byte("tokenfeeders"), &p.TokenFeeders, func(_ interface{}) error { return nil }), + } } // Validate validates the set of params From 5d08798639248ee50ac2bbf2cf80b2638779f24c Mon Sep 17 00:00:00 2001 From: leonz789 Date: Tue, 2 Apr 2024 23:57:37 +0800 Subject: [PATCH 28/37] test(oracle-keeper):add keeper test --- app/app.go | 3 +- go.mod | 4 +- x/oracle/client/cli/query.go | 2 +- x/oracle/client/cli/query_prices.go | 70 ++++---- x/oracle/client/cli/query_prices_test.go | 131 +++++++-------- .../bak/msg_server_create_price_test.bak | 131 --------------- x/oracle/types/genesis_test.go | 3 - x/oracle/types/params.go | 12 +- x/oracle/types/query.pb.go | 159 +++++++----------- x/oracle/types/query.pb.gw.go | 83 --------- 10 files changed, 172 insertions(+), 426 deletions(-) delete mode 100644 x/oracle/keeper/bak/msg_server_create_price_test.bak diff --git a/app/app.go b/app/app.go index c67779efc..84ccbd786 100644 --- a/app/app.go +++ b/app/app.go @@ -1282,7 +1282,8 @@ func initParamsKeeper( paramsKeeper.Subspace(ibcexported.ModuleName) paramsKeeper.Subspace(icahosttypes.SubModuleName) // ethermint subspaces - paramsKeeper.Subspace(evmtypes.ModuleName).WithKeyTable(evmtypes.ParamKeyTable()) //nolint: staticcheck + paramsKeeper.Subspace(evmtypes.ModuleName).WithKeyTable(evmtypes.ParamKeyTable()) //nolint:staticcheck + paramsKeeper.Subspace(oracleTypes.ModuleName).WithKeyTable(oracleTypes.ParamKeyTable()) //nolint:staticcheck return paramsKeeper } diff --git a/go.mod b/go.mod index 7d6d83c5e..76c2659cc 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/ExocoreNetwork/exocore go 1.21 require ( + bou.ke/monkey v1.0.2 cosmossdk.io/errors v1.0.0 cosmossdk.io/math v1.0.1 cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d @@ -31,6 +32,7 @@ require ( github.com/spf13/viper v1.16.0 github.com/stretchr/testify v1.8.4 go.opencensus.io v0.24.0 + go.uber.org/mock v0.4.0 golang.org/x/crypto v0.21.0 golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 @@ -58,7 +60,6 @@ require ( ) require ( - bou.ke/monkey v1.0.2 // indirect cloud.google.com/go v0.110.6 // indirect cloud.google.com/go/compute v1.23.0 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect @@ -200,7 +201,6 @@ require ( github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/ledger-go v0.14.1 // indirect go.etcd.io/bbolt v1.3.7 // indirect - go.uber.org/mock v0.4.0 // indirect golang.org/x/oauth2 v0.8.0 // indirect golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.18.0 // indirect diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go index 323eb82f9..81d7a0d12 100644 --- a/x/oracle/client/cli/query.go +++ b/x/oracle/client/cli/query.go @@ -25,7 +25,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { } cmd.AddCommand(CmdQueryParams()) - cmd.AddCommand(CmdListPrices()) + //cmd.AddCommand(CmdListPrices()) cmd.AddCommand(CmdShowPrices()) cmd.AddCommand(CmdShowValidatorUpdateBlock()) cmd.AddCommand(CmdShowIndexRecentParams()) diff --git a/x/oracle/client/cli/query_prices.go b/x/oracle/client/cli/query_prices.go index 352f1947a..50050446b 100644 --- a/x/oracle/client/cli/query_prices.go +++ b/x/oracle/client/cli/query_prices.go @@ -9,41 +9,41 @@ import ( "github.com/spf13/cast" ) -func CmdListPrices() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-prices", - Short: "list all prices", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAllPricesRequest{ - Pagination: pageReq, - } - - res, err := queryClient.PricesAll(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} +//func CmdListPrices() *cobra.Command { +// cmd := &cobra.Command{ +// Use: "list-prices", +// Short: "list all prices", +// RunE: func(cmd *cobra.Command, args []string) error { +// clientCtx, err := client.GetClientQueryContext(cmd) +// if err != nil { +// return err +// } +// +// pageReq, err := client.ReadPageRequest(cmd.Flags()) +// if err != nil { +// return err +// } +// +// queryClient := types.NewQueryClient(clientCtx) +// +// params := &types.QueryAllPricesRequest{ +// Pagination: pageReq, +// } +// +// res, err := queryClient.PricesAll(cmd.Context(), params) +// if err != nil { +// return err +// } +// +// return clientCtx.PrintProto(res) +// }, +// } +// +// flags.AddPaginationFlagsToCmd(cmd, cmd.Use) +// flags.AddQueryFlagsToCmd(cmd) +// +// return cmd +//} func CmdShowPrices() *cobra.Command { cmd := &cobra.Command{ diff --git a/x/oracle/client/cli/query_prices_test.go b/x/oracle/client/cli/query_prices_test.go index 34ce7d8bc..48346ecb2 100644 --- a/x/oracle/client/cli/query_prices_test.go +++ b/x/oracle/client/cli/query_prices_test.go @@ -6,7 +6,6 @@ import ( "testing" tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" @@ -93,68 +92,68 @@ func TestShowPrices(t *testing.T) { } } -func TestListPrices(t *testing.T) { - net, objs := networkWithPricesObjects(t, 5) - - ctx := net.Validators[0].ClientCtx - request := func(next []byte, offset, limit uint64, total bool) []string { - args := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - if next == nil { - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) - } else { - args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) - } - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) - if total { - args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) - } - return args - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(objs); i += step { - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListPrices(), args) - require.NoError(t, err) - var resp types.QueryAllPricesResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.Prices), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.Prices), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(objs); i += step { - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListPrices(), args) - require.NoError(t, err) - var resp types.QueryAllPricesResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.Prices), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.Prices), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListPrices(), args) - require.NoError(t, err) - var resp types.QueryAllPricesResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NoError(t, err) - require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(objs), - nullify.Fill(resp.Prices), - ) - }) -} +//func TestListPrices(t *testing.T) { +// net, objs := networkWithPricesObjects(t, 5) +// +// ctx := net.Validators[0].ClientCtx +// request := func(next []byte, offset, limit uint64, total bool) []string { +// args := []string{ +// fmt.Sprintf("--%s=json", tmcli.OutputFlag), +// } +// if next == nil { +// args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) +// } else { +// args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) +// } +// args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) +// if total { +// args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) +// } +// return args +// } +// t.Run("ByOffset", func(t *testing.T) { +// step := 2 +// for i := 0; i < len(objs); i += step { +// args := request(nil, uint64(i), uint64(step), false) +// out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListPrices(), args) +// require.NoError(t, err) +// var resp types.QueryAllPricesResponse +// require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) +// require.LessOrEqual(t, len(resp.Prices), step) +// require.Subset(t, +// nullify.Fill(objs), +// nullify.Fill(resp.Prices), +// ) +// } +// }) +// t.Run("ByKey", func(t *testing.T) { +// step := 2 +// var next []byte +// for i := 0; i < len(objs); i += step { +// args := request(next, 0, uint64(step), false) +// out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListPrices(), args) +// require.NoError(t, err) +// var resp types.QueryAllPricesResponse +// require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) +// require.LessOrEqual(t, len(resp.Prices), step) +// require.Subset(t, +// nullify.Fill(objs), +// nullify.Fill(resp.Prices), +// ) +// next = resp.Pagination.NextKey +// } +// }) +// t.Run("Total", func(t *testing.T) { +// args := request(nil, 0, uint64(len(objs)), true) +// out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListPrices(), args) +// require.NoError(t, err) +// var resp types.QueryAllPricesResponse +// require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) +// require.NoError(t, err) +// require.Equal(t, len(objs), int(resp.Pagination.Total)) +// require.ElementsMatch(t, +// nullify.Fill(objs), +// nullify.Fill(resp.Prices), +// ) +// }) +//} diff --git a/x/oracle/keeper/bak/msg_server_create_price_test.bak b/x/oracle/keeper/bak/msg_server_create_price_test.bak deleted file mode 100644 index 8b792f58f..000000000 --- a/x/oracle/keeper/bak/msg_server_create_price_test.bak +++ /dev/null @@ -1,131 +0,0 @@ -func TestCreatePrice(t *testing.T) { - ms, ctx, k := setupMsgServer(t) - require.NotNil(t, ms) - require.NotNil(t, ctx) - - ctrl := gomock.NewController(t) - validatorC := NewMockValidatorI(ctrl) - validatorC.EXPECT().GetBondedTokens().Return(math.NewInt(1)) - validatorC.EXPECT().GetBondedTokens().Return(math.NewInt(1)) - validatorC.EXPECT().GetBondedTokens().Return(math.NewInt(1)) - - validatorC.EXPECT().GetConsensusPower(gomock.Any()).Return(int64(1)) - validatorC.EXPECT().GetConsensusPower(gomock.Any()).Return(int64(1)) - validatorC.EXPECT().GetConsensusPower(gomock.Any()).Return(int64(1)) - - privVal1 := mock.NewPV() - pubKey1, _ := privVal1.GetPubKey() - operator1 := sdk.ValAddress(pubKey1.Address()) - - privVal2 := mock.NewPV() - pubKey2, _ := privVal2.GetPubKey() - operator2 := sdk.ValAddress(pubKey2.Address()) - - privVal3 := mock.NewPV() - pubKey3, _ := privVal3.GetPubKey() - operator3 := sdk.ValAddress(pubKey3.Address()) - - validatorC.EXPECT().GetOperator().Return(operator1) - validatorC.EXPECT().GetOperator().Return(operator2) - validatorC.EXPECT().GetOperator().Return(operator3) - - monkey.PatchInstanceMethod(reflect.TypeOf(keeper.Keeper{}), "IterateBondedValidatorsByPower", func(k keeper.Keeper, ctx sdk.Context, f func(index int64, validator stakingtypes.ValidatorI) bool) { - f(0, validatorC) - f(0, validatorC) - f(0, validatorC) - }) - monkey.PatchInstanceMethod(reflect.TypeOf(keeper.Keeper{}), "GetLastTotalPower", func(k keeper.Keeper, ctx sdk.Context) *big.Int { return big.NewInt(3) }) - wCtx := sdk.UnwrapSDKContext(ctx) - h := wCtx.BlockHeight() - assert.Equal(t, int64(2), h) - vpRes := make(map[string]*big.Int) - c := keeper.GetCaches() - c.GetCache(cache.CacheItemV(vpRes)) - // fmt.Println("Caches get validatorPowers", vpRes) - ms.CreatePrice(ctx, &types.MsgCreatePrice{ - Creator: operator1.String(), - FeederId: 1, - Prices: []*types.PriceWithSource{ - { - SourceId: 1, - Prices: []*types.PriceWithTimeAndDetId{ - { - Price: "1000", - Decimal: 1, - Timestamp: "", - DetId: "5", - }, - }, - Desc: "", - }, - }, - BasedBlock: 1, - Nonce: 1, - }, - ) - - pRes := &common.Params{} - c.GetCache(cache.CacheItemP(pRes)) - // fmt.Println("Caches get params", pRes) - - iRes := make([]*cache.CacheItemM, 0) - c.GetCache(&iRes) - //fmt.Println("Caches get itemM", len(iRes), iRes[0]) - - ms.CreatePrice(ctx, &types.MsgCreatePrice{ - Creator: operator2.String(), - FeederId: 1, - Prices: []*types.PriceWithSource{ - { - SourceId: 1, - Prices: []*types.PriceWithTimeAndDetId{ - { - Price: "1090", - Decimal: 1, - Timestamp: "", - DetId: "6", - }, - { - Price: "1000", - Decimal: 1, - Timestamp: "", - DetId: "5", - }, - }, - Desc: "", - }, - }, - BasedBlock: 1, - Nonce: 1, - }, - ) - ms.CreatePrice(ctx, &types.MsgCreatePrice{}) - c.GetCache(&iRes) - //fmt.Println("Caches get itemM", len(iRes), iRes[0], iRes[1]) - ms.CreatePrice(ctx, &types.MsgCreatePrice{ - Creator: operator3.String(), - FeederId: 1, - Prices: []*types.PriceWithSource{ - { - SourceId: 1, - Prices: []*types.PriceWithTimeAndDetId{ - { - Price: "1000", - Decimal: 1, - Timestamp: "", - DetId: "5", - }, - }, - Desc: "", - }, - }, - BasedBlock: 1, - Nonce: 1, - }, - ) - - c.GetCache(&iRes) - //fmt.Println("Caches get itemM", len(iRes)) - fmt.Println(k.GetAllPrices(sdk.UnwrapSDKContext(ctx))) - -} diff --git a/x/oracle/types/genesis_test.go b/x/oracle/types/genesis_test.go index d04c2ad20..5190f66f3 100644 --- a/x/oracle/types/genesis_test.go +++ b/x/oracle/types/genesis_test.go @@ -30,9 +30,6 @@ func TestGenesisState_Validate(t *testing.T) { TokenId: 1, }, }, - Validators: &types.Validators{ - Block: 45, - }, ValidatorUpdateBlock: &types.ValidatorUpdateBlock{}, IndexRecentParams: &types.IndexRecentParams{}, IndexRecentMsg: &types.IndexRecentMsg{}, diff --git a/x/oracle/types/params.go b/x/oracle/types/params.go index df898a566..3a7dc729b 100644 --- a/x/oracle/types/params.go +++ b/x/oracle/types/params.go @@ -9,7 +9,7 @@ var ( KeyChains = []byte("Chains") KeyTokens = []byte("Tokens") KeySources = []byte("Sources") - KeyRules = []byte("Sources") + KeyRules = []byte("Rules") KeyTokenFeeders = []byte("TokenFeeders") ) @@ -94,11 +94,11 @@ func DefaultParams() Params { // ParamSetPairs get the params.ParamSet func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair([]byte("chains"), &p.Chains, func(_ interface{}) error { return nil }), - paramtypes.NewParamSetPair([]byte("tokens"), &p.Tokens, func(_ interface{}) error { return nil }), - paramtypes.NewParamSetPair([]byte("sources"), &p.Sources, func(_ interface{}) error { return nil }), - paramtypes.NewParamSetPair([]byte("rules"), &p.Rules, func(_ interface{}) error { return nil }), - paramtypes.NewParamSetPair([]byte("tokenfeeders"), &p.TokenFeeders, func(_ interface{}) error { return nil }), + paramtypes.NewParamSetPair(KeyChains, &p.Chains, func(_ interface{}) error { return nil }), + paramtypes.NewParamSetPair(KeyTokens, &p.Tokens, func(_ interface{}) error { return nil }), + paramtypes.NewParamSetPair(KeySources, &p.Sources, func(_ interface{}) error { return nil }), + paramtypes.NewParamSetPair(KeyRules, &p.Rules, func(_ interface{}) error { return nil }), + paramtypes.NewParamSetPair(KeyTokenFeeders, &p.TokenFeeders, func(_ interface{}) error { return nil }), } } diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index b4fefb2bd..054cec294 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -931,68 +931,67 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/query.proto", fileDescriptor_f604621c8da1a6f3) } var fileDescriptor_f604621c8da1a6f3 = []byte{ - // 970 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0x41, 0x8f, 0xdb, 0x44, - 0x14, 0xc7, 0x33, 0xdd, 0xee, 0xa2, 0x1d, 0x56, 0x45, 0x0c, 0xa1, 0xda, 0xba, 0x8b, 0xb7, 0x9d, - 0x36, 0x6d, 0x4a, 0x5a, 0x7b, 0xb3, 0x09, 0x54, 0x20, 0x7a, 0xd8, 0x95, 0x68, 0x55, 0xa0, 0xd5, - 0x12, 0xa9, 0x1c, 0x7a, 0x20, 0x72, 0x92, 0xc1, 0x44, 0xeb, 0x78, 0x52, 0xdb, 0x29, 0x5b, 0xaa, - 0x4a, 0x88, 0x03, 0x12, 0xb7, 0x4a, 0x48, 0x70, 0xe0, 0x06, 0x07, 0xb8, 0x71, 0xe1, 0x03, 0x70, - 0xdc, 0xe3, 0x4a, 0x70, 0xe0, 0x84, 0xd0, 0x2e, 0x1f, 0x04, 0x79, 0xfc, 0x9c, 0xc4, 0xe3, 0xb1, - 0xe3, 0x54, 0xb9, 0xc5, 0x7e, 0xff, 0xf7, 0xde, 0xef, 0xbd, 0x79, 0xd6, 0x9b, 0x60, 0x8d, 0x1d, - 0xf0, 0x2e, 0xf7, 0x98, 0xc9, 0x3d, 0xab, 0xeb, 0x30, 0xf3, 0xd1, 0x88, 0x79, 0x4f, 0x8c, 0xa1, - 0xc7, 0x03, 0x4e, 0xce, 0x80, 0xcd, 0x88, 0x6c, 0x5a, 0xd9, 0xe6, 0x36, 0x17, 0x26, 0x33, 0xfc, - 0x15, 0xa9, 0xb4, 0x0d, 0x9b, 0x73, 0xdb, 0x61, 0xa6, 0x35, 0xec, 0x9b, 0x96, 0xeb, 0xf2, 0xc0, - 0x0a, 0xfa, 0xdc, 0xf5, 0xc1, 0xfa, 0x66, 0x97, 0xfb, 0x03, 0xee, 0x9b, 0x1d, 0xcb, 0x87, 0xe0, - 0xe6, 0xe3, 0x7a, 0x87, 0x05, 0x56, 0xdd, 0x1c, 0x5a, 0x76, 0xdf, 0x15, 0x62, 0xd0, 0x9e, 0x97, - 0x58, 0x86, 0x96, 0x67, 0x0d, 0xfc, 0x2c, 0xa3, 0xd7, 0xef, 0xb2, 0xd8, 0x58, 0x93, 0x8c, 0x8f, - 0x2d, 0xa7, 0xdf, 0xb3, 0x02, 0xee, 0xb5, 0x47, 0xc3, 0x9e, 0x15, 0xb0, 0x76, 0xc7, 0xe1, 0xdd, - 0x7d, 0x10, 0x57, 0x25, 0x71, 0xdf, 0xed, 0xb1, 0x83, 0xb6, 0xc7, 0xba, 0xcc, 0x0d, 0xda, 0x89, - 0x9c, 0x95, 0x3c, 0xe5, 0xc0, 0xb7, 0x41, 0xb6, 0x29, 0xc9, 0x52, 0x02, 0xaa, 0x16, 0x4c, 0xe7, - 0xa2, 0x65, 0x4c, 0x3e, 0x0e, 0xdb, 0xb3, 0x27, 0x5e, 0xb6, 0xd8, 0xa3, 0x11, 0xf3, 0x03, 0xfa, - 0x21, 0x7e, 0x2d, 0xf1, 0xd6, 0x1f, 0x72, 0xd7, 0x67, 0xa4, 0x89, 0x57, 0x22, 0xe7, 0x75, 0x74, - 0x01, 0x55, 0x5f, 0xde, 0x3e, 0x6b, 0x24, 0x8f, 0xca, 0x88, 0xf4, 0xbb, 0xa7, 0x0f, 0xff, 0xd9, - 0x2c, 0xb5, 0x40, 0x4b, 0xeb, 0xf8, 0x75, 0x11, 0xec, 0x0e, 0x0b, 0xf6, 0x44, 0xf7, 0x20, 0x0b, - 0x59, 0xc7, 0x2f, 0x05, 0x7c, 0x9f, 0xb9, 0x77, 0x7b, 0x22, 0xde, 0x72, 0x2b, 0x7e, 0xa4, 0xf7, - 0xf1, 0x59, 0xd9, 0x65, 0x0a, 0x41, 0xbc, 0xc9, 0x44, 0x10, 0xd6, 0x31, 0x82, 0x78, 0xa2, 0x6d, - 0x40, 0xd8, 0x71, 0x9c, 0x24, 0xc2, 0x6d, 0x8c, 0x27, 0xf3, 0x00, 0x21, 0xaf, 0x18, 0xd1, 0xf0, - 0x18, 0xe1, 0xf0, 0x18, 0xd1, 0x64, 0xc2, 0xf0, 0x18, 0x7b, 0x96, 0xcd, 0xc0, 0xb7, 0x35, 0xe5, - 0x49, 0x7f, 0x40, 0x40, 0x3c, 0x95, 0x41, 0x41, 0xbc, 0x54, 0x94, 0x98, 0xdc, 0x49, 0x80, 0x9d, - 0x12, 0x60, 0x57, 0x67, 0x82, 0x45, 0x29, 0x13, 0x64, 0x15, 0x7c, 0x29, 0x6e, 0xe5, 0x27, 0xf1, - 0x78, 0x3e, 0x10, 0xd3, 0xb9, 0x1b, 0x0e, 0x67, 0x7c, 0xe2, 0xdf, 0x20, 0x7c, 0x39, 0x5f, 0x07, - 0xe5, 0x7c, 0x8a, 0xcb, 0x2a, 0x3b, 0xf4, 0xee, 0xb2, 0x5c, 0x9c, 0x4a, 0x0b, 0xa5, 0x2a, 0xe3, - 0x50, 0x8a, 0x2f, 0xc4, 0x1c, 0x77, 0xc3, 0xb9, 0x6f, 0x89, 0xa1, 0x4d, 0x8e, 0xe7, 0x97, 0xf8, - 0x62, 0x8e, 0x06, 0x40, 0x1f, 0xe0, 0x57, 0x53, 0x46, 0xa0, 0xbc, 0x28, 0x53, 0xa6, 0x84, 0x80, - 0x98, 0x8e, 0x40, 0x37, 0xf1, 0x1b, 0x8a, 0xdc, 0xf7, 0x7c, 0x3b, 0x86, 0x73, 0xb1, 0x9e, 0x25, - 0x00, 0xb2, 0x8f, 0xf0, 0x99, 0xa4, 0x05, 0xb0, 0xf4, 0x1c, 0xac, 0x7b, 0xbe, 0x0d, 0x4c, 0x92, - 0x2f, 0xdd, 0xc2, 0xeb, 0x71, 0x3e, 0x99, 0x85, 0x94, 0xf1, 0x72, 0x67, 0x7c, 0x3a, 0xa7, 0x5b, - 0xd1, 0x03, 0x7d, 0x88, 0xcf, 0x29, 0x3c, 0x00, 0xee, 0x16, 0x5e, 0xf5, 0x24, 0xae, 0x73, 0x32, - 0x97, 0x8c, 0x34, 0xf1, 0xa0, 0x1d, 0xa0, 0xd9, 0x71, 0x9c, 0x14, 0xcd, 0xa2, 0x3e, 0xb6, 0x9f, - 0x11, 0x14, 0x90, 0x4c, 0xa2, 0x2e, 0x60, 0x69, 0xbe, 0x02, 0x16, 0xf7, 0xe1, 0x35, 0xf0, 0xf9, - 0x64, 0x97, 0x13, 0x33, 0x9c, 0x71, 0x34, 0x9f, 0xe1, 0x0d, 0xb5, 0x13, 0x14, 0x77, 0x1b, 0xaf, - 0x79, 0xe9, 0x79, 0xde, 0x50, 0xd7, 0x97, 0x18, 0xe5, 0x84, 0x1f, 0x65, 0x00, 0x37, 0xee, 0x60, - 0x12, 0x6e, 0x51, 0x27, 0xf5, 0x1b, 0x82, 0x7a, 0x52, 0x79, 0x32, 0xeb, 0x59, 0x7a, 0x91, 0x7a, - 0x16, 0x76, 0x6a, 0xdb, 0x7f, 0xad, 0xe1, 0x65, 0x41, 0x4c, 0xbe, 0x42, 0x78, 0x05, 0xa2, 0x53, - 0x99, 0x27, 0xbd, 0x32, 0xb5, 0x4b, 0xb9, 0x9a, 0x28, 0x13, 0xbd, 0xf1, 0xf5, 0x9f, 0xff, 0x7d, - 0x77, 0xea, 0x2a, 0xa9, 0x98, 0xef, 0x47, 0xe2, 0xfb, 0x2c, 0xf8, 0x82, 0x7b, 0xfb, 0xa6, 0xf2, - 0x0a, 0x42, 0x9e, 0x87, 0x08, 0xd1, 0x3e, 0xa8, 0x28, 0xc3, 0xcb, 0x2b, 0x55, 0xbb, 0x32, 0x4b, - 0x06, 0x20, 0x37, 0x05, 0x48, 0x9d, 0x98, 0xb3, 0x40, 0x84, 0x9b, 0xf9, 0x14, 0x16, 0xf3, 0x33, - 0xf2, 0x2d, 0xc2, 0xab, 0x51, 0xac, 0x1d, 0xc7, 0xc9, 0xa0, 0x92, 0xb7, 0x6c, 0x06, 0x55, 0x6a, - 0x55, 0x16, 0x6f, 0x4f, 0xd4, 0x93, 0x3f, 0x90, 0x7a, 0x17, 0x91, 0x46, 0x56, 0x17, 0x72, 0x36, - 0xa0, 0xd6, 0x9c, 0xcf, 0x09, 0x90, 0x6f, 0x09, 0xe4, 0x9b, 0xe4, 0xad, 0x19, 0xc8, 0xea, 0xab, - 0x21, 0xf9, 0x1d, 0x29, 0xb6, 0x14, 0xd9, 0xca, 0x42, 0xc9, 0xda, 0x88, 0x5a, 0x7d, 0x0e, 0x0f, - 0x20, 0x7f, 0x57, 0x90, 0x37, 0xc9, 0xf6, 0x0c, 0x72, 0xc5, 0x3d, 0x95, 0xfc, 0x8a, 0xe4, 0x15, - 0x46, 0x6e, 0x14, 0x20, 0x98, 0xec, 0x02, 0xcd, 0x28, 0x2a, 0x9f, 0x73, 0x60, 0xe5, 0xbb, 0x32, - 0xf9, 0x11, 0xe1, 0xd5, 0x09, 0x65, 0x35, 0x2b, 0x6d, 0x0a, 0xf0, 0x5a, 0x01, 0x25, 0xb0, 0xbd, - 0x23, 0xd8, 0x1a, 0xa4, 0x3e, 0x83, 0x6d, 0x42, 0x65, 0x3e, 0x15, 0xc7, 0xff, 0x8c, 0x7c, 0x8f, - 0xf0, 0xda, 0x38, 0x60, 0xf8, 0x45, 0x55, 0xb3, 0x3e, 0x95, 0x82, 0x80, 0xaa, 0x95, 0x48, 0xeb, - 0x02, 0xb0, 0x46, 0xae, 0x15, 0x06, 0x24, 0xbf, 0x8c, 0xc1, 0x60, 0x26, 0x6b, 0xf9, 0xfd, 0x48, - 0x8e, 0xe3, 0xf5, 0x62, 0x62, 0xc0, 0x7b, 0x4f, 0xe0, 0xbd, 0x4d, 0x9a, 0xc5, 0xf0, 0xa2, 0x19, - 0x1c, 0xb7, 0xf0, 0x27, 0x84, 0x5f, 0x99, 0x0e, 0x1b, 0x76, 0xb1, 0x96, 0xdf, 0x9b, 0x22, 0xb0, - 0x19, 0x1b, 0x8b, 0x36, 0x05, 0xac, 0x41, 0xae, 0xcf, 0x03, 0xbb, 0xfb, 0xc1, 0xe1, 0xb1, 0x8e, - 0x8e, 0x8e, 0x75, 0xf4, 0xef, 0xb1, 0x8e, 0x9e, 0x9f, 0xe8, 0xa5, 0xa3, 0x13, 0xbd, 0xf4, 0xf7, - 0x89, 0x5e, 0x7a, 0xb8, 0x65, 0xf7, 0x83, 0xcf, 0x47, 0x1d, 0xa3, 0xcb, 0x07, 0x59, 0x11, 0x0f, - 0xe2, 0x98, 0xc1, 0x93, 0x21, 0xf3, 0x3b, 0x2b, 0xe2, 0x9f, 0x5b, 0xe3, 0xff, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x79, 0x95, 0x81, 0x2c, 0x44, 0x0f, 0x00, 0x00, + // 948 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xc7, 0x3d, 0x4d, 0x13, 0xd4, 0x69, 0x55, 0xc4, 0x60, 0xaa, 0x74, 0x1b, 0x36, 0xed, 0xb4, + 0x6e, 0x53, 0xdc, 0xee, 0xc6, 0xb1, 0xa1, 0x02, 0xd1, 0x43, 0x22, 0xd1, 0xaa, 0x40, 0xa3, 0x60, + 0x29, 0x1c, 0x72, 0xc0, 0x5a, 0xdb, 0xc3, 0x62, 0x65, 0xbd, 0xe3, 0xec, 0xae, 0x43, 0x42, 0x14, + 0x09, 0x71, 0xe0, 0x1c, 0x09, 0x09, 0x0e, 0xdc, 0xe0, 0x00, 0x37, 0x2e, 0x7c, 0x00, 0x8e, 0x39, + 0x46, 0xe2, 0xc2, 0x09, 0xa1, 0x84, 0x0f, 0x82, 0x3c, 0xfb, 0xd6, 0xf6, 0xce, 0xce, 0xae, 0xd7, + 0xc8, 0xb7, 0xec, 0xbe, 0xff, 0x7b, 0xef, 0xf7, 0xde, 0x3c, 0xef, 0x9b, 0x60, 0x8d, 0x1d, 0xf0, + 0x16, 0xf7, 0x98, 0xc9, 0x3d, 0xab, 0xe5, 0x30, 0x73, 0xaf, 0xcf, 0xbc, 0x43, 0xa3, 0xe7, 0xf1, + 0x80, 0x93, 0xeb, 0x60, 0x33, 0x42, 0x9b, 0x56, 0xb4, 0xb9, 0xcd, 0x85, 0xc9, 0x1c, 0xfc, 0x15, + 0xaa, 0xb4, 0x25, 0x9b, 0x73, 0xdb, 0x61, 0xa6, 0xd5, 0xeb, 0x98, 0x96, 0xeb, 0xf2, 0xc0, 0x0a, + 0x3a, 0xdc, 0xf5, 0xc1, 0xfa, 0x56, 0x8b, 0xfb, 0x5d, 0xee, 0x9b, 0x4d, 0xcb, 0x87, 0xe0, 0xe6, + 0x7e, 0xa5, 0xc9, 0x02, 0xab, 0x62, 0xf6, 0x2c, 0xbb, 0xe3, 0x0a, 0x31, 0x68, 0x6f, 0x49, 0x2c, + 0x3d, 0xcb, 0xb3, 0xba, 0x7e, 0x9a, 0xd1, 0xeb, 0xb4, 0x58, 0x64, 0x2c, 0x4b, 0xc6, 0x7d, 0xcb, + 0xe9, 0xb4, 0xad, 0x80, 0x7b, 0x8d, 0x7e, 0xaf, 0x6d, 0x05, 0xac, 0xd1, 0x74, 0x78, 0x6b, 0x17, + 0xc4, 0x2b, 0x92, 0xb8, 0xe3, 0xb6, 0xd9, 0x41, 0xc3, 0x63, 0x2d, 0xe6, 0x06, 0x8d, 0x58, 0xce, + 0x52, 0x96, 0xb2, 0xeb, 0xdb, 0x20, 0x5b, 0x96, 0x64, 0x09, 0x01, 0x55, 0x0b, 0xc6, 0x73, 0xd1, + 0x22, 0x26, 0x9f, 0x0c, 0xda, 0xb3, 0x25, 0x5e, 0xd6, 0xd9, 0x5e, 0x9f, 0xf9, 0x01, 0xfd, 0x08, + 0xbf, 0x1e, 0x7b, 0xeb, 0xf7, 0xb8, 0xeb, 0x33, 0x52, 0xc3, 0x0b, 0xa1, 0xf3, 0x22, 0xba, 0x8d, + 0x56, 0xae, 0xae, 0xdd, 0x30, 0xe2, 0x47, 0x65, 0x84, 0xfa, 0x8d, 0xcb, 0xa7, 0x7f, 0x2f, 0x17, + 0xea, 0xa0, 0xa5, 0x15, 0xfc, 0x86, 0x08, 0xf6, 0x9c, 0x05, 0x5b, 0xa2, 0x7b, 0x90, 0x85, 0x2c, + 0xe2, 0x57, 0x02, 0xbe, 0xcb, 0xdc, 0x17, 0x6d, 0x11, 0x6f, 0xbe, 0x1e, 0x3d, 0xd2, 0x4d, 0x7c, + 0x43, 0x76, 0x19, 0x43, 0x10, 0x6f, 0x52, 0x11, 0x84, 0x75, 0x88, 0x20, 0x9e, 0x68, 0x03, 0x10, + 0xd6, 0x1d, 0x27, 0x8e, 0xf0, 0x0c, 0xe3, 0xd1, 0x3c, 0x40, 0xc8, 0xfb, 0x46, 0x38, 0x3c, 0xc6, + 0x60, 0x78, 0x8c, 0x70, 0x32, 0x61, 0x78, 0x8c, 0x2d, 0xcb, 0x66, 0xe0, 0x5b, 0x1f, 0xf3, 0xa4, + 0x3f, 0x20, 0x20, 0x1e, 0xcb, 0xa0, 0x20, 0x9e, 0xcb, 0x4b, 0x4c, 0x9e, 0xc7, 0xc0, 0x2e, 0x09, + 0xb0, 0x07, 0x13, 0xc1, 0xc2, 0x94, 0x31, 0xb2, 0x12, 0xbe, 0x1b, 0xb5, 0xf2, 0xd3, 0x68, 0x3c, + 0xb7, 0xc5, 0x74, 0x6e, 0x0c, 0x86, 0x33, 0x3a, 0xf1, 0x6f, 0x11, 0xbe, 0x97, 0xad, 0x83, 0x72, + 0x3e, 0xc3, 0x45, 0x95, 0x1d, 0x7a, 0x77, 0x4f, 0x2e, 0x4e, 0xa5, 0x85, 0x52, 0x95, 0x71, 0x28, + 0xc5, 0xb7, 0x23, 0x8e, 0x17, 0x83, 0xb9, 0xaf, 0x8b, 0xa1, 0x8d, 0x8f, 0xe7, 0x57, 0xf8, 0x4e, + 0x86, 0x06, 0x40, 0xb7, 0xf1, 0x6b, 0x09, 0x23, 0x50, 0xde, 0x91, 0x29, 0x13, 0x42, 0x40, 0x4c, + 0x46, 0xa0, 0xcb, 0xf8, 0x4d, 0x45, 0xee, 0x97, 0xbe, 0x1d, 0xc1, 0xb9, 0x58, 0x4f, 0x13, 0x00, + 0xd9, 0xc7, 0xf8, 0x7a, 0xdc, 0x02, 0x58, 0x7a, 0x06, 0xd6, 0x4b, 0xdf, 0x06, 0x26, 0xc9, 0x97, + 0xae, 0xe2, 0xc5, 0x28, 0x9f, 0xcc, 0x42, 0x8a, 0x78, 0xbe, 0x39, 0x3c, 0x9d, 0xcb, 0xf5, 0xf0, + 0x81, 0xee, 0xe0, 0x9b, 0x0a, 0x0f, 0x80, 0x7b, 0x8a, 0xaf, 0x78, 0x12, 0xd7, 0x4d, 0x99, 0x4b, + 0x46, 0x1a, 0x79, 0xd0, 0x26, 0xd0, 0xac, 0x3b, 0x4e, 0x82, 0x66, 0x56, 0x3f, 0xb6, 0x9f, 0x11, + 0x14, 0x10, 0x4f, 0xa2, 0x2e, 0x60, 0x6e, 0xba, 0x02, 0x66, 0xf7, 0xc3, 0xab, 0xe2, 0x5b, 0xf1, + 0x2e, 0xc7, 0x66, 0x38, 0xe5, 0x68, 0x3e, 0xc7, 0x4b, 0x6a, 0x27, 0x28, 0xee, 0x19, 0xbe, 0xe6, + 0x25, 0xe7, 0x79, 0x49, 0x5d, 0x5f, 0x6c, 0x94, 0x63, 0x7e, 0x94, 0x01, 0xdc, 0xb0, 0x83, 0x71, + 0xb8, 0x59, 0x9d, 0xd4, 0x6f, 0x08, 0xea, 0x49, 0xe4, 0x49, 0xad, 0x67, 0xee, 0xff, 0xd4, 0x33, + 0xb3, 0x53, 0x5b, 0x3b, 0xbd, 0x8a, 0xe7, 0x05, 0x31, 0xf9, 0x1a, 0xe1, 0x05, 0x88, 0x4e, 0x65, + 0x9e, 0xe4, 0xca, 0xd4, 0xee, 0x66, 0x6a, 0xc2, 0x4c, 0xf4, 0xf1, 0x37, 0x7f, 0xfe, 0xfb, 0xdd, + 0xa5, 0x07, 0xa4, 0x64, 0x7e, 0x10, 0x8a, 0x37, 0x59, 0xf0, 0x25, 0xf7, 0x76, 0x4d, 0xe5, 0x15, + 0x84, 0x9c, 0x0c, 0x10, 0xc2, 0x7d, 0x50, 0x52, 0x86, 0x97, 0x57, 0xaa, 0x76, 0x7f, 0x92, 0x0c, + 0x40, 0x9e, 0x08, 0x90, 0x0a, 0x31, 0x27, 0x81, 0x08, 0x37, 0xf3, 0x08, 0x16, 0xf3, 0x31, 0xf9, + 0x03, 0xa9, 0xbf, 0xff, 0xa4, 0x9a, 0x96, 0x39, 0x63, 0xeb, 0x68, 0xb5, 0xe9, 0x9c, 0x00, 0xfe, + 0xa9, 0x80, 0x7f, 0x42, 0xde, 0x9e, 0x00, 0xaf, 0xbe, 0x8e, 0x91, 0xdf, 0x91, 0x62, 0x33, 0x90, + 0xd5, 0x34, 0x94, 0xb4, 0x2d, 0xa4, 0x55, 0xa6, 0xf0, 0x00, 0xf2, 0xf7, 0x04, 0x79, 0x8d, 0xac, + 0x4d, 0x20, 0x57, 0xdc, 0x0d, 0xc9, 0xaf, 0x48, 0x5e, 0x1b, 0xe4, 0x71, 0x0e, 0x82, 0xd1, 0xf7, + 0x57, 0x33, 0xf2, 0xca, 0xa7, 0x1c, 0x12, 0xf9, 0x7e, 0x4a, 0x7e, 0x44, 0xf8, 0xca, 0x88, 0x72, + 0x25, 0x2d, 0x6d, 0x02, 0xf0, 0x61, 0x0e, 0x25, 0xb0, 0xbd, 0x2b, 0xd8, 0xaa, 0xa4, 0x32, 0x81, + 0x6d, 0x44, 0x65, 0x1e, 0x89, 0xe3, 0x3f, 0x26, 0xdf, 0x23, 0x7c, 0x6d, 0x18, 0x70, 0xdd, 0x71, + 0x52, 0x00, 0x15, 0x1b, 0x2c, 0x05, 0x50, 0xb5, 0x86, 0x68, 0x45, 0x00, 0x96, 0xc9, 0xc3, 0xdc, + 0x80, 0xe4, 0x97, 0x21, 0x18, 0xcc, 0x64, 0x39, 0xbb, 0x1f, 0xf1, 0x71, 0x7c, 0x94, 0x4f, 0x0c, + 0x78, 0xef, 0x0b, 0xbc, 0x77, 0x48, 0x2d, 0x1f, 0x5e, 0x38, 0x83, 0xc3, 0x16, 0xfe, 0x84, 0xf0, + 0xab, 0xe3, 0x61, 0x07, 0x5d, 0x2c, 0x67, 0xf7, 0x26, 0x0f, 0x6c, 0xca, 0x96, 0xa0, 0x35, 0x01, + 0x6b, 0x90, 0x47, 0xd3, 0xc0, 0x6e, 0x7c, 0x78, 0x7a, 0xae, 0xa3, 0xb3, 0x73, 0x1d, 0xfd, 0x73, + 0xae, 0xa3, 0x93, 0x0b, 0xbd, 0x70, 0x76, 0xa1, 0x17, 0xfe, 0xba, 0xd0, 0x0b, 0x3b, 0xab, 0x76, + 0x27, 0xf8, 0xa2, 0xdf, 0x34, 0x5a, 0xbc, 0x9b, 0x16, 0xf1, 0x20, 0x8a, 0x19, 0x1c, 0xf6, 0x98, + 0xdf, 0x5c, 0x10, 0xff, 0x2d, 0x55, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x5c, 0xa1, 0xc6, + 0xb8, 0x0e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1011,7 +1010,6 @@ type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Queries a list of Prices items. Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) - PricesAll(ctx context.Context, in *QueryAllPricesRequest, opts ...grpc.CallOption) (*QueryAllPricesResponse, error) // Queries a ValidatorUpdateBlock by index. ValidatorUpdateBlock(ctx context.Context, in *QueryGetValidatorUpdateBlockRequest, opts ...grpc.CallOption) (*QueryGetValidatorUpdateBlockResponse, error) // Queries a IndexRecentParams by index. @@ -1052,15 +1050,6 @@ func (c *queryClient) Prices(ctx context.Context, in *QueryGetPricesRequest, opt return out, nil } -func (c *queryClient) PricesAll(ctx context.Context, in *QueryAllPricesRequest, opts ...grpc.CallOption) (*QueryAllPricesResponse, error) { - out := new(QueryAllPricesResponse) - err := c.cc.Invoke(ctx, "/exocore.oracle.Query/PricesAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) ValidatorUpdateBlock(ctx context.Context, in *QueryGetValidatorUpdateBlockRequest, opts ...grpc.CallOption) (*QueryGetValidatorUpdateBlockResponse, error) { out := new(QueryGetValidatorUpdateBlockResponse) err := c.cc.Invoke(ctx, "/exocore.oracle.Query/ValidatorUpdateBlock", in, out, opts...) @@ -1130,7 +1119,6 @@ type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // Queries a list of Prices items. Prices(context.Context, *QueryGetPricesRequest) (*QueryGetPricesResponse, error) - PricesAll(context.Context, *QueryAllPricesRequest) (*QueryAllPricesResponse, error) // Queries a ValidatorUpdateBlock by index. ValidatorUpdateBlock(context.Context, *QueryGetValidatorUpdateBlockRequest) (*QueryGetValidatorUpdateBlockResponse, error) // Queries a IndexRecentParams by index. @@ -1155,9 +1143,6 @@ func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsReq func (*UnimplementedQueryServer) Prices(ctx context.Context, req *QueryGetPricesRequest) (*QueryGetPricesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Prices not implemented") } -func (*UnimplementedQueryServer) PricesAll(ctx context.Context, req *QueryAllPricesRequest) (*QueryAllPricesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PricesAll not implemented") -} func (*UnimplementedQueryServer) ValidatorUpdateBlock(ctx context.Context, req *QueryGetValidatorUpdateBlockRequest) (*QueryGetValidatorUpdateBlockResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ValidatorUpdateBlock not implemented") } @@ -1220,24 +1205,6 @@ func _Query_Prices_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_PricesAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllPricesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).PricesAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.oracle.Query/PricesAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).PricesAll(ctx, req.(*QueryAllPricesRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_ValidatorUpdateBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryGetValidatorUpdateBlockRequest) if err := dec(in); err != nil { @@ -1376,10 +1343,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Prices", Handler: _Query_Prices_Handler, }, - { - MethodName: "PricesAll", - Handler: _Query_PricesAll_Handler, - }, { MethodName: "ValidatorUpdateBlock", Handler: _Query_ValidatorUpdateBlock_Handler, diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index d87c74b38..f23ccd96f 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -105,42 +105,6 @@ func local_request_Query_Prices_0(ctx context.Context, marshaler runtime.Marshal } -var ( - filter_Query_PricesAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_PricesAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllPricesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_PricesAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.PricesAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_PricesAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllPricesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_PricesAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.PricesAll(ctx, &protoReq) - return msg, metadata, err - -} - func request_Query_ValidatorUpdateBlock_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetValidatorUpdateBlockRequest var metadata runtime.ServerMetadata @@ -427,29 +391,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_PricesAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_PricesAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_PricesAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_ValidatorUpdateBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -692,26 +633,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_PricesAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_PricesAll_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_PricesAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_ValidatorUpdateBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -860,8 +781,6 @@ var ( pattern_Query_Prices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "prices", "tokenId"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_PricesAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "prices"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ValidatorUpdateBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "validator_update_block"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_IndexRecentParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "index_recent_params"}, "", runtime.AssumeColonVerbOpt(true))) @@ -882,8 +801,6 @@ var ( forward_Query_Prices_0 = runtime.ForwardResponseMessage - forward_Query_PricesAll_0 = runtime.ForwardResponseMessage - forward_Query_ValidatorUpdateBlock_0 = runtime.ForwardResponseMessage forward_Query_IndexRecentParams_0 = runtime.ForwardResponseMessage From 75575924214bbb17a211f7bc1b44feaec786ea0b Mon Sep 17 00:00:00 2001 From: leonz789 Date: Wed, 3 Apr 2024 01:06:29 +0800 Subject: [PATCH 29/37] feat(oracle-proto): add proto files for oracle module and some ignite scalffold dependencies --- config.yml | 21 + docs/static/openapi.yml | 74180 ++++++++++++++++ go.mod | 8 + go.sum | 10 + proto/exocore/oracle/genesis.proto | 28 + proto/exocore/oracle/index_recent_msg.proto | 8 + .../exocore/oracle/index_recent_params.proto | 8 + proto/exocore/oracle/info.proto | 42 + proto/exocore/oracle/params.proto | 18 + proto/exocore/oracle/price.proto | 33 + proto/exocore/oracle/prices.proto | 12 + proto/exocore/oracle/query.proto | 153 + proto/exocore/oracle/recent_msg.proto | 23 + proto/exocore/oracle/recent_params.proto | 12 + proto/exocore/oracle/token_feeder.proto | 42 + proto/exocore/oracle/tx.proto | 24 + .../oracle/validator_update_block.proto | 8 + testutil/keeper/oracle.go | 54 + testutil/nullify/nullify.go | 57 + testutil/sample/sample.go | 13 + tools/tools.go | 11 + 21 files changed, 74765 insertions(+) create mode 100644 config.yml create mode 100644 docs/static/openapi.yml create mode 100644 proto/exocore/oracle/genesis.proto create mode 100644 proto/exocore/oracle/index_recent_msg.proto create mode 100644 proto/exocore/oracle/index_recent_params.proto create mode 100644 proto/exocore/oracle/info.proto create mode 100644 proto/exocore/oracle/params.proto create mode 100644 proto/exocore/oracle/price.proto create mode 100644 proto/exocore/oracle/prices.proto create mode 100644 proto/exocore/oracle/query.proto create mode 100644 proto/exocore/oracle/recent_msg.proto create mode 100644 proto/exocore/oracle/recent_params.proto create mode 100644 proto/exocore/oracle/token_feeder.proto create mode 100644 proto/exocore/oracle/tx.proto create mode 100644 proto/exocore/oracle/validator_update_block.proto create mode 100644 testutil/keeper/oracle.go create mode 100644 testutil/nullify/nullify.go create mode 100644 testutil/sample/sample.go create mode 100644 tools/tools.go diff --git a/config.yml b/config.yml new file mode 100644 index 000000000..868e0e1f3 --- /dev/null +++ b/config.yml @@ -0,0 +1,21 @@ +version: 1 +accounts: +- name: alice + coins: + - 20000token + - 200000000stake +- name: bob + coins: + - 10000token + - 100000000stake +client: + openapi: + path: docs/static/openapi.yml +faucet: + name: bob + coins: + - 5token + - 100000stake +validators: +- name: alice + bonded: 100000000stake diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml new file mode 100644 index 000000000..996fad9b0 --- /dev/null +++ b/docs/static/openapi.yml @@ -0,0 +1,74180 @@ +swagger: '2.0' +info: + title: HTTP API Console + name: '' + description: '' +paths: + /cosmos/auth/v1beta1/account_info/{address}: + get: + summary: AccountInfo queries account info which is common to all account types. + description: 'Since: cosmos-sdk 0.47' + operationId: CosmosAuthV1Beta1AccountInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + info: + description: info is the account info which is represented by BaseAccount. + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + account_number: + type: string + format: uint64 + sequence: + type: string + format: uint64 + description: |- + QueryAccountInfoResponse is the Query/AccountInfo response type. + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: address + description: address is the account address string. + in: path + required: true + type: string + tags: + - Query + /cosmos/auth/v1beta1/accounts: + get: + summary: Accounts returns all the existing accounts. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.43 + operationId: CosmosAuthV1Beta1Accounts + responses: + '200': + description: A successful response. + schema: + type: object + properties: + accounts: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: accounts are the existing accounts + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAccountsResponse is the response type for the Query/Accounts + RPC method. + + + Since: cosmos-sdk 0.43 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/auth/v1beta1/accounts/{address}: + get: + summary: Account returns account details based on address. + operationId: CosmosAuthV1Beta1Account + responses: + '200': + description: A successful response. + schema: + type: object + properties: + account: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + QueryAccountResponse is the response type for the Query/Account + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: address + description: address defines the address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/auth/v1beta1/address_by_id/{id}: + get: + summary: AccountAddressByID returns account address based on account number. + description: 'Since: cosmos-sdk 0.46.2' + operationId: CosmosAuthV1Beta1AccountAddressByID + responses: + '200': + description: A successful response. + schema: + type: object + properties: + account_address: + type: string + description: 'Since: cosmos-sdk 0.46.2' + title: >- + QueryAccountAddressByIDResponse is the response type for + AccountAddressByID rpc method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: id + description: |- + Deprecated, use account_id instead + + id is the account number of the address to be queried. This field + should have been an uint64 (like all account numbers), and will be + updated to uint64 in a future version of the auth query. + in: path + required: true + type: string + format: int64 + - name: account_id + description: |- + account_id is the account number of the address to be queried. + + Since: cosmos-sdk 0.47 + in: query + required: false + type: string + format: uint64 + tags: + - Query + /cosmos/auth/v1beta1/bech32: + get: + summary: Bech32Prefix queries bech32Prefix + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosAuthV1Beta1Bech32Prefix + responses: + '200': + description: A successful response. + schema: + type: object + properties: + bech32_prefix: + type: string + description: >- + Bech32PrefixResponse is the response type for Bech32Prefix rpc + method. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /cosmos/auth/v1beta1/bech32/{address_bytes}: + get: + summary: AddressBytesToString converts Account Address bytes to string + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosAuthV1Beta1AddressBytesToString + responses: + '200': + description: A successful response. + schema: + type: object + properties: + address_string: + type: string + description: >- + AddressBytesToStringResponse is the response type for + AddressString rpc method. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: address_bytes + in: path + required: true + type: string + format: byte + tags: + - Query + /cosmos/auth/v1beta1/bech32/{address_string}: + get: + summary: AddressStringToBytes converts Address string to bytes + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosAuthV1Beta1AddressStringToBytes + responses: + '200': + description: A successful response. + schema: + type: object + properties: + address_bytes: + type: string + format: byte + description: >- + AddressStringToBytesResponse is the response type for AddressBytes + rpc method. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: address_string + in: path + required: true + type: string + tags: + - Query + /cosmos/auth/v1beta1/module_accounts: + get: + summary: ModuleAccounts returns all the existing module accounts. + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosAuthV1Beta1ModuleAccounts + responses: + '200': + description: A successful response. + schema: + type: object + properties: + accounts: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + QueryModuleAccountsResponse is the response type for the + Query/ModuleAccounts RPC method. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /cosmos/auth/v1beta1/module_accounts/{name}: + get: + summary: ModuleAccountByName returns the module account info by module name + operationId: CosmosAuthV1Beta1ModuleAccountByName + responses: + '200': + description: A successful response. + schema: + type: object + properties: + account: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + QueryModuleAccountByNameResponse is the response type for the + Query/ModuleAccountByName RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: name + in: path + required: true + type: string + tags: + - Query + /cosmos/auth/v1beta1/params: + get: + summary: Params queries all parameters. + operationId: CosmosAuthV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + max_memo_characters: + type: string + format: uint64 + tx_sig_limit: + type: string + format: uint64 + tx_size_cost_per_byte: + type: string + format: uint64 + sig_verify_cost_ed25519: + type: string + format: uint64 + sig_verify_cost_secp256k1: + type: string + format: uint64 + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /cosmos/authz/v1beta1/grants: + get: + summary: Returns list of `Authorization`, granted to the grantee by the granter. + operationId: CosmosAuthzV1Beta1Grants + responses: + '200': + description: A successful response. + schema: + type: object + properties: + grants: + type: array + items: + type: object + properties: + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + time when the grant will expire and will be pruned. If + null, then the grant + + doesn't have a time expiration (other conditions in + `authorization` + + may apply to invalidate the grant) + description: |- + Grant gives permissions to execute + the provide method with expiration time. + description: >- + authorizations is a list of grants granted for grantee by + granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGrantsResponse is the response type for the + Query/Authorizations RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: granter + in: query + required: false + type: string + - name: grantee + in: query + required: false + type: string + - name: msg_type_url + description: >- + Optional, msg_type_url, when set, will query only grants matching + given msg type. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/authz/v1beta1/grants/grantee/{grantee}: + get: + summary: GranteeGrants returns a list of `GrantAuthorization` by grantee. + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosAuthzV1Beta1GranteeGrants + responses: + '200': + description: A successful response. + schema: + type: object + properties: + grants: + type: array + items: + type: object + properties: + granter: + type: string + grantee: + type: string + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + GrantAuthorization extends a grant with both the addresses + of the grantee and granter. + + It is used in genesis.proto and query.proto + description: grants is a list of grants granted to the grantee. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGranteeGrantsResponse is the response type for the + Query/GranteeGrants RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: grantee + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/authz/v1beta1/grants/granter/{granter}: + get: + summary: GranterGrants returns list of `GrantAuthorization`, granted by granter. + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosAuthzV1Beta1GranterGrants + responses: + '200': + description: A successful response. + schema: + type: object + properties: + grants: + type: array + items: + type: object + properties: + granter: + type: string + grantee: + type: string + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + GrantAuthorization extends a grant with both the addresses + of the grantee and granter. + + It is used in genesis.proto and query.proto + description: grants is a list of grants granted by the granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGranterGrantsResponse is the response type for the + Query/GranterGrants RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: granter + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/balances/{address}: + get: + summary: AllBalances queries the balance of all coins for a single account. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosBankV1Beta1AllBalances + responses: + '200': + description: A successful response. + schema: + type: object + properties: + balances: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: balances is the balances of all the coins. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllBalancesResponse is the response type for the + Query/AllBalances RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: address + description: address is the address to query balances for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/balances/{address}/by_denom: + get: + summary: Balance queries the balance of a single coin for a single account. + operationId: CosmosBankV1Beta1Balance + responses: + '200': + description: A successful response. + schema: + type: object + properties: + balance: + description: balance is the balance of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QueryBalanceResponse is the response type for the Query/Balance + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: address + description: address is the address to query balances for. + in: path + required: true + type: string + - name: denom + description: denom is the coin denom to query balances for. + in: query + required: false + type: string + tags: + - Query + /cosmos/bank/v1beta1/denom_owners/{denom}: + get: + summary: >- + DenomOwners queries for all account addresses that own a particular + token + + denomination. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.46 + operationId: CosmosBankV1Beta1DenomOwners + responses: + '200': + description: A successful response. + schema: + type: object + properties: + denom_owners: + type: array + items: + type: object + properties: + address: + type: string + description: >- + address defines the address that owns a particular + denomination. + balance: + description: >- + balance is the balance of the denominated coin for an + account. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DenomOwner defines structure representing an account that + owns or holds a + + particular denominated token. It contains the account + address and account + + balance of the denominated token. + + + Since: cosmos-sdk 0.46 + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDenomOwnersResponse defines the RPC response of a DenomOwners + RPC query. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: denom + description: >- + denom defines the coin denomination to query all account holders + for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/denoms_metadata: + get: + summary: |- + DenomsMetadata queries the client metadata for all registered coin + denominations. + operationId: CosmosBankV1Beta1DenomsMetadata + responses: + '200': + description: A successful response. + schema: + type: object + properties: + metadatas: + type: array + items: + type: object + properties: + description: + type: string + denom_units: + type: array + items: + type: object + properties: + denom: + type: string + description: >- + denom represents the string name of the given + denom unit (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one + must + + raise the base_denom to in order to equal the + given DenomUnit's denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a + DenomUnit of 'atom' with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: >- + aliases is a list of string aliases for the given + denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: >- + denom_units represents the list of DenomUnit's for a + given coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit + with exponent = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges + (eg: ATOM). This can + + be the same as the display. + + + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains + additional information. Optional. + + + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. + It's used to verify that + + the document didn't change. Optional. + + + Since: cosmos-sdk 0.46 + description: |- + Metadata represents a struct that describes + a basic token. + description: >- + metadata provides the client information for all the + registered tokens. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDenomsMetadataResponse is the response type for the + Query/DenomsMetadata RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/denoms_metadata/{denom}: + get: + summary: DenomsMetadata queries the client metadata of a given coin denomination. + operationId: CosmosBankV1Beta1DenomMetadata + responses: + '200': + description: A successful response. + schema: + type: object + properties: + metadata: + description: >- + metadata describes and provides all the client information for + the requested token. + type: object + properties: + description: + type: string + denom_units: + type: array + items: + type: object + properties: + denom: + type: string + description: >- + denom represents the string name of the given denom + unit (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one + must + + raise the base_denom to in order to equal the given + DenomUnit's denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a + DenomUnit of 'atom' with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: >- + aliases is a list of string aliases for the given + denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: >- + denom_units represents the list of DenomUnit's for a given + coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit + with exponent = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges (eg: + ATOM). This can + + be the same as the display. + + + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains + additional information. Optional. + + + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. + It's used to verify that + + the document didn't change. Optional. + + + Since: cosmos-sdk 0.46 + description: >- + QueryDenomMetadataResponse is the response type for the + Query/DenomMetadata RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: denom + description: denom is the coin denom to query the metadata for. + in: path + required: true + type: string + tags: + - Query + /cosmos/bank/v1beta1/params: + get: + summary: Params queries the parameters of x/bank module. + operationId: CosmosBankV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status + (whether a denom is + + sendable). + description: >- + Deprecated: Use of SendEnabled in params is deprecated. + + For genesis, use the newly added send_enabled field in the + genesis object. + + Storage, lookup, and manipulation of this information is + now in the keeper. + + + As of cosmos-sdk 0.47, this only exists for backwards + compatibility of genesis files. + default_send_enabled: + type: boolean + description: Params defines the parameters for the bank module. + description: >- + QueryParamsResponse defines the response type for querying x/bank + parameters. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/bank/v1beta1/send_enabled: + get: + summary: SendEnabled queries for SendEnabled entries. + description: >- + This query only returns denominations that have specific SendEnabled + settings. + + Any denomination that does not have a specific setting will use the + default + + params.default_send_enabled, and will not be returned by this query. + + + Since: cosmos-sdk 0.47 + operationId: CosmosBankV1Beta1SendEnabled + responses: + '200': + description: A successful response. + schema: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status + (whether a denom is + + sendable). + pagination: + description: >- + pagination defines the pagination in the response. This field + is only + + populated if the denoms field in the request is empty. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QuerySendEnabledResponse defines the RPC response of a SendEnable + query. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: denoms + description: >- + denoms is the specific denoms you want look up. Leave empty to get + all entries. + in: query + required: false + type: array + items: + type: string + collectionFormat: multi + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/spendable_balances/{address}: + get: + summary: >- + SpendableBalances queries the spendable balance of all coins for a + single + + account. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.46 + operationId: CosmosBankV1Beta1SpendableBalances + responses: + '200': + description: A successful response. + schema: + type: object + properties: + balances: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: balances is the spendable balances of all the coins. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QuerySpendableBalancesResponse defines the gRPC response structure + for querying + + an account's spendable balances. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: address + description: address is the address to query spendable balances for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/spendable_balances/{address}/by_denom: + get: + summary: >- + SpendableBalanceByDenom queries the spendable balance of a single denom + for + + a single account. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.47 + operationId: CosmosBankV1Beta1SpendableBalanceByDenom + responses: + '200': + description: A successful response. + schema: + type: object + properties: + balance: + description: balance is the balance of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QuerySpendableBalanceByDenomResponse defines the gRPC response + structure for + + querying an account's spendable balance for a specific denom. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: address + description: address is the address to query balances for. + in: path + required: true + type: string + - name: denom + description: denom is the coin denom to query balances for. + in: query + required: false + type: string + tags: + - Query + /cosmos/bank/v1beta1/supply: + get: + summary: TotalSupply queries the total supply of all coins. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosBankV1Beta1TotalSupply + responses: + '200': + description: A successful response. + schema: + type: object + properties: + supply: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: supply is the supply of the coins + pagination: + description: |- + pagination defines the pagination in the response. + + Since: cosmos-sdk 0.43 + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryTotalSupplyResponse is the response type for the + Query/TotalSupply RPC + + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/supply/by_denom: + get: + summary: SupplyOf queries the supply of a single coin. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosBankV1Beta1SupplyOf + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amount: + description: amount is the supply of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QuerySupplyOfResponse is the response type for the Query/SupplyOf + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: denom + description: denom is the coin denom to query balances for. + in: query + required: false + type: string + tags: + - Query + /cosmos/base/node/v1beta1/config: + get: + summary: Config queries for the operator configuration. + operationId: CosmosBaseNodeV1Beta1Config + responses: + '200': + description: A successful response. + schema: + type: object + properties: + minimum_gas_price: + type: string + description: >- + ConfigResponse defines the response structure for the Config gRPC + query. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Service + /cosmos/base/tendermint/v1beta1/abci_query: + get: + summary: >- + ABCIQuery defines a query handler that supports ABCI queries directly to + the + + application, bypassing Tendermint completely. The ABCI query must + contain + + a valid and supported path, including app, custom, p2p, and store. + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosBaseTendermintV1Beta1ABCIQuery + responses: + '200': + description: A successful response. + schema: + type: object + properties: + code: + type: integer + format: int64 + log: + type: string + title: nondeterministic + info: + type: string + title: nondeterministic + index: + type: string + format: int64 + key: + type: string + format: byte + value: + type: string + format: byte + proof_ops: + type: object + properties: + ops: + type: array + items: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + description: >- + ProofOp defines an operation used for calculating Merkle + root. The data could + + be arbitrary format, providing necessary data for + example neighbouring node + + hash. + + + Note: This type is a duplicate of the ProofOp proto type + defined in Tendermint. + description: >- + ProofOps is Merkle proof defined by the list of ProofOps. + + + Note: This type is a duplicate of the ProofOps proto type + defined in Tendermint. + height: + type: string + format: int64 + codespace: + type: string + description: >- + ABCIQueryResponse defines the response structure for the ABCIQuery + gRPC query. + + + Note: This type is a duplicate of the ResponseQuery proto type + defined in + + Tendermint. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: data + in: query + required: false + type: string + format: byte + - name: path + in: query + required: false + type: string + - name: height + in: query + required: false + type: string + format: int64 + - name: prove + in: query + required: false + type: boolean + tags: + - Service + /cosmos/base/tendermint/v1beta1/blocks/latest: + get: + summary: GetLatestBlock returns the latest block. + operationId: CosmosBaseTendermintV1Beta1GetLatestBlock + responses: + '200': + description: A successful response. + schema: + type: object + properties: + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + block: + title: 'Deprecated: please use `sdk_block` instead' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing + on the order first. + + This means that block.AppHash does not include these + txs. + title: >- + Data contains the set of transactions included in the + block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a + validator signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a + block was committed by a set of + validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a + set of validators attempting to mislead a light + client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was committed by + a set of validators. + sdk_block: + title: 'Since: cosmos-sdk 0.47' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer + address, formatted as a Bech32 string. + + In Tendermint, this type is `bytes`, but in the SDK, + we convert it to a Bech32 string + + for better UX. + + + original proposer of the block + description: Header defines the structure of a Tendermint block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing + on the order first. + + This means that block.AppHash does not include these + txs. + title: >- + Data contains the set of transactions included in the + block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a + validator signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a + block was committed by a set of + validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a + set of validators attempting to mislead a light + client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was committed by + a set of validators. + description: >- + Block is tendermint type Block, with the Header proposer + address + + field converted to bech32 string. + description: >- + GetLatestBlockResponse is the response type for the + Query/GetLatestBlock RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Service + /cosmos/base/tendermint/v1beta1/blocks/{height}: + get: + summary: GetBlockByHeight queries block for given height. + operationId: CosmosBaseTendermintV1Beta1GetBlockByHeight + responses: + '200': + description: A successful response. + schema: + type: object + properties: + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + block: + title: 'Deprecated: please use `sdk_block` instead' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing + on the order first. + + This means that block.AppHash does not include these + txs. + title: >- + Data contains the set of transactions included in the + block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a + validator signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a + block was committed by a set of + validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a + set of validators attempting to mislead a light + client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was committed by + a set of validators. + sdk_block: + title: 'Since: cosmos-sdk 0.47' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer + address, formatted as a Bech32 string. + + In Tendermint, this type is `bytes`, but in the SDK, + we convert it to a Bech32 string + + for better UX. + + + original proposer of the block + description: Header defines the structure of a Tendermint block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing + on the order first. + + This means that block.AppHash does not include these + txs. + title: >- + Data contains the set of transactions included in the + block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a + validator signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a + block was committed by a set of + validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a + set of validators attempting to mislead a light + client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was committed by + a set of validators. + description: >- + Block is tendermint type Block, with the Header proposer + address + + field converted to bech32 string. + description: >- + GetBlockByHeightResponse is the response type for the + Query/GetBlockByHeight RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: height + in: path + required: true + type: string + format: int64 + tags: + - Service + /cosmos/base/tendermint/v1beta1/node_info: + get: + summary: GetNodeInfo queries the current node info. + operationId: CosmosBaseTendermintV1Beta1GetNodeInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + default_node_info: + type: object + properties: + protocol_version: + type: object + properties: + p2p: + type: string + format: uint64 + block: + type: string + format: uint64 + app: + type: string + format: uint64 + default_node_id: + type: string + listen_addr: + type: string + network: + type: string + version: + type: string + channels: + type: string + format: byte + moniker: + type: string + other: + type: object + properties: + tx_index: + type: string + rpc_address: + type: string + application_version: + type: object + properties: + name: + type: string + app_name: + type: string + version: + type: string + git_commit: + type: string + build_tags: + type: string + go_version: + type: string + build_deps: + type: array + items: + type: object + properties: + path: + type: string + title: module path + version: + type: string + title: module version + sum: + type: string + title: checksum + title: Module is the type for VersionInfo + cosmos_sdk_version: + type: string + title: 'Since: cosmos-sdk 0.43' + description: VersionInfo is the type for the GetNodeInfoResponse message. + description: >- + GetNodeInfoResponse is the response type for the Query/GetNodeInfo + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Service + /cosmos/base/tendermint/v1beta1/syncing: + get: + summary: GetSyncing queries node syncing. + operationId: CosmosBaseTendermintV1Beta1GetSyncing + responses: + '200': + description: A successful response. + schema: + type: object + properties: + syncing: + type: boolean + description: >- + GetSyncingResponse is the response type for the Query/GetSyncing + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Service + /cosmos/base/tendermint/v1beta1/validatorsets/latest: + get: + summary: GetLatestValidatorSet queries latest validator-set. + operationId: CosmosBaseTendermintV1Beta1GetLatestValidatorSet + responses: + '200': + description: A successful response. + schema: + type: object + properties: + block_height: + type: string + format: int64 + validators: + type: array + items: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + description: Validator is the type for the validator-set. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + GetLatestValidatorSetResponse is the response type for the + Query/GetValidatorSetByHeight RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Service + /cosmos/base/tendermint/v1beta1/validatorsets/{height}: + get: + summary: GetValidatorSetByHeight queries validator-set at a given height. + operationId: CosmosBaseTendermintV1Beta1GetValidatorSetByHeight + responses: + '200': + description: A successful response. + schema: + type: object + properties: + block_height: + type: string + format: int64 + validators: + type: array + items: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + description: Validator is the type for the validator-set. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + GetValidatorSetByHeightResponse is the response type for the + Query/GetValidatorSetByHeight RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: height + in: path + required: true + type: string + format: int64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Service + /cosmos/consensus/v1/params: + get: + summary: Params queries the parameters of x/consensus_param module. + operationId: CosmosConsensusV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: >- + params are the tendermint consensus params stored in the + consensus module. + + Please note that `params.version` is not populated in this + response, it is + + tracked separately in the x/upgrade module. + type: object + properties: + block: + type: object + properties: + max_bytes: + type: string + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: + type: string + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + evidence: + type: object + properties: + max_age_num_blocks: + type: string + format: int64 + description: >- + Max age of evidence, in blocks. + + + The basic formula for calculating this is: + MaxAgeDuration / {average block + + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. + + + It should correspond with an app's "unbonding period" + or other similar + + mechanism for handling [Nothing-At-Stake + + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes + that can be committed in a single block. + + and should fall comfortably under the max block bytes. + + Default is 1048576 or 1MB + description: >- + EvidenceParams determine how we handle evidence of + malfeasance. + validator: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: >- + ValidatorParams restrict the public key types validators + can use. + + NOTE: uses ABCI pubkey naming, not Amino names. + version: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. + description: >- + QueryParamsResponse defines the response type for querying + x/consensus parameters. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/distribution/v1beta1/community_pool: + get: + summary: CommunityPool queries the community pool coins. + operationId: CosmosDistributionV1Beta1CommunityPool + responses: + '200': + description: A successful response. + schema: + type: object + properties: + pool: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: pool defines community pool's coins. + description: >- + QueryCommunityPoolResponse is the response type for the + Query/CommunityPool + + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards: + get: + summary: |- + DelegationTotalRewards queries the total rewards accrued by a each + validator. + operationId: CosmosDistributionV1Beta1DelegationTotalRewards + responses: + '200': + description: A successful response. + schema: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + validator_address: + type: string + reward: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a + decimal amount. + + + NOTE: The amount field is an Dec which implements the + custom method + + signatures required by gogoproto. + description: |- + DelegationDelegatorReward represents the properties + of a delegator's delegation reward. + description: rewards defines all the rewards accrued by a delegator. + total: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: total defines the sum of all the rewards. + description: |- + QueryDelegationTotalRewardsResponse is the response type for the + Query/DelegationTotalRewards RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: delegator_address + description: delegator_address defines the delegator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}: + get: + summary: DelegationRewards queries the total rewards accrued by a delegation. + operationId: CosmosDistributionV1Beta1DelegationRewards + responses: + '200': + description: A successful response. + schema: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: rewards defines the rewards accrued by a delegation. + description: |- + QueryDelegationRewardsResponse is the response type for the + Query/DelegationRewards RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: delegator_address + description: delegator_address defines the delegator address to query for. + in: path + required: true + type: string + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/delegators/{delegator_address}/validators: + get: + summary: DelegatorValidators queries the validators of a delegator. + operationId: CosmosDistributionV1Beta1DelegatorValidators + responses: + '200': + description: A successful response. + schema: + type: object + properties: + validators: + type: array + items: + type: string + description: >- + validators defines the validators a delegator is delegating + for. + description: |- + QueryDelegatorValidatorsResponse is the response type for the + Query/DelegatorValidators RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: delegator_address + description: delegator_address defines the delegator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address: + get: + summary: DelegatorWithdrawAddress queries withdraw address of a delegator. + operationId: CosmosDistributionV1Beta1DelegatorWithdrawAddress + responses: + '200': + description: A successful response. + schema: + type: object + properties: + withdraw_address: + type: string + description: withdraw_address defines the delegator address to query for. + description: |- + QueryDelegatorWithdrawAddressResponse is the response type for the + Query/DelegatorWithdrawAddress RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: delegator_address + description: delegator_address defines the delegator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/params: + get: + summary: Params queries params of the distribution module. + operationId: CosmosDistributionV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + community_tax: + type: string + base_proposer_reward: + type: string + description: >- + Deprecated: The base_proposer_reward field is deprecated + and is no longer used + + in the x/distribution module's reward mechanism. + bonus_proposer_reward: + type: string + description: >- + Deprecated: The bonus_proposer_reward field is deprecated + and is no longer used + + in the x/distribution module's reward mechanism. + withdraw_addr_enabled: + type: boolean + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/distribution/v1beta1/validators/{validator_address}: + get: + summary: >- + ValidatorDistributionInfo queries validator commission and + self-delegation rewards for validator + operationId: CosmosDistributionV1Beta1ValidatorDistributionInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + operator_address: + type: string + description: operator_address defines the validator operator address. + self_bond_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: self_bond_rewards defines the self delegations rewards. + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: commission defines the commission the validator received. + description: >- + QueryValidatorDistributionInfoResponse is the response type for + the Query/ValidatorDistributionInfo RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/validators/{validator_address}/commission: + get: + summary: ValidatorCommission queries accumulated commission for a validator. + operationId: CosmosDistributionV1Beta1ValidatorCommission + responses: + '200': + description: A successful response. + schema: + type: object + properties: + commission: + description: commission defines the commission the validator received. + type: object + properties: + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a + decimal amount. + + + NOTE: The amount field is an Dec which implements the + custom method + + signatures required by gogoproto. + title: |- + QueryValidatorCommissionResponse is the response type for the + Query/ValidatorCommission RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards: + get: + summary: ValidatorOutstandingRewards queries rewards of a validator address. + operationId: CosmosDistributionV1Beta1ValidatorOutstandingRewards + responses: + '200': + description: A successful response. + schema: + type: object + properties: + rewards: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a + decimal amount. + + + NOTE: The amount field is an Dec which implements the + custom method + + signatures required by gogoproto. + description: >- + ValidatorOutstandingRewards represents outstanding + (un-withdrawn) rewards + + for a validator inexpensive to track, allows simple sanity + checks. + description: >- + QueryValidatorOutstandingRewardsResponse is the response type for + the + + Query/ValidatorOutstandingRewards RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/validators/{validator_address}/slashes: + get: + summary: ValidatorSlashes queries slash events of a validator. + operationId: CosmosDistributionV1Beta1ValidatorSlashes + responses: + '200': + description: A successful response. + schema: + type: object + properties: + slashes: + type: array + items: + type: object + properties: + validator_period: + type: string + format: uint64 + fraction: + type: string + description: >- + ValidatorSlashEvent represents a validator slash event. + + Height is implicit within the store key. + + This is needed to calculate appropriate amount of staking + tokens + + for delegations which are withdrawn after a slash has + occurred. + description: slashes defines the slashes the validator received. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryValidatorSlashesResponse is the response type for the + Query/ValidatorSlashes RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true + type: string + - name: starting_height + description: >- + starting_height defines the optional starting height to query the + slashes. + in: query + required: false + type: string + format: uint64 + - name: ending_height + description: >- + starting_height defines the optional ending height to query the + slashes. + in: query + required: false + type: string + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/evidence/v1beta1/evidence: + get: + summary: AllEvidence queries all evidence. + operationId: CosmosEvidenceV1Beta1AllEvidence + responses: + '200': + description: A successful response. + schema: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: evidence returns all evidences. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllEvidenceResponse is the response type for the + Query/AllEvidence RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/evidence/v1beta1/evidence/{hash}: + get: + summary: Evidence queries evidence based on evidence hash. + operationId: CosmosEvidenceV1Beta1Evidence + responses: + '200': + description: A successful response. + schema: + type: object + properties: + evidence: + description: evidence returns the requested evidence. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + QueryEvidenceResponse is the response type for the Query/Evidence + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: hash + description: |- + hash defines the evidence hash of the requested evidence. + + Since: cosmos-sdk 0.47 + in: path + required: true + type: string + - name: evidence_hash + description: |- + evidence_hash defines the hash of the requested evidence. + Deprecated: Use hash, a HEX encoded string, instead. + in: query + required: false + type: string + format: byte + tags: + - Query + /cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}: + get: + summary: Allowance returns fee granted to the grantee by the granter. + operationId: CosmosFeegrantV1Beta1Allowance + responses: + '200': + description: A successful response. + schema: + type: object + properties: + allowance: + description: allowance is a allowance granted for grantee by granter. + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance + of their funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an + allowance of another user's funds. + allowance: + description: >- + allowance can be any of basic, periodic, allowed fee + allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + title: >- + Grant is stored in the KVStore to record a grant with full + context + description: >- + QueryAllowanceResponse is the response type for the + Query/Allowance RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: granter + description: >- + granter is the address of the user granting an allowance of their + funds. + in: path + required: true + type: string + - name: grantee + description: >- + grantee is the address of the user being granted an allowance of + another user's funds. + in: path + required: true + type: string + tags: + - Query + /cosmos/feegrant/v1beta1/allowances/{grantee}: + get: + summary: Allowances returns all the grants for address. + operationId: CosmosFeegrantV1Beta1Allowances + responses: + '200': + description: A successful response. + schema: + type: object + properties: + allowances: + type: array + items: + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance + of their funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an + allowance of another user's funds. + allowance: + description: >- + allowance can be any of basic, periodic, allowed fee + allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + title: >- + Grant is stored in the KVStore to record a grant with full + context + description: allowances are allowance's granted for grantee by granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllowancesResponse is the response type for the + Query/Allowances RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: grantee + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/feegrant/v1beta1/issued/{granter}: + get: + summary: AllowancesByGranter returns all the grants given by an address + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosFeegrantV1Beta1AllowancesByGranter + responses: + '200': + description: A successful response. + schema: + type: object + properties: + allowances: + type: array + items: + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance + of their funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an + allowance of another user's funds. + allowance: + description: >- + allowance can be any of basic, periodic, allowed fee + allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + title: >- + Grant is stored in the KVStore to record a grant with full + context + description: allowances that have been issued by the granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllowancesByGranterResponse is the response type for the + Query/AllowancesByGranter RPC method. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: granter + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/gov/v1/params/{params_type}: + get: + summary: Params queries all parameters of the gov module. + operationId: CosmosGovV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + voting_params: + description: |- + Deprecated: Prefer to use `params` instead. + voting_params defines the parameters related to voting. + type: object + properties: + voting_period: + type: string + description: Duration of the voting period. + deposit_params: + description: |- + Deprecated: Prefer to use `params` instead. + deposit_params defines the parameters related to deposit. + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. + Initial value: 2 + + months. + tally_params: + description: |- + Deprecated: Prefer to use `params` instead. + tally_params defines the parameters related to tally. + type: object + properties: + quorum: + type: string + description: >- + Minimum percentage of total stake needed to vote for a + result to be + + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. + Default value: 0.5. + veto_threshold: + type: string + description: >- + Minimum value of Veto votes to Total votes ratio for + proposal to be + + vetoed. Default value: 1/3. + params: + description: |- + params defines all the paramaters of x/gov module. + + Since: cosmos-sdk 0.47 + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. + Initial value: 2 + + months. + voting_period: + type: string + description: Duration of the voting period. + quorum: + type: string + description: >- + Minimum percentage of total stake needed to vote for a + result to be + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. + Default value: 0.5. + veto_threshold: + type: string + description: >- + Minimum value of Veto votes to Total votes ratio for + proposal to be + vetoed. Default value: 1/3. + min_initial_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value + that must be paid at proposal submission. + burn_vote_quorum: + type: boolean + title: burn deposits if a proposal does not meet quorum + burn_proposal_deposit_prevote: + type: boolean + title: burn deposits if the proposal does not enter voting period + burn_vote_veto: + type: boolean + title: burn deposits if quorum with vote type no_veto is met + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: params_type + description: >- + params_type defines which parameters to query for, can be one of + "voting", + + "tallying" or "deposit". + in: path + required: true + type: string + tags: + - Query + /cosmos/gov/v1/proposals: + get: + summary: Proposals queries all proposals based on given status. + operationId: CosmosGovV1Proposals + responses: + '200': + description: A successful response. + schema: + type: object + properties: + proposals: + type: array + items: + type: object + properties: + id: + type: string + format: uint64 + description: id defines the unique id of the proposal. + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain + at least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should + be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, + for URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions + as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently + available in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods + of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL + and the unpack + + methods only use the fully qualified type name after + the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages are the arbitrary messages to be executed if + the proposal passes. + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the + proposal. When + + querying a proposal via gRPC, this field is not + populated until the + + proposal's voting period has ended. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: >- + abstain_count is the number of abstain votes on a + proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto + votes on a proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + metadata: + type: string + description: >- + metadata is any arbitrary metadata attached to the + proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter + description: >- + Proposal defines the core field members of a governance + proposal. + description: proposals defines all the requested governance proposals. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryProposalsResponse is the response type for the + Query/Proposals RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_status + description: |- + proposal_status defines the status of the proposals. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + period. + - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + period. + - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + passed. + - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + been rejected. + - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + failed. + in: query + required: false + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + - name: voter + description: voter defines the voter address for the proposals. + in: query + required: false + type: string + - name: depositor + description: depositor defines the deposit addresses from the proposals. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/gov/v1/proposals/{proposal_id}: + get: + summary: Proposal queries proposal details based on ProposalID. + operationId: CosmosGovV1Proposal + responses: + '200': + description: A successful response. + schema: + type: object + properties: + proposal: + description: proposal is the requested governance proposal. + type: object + properties: + id: + type: string + format: uint64 + description: id defines the unique id of the proposal. + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages are the arbitrary messages to be executed if the + proposal passes. + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the + proposal. When + + querying a proposal via gRPC, this field is not populated + until the + + proposal's voting period has ended. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: >- + abstain_count is the number of abstain votes on a + proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes + on a proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + metadata: + type: string + description: >- + metadata is any arbitrary metadata attached to the + proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter + description: >- + QueryProposalResponse is the response type for the Query/Proposal + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + tags: + - Query + /cosmos/gov/v1/proposals/{proposal_id}/deposits: + get: + summary: Deposits queries all deposits of a single proposal. + operationId: CosmosGovV1Deposits + responses: + '200': + description: A successful response. + schema: + type: object + properties: + deposits: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: >- + depositor defines the deposit addresses from the + proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + Deposit defines an amount deposited by an account address to + an active + + proposal. + description: deposits defines the requested deposits. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDepositsResponse is the response type for the Query/Deposits + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}: + get: + summary: >- + Deposit queries single deposit information based proposalID, + depositAddr. + operationId: CosmosGovV1Deposit + responses: + '200': + description: A successful response. + schema: + type: object + properties: + deposit: + description: deposit defines the requested deposit. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: >- + depositor defines the deposit addresses from the + proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + QueryDepositResponse is the response type for the Query/Deposit + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: depositor + description: depositor defines the deposit addresses from the proposals. + in: path + required: true + type: string + tags: + - Query + /cosmos/gov/v1/proposals/{proposal_id}/tally: + get: + summary: TallyResult queries the tally of a proposal vote. + operationId: CosmosGovV1TallyResult + responses: + '200': + description: A successful response. + schema: + type: object + properties: + tally: + description: tally defines the requested tally. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: >- + abstain_count is the number of abstain votes on a + proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes on + a proposal. + description: >- + QueryTallyResultResponse is the response type for the Query/Tally + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + tags: + - Query + /cosmos/gov/v1/proposals/{proposal_id}/votes: + get: + summary: Votes queries votes of a given proposal. + operationId: CosmosGovV1Votes + responses: + '200': + description: A successful response. + schema: + type: object + properties: + votes: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: >- + weight is the vote weight associated with the vote + option. + description: >- + WeightedVoteOption defines a unit of vote for vote + split. + description: options is the weighted vote options. + metadata: + type: string + description: >- + metadata is any arbitrary metadata to attached to the + vote. + description: >- + Vote defines a vote on a governance proposal. + + A Vote consists of a proposal ID, the voter, and the vote + option. + description: votes defines the queried votes. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryVotesResponse is the response type for the Query/Votes RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}: + get: + summary: Vote queries voted information based on proposalID, voterAddr. + operationId: CosmosGovV1Vote + responses: + '200': + description: A successful response. + schema: + type: object + properties: + vote: + description: vote defines the queried vote. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: >- + weight is the vote weight associated with the vote + option. + description: >- + WeightedVoteOption defines a unit of vote for vote + split. + description: options is the weighted vote options. + metadata: + type: string + description: >- + metadata is any arbitrary metadata to attached to the + vote. + description: >- + QueryVoteResponse is the response type for the Query/Vote RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: voter + description: voter defines the voter address for the proposals. + in: path + required: true + type: string + tags: + - Query + /cosmos/gov/v1beta1/params/{params_type}: + get: + summary: Params queries all parameters of the gov module. + operationId: CosmosGovV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + voting_params: + description: voting_params defines the parameters related to voting. + type: object + properties: + voting_period: + type: string + description: Duration of the voting period. + deposit_params: + description: deposit_params defines the parameters related to deposit. + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. + Initial value: 2 + + months. + tally_params: + description: tally_params defines the parameters related to tally. + type: object + properties: + quorum: + type: string + format: byte + description: >- + Minimum percentage of total stake needed to vote for a + result to be + + considered valid. + threshold: + type: string + format: byte + description: >- + Minimum proportion of Yes votes for proposal to pass. + Default value: 0.5. + veto_threshold: + type: string + format: byte + description: >- + Minimum value of Veto votes to Total votes ratio for + proposal to be + + vetoed. Default value: 1/3. + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: params_type + description: >- + params_type defines which parameters to query for, can be one of + "voting", + + "tallying" or "deposit". + in: path + required: true + type: string + tags: + - Query + /cosmos/gov/v1beta1/proposals: + get: + summary: Proposals queries all proposals based on given status. + operationId: CosmosGovV1Beta1Proposals + responses: + '200': + description: A successful response. + schema: + type: object + properties: + proposals: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + content: + description: content is the proposal's content. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the + proposal. When + + querying a proposal via gRPC, this field is not + populated until the + + proposal's voting period has ended. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: >- + abstain is the number of abstain votes on a + proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: >- + no_with_veto is the number of no with veto votes on + a proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + description: >- + Proposal defines the core field members of a governance + proposal. + description: proposals defines all the requested governance proposals. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryProposalsResponse is the response type for the + Query/Proposals RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_status + description: |- + proposal_status defines the status of the proposals. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + period. + - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + period. + - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + passed. + - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + been rejected. + - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + failed. + in: query + required: false + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + - name: voter + description: voter defines the voter address for the proposals. + in: query + required: false + type: string + - name: depositor + description: depositor defines the deposit addresses from the proposals. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/gov/v1beta1/proposals/{proposal_id}: + get: + summary: Proposal queries proposal details based on ProposalID. + operationId: CosmosGovV1Beta1Proposal + responses: + '200': + description: A successful response. + schema: + type: object + properties: + proposal: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + content: + description: content is the proposal's content. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the + proposal. When + + querying a proposal via gRPC, this field is not populated + until the + + proposal's voting period has ended. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + description: >- + Proposal defines the core field members of a governance + proposal. + description: >- + QueryProposalResponse is the response type for the Query/Proposal + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + tags: + - Query + /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits: + get: + summary: Deposits queries all deposits of a single proposal. + operationId: CosmosGovV1Beta1Deposits + responses: + '200': + description: A successful response. + schema: + type: object + properties: + deposits: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: >- + depositor defines the deposit addresses from the + proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + Deposit defines an amount deposited by an account address to + an active + + proposal. + description: deposits defines the requested deposits. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDepositsResponse is the response type for the Query/Deposits + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}: + get: + summary: >- + Deposit queries single deposit information based proposalID, + depositAddr. + operationId: CosmosGovV1Beta1Deposit + responses: + '200': + description: A successful response. + schema: + type: object + properties: + deposit: + description: deposit defines the requested deposit. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: >- + depositor defines the deposit addresses from the + proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + QueryDepositResponse is the response type for the Query/Deposit + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: depositor + description: depositor defines the deposit addresses from the proposals. + in: path + required: true + type: string + tags: + - Query + /cosmos/gov/v1beta1/proposals/{proposal_id}/tally: + get: + summary: TallyResult queries the tally of a proposal vote. + operationId: CosmosGovV1Beta1TallyResult + responses: + '200': + description: A successful response. + schema: + type: object + properties: + tally: + description: tally defines the requested tally. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. + description: >- + QueryTallyResultResponse is the response type for the Query/Tally + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + tags: + - Query + /cosmos/gov/v1beta1/proposals/{proposal_id}/votes: + get: + summary: Votes queries votes of a given proposal. + operationId: CosmosGovV1Beta1Votes + responses: + '200': + description: A successful response. + schema: + type: object + properties: + votes: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + option: + description: >- + Deprecated: Prefer to use `options` instead. This field + is set in queries + + if and only if `len(options) == 1` and that option has + weight 1. In all + + other cases, this field will default to + VOTE_OPTION_UNSPECIFIED. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: >- + weight is the vote weight associated with the vote + option. + description: >- + WeightedVoteOption defines a unit of vote for vote + split. + + + Since: cosmos-sdk 0.43 + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 + description: >- + Vote defines a vote on a governance proposal. + + A Vote consists of a proposal ID, the voter, and the vote + option. + description: votes defines the queried votes. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryVotesResponse is the response type for the Query/Votes RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}: + get: + summary: Vote queries voted information based on proposalID, voterAddr. + operationId: CosmosGovV1Beta1Vote + responses: + '200': + description: A successful response. + schema: + type: object + properties: + vote: + description: vote defines the queried vote. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + option: + description: >- + Deprecated: Prefer to use `options` instead. This field is + set in queries + + if and only if `len(options) == 1` and that option has + weight 1. In all + + other cases, this field will default to + VOTE_OPTION_UNSPECIFIED. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: >- + weight is the vote weight associated with the vote + option. + description: >- + WeightedVoteOption defines a unit of vote for vote + split. + + + Since: cosmos-sdk 0.43 + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 + description: >- + QueryVoteResponse is the response type for the Query/Vote RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: voter + description: voter defines the voter address for the proposals. + in: path + required: true + type: string + tags: + - Query + /cosmos/mint/v1beta1/annual_provisions: + get: + summary: AnnualProvisions current minting annual provisions value. + operationId: CosmosMintV1Beta1AnnualProvisions + responses: + '200': + description: A successful response. + schema: + type: object + properties: + annual_provisions: + type: string + format: byte + description: >- + annual_provisions is the current minting annual provisions + value. + description: |- + QueryAnnualProvisionsResponse is the response type for the + Query/AnnualProvisions RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/mint/v1beta1/inflation: + get: + summary: Inflation returns the current minting inflation value. + operationId: CosmosMintV1Beta1Inflation + responses: + '200': + description: A successful response. + schema: + type: object + properties: + inflation: + type: string + format: byte + description: inflation is the current minting inflation value. + description: >- + QueryInflationResponse is the response type for the + Query/Inflation RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/mint/v1beta1/params: + get: + summary: Params returns the total set of minting parameters. + operationId: CosmosMintV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + mint_denom: + type: string + title: type of coin to mint + inflation_rate_change: + type: string + title: maximum annual change in inflation rate + inflation_max: + type: string + title: maximum inflation rate + inflation_min: + type: string + title: minimum inflation rate + goal_bonded: + type: string + title: goal of percent bonded atoms + blocks_per_year: + type: string + format: uint64 + title: expected blocks per year + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/nft/v1beta1/balance/{owner}/{class_id}: + get: + summary: >- + Balance queries the number of NFTs of a given class owned by the owner, + same as balanceOf in ERC721 + operationId: CosmosNftV1Beta1Balance + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amount: + type: string + format: uint64 + title: >- + amount is the number of all NFTs of a given class owned by the + owner + title: >- + QueryBalanceResponse is the response type for the Query/Balance + RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: owner + description: owner is the owner address of the nft + in: path + required: true + type: string + - name: class_id + description: class_id associated with the nft + in: path + required: true + type: string + tags: + - Query + /cosmos/nft/v1beta1/classes: + get: + summary: Classes queries all NFT classes + operationId: CosmosNftV1Beta1Classes + responses: + '200': + description: A successful response. + schema: + type: object + properties: + classes: + type: array + items: + type: object + properties: + id: + type: string + title: >- + id defines the unique identifier of the NFT + classification, similar to the contract address of + ERC721 + name: + type: string + title: >- + name defines the human-readable name of the NFT + classification. Optional + symbol: + type: string + title: >- + symbol is an abbreviated name for nft classification. + Optional + description: + type: string + title: >- + description is a brief description of nft + classification. Optional + uri: + type: string + title: >- + uri for the class metadata stored off chain. It can + define schema for Class and NFT `Data` attributes. + Optional + uri_hash: + type: string + title: >- + uri_hash is a hash of the document pointed by uri. + Optional + data: + title: >- + data is the app specific metadata of the NFT class. + Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: Class defines the class of the nft type. + description: class defines the class of the nft type. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryClassesResponse is the response type for the Query/Classes + RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/nft/v1beta1/classes/{class_id}: + get: + summary: Class queries an NFT class based on its id + operationId: CosmosNftV1Beta1Class + responses: + '200': + description: A successful response. + schema: + type: object + properties: + class: + description: class defines the class of the nft type. + type: object + properties: + id: + type: string + title: >- + id defines the unique identifier of the NFT + classification, similar to the contract address of ERC721 + name: + type: string + title: >- + name defines the human-readable name of the NFT + classification. Optional + symbol: + type: string + title: >- + symbol is an abbreviated name for nft classification. + Optional + description: + type: string + title: >- + description is a brief description of nft classification. + Optional + uri: + type: string + title: >- + uri for the class metadata stored off chain. It can define + schema for Class and NFT `Data` attributes. Optional + uri_hash: + type: string + title: >- + uri_hash is a hash of the document pointed by uri. + Optional + data: + title: >- + data is the app specific metadata of the NFT class. + Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + QueryClassResponse is the response type for the Query/Class RPC + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: class_id + description: class_id associated with the nft + in: path + required: true + type: string + tags: + - Query + /cosmos/nft/v1beta1/nfts: + get: + summary: >- + NFTs queries all NFTs of a given class or owner,choose at least one of + the two, similar to tokenByIndex in + + ERC721Enumerable + operationId: CosmosNftV1Beta1NFTs + responses: + '200': + description: A successful response. + schema: + type: object + properties: + nfts: + type: array + items: + type: object + properties: + class_id: + type: string + title: >- + class_id associated with the NFT, similar to the + contract address of ERC721 + id: + type: string + title: id is a unique identifier of the NFT + uri: + type: string + title: uri for the NFT metadata stored off chain + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri + data: + title: data is an app specific data of the NFT. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: NFT defines the NFT. + title: NFT defines the NFT + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryNFTsResponse is the response type for the Query/NFTs RPC + methods + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: class_id + description: class_id associated with the nft + in: query + required: false + type: string + - name: owner + description: owner is the owner address of the nft + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/nft/v1beta1/nfts/{class_id}/{id}: + get: + summary: NFT queries an NFT based on its class and id. + operationId: CosmosNftV1Beta1NFT + responses: + '200': + description: A successful response. + schema: + type: object + properties: + nft: + title: owner is the owner address of the nft + type: object + properties: + class_id: + type: string + title: >- + class_id associated with the NFT, similar to the contract + address of ERC721 + id: + type: string + title: id is a unique identifier of the NFT + uri: + type: string + title: uri for the NFT metadata stored off chain + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri + data: + title: data is an app specific data of the NFT. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: NFT defines the NFT. + title: QueryNFTResponse is the response type for the Query/NFT RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: class_id + description: class_id associated with the nft + in: path + required: true + type: string + - name: id + description: id is a unique identifier of the NFT + in: path + required: true + type: string + tags: + - Query + /cosmos/nft/v1beta1/owner/{class_id}/{id}: + get: + summary: >- + Owner queries the owner of the NFT based on its class and id, same as + ownerOf in ERC721 + operationId: CosmosNftV1Beta1Owner + responses: + '200': + description: A successful response. + schema: + type: object + properties: + owner: + type: string + title: owner is the owner address of the nft + title: >- + QueryOwnerResponse is the response type for the Query/Owner RPC + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: class_id + description: class_id associated with the nft + in: path + required: true + type: string + - name: id + description: id is a unique identifier of the NFT + in: path + required: true + type: string + tags: + - Query + /cosmos/nft/v1beta1/supply/{class_id}: + get: + summary: >- + Supply queries the number of NFTs from the given class, same as + totalSupply of ERC721. + operationId: CosmosNftV1Beta1Supply + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amount: + type: string + format: uint64 + title: amount is the number of all NFTs from the given class + title: >- + QuerySupplyResponse is the response type for the Query/Supply RPC + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: class_id + description: class_id associated with the nft + in: path + required: true + type: string + tags: + - Query + /cosmos/params/v1beta1/params: + get: + summary: |- + Params queries a specific parameter of a module, given its subspace and + key. + operationId: CosmosParamsV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + param: + description: param defines the queried parameter. + type: object + properties: + subspace: + type: string + key: + type: string + value: + type: string + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: subspace + description: subspace defines the module to query the parameter for. + in: query + required: false + type: string + - name: key + description: key defines the key of the parameter in the subspace. + in: query + required: false + type: string + tags: + - Query + /cosmos/params/v1beta1/subspaces: + get: + summary: >- + Subspaces queries for all registered subspaces and all keys for a + subspace. + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosParamsV1Beta1Subspaces + responses: + '200': + description: A successful response. + schema: + type: object + properties: + subspaces: + type: array + items: + type: object + properties: + subspace: + type: string + keys: + type: array + items: + type: string + description: >- + Subspace defines a parameter subspace name and all the keys + that exist for + + the subspace. + + + Since: cosmos-sdk 0.46 + description: >- + QuerySubspacesResponse defines the response types for querying for + all + + registered subspaces and all keys for a subspace. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/slashing/v1beta1/params: + get: + summary: Params queries the parameters of slashing module + operationId: CosmosSlashingV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + type: object + properties: + signed_blocks_window: + type: string + format: int64 + min_signed_per_window: + type: string + format: byte + downtime_jail_duration: + type: string + slash_fraction_double_sign: + type: string + format: byte + slash_fraction_downtime: + type: string + format: byte + description: >- + Params represents the parameters used for by the slashing + module. + title: >- + QueryParamsResponse is the response type for the Query/Params RPC + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/slashing/v1beta1/signing_infos: + get: + summary: SigningInfos queries signing info of all validators + operationId: CosmosSlashingV1Beta1SigningInfos + responses: + '200': + description: A successful response. + schema: + type: object + properties: + info: + type: array + items: + type: object + properties: + address: + type: string + start_height: + type: string + format: int64 + title: >- + Height at which validator was first a candidate OR was + unjailed + index_offset: + type: string + format: int64 + description: >- + Index which is incremented each time the validator was a + bonded + + in a block and may have signed a precommit or not. This + in conjunction with the + + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time + description: >- + Timestamp until which the validator is jailed due to + liveness downtime. + tombstoned: + type: boolean + description: >- + Whether or not a validator has been tombstoned (killed + out of validator set). It is set + + once the validator commits an equivocation or for any + other configured misbehiavor. + missed_blocks_counter: + type: string + format: int64 + description: >- + A counter kept to avoid unnecessary array reads. + + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. + description: >- + ValidatorSigningInfo defines a validator's signing info for + monitoring their + + liveness activity. + title: info is the signing info of all validators + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: >- + QuerySigningInfosResponse is the response type for the + Query/SigningInfos RPC + + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/slashing/v1beta1/signing_infos/{cons_address}: + get: + summary: SigningInfo queries the signing info of given cons address + operationId: CosmosSlashingV1Beta1SigningInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + val_signing_info: + title: >- + val_signing_info is the signing info of requested val cons + address + type: object + properties: + address: + type: string + start_height: + type: string + format: int64 + title: >- + Height at which validator was first a candidate OR was + unjailed + index_offset: + type: string + format: int64 + description: >- + Index which is incremented each time the validator was a + bonded + + in a block and may have signed a precommit or not. This in + conjunction with the + + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time + description: >- + Timestamp until which the validator is jailed due to + liveness downtime. + tombstoned: + type: boolean + description: >- + Whether or not a validator has been tombstoned (killed out + of validator set). It is set + + once the validator commits an equivocation or for any + other configured misbehiavor. + missed_blocks_counter: + type: string + format: int64 + description: >- + A counter kept to avoid unnecessary array reads. + + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. + description: >- + ValidatorSigningInfo defines a validator's signing info for + monitoring their + + liveness activity. + title: >- + QuerySigningInfoResponse is the response type for the + Query/SigningInfo RPC + + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: cons_address + description: cons_address is the address to query signing info of + in: path + required: true + type: string + tags: + - Query + /cosmos/staking/v1beta1/delegations/{delegator_addr}: + get: + summary: >- + DelegatorDelegations queries all delegations of a given delegator + address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1DelegatorDelegations + responses: + '200': + description: A successful response. + schema: + type: object + properties: + delegation_responses: + type: array + items: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of + the delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of + the validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an + account. It is + + owned by one delegator, and is associated with the + voting power of one + + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that + it contains a + + balance in addition to shares which is more suitable for + client responses. + description: >- + delegation_responses defines all the delegations' info of a + delegator. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryDelegatorDelegationsResponse is response type for the + Query/DelegatorDelegations RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations: + get: + summary: Redelegations queries redelegations of given address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1Redelegations + responses: + '200': + description: A successful response. + schema: + type: object + properties: + redelegation_responses: + type: array + items: + type: object + properties: + redelegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of + the delegator. + validator_src_address: + type: string + description: >- + validator_src_address is the validator redelegation + source operator address. + validator_dst_address: + type: string + description: >- + validator_dst_address is the validator redelegation + destination operator address. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the + redelegation took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for + redelegation completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance + when redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of + destination-validator shares created by + redelegation. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding + has been stopped by external modules + description: >- + RedelegationEntry defines a redelegation object + with relevant metadata. + description: entries are the redelegation entries. + description: >- + Redelegation contains the list of a particular + delegator's redelegating bonds + + from a particular source validator to a particular + destination validator. + entries: + type: array + items: + type: object + properties: + redelegation_entry: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the + redelegation took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for + redelegation completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance + when redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of + destination-validator shares created by + redelegation. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding + has been stopped by external modules + description: >- + RedelegationEntry defines a redelegation object + with relevant metadata. + balance: + type: string + description: >- + RedelegationEntryResponse is equivalent to a + RedelegationEntry except that it + + contains a balance in addition to shares which is more + suitable for client + + responses. + description: >- + RedelegationResponse is equivalent to a Redelegation except + that its entries + + contain a balance in addition to shares which is more + suitable for client + + responses. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryRedelegationsResponse is response type for the + Query/Redelegations RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + - name: src_validator_addr + description: src_validator_addr defines the validator address to redelegate from. + in: query + required: false + type: string + - name: dst_validator_addr + description: dst_validator_addr defines the validator address to redelegate to. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations: + get: + summary: >- + DelegatorUnbondingDelegations queries all unbonding delegations of a + given + + delegator address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1DelegatorUnbondingDelegations + responses: + '200': + description: A successful response. + schema: + type: object + properties: + unbonding_responses: + type: array + items: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding + took place. + completion_time: + type: string + format: date-time + description: >- + completion_time is the unix time for unbonding + completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially + scheduled to receive at completion. + balance: + type: string + description: >- + balance defines the tokens to receive at + completion. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has + been stopped by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object + with relevant metadata. + description: entries are the unbonding delegation entries. + description: >- + UnbondingDelegation stores all of a single delegator's + unbonding bonds + + for a single validator in an time-ordered list. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryUnbondingDelegatorDelegationsResponse is response type for + the + + Query/UnbondingDelegatorDelegations RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/staking/v1beta1/delegators/{delegator_addr}/validators: + get: + summary: |- + DelegatorValidators queries all validators info for given delegator + address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1DelegatorValidators + responses: + '200': + description: A successful response. + schema: + type: object + properties: + validators: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed + from bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at + which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for + the validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission + rates to be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to + delegators, as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate + which validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily + increase of the validator commission, as a + fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + description: >- + Validator defines a validator, together with the total + amount of the + + Validator's bond shares and their exchange rate to coins. + Slashing results in + + a decrease in the exchange rate, allowing correct + calculation of future + + undelegations without iterating over delegators. When coins + are delegated to + + this validator, the validator is credited with a delegation + whose number of + + bond shares is based on the amount of coins delegated + divided by the current + + exchange rate. Voting power can be calculated as total + bonded shares + + multiplied by exchange rate. + description: validators defines the validators' info of a delegator. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryDelegatorValidatorsResponse is response type for the + Query/DelegatorValidators RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}: + get: + summary: |- + DelegatorValidator queries validator info for given delegator validator + pair. + operationId: CosmosStakingV1Beta1DelegatorValidator + responses: + '200': + description: A successful response. + schema: + type: object + properties: + validator: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from + bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at + which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates + to be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, + as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase + of the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + description: >- + Validator defines a validator, together with the total amount + of the + + Validator's bond shares and their exchange rate to coins. + Slashing results in + + a decrease in the exchange rate, allowing correct calculation + of future + + undelegations without iterating over delegators. When coins + are delegated to + + this validator, the validator is credited with a delegation + whose number of + + bond shares is based on the amount of coins delegated divided + by the current + + exchange rate. Voting power can be calculated as total bonded + shares + + multiplied by exchange rate. + description: |- + QueryDelegatorValidatorResponse response type for the + Query/DelegatorValidator RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + - name: validator_addr + description: validator_addr defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/staking/v1beta1/historical_info/{height}: + get: + summary: HistoricalInfo queries the historical info for given height. + operationId: CosmosStakingV1Beta1HistoricalInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + hist: + description: hist defines the historical info at the given height. + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + valset: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the + validator's operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must + contain at least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name + should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, + for URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message + definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup + results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently + available in the official + + protobuf release, and it is not used for type + URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol + buffer message along with a + + URL that describes the type of the serialized + message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods + of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will + by default use + + 'type.googleapis.com/full.type.name' as the type URL + and the unpack + + methods only use the fully qualified type name after + the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" + will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded + message, with an + + additional field `@type` which contains the type + URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to + the `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed + from bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature + (ex. UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height + at which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time + for the validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission + rates to be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to + delegators, as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate + which validator can ever charge, as a + fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily + increase of the validator commission, as a + fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate + was changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has + been stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + description: >- + Validator defines a validator, together with the total + amount of the + + Validator's bond shares and their exchange rate to + coins. Slashing results in + + a decrease in the exchange rate, allowing correct + calculation of future + + undelegations without iterating over delegators. When + coins are delegated to + + this validator, the validator is credited with a + delegation whose number of + + bond shares is based on the amount of coins delegated + divided by the current + + exchange rate. Voting power can be calculated as total + bonded shares + + multiplied by exchange rate. + description: >- + QueryHistoricalInfoResponse is response type for the + Query/HistoricalInfo RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: height + description: height defines at which height to query the historical info. + in: path + required: true + type: string + format: int64 + tags: + - Query + /cosmos/staking/v1beta1/params: + get: + summary: Parameters queries the staking parameters. + operationId: CosmosStakingV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + unbonding_time: + type: string + description: unbonding_time is the time duration of unbonding. + max_validators: + type: integer + format: int64 + description: max_validators is the maximum number of validators. + max_entries: + type: integer + format: int64 + description: >- + max_entries is the max entries for either unbonding + delegation or redelegation (per pair/trio). + historical_entries: + type: integer + format: int64 + description: >- + historical_entries is the number of historical entries to + persist. + bond_denom: + type: string + description: bond_denom defines the bondable coin denomination. + min_commission_rate: + type: string + title: >- + min_commission_rate is the chain-wide minimum commission + rate that a validator can charge their delegators + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /cosmos/staking/v1beta1/pool: + get: + summary: Pool queries the pool info. + operationId: CosmosStakingV1Beta1Pool + responses: + '200': + description: A successful response. + schema: + type: object + properties: + pool: + description: pool defines the pool info. + type: object + properties: + not_bonded_tokens: + type: string + bonded_tokens: + type: string + description: QueryPoolResponse is response type for the Query/Pool RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /cosmos/staking/v1beta1/validators: + get: + summary: Validators queries all validators that match the given status. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1Validators + responses: + '200': + description: A successful response. + schema: + type: object + properties: + validators: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed + from bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at + which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for + the validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission + rates to be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to + delegators, as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate + which validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily + increase of the validator commission, as a + fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + description: >- + Validator defines a validator, together with the total + amount of the + + Validator's bond shares and their exchange rate to coins. + Slashing results in + + a decrease in the exchange rate, allowing correct + calculation of future + + undelegations without iterating over delegators. When coins + are delegated to + + this validator, the validator is credited with a delegation + whose number of + + bond shares is based on the amount of coins delegated + divided by the current + + exchange rate. Voting power can be calculated as total + bonded shares + + multiplied by exchange rate. + description: validators contains all the queried validators. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryValidatorsResponse is response type for the Query/Validators + RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: status + description: status enables to query for validators matching a given status. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/staking/v1beta1/validators/{validator_addr}: + get: + summary: Validator queries validator info for given validator address. + operationId: CosmosStakingV1Beta1Validator + responses: + '200': + description: A successful response. + schema: + type: object + properties: + validator: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from + bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at + which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates + to be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, + as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase + of the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + description: >- + Validator defines a validator, together with the total amount + of the + + Validator's bond shares and their exchange rate to coins. + Slashing results in + + a decrease in the exchange rate, allowing correct calculation + of future + + undelegations without iterating over delegators. When coins + are delegated to + + this validator, the validator is credited with a delegation + whose number of + + bond shares is based on the amount of coins delegated divided + by the current + + exchange rate. Voting power can be calculated as total bonded + shares + + multiplied by exchange rate. + title: >- + QueryValidatorResponse is response type for the Query/Validator + RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: validator_addr + description: validator_addr defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/staking/v1beta1/validators/{validator_addr}/delegations: + get: + summary: ValidatorDelegations queries delegate info for given validator. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1ValidatorDelegations + responses: + '200': + description: A successful response. + schema: + type: object + properties: + delegation_responses: + type: array + items: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of + the delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of + the validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an + account. It is + + owned by one delegator, and is associated with the + voting power of one + + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that + it contains a + + balance in addition to shares which is more suitable for + client responses. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: |- + QueryValidatorDelegationsResponse is response type for the + Query/ValidatorDelegations RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: validator_addr + description: validator_addr defines the validator address to query for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}: + get: + summary: Delegation queries delegate info for given validator delegator pair. + operationId: CosmosStakingV1Beta1Delegation + responses: + '200': + description: A successful response. + schema: + type: object + properties: + delegation_response: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an + account. It is + + owned by one delegator, and is associated with the voting + power of one + + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that it + contains a + + balance in addition to shares which is more suitable for + client responses. + description: >- + QueryDelegationResponse is response type for the Query/Delegation + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: validator_addr + description: validator_addr defines the validator address to query for. + in: path + required: true + type: string + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation: + get: + summary: |- + UnbondingDelegation queries unbonding info for given validator delegator + pair. + operationId: CosmosStakingV1Beta1UnbondingDelegation + responses: + '200': + description: A successful response. + schema: + type: object + properties: + unbond: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding + took place. + completion_time: + type: string + format: date-time + description: >- + completion_time is the unix time for unbonding + completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially + scheduled to receive at completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object + with relevant metadata. + description: entries are the unbonding delegation entries. + description: >- + UnbondingDelegation stores all of a single delegator's + unbonding bonds + + for a single validator in an time-ordered list. + description: >- + QueryDelegationResponse is response type for the + Query/UnbondingDelegation + + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: validator_addr + description: validator_addr defines the validator address to query for. + in: path + required: true + type: string + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations: + get: + summary: >- + ValidatorUnbondingDelegations queries unbonding delegations of a + validator. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1ValidatorUnbondingDelegations + responses: + '200': + description: A successful response. + schema: + type: object + properties: + unbonding_responses: + type: array + items: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding + took place. + completion_time: + type: string + format: date-time + description: >- + completion_time is the unix time for unbonding + completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially + scheduled to receive at completion. + balance: + type: string + description: >- + balance defines the tokens to receive at + completion. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has + been stopped by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object + with relevant metadata. + description: entries are the unbonding delegation entries. + description: >- + UnbondingDelegation stores all of a single delegator's + unbonding bonds + + for a single validator in an time-ordered list. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryValidatorUnbondingDelegationsResponse is response type for + the + + Query/ValidatorUnbondingDelegations RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: validator_addr + description: validator_addr defines the validator address to query for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/tx/v1beta1/decode: + post: + summary: TxDecode decodes the transaction. + description: 'Since: cosmos-sdk 0.47' + operationId: CosmosTxV1Beta1TxDecode + responses: + '200': + description: A successful response. + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.TxDecodeResponse' + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + description: |- + TxDecodeRequest is the request type for the Service.TxDecode + RPC method. + + Since: cosmos-sdk 0.47 + in: body + required: true + schema: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + description: |- + TxDecodeRequest is the request type for the Service.TxDecode + RPC method. + + Since: cosmos-sdk 0.47 + tags: + - Service + /cosmos/tx/v1beta1/decode/amino: + post: + summary: TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. + description: 'Since: cosmos-sdk 0.47' + operationId: CosmosTxV1Beta1TxDecodeAmino + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amino_json: + type: string + description: >- + TxDecodeAminoResponse is the response type for the + Service.TxDecodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + description: >- + TxDecodeAminoRequest is the request type for the + Service.TxDecodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + in: body + required: true + schema: + type: object + properties: + amino_binary: + type: string + format: byte + description: >- + TxDecodeAminoRequest is the request type for the + Service.TxDecodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + tags: + - Service + /cosmos/tx/v1beta1/encode: + post: + summary: TxEncode encodes the transaction. + description: 'Since: cosmos-sdk 0.47' + operationId: CosmosTxV1Beta1TxEncode + responses: + '200': + description: A successful response. + schema: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the encoded transaction bytes. + description: |- + TxEncodeResponse is the response type for the + Service.TxEncode method. + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + description: |- + TxEncodeRequest is the request type for the Service.TxEncode + RPC method. + + Since: cosmos-sdk 0.47 + in: body + required: true + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.TxEncodeRequest' + tags: + - Service + /cosmos/tx/v1beta1/encode/amino: + post: + summary: TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. + description: 'Since: cosmos-sdk 0.47' + operationId: CosmosTxV1Beta1TxEncodeAmino + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amino_binary: + type: string + format: byte + description: >- + TxEncodeAminoResponse is the response type for the + Service.TxEncodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + description: >- + TxEncodeAminoRequest is the request type for the + Service.TxEncodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + in: body + required: true + schema: + type: object + properties: + amino_json: + type: string + description: >- + TxEncodeAminoRequest is the request type for the + Service.TxEncodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + tags: + - Service + /cosmos/tx/v1beta1/simulate: + post: + summary: Simulate simulates executing a transaction for estimating gas usage. + operationId: CosmosTxV1Beta1Simulate + responses: + '200': + description: A successful response. + schema: + type: object + properties: + gas_info: + description: gas_info is the information about gas used in the simulation. + type: object + properties: + gas_wanted: + type: string + format: uint64 + description: >- + GasWanted is the maximum units of work we allow this tx to + perform. + gas_used: + type: string + format: uint64 + description: GasUsed is the amount of gas actually consumed. + result: + description: result is the result of the simulation. + type: object + properties: + data: + type: string + format: byte + description: >- + Data is any data returned from message or handler + execution. It MUST be + + length prefixed in order to separate data from multiple + message executions. + + Deprecated. This field is still populated, but prefer + msg_response instead + + because it also contains the Msg response typeURL. + log: + type: string + description: >- + Log contains the log information from message or handler + execution. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, + associated with an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx + and ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events contains a slice of Event objects that were emitted + during message + + or handler execution. + msg_responses: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + msg_responses contains the Msg handler responses type + packed in Anys. + + + Since: cosmos-sdk 0.46 + description: |- + SimulateResponse is the response type for the + Service.SimulateRPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + description: |- + SimulateRequest is the request type for the Service.Simulate + RPC method. + in: body + required: true + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.SimulateRequest' + tags: + - Service + /cosmos/tx/v1beta1/txs: + get: + summary: GetTxsEvent fetches txs by event. + operationId: CosmosTxV1Beta1GetTxsEvent + responses: + '200': + description: A successful response. + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.GetTxsEventResponse' + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: events + description: events is the list of transaction event type. + in: query + required: false + type: array + items: + type: string + collectionFormat: multi + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + - name: order_by + description: |2- + - ORDER_BY_UNSPECIFIED: ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. + - ORDER_BY_ASC: ORDER_BY_ASC defines ascending order + - ORDER_BY_DESC: ORDER_BY_DESC defines descending order + in: query + required: false + type: string + enum: + - ORDER_BY_UNSPECIFIED + - ORDER_BY_ASC + - ORDER_BY_DESC + default: ORDER_BY_UNSPECIFIED + - name: page + description: >- + page is the page number to query, starts at 1. If not provided, will + default to first page. + in: query + required: false + type: string + format: uint64 + - name: limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + tags: + - Service + post: + summary: BroadcastTx broadcast transaction. + operationId: CosmosTxV1Beta1BroadcastTx + responses: + '200': + description: A successful response. + schema: + type: object + properties: + tx_response: + description: tx_response is the queried TxResponses. + type: object + properties: + height: + type: string + format: int64 + title: The block height + txhash: + type: string + description: The transaction hash. + codespace: + type: string + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. + data: + type: string + description: Result bytes, if any. + raw_log: + type: string + description: >- + The output of the application's logger (raw string). May + be + + non-deterministic. + logs: + type: array + items: + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where + the key and value are + + strings instead of raw bytes. + description: >- + StringEvent defines en Event object wrapper where + all the attributes + + contain key/value pairs that are strings instead + of raw bytes. + description: >- + Events contains a slice of Event objects that were + emitted during some + + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed + tx ABCI message log. + description: >- + The output of the application's logger (typed). May be + non-deterministic. + info: + type: string + description: Additional information. May be non-deterministic. + gas_wanted: + type: string + format: int64 + description: Amount of gas requested for transaction. + gas_used: + type: string + format: int64 + description: Amount of gas consumed by transaction. + tx: + description: The request transaction bytes. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + timestamp: + type: string + description: >- + Time of the previous block. For heights > 1, it's the + weighted median of + + the timestamps of the valid votes in the block.LastCommit. + For height == 1, + + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, + associated with an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx + and ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a + transaction. Note, + + these events include those emitted by processing all the + messages and those + + emitted from the ante. Whereas Logs contains the events, + with + + additional metadata, emitted only by processing the + messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: |- + BroadcastTxResponse is the response type for the + Service.BroadcastTx method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + description: >- + BroadcastTxRequest is the request type for the + Service.BroadcastTxRequest + + RPC method. + in: body + required: true + schema: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + mode: + type: string + enum: + - BROADCAST_MODE_UNSPECIFIED + - BROADCAST_MODE_BLOCK + - BROADCAST_MODE_SYNC + - BROADCAST_MODE_ASYNC + default: BROADCAST_MODE_UNSPECIFIED + description: >- + BroadcastMode specifies the broadcast mode for the + TxService.Broadcast RPC method. + + - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x + onwards. + - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + a CheckTx execution response only. + - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + immediately. + description: >- + BroadcastTxRequest is the request type for the + Service.BroadcastTxRequest + + RPC method. + tags: + - Service + /cosmos/tx/v1beta1/txs/block/{height}: + get: + summary: GetBlockWithTxs fetches a block with decoded txs. + description: 'Since: cosmos-sdk 0.45.2' + operationId: CosmosTxV1Beta1GetBlockWithTxs + responses: + '200': + description: A successful response. + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.GetBlockWithTxsResponse' + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: height + description: height is the height of the block to query. + in: path + required: true + type: string + format: int64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Service + /cosmos/tx/v1beta1/txs/{hash}: + get: + summary: GetTx fetches a tx by hash. + operationId: CosmosTxV1Beta1GetTx + responses: + '200': + description: A successful response. + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.GetTxResponse' + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: hash + description: hash is the tx hash to query, encoded as a hex string. + in: path + required: true + type: string + tags: + - Service + /cosmos/upgrade/v1beta1/applied_plan/{name}: + get: + summary: AppliedPlan queries a previously applied upgrade plan by its name. + operationId: CosmosUpgradeV1Beta1AppliedPlan + responses: + '200': + description: A successful response. + schema: + type: object + properties: + height: + type: string + format: int64 + description: height is the block height at which the plan was applied. + description: >- + QueryAppliedPlanResponse is the response type for the + Query/AppliedPlan RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: name + description: name is the name of the applied plan to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/upgrade/v1beta1/authority: + get: + summary: Returns the account with authority to conduct upgrades + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosUpgradeV1Beta1Authority + responses: + '200': + description: A successful response. + schema: + type: object + properties: + address: + type: string + description: 'Since: cosmos-sdk 0.46' + title: QueryAuthorityResponse is the response type for Query/Authority + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /cosmos/upgrade/v1beta1/current_plan: + get: + summary: CurrentPlan queries the current upgrade plan. + operationId: CosmosUpgradeV1Beta1CurrentPlan + responses: + '200': + description: A successful response. + schema: + type: object + properties: + plan: + description: plan is the current upgrade plan. + type: object + properties: + name: + type: string + description: >- + Sets the name for the upgrade. This name will be used by + the upgraded + + version of the software to apply any special "on-upgrade" + commands during + + the first BeginBlock method after the upgrade is applied. + It is also used + + to detect whether a software version can handle a given + upgrade. If no + + upgrade handler with this name has been set in the + software, it will be + + assumed that the software is out-of-date when the upgrade + Time or Height is + + reached and the software will exit. + time: + type: string + format: date-time + description: >- + Deprecated: Time based upgrades have been deprecated. Time + based upgrade logic + + has been removed from the SDK. + + If this field is not empty, an error will be thrown. + height: + type: string + format: int64 + description: The height at which the upgrade must be performed. + info: + type: string + title: >- + Any application specific upgrade info to be included + on-chain + + such as a git commit that validators could automatically + upgrade to + upgraded_client_state: + description: >- + Deprecated: UpgradedClientState field has been deprecated. + IBC upgrade logic has been + + moved to the IBC module in the sub module 02-client. + + If this field is not empty, an error will be thrown. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + QueryCurrentPlanResponse is the response type for the + Query/CurrentPlan RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /cosmos/upgrade/v1beta1/module_versions: + get: + summary: ModuleVersions queries the list of module versions from state. + description: 'Since: cosmos-sdk 0.43' + operationId: CosmosUpgradeV1Beta1ModuleVersions + responses: + '200': + description: A successful response. + schema: + type: object + properties: + module_versions: + type: array + items: + type: object + properties: + name: + type: string + title: name of the app module + version: + type: string + format: uint64 + title: consensus version of the app module + description: |- + ModuleVersion specifies a module and its consensus version. + + Since: cosmos-sdk 0.43 + description: >- + module_versions is a list of module names with their consensus + versions. + description: >- + QueryModuleVersionsResponse is the response type for the + Query/ModuleVersions + + RPC method. + + + Since: cosmos-sdk 0.43 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: module_name + description: |- + module_name is a field to query a specific module + consensus version from state. Leaving this empty will + fetch the full list of module versions from state + in: query + required: false + type: string + tags: + - Query + /cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}: + get: + summary: >- + UpgradedConsensusState queries the consensus state that will serve + + as a trusted kernel for the next version of this chain. It will only be + + stored at the last height of this chain. + + UpgradedConsensusState RPC not supported with legacy querier + + This rpc is deprecated now that IBC has its own replacement + + (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) + operationId: CosmosUpgradeV1Beta1UpgradedConsensusState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + upgraded_consensus_state: + type: string + format: byte + title: 'Since: cosmos-sdk 0.43' + description: >- + QueryUpgradedConsensusStateResponse is the response type for the + Query/UpgradedConsensusState + + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: last_height + description: |- + last height of the current chain must be sent in request + as this is the height under which next consensus state is stored + in: path + required: true + type: string + format: int64 + tags: + - Query + /evmos/feemarket/v1/base_fee: + get: + summary: BaseFee queries the base fee of the parent block of the current block. + operationId: EthermintFeemarketV1BaseFee + responses: + '200': + description: A successful response. + schema: + type: object + properties: + base_fee: + type: string + title: base_fee is the EIP1559 base fee + description: QueryBaseFeeResponse returns the EIP1559 base fee. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/feemarket/v1/block_gas: + get: + summary: BlockGas queries the gas used at a given block height + operationId: EthermintFeemarketV1BlockGas + responses: + '200': + description: A successful response. + schema: + type: object + properties: + gas: + type: string + format: int64 + title: gas is the returned block gas + description: QueryBlockGasResponse returns block gas used for a given height. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/feemarket/v1/params: + get: + summary: Params queries the parameters of x/feemarket module. + operationId: EthermintFeemarketV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params define the evm module parameters. + type: object + properties: + no_base_fee: + type: boolean + title: >- + no_base_fee forces the EIP-1559 base fee to 0 (needed for + 0 price calls) + base_fee_change_denominator: + type: integer + format: int64 + description: >- + base_fee_change_denominator bounds the amount the base fee + can change + + between blocks. + elasticity_multiplier: + type: integer + format: int64 + description: >- + elasticity_multiplier bounds the maximum gas limit an + EIP-1559 block may + + have. + enable_height: + type: string + format: int64 + description: >- + enable_height defines at which block height the base fee + calculation is enabled. + base_fee: + type: string + description: base_fee for EIP-1559 blocks. + min_gas_price: + type: string + title: >- + min_gas_price defines the minimum gas price value for + cosmos and eth transactions + min_gas_multiplier: + type: string + title: >- + min_gas_multiplier bounds the minimum gas used to be + charged + + to senders based on gas limit + title: Params defines the EVM module parameters + description: >- + QueryParamsResponse defines the response type for querying x/evm + parameters. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/claims/v1/claims_records: + get: + summary: ClaimsRecords returns all claims records + operationId: EvmosClaimsV1ClaimsRecords + responses: + '200': + description: A successful response. + schema: + type: object + properties: + claims: + type: array + items: + type: object + properties: + address: + type: string + title: address of claiming user in either bech32 or hex format + initial_claimable_amount: + type: string + title: initial_claimable_amount for the user + actions_completed: + type: array + items: + type: boolean + title: >- + actions_completed is a slice that describes which + actions were completed + description: >- + ClaimsRecordAddress is the claims metadata per address that + is used at + + Genesis. + title: claims defines all claims records + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryClaimsRecordsResponse is the response type for the + Query/ClaimsRecords + + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /evmos/claims/v1/claims_records/{address}: + get: + summary: ClaimsRecord returns the claims record for a given address + operationId: EvmosClaimsV1ClaimsRecord + responses: + '200': + description: A successful response. + schema: + type: object + properties: + initial_claimable_amount: + type: string + title: initial_claimable_amount of the user + claims: + type: array + items: + type: object + properties: + action: + title: action enum + type: string + enum: + - ACTION_UNSPECIFIED + - ACTION_VOTE + - ACTION_DELEGATE + - ACTION_EVM + - ACTION_IBC_TRANSFER + default: ACTION_UNSPECIFIED + description: >- + Action defines the list of available actions to claim + the airdrop tokens. + + - ACTION_UNSPECIFIED: ACTION_UNSPECIFIED defines an invalid action. + - ACTION_VOTE: ACTION_VOTE defines a proposal vote. + - ACTION_DELEGATE: ACTION_DELEGATE defines an staking delegation. + - ACTION_EVM: ACTION_EVM defines an EVM transaction. + - ACTION_IBC_TRANSFER: ACTION_IBC_TRANSFER defines a fungible token transfer transaction via IBC. + completed: + type: boolean + title: completed is true if the action has been completed + claimable_amount: + type: string + title: >- + claimable_amount of tokens for the action. Zero if + completed + description: >- + Claim defines the action, completed flag and the remaining + claimable amount + + for a given user. This is only used during client queries. + title: claims of the user + description: >- + QueryClaimsRecordResponse is the response type for the + Query/ClaimsRecord RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: address + description: address defines the user to query claims record for + in: path + required: true + type: string + tags: + - Query + /evmos/claims/v1/params: + get: + summary: Params returns the claims module parameters + operationId: EvmosClaimsV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + enable_claims: + type: boolean + title: >- + enable_claims is the parameter to enable the claiming + process + airdrop_start_time: + type: string + format: date-time + title: >- + airdrop_start_time defines the timestamp of the airdrop + start + duration_until_decay: + type: string + title: duration_until_decay of claimable tokens begin + duration_of_decay: + type: string + title: duration_of_decay for token claim decay period + claims_denom: + type: string + title: claims_denom is the denomination of the claimable coin + authorized_channels: + type: array + items: + type: string + description: >- + authorized_channels is the list of authorized channel + identifiers that can perform address + + attestations via IBC. + evm_channels: + type: array + items: + type: string + title: >- + evm_channels is the list of channel identifiers from EVM + compatible chains + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/claims/v1/total_unclaimed: + get: + summary: TotalUnclaimed queries the total unclaimed tokens from the airdrop + operationId: EvmosClaimsV1TotalUnclaimed + responses: + '200': + description: A successful response. + schema: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: coins defines the unclaimed coins + description: >- + QueryTotalUnclaimedResponse is the response type for the + Query/TotalUnclaimed + + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/epochs/v1/current_epoch: + get: + summary: CurrentEpoch provide current epoch of specified identifier + operationId: EvmosEpochsV1CurrentEpoch + responses: + '200': + description: A successful response. + schema: + type: object + properties: + current_epoch: + type: string + format: int64 + title: current_epoch is the number of the current epoch + description: >- + QueryCurrentEpochResponse is the response type for the + Query/EpochInfos RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: identifier + description: identifier of the current epoch + in: query + required: false + type: string + tags: + - Query + /evmos/epochs/v1/epochs: + get: + summary: EpochInfos provide running epochInfos + operationId: EvmosEpochsV1EpochInfos + responses: + '200': + description: A successful response. + schema: + type: object + properties: + epochs: + type: array + items: + type: object + properties: + identifier: + type: string + title: identifier of the epoch + start_time: + type: string + format: date-time + title: start_time of the epoch + duration: + type: string + title: duration of the epoch + current_epoch: + type: string + format: int64 + title: current_epoch is the integer identifier of the epoch + current_epoch_start_time: + type: string + format: date-time + title: >- + current_epoch_start_time defines the timestamp of the + start of the epoch + epoch_counting_started: + type: boolean + title: >- + epoch_counting_started reflects if the counting for the + epoch has started + current_epoch_start_height: + type: string + format: int64 + title: current_epoch_start_height of the epoch + description: >- + EpochInfo defines the message interface containing the + relevant informations about + + an epoch. + title: epochs is a slice of all EpochInfos + pagination: + description: pagination defines an optional pagination for the request. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryEpochsInfoResponse is the response type for the + Query/EpochInfos RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /evmos/erc20/v1/params: + get: + summary: Params retrieves the erc20 module params + operationId: EvmosErc20V1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + title: params are the erc20 module parameters + type: object + properties: + enable_erc20: + type: boolean + description: >- + enable_erc20 is the parameter to enable the conversion of + Cosmos coins <--> ERC20 tokens. + enable_evm_hook: + type: boolean + description: >- + enable_evm_hook is the parameter to enable the EVM hook + that converts an ERC20 token to a Cosmos + + Coin by transferring the Tokens through a MsgEthereumTx to + the ModuleAddress Ethereum address. + description: |- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/erc20/v1/token_pairs: + get: + summary: TokenPairs retrieves registered token pairs + operationId: EvmosErc20V1TokenPairs + responses: + '200': + description: A successful response. + schema: + type: object + properties: + token_pairs: + type: array + items: + type: object + properties: + erc20_address: + type: string + title: erc20_address is the hex address of ERC20 contract token + denom: + type: string + title: >- + denom defines the cosmos base denomination to be mapped + to + enabled: + type: boolean + title: enabled defines the token mapping enable status + contract_owner: + title: >- + contract_owner is the an ENUM specifying the type of + ERC20 owner (0 invalid, 1 ModuleAccount, 2 external + address) + type: string + enum: + - OWNER_UNSPECIFIED + - OWNER_MODULE + - OWNER_EXTERNAL + default: OWNER_UNSPECIFIED + description: |- + Owner enumerates the ownership of a ERC20 contract. + + - OWNER_UNSPECIFIED: OWNER_UNSPECIFIED defines an invalid/undefined owner. + - OWNER_MODULE: OWNER_MODULE - erc20 is owned by the erc20 module account. + - OWNER_EXTERNAL: OWNER_EXTERNAL - erc20 is owned by an external account. + description: >- + TokenPair defines an instance that records a pairing + consisting of a native + + Cosmos Coin and an ERC20 token address. + title: >- + token_pairs is a slice of registered token pairs for the erc20 + module + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryTokenPairsResponse is the response type for the + Query/TokenPairs RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /evmos/erc20/v1/token_pairs/{token}: + get: + summary: TokenPair retrieves a registered token pair + operationId: EvmosErc20V1TokenPair + responses: + '200': + description: A successful response. + schema: + type: object + properties: + token_pair: + type: object + properties: + erc20_address: + type: string + title: erc20_address is the hex address of ERC20 contract token + denom: + type: string + title: denom defines the cosmos base denomination to be mapped to + enabled: + type: boolean + title: enabled defines the token mapping enable status + contract_owner: + title: >- + contract_owner is the an ENUM specifying the type of ERC20 + owner (0 invalid, 1 ModuleAccount, 2 external address) + type: string + enum: + - OWNER_UNSPECIFIED + - OWNER_MODULE + - OWNER_EXTERNAL + default: OWNER_UNSPECIFIED + description: |- + Owner enumerates the ownership of a ERC20 contract. + + - OWNER_UNSPECIFIED: OWNER_UNSPECIFIED defines an invalid/undefined owner. + - OWNER_MODULE: OWNER_MODULE - erc20 is owned by the erc20 module account. + - OWNER_EXTERNAL: OWNER_EXTERNAL - erc20 is owned by an external account. + description: >- + TokenPair defines an instance that records a pairing + consisting of a native + + Cosmos Coin and an ERC20 token address. + title: >- + token_pairs returns the info about a registered token pair for + the erc20 module + description: >- + QueryTokenPairResponse is the response type for the + Query/TokenPair RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: token + description: >- + token identifier can be either the hex contract address of the ERC20 + or the + + Cosmos base denomination + in: path + required: true + type: string + tags: + - Query + /evmos/erc20/v1/tx/convert_coin: + get: + summary: |- + ConvertCoin mints a ERC20 representation of the native Cosmos coin denom + that is registered on the token mapping. + operationId: EvmosErc20V1ConvertCoin + responses: + '200': + description: A successful response. + schema: + type: object + title: MsgConvertCoinResponse returns no fields + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: coin.denom + in: query + required: false + type: string + - name: coin.amount + in: query + required: false + type: string + - name: receiver + description: receiver is the hex address to receive ERC20 token + in: query + required: false + type: string + - name: sender + description: >- + sender is the cosmos bech32 address from the owner of the given + Cosmos coins + in: query + required: false + type: string + tags: + - Msg + /evmos/erc20/v1/tx/convert_erc20: + get: + summary: >- + ConvertERC20 mints a native Cosmos coin representation of the ERC20 + token + + contract that is registered on the token mapping. + operationId: EvmosErc20V1ConvertERC20 + responses: + '200': + description: A successful response. + schema: + type: object + title: MsgConvertERC20Response returns no fields + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: contract_address + description: >- + contract_address of an ERC20 token contract, that is registered in a + token pair + in: query + required: false + type: string + - name: amount + description: amount of ERC20 tokens to convert + in: query + required: false + type: string + - name: receiver + description: receiver is the bech32 address to receive native Cosmos coins + in: query + required: false + type: string + - name: sender + description: sender is the hex address from the owner of the given ERC20 tokens + in: query + required: false + type: string + tags: + - Msg + /evmos/incentives/v1/allocation_meters: + get: + summary: |- + AllocationMeters retrieves active allocation meters for a given + denomination + operationId: EvmosIncentivesV1AllocationMeters + responses: + '200': + description: A successful response. + schema: + type: object + properties: + allocation_meters: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + title: allocation_meters is a slice of all allocations + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryAllocationMetersResponse is the response type for the + Query/AllocationMeters RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /evmos/incentives/v1/allocation_meters/{denom}: + get: + summary: AllocationMeter retrieves a active gas meter + operationId: EvmosIncentivesV1AllocationMeter + responses: + '200': + description: A successful response. + schema: + type: object + properties: + allocation_meter: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + title: allocation_meter defines the allocation of the queried denom + description: |- + QueryAllocationMeterResponse is the response type for the + Query/AllocationMeter RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: denom + description: denom is the coin denom to query an allocation meter for. + in: path + required: true + type: string + tags: + - Query + /evmos/incentives/v1/gas_meters/{contract}: + get: + summary: GasMeters retrieves active gas meters for a given contract + operationId: EvmosIncentivesV1GasMeters + responses: + '200': + description: A successful response. + schema: + type: object + properties: + gas_meters: + type: array + items: + type: object + properties: + contract: + type: string + title: >- + contract is the hex address of the incentivized smart + contract + participant: + type: string + title: participant address that interacts with the incentive + cumulative_gas: + type: string + format: uint64 + title: cumulative_gas spent during the epoch + title: >- + GasMeter tracks the cumulative gas spent per participant in + one epoch + title: >- + gas_meters is a slice of the gas meters for an incentivized + smart contract + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGasMetersResponse is the response type for the + Query/Incentives RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: contract + description: >- + contract is the hex contract address of a incentivized smart + contract + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /evmos/incentives/v1/gas_meters/{contract}/{participant}: + get: + summary: GasMeter retrieves a active gas meter + operationId: EvmosIncentivesV1GasMeter + responses: + '200': + description: A successful response. + schema: + type: object + properties: + gas_meter: + type: string + format: uint64 + title: >- + gas_meter is a gas meter for one participant on an + incentivized smart contract + description: >- + QueryGasMeterResponse is the response type for the Query/Incentive + RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: contract + description: contract is the hex contract address of a contract + in: path + required: true + type: string + - name: participant + description: participant is the hex address of a user + in: path + required: true + type: string + tags: + - Query + /evmos/incentives/v1/incentives: + get: + summary: Incentives retrieves registered incentives + operationId: EvmosIncentivesV1Incentives + responses: + '200': + description: A successful response. + schema: + type: object + properties: + incentives: + type: array + items: + type: object + properties: + contract: + type: string + title: >- + contract address of the smart contract to be + incentivized + allocations: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a + decimal amount. + + + NOTE: The amount field is an Dec which implements the + custom method + + signatures required by gogoproto. + title: >- + allocations is a slice of denoms and percentages of + rewards to be allocated + epochs: + type: integer + format: int64 + title: >- + epochs defines the number of remaining epochs for the + incentive + start_time: + type: string + format: date-time + title: start_time of the incentive distribution + total_gas: + type: string + format: uint64 + title: >- + total_gas is the cumulative gas spent by all gas meters + of the incentive during the epoch + title: >- + Incentive defines an instance that organizes distribution + conditions for a + + given smart contract + title: incentives is a slice of all incentives + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryIncentivesResponse is the response type for the + Query/Incentives RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /evmos/incentives/v1/incentives/{contract}: + get: + summary: Incentive retrieves a registered incentive + operationId: EvmosIncentivesV1Incentive + responses: + '200': + description: A successful response. + schema: + type: object + properties: + incentive: + type: object + properties: + contract: + type: string + title: contract address of the smart contract to be incentivized + allocations: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a + decimal amount. + + + NOTE: The amount field is an Dec which implements the + custom method + + signatures required by gogoproto. + title: >- + allocations is a slice of denoms and percentages of + rewards to be allocated + epochs: + type: integer + format: int64 + title: >- + epochs defines the number of remaining epochs for the + incentive + start_time: + type: string + format: date-time + title: start_time of the incentive distribution + total_gas: + type: string + format: uint64 + title: >- + total_gas is the cumulative gas spent by all gas meters of + the incentive during the epoch + title: >- + Incentive defines an instance that organizes distribution + conditions for a + + given smart contract + description: >- + QueryIncentiveResponse is the response type for the + Query/Incentive RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: contract + description: >- + contract is the hex contract address of a incentivized smart + contract + in: path + required: true + type: string + tags: + - Query + /evmos/incentives/v1/params: + get: + summary: Params retrieves the incentives module params + operationId: EvmosIncentivesV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + title: params are the incentives module parameters + type: object + properties: + enable_incentives: + type: boolean + title: enable_incentives is the parameter to enable incentives + allocation_limit: + type: string + title: >- + allocation_limit is the maximum percentage an incentive + can allocate per denomination + incentives_epoch_identifier: + type: string + title: incentives_epoch_identifier for the epochs module hooks + reward_scaler: + type: string + title: reward_scaler is the scaling factor for capping rewards + description: |- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/inflation/v1/circulating_supply: + get: + summary: |- + CirculatingSupply retrieves the total number of tokens that are in + circulation (i.e. excluding unvested tokens). + operationId: EvmosInflationV1CirculatingSupply + responses: + '200': + description: A successful response. + schema: + type: object + properties: + circulating_supply: + title: circulating_supply is the total amount of coins in circulation + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: |- + QueryCirculatingSupplyResponse is the response type for the + Query/CirculatingSupply RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/inflation/v1/epoch_mint_provision: + get: + summary: EpochMintProvision retrieves current minting epoch provision value. + operationId: EvmosInflationV1EpochMintProvision + responses: + '200': + description: A successful response. + schema: + type: object + properties: + epoch_mint_provision: + description: >- + epoch_mint_provision is the current minting per epoch + provision value. + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + QueryEpochMintProvisionResponse is the response type for the + Query/EpochMintProvision RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/inflation/v1/inflation_rate: + get: + summary: InflationRate retrieves the inflation rate of the current period. + operationId: EvmosInflationV1InflationRate + responses: + '200': + description: A successful response. + schema: + type: object + properties: + inflation_rate: + type: string + title: >- + inflation_rate by which the total supply increases within one + period + description: >- + QueryInflationRateResponse is the response type for the + Query/InflationRate + + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/inflation/v1/params: + get: + summary: Params retrieves the total set of minting parameters. + operationId: EvmosInflationV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + mint_denom: + type: string + title: mint_denom specifies the type of coin to mint + exponential_calculation: + title: >- + exponential_calculation takes in the variables to + calculate exponential inflation + type: object + properties: + a: + type: string + title: a defines the initial value + r: + type: string + title: r defines the reduction factor + c: + type: string + title: c defines the parameter for long term inflation + bonding_target: + type: string + title: bonding_target + max_variance: + type: string + title: max_variance + inflation_distribution: + title: inflation_distribution of the minted denom + type: object + properties: + staking_rewards: + type: string + title: >- + staking_rewards defines the proportion of the minted + minted_denom that is + + to be allocated as staking rewards + usage_incentives: + type: string + title: >- + usage_incentives defines the proportion of the minted + minted_denom that is + + to be allocated to the incentives module address + community_pool: + type: string + title: >- + community_pool defines the proportion of the minted + minted_denom that is to + + be allocated to the community pool + enable_inflation: + type: boolean + title: >- + enable_inflation is the parameter that enables inflation + and halts increasing the skipped_epochs + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/inflation/v1/period: + get: + summary: Period retrieves current period. + operationId: EvmosInflationV1Period + responses: + '200': + description: A successful response. + schema: + type: object + properties: + period: + type: string + format: uint64 + description: period is the current minting per epoch provision value. + description: >- + QueryPeriodResponse is the response type for the Query/Period RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/inflation/v1/skipped_epochs: + get: + summary: SkippedEpochs retrieves the total number of skipped epochs. + operationId: EvmosInflationV1SkippedEpochs + responses: + '200': + description: A successful response. + schema: + type: object + properties: + skipped_epochs: + type: string + format: uint64 + description: >- + skipped_epochs is the number of epochs that the inflation + module has been disabled. + description: >- + QuerySkippedEpochsResponse is the response type for the + Query/SkippedEpochs + + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/recovery/v1/params: + get: + summary: Params retrieves the total set of recovery parameters. + operationId: EvmosRecoveryV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + enable_recovery: + type: boolean + title: enable_recovery IBC middleware + packet_timeout_duration: + type: string + title: >- + packet_timeout_duration is the duration added to timeout + timestamp for balances recovered via IBC packets + title: Params holds parameters for the recovery module + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /evmos/vesting/v2/balances/{address}: + get: + summary: >- + Balances retrieves the unvested, vested and locked tokens for a vesting + account + operationId: EvmosVestingV2Balances + responses: + '200': + description: A successful response. + schema: + type: object + properties: + locked: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: locked defines the current amount of locked tokens + unvested: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: unvested defines the current amount of unvested tokens + vested: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: vested defines the current amount of vested tokens + description: >- + QueryBalancesResponse is the response type for the Query/Balances + RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: address + description: address of the clawback vesting account + in: path + required: true + type: string + tags: + - Query + /evmos/vesting/v2/tx/clawback: + get: + summary: Clawback removes the unvested tokens from a ClawbackVestingAccount. + operationId: EvmosVestingV2Clawback + responses: + '200': + description: A successful response. + schema: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: coins is the slice of clawed back coins + description: MsgClawbackResponse defines the MsgClawback response type. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: funder_address + description: funder_address is the address which funded the account + in: query + required: false + type: string + - name: account_address + description: >- + account_address is the address of the ClawbackVestingAccount to claw + back + + from. + in: query + required: false + type: string + - name: dest_address + description: >- + dest_address specifies where the clawed-back tokens should be + transferred + + to. If empty, the tokens will be transferred back to the original + funder of + + the account. + in: query + required: false + type: string + tags: + - Msg + /evmos/vesting/v2/tx/convert_vesting_account: + get: + summary: >- + ConvertVestingAccount converts a ClawbackVestingAccount to an Eth + account + operationId: EvmosVestingV2ConvertVestingAccount + responses: + '200': + description: A successful response. + schema: + type: object + description: >- + MsgConvertVestingAccountResponse defines the + MsgConvertVestingAccount response type. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: vesting_address + description: vesting_address is the address of the vesting account to convert + in: query + required: false + type: string + tags: + - Msg + /evmos/vesting/v2/tx/create_clawback_vesting_account: + get: + summary: >- + CreateClawbackVestingAccount creats a vesting account that is subject to + clawback. + operationId: EvmosVestingV2CreateClawbackVestingAccount + responses: + '200': + description: A successful response. + schema: + type: object + description: |- + MsgCreateClawbackVestingAccountResponse defines the + MsgCreateClawbackVestingAccount response type. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: funder_address + description: >- + funder_address specifies the account that will be able to fund the + vesting account + in: query + required: false + type: string + - name: vesting_address + description: >- + vesting_address specifies the address that will receive the vesting + tokens + in: query + required: false + type: string + - name: enable_gov_clawback + description: >- + enable_gov_clawback specifies whether the governance module can + clawback this account + in: query + required: false + type: boolean + tags: + - Msg + /evmos/vesting/v2/tx/fund_vesting_account: + get: + summary: |- + FundVestingAccount funds an existing ClawbackVestingAccount with tokens + according to the vesting and lockup schedules. + operationId: EvmosVestingV2FundVestingAccount + responses: + '200': + description: A successful response. + schema: + type: object + description: |- + MsgFundVestingAccountResponse defines the + MsgFundVestingAccount response type. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: funder_address + description: funder_address specifies the account that funds the vesting account + in: query + required: false + type: string + - name: vesting_address + description: vesting_address specifies the account that receives the funds + in: query + required: false + type: string + - name: start_time + description: start_time defines the time at which the vesting period begins + in: query + required: false + type: string + format: date-time + tags: + - Msg + /evmos/vesting/v2/tx/update_vesting_funder: + get: + summary: |- + UpdateVestingFunder updates the funder address of an existing + ClawbackVestingAccount. + operationId: EvmosVestingV2UpdateVestingFunder + responses: + '200': + description: A successful response. + schema: + type: object + description: >- + MsgUpdateVestingFunderResponse defines the MsgUpdateVestingFunder + response + + type. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: funder_address + description: >- + funder_address is the current funder address of the + ClawbackVestingAccount + in: query + required: false + type: string + - name: new_funder_address + description: >- + new_funder_address is the new address to replace the existing + funder_address + in: query + required: false + type: string + - name: vesting_address + description: >- + vesting_address is the address of the ClawbackVestingAccount being + updated + in: query + required: false + type: string + tags: + - Msg + /exocore/delegation/v1/GetDelegationInfo: + get: + summary: Balance queries the balance of a single coin for a single account. + operationId: ExocoreDelegationV1QueryDelegationInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + TotalDelegatedAmount: + type: string + delegationInfos: + type: object + additionalProperties: + type: object + properties: + CanUndelegationAmount: + type: string + WaitUndelegationAmount: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: stakerID + in: query + required: false + type: string + - name: assetID + in: query + required: false + type: string + tags: + - Query + /exocore/delegation/v1/GetOperatorInfo: + get: + operationId: ExocoreDelegationV1QueryOperatorInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + EarningsAddr: + type: string + ApproveAddr: + type: string + OperatorMetaInfo: + type: string + ClientChainEarningsAddr: + type: object + properties: + EarningInfoList: + type: array + items: + type: object + properties: + lzClientChainID: + type: string + format: uint64 + clientChainEarningAddr: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: OperatorAddr + in: query + required: false + type: string + tags: + - Query + /exocore/delegation/v1/QuerySingleDelegationInfo: + get: + operationId: ExocoreDelegationV1QuerySingleDelegationInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + CanUndelegationAmount: + type: string + WaitUndelegationAmount: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: stakerID + in: query + required: false + type: string + - name: operatorAddr + in: query + required: false + type: string + - name: assetID + in: query + required: false + type: string + tags: + - Query + /exocore/deposit/v1/Params: + get: + summary: Params retrieves the deposit module params + operationId: ExocoreDepositV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: >- + GenesisState defines the restaking_assets_manage module's + genesis state. + description: |- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /ExocoreNetwork/exocore/oracle/params: + get: + summary: Parameters queries the parameters of the module. + operationId: ExocoreOracleParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /exocore/restaking_assets_manage/v1/QueAllClientChainInfo: + get: + operationId: ExocoreRestakingAssetsManageV1QueAllClientChainInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + allClientChainInfos: + type: object + additionalProperties: + type: object + properties: + Name: + type: string + MetaInfo: + type: string + ChainId: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + FinalizationBlocks: + type: string + format: uint64 + LayerZeroChainID: + type: string + format: uint64 + SignatureType: + type: string + AddressLength: + type: integer + format: int64 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /exocore/restaking_assets_manage/v1/QueAllStakingAssetsInfo: + get: + operationId: ExocoreRestakingAssetsManageV1QueAllStakingAssetsInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + allStakingAssetsInfo: + type: object + additionalProperties: + type: object + properties: + AssetBasicInfo: + type: object + properties: + Name: + type: string + Symbol: + type: string + Address: + type: string + Decimals: + type: integer + format: int64 + TotalSupply: + type: string + LayerZeroChainID: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + MetaInfo: + type: string + StakingTotalAmount: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /exocore/restaking_assets_manage/v1/QueClientChainInfoByIndex: + get: + summary: Balance queries the balance of a single coin for a single account. + operationId: ExocoreRestakingAssetsManageV1QueClientChainInfoByIndex + responses: + '200': + description: A successful response. + schema: + type: object + properties: + Name: + type: string + MetaInfo: + type: string + ChainId: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + FinalizationBlocks: + type: string + format: uint64 + LayerZeroChainID: + type: string + format: uint64 + SignatureType: + type: string + AddressLength: + type: integer + format: int64 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: chainIndex + in: query + required: false + type: string + format: uint64 + tags: + - Query + /exocore/restaking_assets_manage/v1/QueOperatorAssetInfos: + get: + operationId: ExocoreRestakingAssetsManageV1QueOperatorAssetInfos + responses: + '200': + description: A successful response. + schema: + type: object + properties: + assetInfos: + type: object + additionalProperties: + type: object + properties: + TotalAmountOrWantChangeValue: + type: string + OperatorOwnAmountOrWantChangeValue: + type: string + title: >- + todo: the field is used to mark operator's own assets + and is not temporarily used now + WaitUndelegationAmountOrWantChangeValue: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: operatorAddr + in: query + required: false + type: string + tags: + - Query + /exocore/restaking_assets_manage/v1/QueStakerAssetInfos: + get: + operationId: ExocoreRestakingAssetsManageV1QueStakerAssetInfos + responses: + '200': + description: A successful response. + schema: + type: object + properties: + assetInfos: + type: object + additionalProperties: + type: object + properties: + TotalDepositAmountOrWantChangeValue: + type: string + CanWithdrawAmountOrWantChangeValue: + type: string + WaitUndelegationAmountOrWantChangeValue: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: stakerID + in: query + required: false + type: string + tags: + - Query + /exocore/restaking_assets_manage/v1/QueStakerExoCoreAddr/{StakerID}: + get: + operationId: ExocoreRestakingAssetsManageV1QueStakerExoCoreAddr + responses: + '200': + description: A successful response. + schema: + type: object + properties: + ExCoreAddr: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: StakerID + in: path + required: true + type: string + tags: + - Query + /exocore/restaking_assets_manage/v1/QueStakerSpecifiedAssetAmount: + get: + operationId: ExocoreRestakingAssetsManageV1QueOperatorSpecifiedAssetAmount + responses: + '200': + description: A successful response. + schema: + type: object + properties: + TotalAmountOrWantChangeValue: + type: string + OperatorOwnAmountOrWantChangeValue: + type: string + title: >- + todo: the field is used to mark operator's own assets and is + not temporarily used now + WaitUndelegationAmountOrWantChangeValue: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: operatorAddr + in: query + required: false + type: string + - name: assetID + in: query + required: false + type: string + tags: + - Query + /exocore/restaking_assets_manage/v1/QueStakingAssetInfo: + get: + operationId: ExocoreRestakingAssetsManageV1QueStakingAssetInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + AssetBasicInfo: + type: object + properties: + Name: + type: string + Symbol: + type: string + Address: + type: string + Decimals: + type: integer + format: int64 + TotalSupply: + type: string + LayerZeroChainID: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + MetaInfo: + type: string + StakingTotalAmount: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: assetID + in: query + required: false + type: string + tags: + - Query + /exocore/reward/params: + get: + summary: Parameters queries the parameters of the module. + operationId: ExocoreRewardParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /exocore/slash/params: + get: + summary: Parameters queries the parameters of the module. + operationId: ExocoreSlashParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /exocore/withdraw/params: + get: + summary: Parameters queries the parameters of the module. + operationId: ExocoreWithdrawParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /ibc/apps/interchain_accounts/controller/v1/owners/{owner}/connections/{connection_id}: + get: + summary: >- + InterchainAccount returns the interchain account address for a given + owner address on a given connection + operationId: IbcApplicationsInterchainAccountsControllerV1InterchainAccount + responses: + '200': + description: A successful response. + schema: + type: object + properties: + address: + type: string + description: >- + QueryInterchainAccountResponse the response type for the + Query/InterchainAccount RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: owner + in: path + required: true + type: string + - name: connection_id + in: path + required: true + type: string + tags: + - Query + /ibc/apps/interchain_accounts/controller/v1/params: + get: + summary: Params queries all parameters of the ICA controller submodule. + operationId: IbcApplicationsInterchainAccountsControllerV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + controller_enabled: + type: boolean + description: >- + controller_enabled enables or disables the controller + submodule. + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /ibc/apps/interchain_accounts/host/v1/params: + get: + summary: Params queries all parameters of the ICA host submodule. + operationId: IbcApplicationsInterchainAccountsHostV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + host_enabled: + type: boolean + description: host_enabled enables or disables the host submodule. + allow_messages: + type: array + items: + type: string + description: >- + allow_messages defines a list of sdk message typeURLs + allowed to be executed on a host chain. + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /ibc/core/channel/v1/channels: + get: + summary: Channels queries all the IBC channels of a chain. + operationId: IbcCoreChannelV1Channels + responses: + '200': + description: A successful response. + schema: + type: object + properties: + channels: + type: array + items: + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: >- + State defines if a channel is in one of the following + states: + + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: >- + - ORDER_NONE_UNSPECIFIED: zero-value for channel + ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other + end of the channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: >- + list of connection identifiers, in order, along which + packets sent on + + this channel will travel + version: + type: string + title: >- + opaque channel version, which is agreed upon during the + handshake + port_id: + type: string + title: port identifier + channel_id: + type: string + title: channel identifier + description: >- + IdentifiedChannel defines a channel with additional port and + channel + + identifier fields. + description: list of stored channels of the chain. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryChannelsResponse is the response type for the Query/Channels + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}: + get: + summary: Channel queries an IBC Channel. + operationId: IbcCoreChannelV1Channel + responses: + '200': + description: A successful response. + schema: + type: object + properties: + channel: + title: channel associated with the request identifiers + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: >- + State defines if a channel is in one of the following + states: + + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: |- + - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other + end of the channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: >- + list of connection identifiers, in order, along which + packets sent on + + this channel will travel + version: + type: string + title: >- + opaque channel version, which is agreed upon during the + handshake + description: >- + Channel defines pipeline for exactly-once packet delivery + between specific + + modules on separate blockchains, which has at least one end + capable of + + sending packets and one end capable of receiving packets. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryChannelResponse is the response type for the Query/Channel + RPC method. + + Besides the Channel end, it includes a proof and the height from + which the + + proof was retrieved. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/client_state: + get: + summary: >- + ChannelClientState queries for the client state for the channel + associated + + with the provided channel identifiers. + operationId: IbcCoreChannelV1ChannelClientState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + identified_client_state: + title: client state associated with the channel + type: object + properties: + client_id: + type: string + title: client identifier + client_state: + title: client state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + IdentifiedClientState defines a client state with an + additional client + + identifier field. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryChannelClientStateResponse is the Response type for the + Query/QueryChannelClientState RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height}: + get: + summary: |- + ChannelConsensusState queries for the consensus state for the channel + associated with the provided channel identifiers. + operationId: IbcCoreChannelV1ChannelConsensusState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + consensus_state: + title: consensus state associated with the channel + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + client_id: + type: string + title: client ID associated with the consensus state + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryChannelClientStateResponse is the Response type for the + Query/QueryChannelClientState RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: revision_number + description: revision number of the consensus state + in: path + required: true + type: string + format: uint64 + - name: revision_height + description: revision height of the consensus state + in: path + required: true + type: string + format: uint64 + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/next_sequence: + get: + summary: >- + NextSequenceReceive returns the next receive sequence for a given + channel. + operationId: IbcCoreChannelV1NextSequenceReceive + responses: + '200': + description: A successful response. + schema: + type: object + properties: + next_sequence_receive: + type: string + format: uint64 + title: next sequence receive number + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QuerySequenceResponse is the request type for the + Query/QueryNextSequenceReceiveResponse RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements: + get: + summary: >- + PacketAcknowledgements returns all the packet acknowledgements + associated + + with a channel. + operationId: IbcCoreChannelV1PacketAcknowledgements + responses: + '200': + description: A successful response. + schema: + type: object + properties: + acknowledgements: + type: array + items: + type: object + properties: + port_id: + type: string + description: channel port identifier. + channel_id: + type: string + description: channel unique identifier. + sequence: + type: string + format: uint64 + description: packet sequence. + data: + type: string + format: byte + description: embedded data that represents packet state. + description: >- + PacketState defines the generic type necessary to retrieve + and store + + packet commitments, acknowledgements, and receipts. + + Caller is responsible for knowing the context necessary to + interpret this + + state as a commitment, acknowledgement, or a receipt. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryPacketAcknowledgemetsResponse is the request type for the + Query/QueryPacketAcknowledgements RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + - name: packet_commitment_sequences + description: list of packet sequences + in: query + required: false + type: array + items: + type: string + format: uint64 + collectionFormat: multi + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}: + get: + summary: PacketAcknowledgement queries a stored packet acknowledgement hash. + operationId: IbcCoreChannelV1PacketAcknowledgement + responses: + '200': + description: A successful response. + schema: + type: object + properties: + acknowledgement: + type: string + format: byte + title: packet associated with the request fields + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + QueryPacketAcknowledgementResponse defines the client query + response for a + + packet which also includes a proof and the height from which the + + proof was retrieved + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: sequence + description: packet sequence + in: path + required: true + type: string + format: uint64 + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments: + get: + summary: |- + PacketCommitments returns all the packet commitments hashes associated + with a channel. + operationId: IbcCoreChannelV1PacketCommitments + responses: + '200': + description: A successful response. + schema: + type: object + properties: + commitments: + type: array + items: + type: object + properties: + port_id: + type: string + description: channel port identifier. + channel_id: + type: string + description: channel unique identifier. + sequence: + type: string + format: uint64 + description: packet sequence. + data: + type: string + format: byte + description: embedded data that represents packet state. + description: >- + PacketState defines the generic type necessary to retrieve + and store + + packet commitments, acknowledgements, and receipts. + + Caller is responsible for knowing the context necessary to + interpret this + + state as a commitment, acknowledgement, or a receipt. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryPacketCommitmentsResponse is the request type for the + Query/QueryPacketCommitments RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks: + get: + summary: >- + UnreceivedAcks returns all the unreceived IBC acknowledgements + associated + + with a channel and sequences. + operationId: IbcCoreChannelV1UnreceivedAcks + responses: + '200': + description: A successful response. + schema: + type: object + properties: + sequences: + type: array + items: + type: string + format: uint64 + title: list of unreceived acknowledgement sequences + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryUnreceivedAcksResponse is the response type for the + Query/UnreceivedAcks RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: packet_ack_sequences + description: list of acknowledgement sequences + in: path + required: true + type: array + items: + type: string + format: uint64 + collectionFormat: csv + minItems: 1 + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets: + get: + summary: >- + UnreceivedPackets returns all the unreceived IBC packets associated with + a + + channel and sequences. + operationId: IbcCoreChannelV1UnreceivedPackets + responses: + '200': + description: A successful response. + schema: + type: object + properties: + sequences: + type: array + items: + type: string + format: uint64 + title: list of unreceived packet sequences + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryUnreceivedPacketsResponse is the response type for the + Query/UnreceivedPacketCommitments RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: packet_commitment_sequences + description: list of packet sequences + in: path + required: true + type: array + items: + type: string + format: uint64 + collectionFormat: csv + minItems: 1 + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}: + get: + summary: PacketCommitment queries a stored packet commitment hash. + operationId: IbcCoreChannelV1PacketCommitment + responses: + '200': + description: A successful response. + schema: + type: object + properties: + commitment: + type: string + format: byte + title: packet associated with the request fields + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + QueryPacketCommitmentResponse defines the client query response + for a packet + + which also includes a proof and the height from which the proof + was + + retrieved + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: sequence + description: packet sequence + in: path + required: true + type: string + format: uint64 + tags: + - Query + /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}: + get: + summary: >- + PacketReceipt queries if a given packet sequence has been received on + the + + queried chain + operationId: IbcCoreChannelV1PacketReceipt + responses: + '200': + description: A successful response. + schema: + type: object + properties: + received: + type: boolean + title: success flag for if receipt exists + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + QueryPacketReceiptResponse defines the client query response for a + packet + + receipt which also includes a proof, and the height from which the + proof was + + retrieved + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: channel_id + description: channel unique identifier + in: path + required: true + type: string + - name: port_id + description: port unique identifier + in: path + required: true + type: string + - name: sequence + description: packet sequence + in: path + required: true + type: string + format: uint64 + tags: + - Query + /ibc/core/channel/v1/connections/{connection}/channels: + get: + summary: |- + ConnectionChannels queries all the channels associated with a connection + end. + operationId: IbcCoreChannelV1ConnectionChannels + responses: + '200': + description: A successful response. + schema: + type: object + properties: + channels: + type: array + items: + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: >- + State defines if a channel is in one of the following + states: + + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: >- + - ORDER_NONE_UNSPECIFIED: zero-value for channel + ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other + end of the channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: >- + list of connection identifiers, in order, along which + packets sent on + + this channel will travel + version: + type: string + title: >- + opaque channel version, which is agreed upon during the + handshake + port_id: + type: string + title: port identifier + channel_id: + type: string + title: channel identifier + description: >- + IdentifiedChannel defines a channel with additional port and + channel + + identifier fields. + description: list of channels associated with a connection. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryConnectionChannelsResponse is the Response type for the + Query/QueryConnectionChannels RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: connection + description: connection unique identifier + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/client/v1/client_states: + get: + summary: ClientStates queries all the IBC light clients of a chain. + operationId: IbcCoreClientV1ClientStates + responses: + '200': + description: A successful response. + schema: + type: object + properties: + client_states: + type: array + items: + type: object + properties: + client_id: + type: string + title: client identifier + client_state: + title: client state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + IdentifiedClientState defines a client state with an + additional client + + identifier field. + description: list of stored ClientStates of the chain. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + description: >- + QueryClientStatesResponse is the response type for the + Query/ClientStates RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/client/v1/client_states/{client_id}: + get: + summary: ClientState queries an IBC light client. + operationId: IbcCoreClientV1ClientState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + client_state: + title: client state associated with the request identifier + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryClientStateResponse is the response type for the + Query/ClientState RPC + + method. Besides the client state, it includes a proof and the + height from + + which the proof was retrieved. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: client_id + description: client state unique identifier + in: path + required: true + type: string + tags: + - Query + /ibc/core/client/v1/client_status/{client_id}: + get: + summary: Status queries the status of an IBC client. + operationId: IbcCoreClientV1ClientStatus + responses: + '200': + description: A successful response. + schema: + type: object + properties: + status: + type: string + description: >- + QueryClientStatusResponse is the response type for the + Query/ClientStatus RPC + + method. It returns the current status of the IBC client. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: client_id + description: client unique identifier + in: path + required: true + type: string + tags: + - Query + /ibc/core/client/v1/consensus_states/{client_id}: + get: + summary: |- + ConsensusStates queries all the consensus state associated with a given + client. + operationId: IbcCoreClientV1ConsensusStates + responses: + '200': + description: A successful response. + schema: + type: object + properties: + consensus_states: + type: array + items: + type: object + properties: + height: + title: consensus state height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each + height while keeping + + RevisionNumber the same. However some consensus + algorithms may choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as + the RevisionHeight + + gets reset + consensus_state: + title: consensus state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + ConsensusStateWithHeight defines a consensus state with an + additional height + + field. + title: consensus states associated with the identifier + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: |- + QueryConsensusStatesResponse is the response type for the + Query/ConsensusStates RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: client_id + description: client identifier + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/client/v1/consensus_states/{client_id}/heights: + get: + summary: >- + ConsensusStateHeights queries the height of every consensus states + associated with a given client. + operationId: IbcCoreClientV1ConsensusStateHeights + responses: + '200': + description: A successful response. + schema: + type: object + properties: + consensus_state_heights: + type: array + items: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms + may choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes + of updating and + + freezing clients + title: consensus state heights + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: |- + QueryConsensusStateHeightsResponse is the response type for the + Query/ConsensusStateHeights RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: client_id + description: client identifier + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/client/v1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}: + get: + summary: >- + ConsensusState queries a consensus state associated with a client state + at + + a given height. + operationId: IbcCoreClientV1ConsensusState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + consensus_state: + title: >- + consensus state associated with the client identifier at the + given height + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + QueryConsensusStateResponse is the response type for the + Query/ConsensusState + + RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: client_id + description: client identifier + in: path + required: true + type: string + - name: revision_number + description: consensus state revision number + in: path + required: true + type: string + format: uint64 + - name: revision_height + description: consensus state revision height + in: path + required: true + type: string + format: uint64 + - name: latest_height + description: >- + latest_height overrrides the height field and queries the latest + stored + + ConsensusState + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/client/v1/params: + get: + summary: ClientParams queries all parameters of the ibc client submodule. + operationId: IbcCoreClientV1ClientParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + allowed_clients: + type: array + items: + type: string + description: >- + allowed_clients defines the list of allowed client state + types which can be created + + and interacted with. If a client type is removed from the + allowed clients list, usage + + of this client will be disabled until it is added again to + the list. + description: >- + QueryClientParamsResponse is the response type for the + Query/ClientParams RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /ibc/core/client/v1/upgraded_client_states: + get: + summary: UpgradedClientState queries an Upgraded IBC light client. + operationId: IbcCoreClientV1UpgradedClientState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + upgraded_client_state: + title: client state associated with the request identifier + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + QueryUpgradedClientStateResponse is the response type for the + Query/UpgradedClientState RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /ibc/core/client/v1/upgraded_consensus_states: + get: + summary: UpgradedConsensusState queries an Upgraded IBC consensus state. + operationId: IbcCoreClientV1UpgradedConsensusState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + upgraded_consensus_state: + title: Consensus state associated with the request identifier + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + QueryUpgradedConsensusStateResponse is the response type for the + Query/UpgradedConsensusState RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query + /ibc/core/connection/v1/client_connections/{client_id}: + get: + summary: |- + ClientConnections queries the connection paths associated with a client + state. + operationId: IbcCoreConnectionV1ClientConnections + responses: + '200': + description: A successful response. + schema: + type: object + properties: + connection_paths: + type: array + items: + type: string + description: slice of all the connection paths associated with a client. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was generated + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryClientConnectionsResponse is the response type for the + Query/ClientConnections RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: client_id + description: client identifier associated with a connection + in: path + required: true + type: string + tags: + - Query + /ibc/core/connection/v1/connections: + get: + summary: Connections queries all the IBC connections of a chain. + operationId: IbcCoreConnectionV1Connections + responses: + '200': + description: A successful response. + schema: + type: object + properties: + connections: + type: array + items: + type: object + properties: + id: + type: string + description: connection identifier. + client_id: + type: string + description: client associated with this connection. + versions: + type: array + items: + type: object + properties: + identifier: + type: string + title: unique version identifier + features: + type: array + items: + type: string + title: >- + list of features compatible with the specified + identifier + description: >- + Version defines the versioning scheme used to + negotiate the IBC verison in + + the connection handshake. + title: >- + IBC version which can be utilised to determine encodings + or protocols for + + channels or packets utilising this connection + state: + description: current state of the connection end. + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + default: STATE_UNINITIALIZED_UNSPECIFIED + counterparty: + description: counterparty chain associated with this connection. + type: object + properties: + client_id: + type: string + description: >- + identifies the client on the counterparty chain + associated with a given + + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty + chain associated with a + + given connection. + prefix: + description: commitment merkle prefix of the counterparty chain. + type: object + properties: + key_prefix: + type: string + format: byte + title: >- + MerklePrefix is merkle path prefixed to the key. + + The constructed key from the Path and the key will + be append(Path.KeyPath, + + append(Path.KeyPrefix, key...)) + delay_period: + type: string + format: uint64 + description: delay period associated with this connection. + description: >- + IdentifiedConnection defines a connection with additional + connection + + identifier field. + description: list of stored connections of the chain. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryConnectionsResponse is the response type for the + Query/Connections RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /ibc/core/connection/v1/connections/{connection_id}: + get: + summary: Connection queries an IBC connection end. + operationId: IbcCoreConnectionV1Connection + responses: + '200': + description: A successful response. + schema: + type: object + properties: + connection: + title: connection associated with the request identifier + type: object + properties: + client_id: + type: string + description: client associated with this connection. + versions: + type: array + items: + type: object + properties: + identifier: + type: string + title: unique version identifier + features: + type: array + items: + type: string + title: >- + list of features compatible with the specified + identifier + description: >- + Version defines the versioning scheme used to negotiate + the IBC verison in + + the connection handshake. + description: >- + IBC version which can be utilised to determine encodings + or protocols for + + channels or packets utilising this connection. + state: + description: current state of the connection end. + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + default: STATE_UNINITIALIZED_UNSPECIFIED + counterparty: + description: counterparty chain associated with this connection. + type: object + properties: + client_id: + type: string + description: >- + identifies the client on the counterparty chain + associated with a given + + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty + chain associated with a + + given connection. + prefix: + description: commitment merkle prefix of the counterparty chain. + type: object + properties: + key_prefix: + type: string + format: byte + title: >- + MerklePrefix is merkle path prefixed to the key. + + The constructed key from the Path and the key will be + append(Path.KeyPath, + + append(Path.KeyPrefix, key...)) + delay_period: + type: string + format: uint64 + description: >- + delay period that must pass before a consensus state can + be used for + + packet-verification NOTE: delay period logic is only + implemented by some + + clients. + description: >- + ConnectionEnd defines a stateful object on a chain connected + to another + + separate one. + + NOTE: there must only be 2 defined ConnectionEnds to establish + + a connection between two chains. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryConnectionResponse is the response type for the + Query/Connection RPC + + method. Besides the connection end, it includes a proof and the + height from + + which the proof was retrieved. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: connection_id + description: connection unique identifier + in: path + required: true + type: string + tags: + - Query + /ibc/core/connection/v1/connections/{connection_id}/client_state: + get: + summary: |- + ConnectionClientState queries the client state associated with the + connection. + operationId: IbcCoreConnectionV1ConnectionClientState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + identified_client_state: + title: client state associated with the channel + type: object + properties: + client_id: + type: string + title: client identifier + client_state: + title: client state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + IdentifiedClientState defines a client state with an + additional client + + identifier field. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryConnectionClientStateResponse is the response type for the + Query/ConnectionClientState RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: connection_id + description: connection identifier + in: path + required: true + type: string + tags: + - Query + /ibc/core/connection/v1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height}: + get: + summary: |- + ConnectionConsensusState queries the consensus state associated with the + connection. + operationId: IbcCoreConnectionV1ConnectionConsensusState + responses: + '200': + description: A successful response. + schema: + type: object + properties: + consensus_state: + title: consensus state associated with the channel + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + client_id: + type: string + title: client ID associated with the consensus state + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height + while keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryConnectionConsensusStateResponse is the response type for the + Query/ConnectionConsensusState RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: connection_id + description: connection identifier + in: path + required: true + type: string + - name: revision_number + in: path + required: true + type: string + format: uint64 + - name: revision_height + in: path + required: true + type: string + format: uint64 + tags: + - Query + /ibc/core/connection/v1/params: + get: + summary: ConnectionParams queries all parameters of the ibc connection submodule. + operationId: IbcCoreConnectionV1ConnectionParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + max_expected_time_per_block: + type: string + format: uint64 + description: >- + maximum expected time per block (in nanoseconds), used to + enforce block delay. This parameter should reflect the + + largest amount of time that the chain might reasonably + take to produce the next block under normal operating + + conditions. A safe choice is 3-5x the expected time per + block. + description: >- + QueryConnectionParamsResponse is the response type for the + Query/ConnectionParams RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Query +definitions: + cosmos.auth.v1beta1.AddressBytesToStringResponse: + type: object + properties: + address_string: + type: string + description: >- + AddressBytesToStringResponse is the response type for AddressString rpc + method. + + + Since: cosmos-sdk 0.46 + cosmos.auth.v1beta1.AddressStringToBytesResponse: + type: object + properties: + address_bytes: + type: string + format: byte + description: >- + AddressStringToBytesResponse is the response type for AddressBytes rpc + method. + + + Since: cosmos-sdk 0.46 + cosmos.auth.v1beta1.BaseAccount: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + account_number: + type: string + format: uint64 + sequence: + type: string + format: uint64 + description: >- + BaseAccount defines a base account type. It contains all the necessary + fields + + for basic account functionality. Any custom account type should extend + this + + type for additional functionality (e.g. vesting). + cosmos.auth.v1beta1.Bech32PrefixResponse: + type: object + properties: + bech32_prefix: + type: string + description: |- + Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + + Since: cosmos-sdk 0.46 + cosmos.auth.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.auth.v1beta1.Params: + type: object + properties: + max_memo_characters: + type: string + format: uint64 + tx_sig_limit: + type: string + format: uint64 + tx_size_cost_per_byte: + type: string + format: uint64 + sig_verify_cost_ed25519: + type: string + format: uint64 + sig_verify_cost_secp256k1: + type: string + format: uint64 + description: Params defines the parameters for the auth module. + cosmos.auth.v1beta1.QueryAccountAddressByIDResponse: + type: object + properties: + account_address: + type: string + description: 'Since: cosmos-sdk 0.46.2' + title: >- + QueryAccountAddressByIDResponse is the response type for + AccountAddressByID rpc method + cosmos.auth.v1beta1.QueryAccountInfoResponse: + type: object + properties: + info: + description: info is the account info which is represented by BaseAccount. + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + account_number: + type: string + format: uint64 + sequence: + type: string + format: uint64 + description: |- + QueryAccountInfoResponse is the Query/AccountInfo response type. + + Since: cosmos-sdk 0.47 + cosmos.auth.v1beta1.QueryAccountResponse: + type: object + properties: + account: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + QueryAccountResponse is the response type for the Query/Account RPC + method. + cosmos.auth.v1beta1.QueryAccountsResponse: + type: object + properties: + accounts: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: accounts are the existing accounts + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAccountsResponse is the response type for the Query/Accounts RPC + method. + + + Since: cosmos-sdk 0.43 + cosmos.auth.v1beta1.QueryModuleAccountByNameResponse: + type: object + properties: + account: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + QueryModuleAccountByNameResponse is the response type for the + Query/ModuleAccountByName RPC method. + cosmos.auth.v1beta1.QueryModuleAccountsResponse: + type: object + properties: + accounts: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + QueryModuleAccountsResponse is the response type for the + Query/ModuleAccounts RPC method. + + + Since: cosmos-sdk 0.46 + cosmos.auth.v1beta1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + max_memo_characters: + type: string + format: uint64 + tx_sig_limit: + type: string + format: uint64 + tx_size_cost_per_byte: + type: string + format: uint64 + sig_verify_cost_ed25519: + type: string + format: uint64 + sig_verify_cost_secp256k1: + type: string + format: uint64 + description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.base.query.v1beta1.PageRequest: + type: object + properties: + key: + type: string + format: byte + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + offset: + type: string + format: uint64 + description: |- + offset is a numeric offset that can be used when key is unavailable. + It is less efficient than using key. Only one of offset or key should + be set. + limit: + type: string + format: uint64 + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + count_total: + type: boolean + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in UIs. + + count_total is only respected when offset is used. It is ignored when + key + + is set. + reverse: + type: boolean + description: >- + reverse is set to true if results are to be returned in the descending + order. + + + Since: cosmos-sdk 0.43 + description: |- + message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } + title: |- + PageRequest is to be embedded in gRPC request messages for efficient + pagination. Ex: + cosmos.base.query.v1beta1.PageResponse: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: |- + total is total number of results available if PageRequest.count_total + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + google.protobuf.Any: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical + form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that + they + + expect it to use in the context of Any. However, for URLs which use + the + + scheme `http`, `https`, or no scheme, one can optionally set up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along with + a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + google.rpc.Status: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + cosmos.authz.v1beta1.Grant: + type: object + properties: + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + time when the grant will expire and will be pruned. If null, then the + grant + + doesn't have a time expiration (other conditions in `authorization` + + may apply to invalidate the grant) + description: |- + Grant gives permissions to execute + the provide method with expiration time. + cosmos.authz.v1beta1.GrantAuthorization: + type: object + properties: + granter: + type: string + grantee: + type: string + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + GrantAuthorization extends a grant with both the addresses of the grantee + and granter. + + It is used in genesis.proto and query.proto + cosmos.authz.v1beta1.MsgExecResponse: + type: object + properties: + results: + type: array + items: + type: string + format: byte + description: MsgExecResponse defines the Msg/MsgExecResponse response type. + cosmos.authz.v1beta1.MsgGrantResponse: + type: object + description: MsgGrantResponse defines the Msg/MsgGrant response type. + cosmos.authz.v1beta1.MsgRevokeResponse: + type: object + description: MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. + cosmos.authz.v1beta1.QueryGranteeGrantsResponse: + type: object + properties: + grants: + type: array + items: + type: object + properties: + granter: + type: string + grantee: + type: string + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + GrantAuthorization extends a grant with both the addresses of the + grantee and granter. + + It is used in genesis.proto and query.proto + description: grants is a list of grants granted to the grantee. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGranteeGrantsResponse is the response type for the + Query/GranteeGrants RPC method. + cosmos.authz.v1beta1.QueryGranterGrantsResponse: + type: object + properties: + grants: + type: array + items: + type: object + properties: + granter: + type: string + grantee: + type: string + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + GrantAuthorization extends a grant with both the addresses of the + grantee and granter. + + It is used in genesis.proto and query.proto + description: grants is a list of grants granted by the granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGranterGrantsResponse is the response type for the + Query/GranterGrants RPC method. + cosmos.authz.v1beta1.QueryGrantsResponse: + type: object + properties: + grants: + type: array + items: + type: object + properties: + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + time when the grant will expire and will be pruned. If null, + then the grant + + doesn't have a time expiration (other conditions in + `authorization` + + may apply to invalidate the grant) + description: |- + Grant gives permissions to execute + the provide method with expiration time. + description: authorizations is a list of grants granted for grantee by granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGrantsResponse is the response type for the Query/Authorizations RPC + method. + cosmos.bank.v1beta1.DenomOwner: + type: object + properties: + address: + type: string + description: address defines the address that owns a particular denomination. + balance: + description: balance is the balance of the denominated coin for an account. + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DenomOwner defines structure representing an account that owns or holds a + particular denominated token. It contains the account address and account + balance of the denominated token. + + Since: cosmos-sdk 0.46 + cosmos.bank.v1beta1.DenomUnit: + type: object + properties: + denom: + type: string + description: denom represents the string name of the given denom unit (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one must + + raise the base_denom to in order to equal the given DenomUnit's denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' + with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: aliases is a list of string aliases for the given denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + cosmos.bank.v1beta1.Input: + type: object + properties: + address: + type: string + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Input models transaction input. + cosmos.bank.v1beta1.Metadata: + type: object + properties: + description: + type: string + denom_units: + type: array + items: + type: object + properties: + denom: + type: string + description: >- + denom represents the string name of the given denom unit (e.g + uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one must + + raise the base_denom to in order to equal the given DenomUnit's + denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a DenomUnit of + 'atom' with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: aliases is a list of string aliases for the given denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: denom_units represents the list of DenomUnit's for a given coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit with exponent + = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges (eg: ATOM). This + can + + be the same as the display. + + + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains additional + information. Optional. + + + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. It's used to + verify that + + the document didn't change. Optional. + + + Since: cosmos-sdk 0.46 + description: |- + Metadata represents a struct that describes + a basic token. + cosmos.bank.v1beta1.MsgMultiSendResponse: + type: object + description: MsgMultiSendResponse defines the Msg/MultiSend response type. + cosmos.bank.v1beta1.MsgSendResponse: + type: object + description: MsgSendResponse defines the Msg/Send response type. + cosmos.bank.v1beta1.MsgSetSendEnabledResponse: + type: object + description: |- + MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + + Since: cosmos-sdk 0.47 + cosmos.bank.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.bank.v1beta1.Output: + type: object + properties: + address: + type: string + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Output models transaction outputs. + cosmos.bank.v1beta1.Params: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status (whether a + denom is + + sendable). + description: >- + Deprecated: Use of SendEnabled in params is deprecated. + + For genesis, use the newly added send_enabled field in the genesis + object. + + Storage, lookup, and manipulation of this information is now in the + keeper. + + + As of cosmos-sdk 0.47, this only exists for backwards compatibility of + genesis files. + default_send_enabled: + type: boolean + description: Params defines the parameters for the bank module. + cosmos.bank.v1beta1.QueryAllBalancesResponse: + type: object + properties: + balances: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: balances is the balances of all the coins. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllBalancesResponse is the response type for the Query/AllBalances + RPC + + method. + cosmos.bank.v1beta1.QueryBalanceResponse: + type: object + properties: + balance: + description: balance is the balance of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QueryBalanceResponse is the response type for the Query/Balance RPC + method. + cosmos.bank.v1beta1.QueryDenomMetadataResponse: + type: object + properties: + metadata: + description: >- + metadata describes and provides all the client information for the + requested token. + type: object + properties: + description: + type: string + denom_units: + type: array + items: + type: object + properties: + denom: + type: string + description: >- + denom represents the string name of the given denom unit + (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one must + + raise the base_denom to in order to equal the given + DenomUnit's denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a DenomUnit + of 'atom' with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: aliases is a list of string aliases for the given denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: denom_units represents the list of DenomUnit's for a given coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit with + exponent = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges (eg: ATOM). + This can + + be the same as the display. + + + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains additional + information. Optional. + + + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. It's used + to verify that + + the document didn't change. Optional. + + + Since: cosmos-sdk 0.46 + description: >- + QueryDenomMetadataResponse is the response type for the + Query/DenomMetadata RPC + + method. + cosmos.bank.v1beta1.QueryDenomOwnersResponse: + type: object + properties: + denom_owners: + type: array + items: + type: object + properties: + address: + type: string + description: address defines the address that owns a particular denomination. + balance: + description: balance is the balance of the denominated coin for an account. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DenomOwner defines structure representing an account that owns or + holds a + + particular denominated token. It contains the account address and + account + + balance of the denominated token. + + + Since: cosmos-sdk 0.46 + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC + query. + + + Since: cosmos-sdk 0.46 + cosmos.bank.v1beta1.QueryDenomsMetadataResponse: + type: object + properties: + metadatas: + type: array + items: + type: object + properties: + description: + type: string + denom_units: + type: array + items: + type: object + properties: + denom: + type: string + description: >- + denom represents the string name of the given denom unit + (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one must + + raise the base_denom to in order to equal the given + DenomUnit's denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a + DenomUnit of 'atom' with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: aliases is a list of string aliases for the given denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: denom_units represents the list of DenomUnit's for a given coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit with + exponent = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges (eg: + ATOM). This can + + be the same as the display. + + + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains additional + information. Optional. + + + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. It's used + to verify that + + the document didn't change. Optional. + + + Since: cosmos-sdk 0.46 + description: |- + Metadata represents a struct that describes + a basic token. + description: >- + metadata provides the client information for all the registered + tokens. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDenomsMetadataResponse is the response type for the + Query/DenomsMetadata RPC + + method. + cosmos.bank.v1beta1.QueryParamsResponse: + type: object + properties: + params: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status (whether a + denom is + + sendable). + description: >- + Deprecated: Use of SendEnabled in params is deprecated. + + For genesis, use the newly added send_enabled field in the genesis + object. + + Storage, lookup, and manipulation of this information is now in + the keeper. + + + As of cosmos-sdk 0.47, this only exists for backwards + compatibility of genesis files. + default_send_enabled: + type: boolean + description: Params defines the parameters for the bank module. + description: >- + QueryParamsResponse defines the response type for querying x/bank + parameters. + cosmos.bank.v1beta1.QuerySendEnabledResponse: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status (whether a + denom is + + sendable). + pagination: + description: |- + pagination defines the pagination in the response. This field is only + populated if the denoms field in the request is empty. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QuerySendEnabledResponse defines the RPC response of a SendEnable query. + + Since: cosmos-sdk 0.47 + cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse: + type: object + properties: + balance: + description: balance is the balance of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QuerySpendableBalanceByDenomResponse defines the gRPC response structure + for + + querying an account's spendable balance for a specific denom. + + + Since: cosmos-sdk 0.47 + cosmos.bank.v1beta1.QuerySpendableBalancesResponse: + type: object + properties: + balances: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: balances is the spendable balances of all the coins. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QuerySpendableBalancesResponse defines the gRPC response structure for + querying + + an account's spendable balances. + + + Since: cosmos-sdk 0.46 + cosmos.bank.v1beta1.QuerySupplyOfResponse: + type: object + properties: + amount: + description: amount is the supply of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC + method. + cosmos.bank.v1beta1.QueryTotalSupplyResponse: + type: object + properties: + supply: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: supply is the supply of the coins + pagination: + description: |- + pagination defines the pagination in the response. + + Since: cosmos-sdk 0.43 + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryTotalSupplyResponse is the response type for the Query/TotalSupply + RPC + + method + cosmos.bank.v1beta1.SendEnabled: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: |- + SendEnabled maps coin denom to a send_enabled status (whether a denom is + sendable). + cosmos.base.v1beta1.Coin: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + cosmos.base.node.v1beta1.ConfigResponse: + type: object + properties: + minimum_gas_price: + type: string + description: ConfigResponse defines the response structure for the Config gRPC query. + cosmos.base.tendermint.v1beta1.ABCIQueryResponse: + type: object + properties: + code: + type: integer + format: int64 + log: + type: string + title: nondeterministic + info: + type: string + title: nondeterministic + index: + type: string + format: int64 + key: + type: string + format: byte + value: + type: string + format: byte + proof_ops: + type: object + properties: + ops: + type: array + items: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + description: >- + ProofOp defines an operation used for calculating Merkle root. + The data could + + be arbitrary format, providing necessary data for example + neighbouring node + + hash. + + + Note: This type is a duplicate of the ProofOp proto type defined + in Tendermint. + description: >- + ProofOps is Merkle proof defined by the list of ProofOps. + + + Note: This type is a duplicate of the ProofOps proto type defined in + Tendermint. + height: + type: string + format: int64 + codespace: + type: string + description: >- + ABCIQueryResponse defines the response structure for the ABCIQuery gRPC + query. + + + Note: This type is a duplicate of the ResponseQuery proto type defined in + + Tendermint. + cosmos.base.tendermint.v1beta1.Block: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in + the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer address, formatted + as a Bech32 string. + + In Tendermint, this type is `bytes`, but in the SDK, we convert it + to a Bech32 string + + for better UX. + + + original proposer of the block + description: Header defines the structure of a Tendermint block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, + + including all blockchain data structures and + the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from + the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block was + committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set of + validators. + description: |- + Block is tendermint type Block, with the Header proposer address + field converted to bech32 string. + cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse: + type: object + properties: + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + block: + title: 'Deprecated: please use `sdk_block` instead' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block + was committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + sdk_block: + title: 'Since: cosmos-sdk 0.47' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer address, + formatted as a Bech32 string. + + In Tendermint, this type is `bytes`, but in the SDK, we + convert it to a Bech32 string + + for better UX. + + + original proposer of the block + description: Header defines the structure of a Tendermint block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block + was committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + description: |- + Block is tendermint type Block, with the Header proposer address + field converted to bech32 string. + description: >- + GetBlockByHeightResponse is the response type for the + Query/GetBlockByHeight RPC method. + cosmos.base.tendermint.v1beta1.GetLatestBlockResponse: + type: object + properties: + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + block: + title: 'Deprecated: please use `sdk_block` instead' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block + was committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + sdk_block: + title: 'Since: cosmos-sdk 0.47' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer address, + formatted as a Bech32 string. + + In Tendermint, this type is `bytes`, but in the SDK, we + convert it to a Bech32 string + + for better UX. + + + original proposer of the block + description: Header defines the structure of a Tendermint block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block + was committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + description: |- + Block is tendermint type Block, with the Header proposer address + field converted to bech32 string. + description: >- + GetLatestBlockResponse is the response type for the Query/GetLatestBlock + RPC method. + cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse: + type: object + properties: + block_height: + type: string + format: int64 + validators: + type: array + items: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + description: Validator is the type for the validator-set. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + GetLatestValidatorSetResponse is the response type for the + Query/GetValidatorSetByHeight RPC method. + cosmos.base.tendermint.v1beta1.GetNodeInfoResponse: + type: object + properties: + default_node_info: + type: object + properties: + protocol_version: + type: object + properties: + p2p: + type: string + format: uint64 + block: + type: string + format: uint64 + app: + type: string + format: uint64 + default_node_id: + type: string + listen_addr: + type: string + network: + type: string + version: + type: string + channels: + type: string + format: byte + moniker: + type: string + other: + type: object + properties: + tx_index: + type: string + rpc_address: + type: string + application_version: + type: object + properties: + name: + type: string + app_name: + type: string + version: + type: string + git_commit: + type: string + build_tags: + type: string + go_version: + type: string + build_deps: + type: array + items: + type: object + properties: + path: + type: string + title: module path + version: + type: string + title: module version + sum: + type: string + title: checksum + title: Module is the type for VersionInfo + cosmos_sdk_version: + type: string + title: 'Since: cosmos-sdk 0.43' + description: VersionInfo is the type for the GetNodeInfoResponse message. + description: >- + GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC + method. + cosmos.base.tendermint.v1beta1.GetSyncingResponse: + type: object + properties: + syncing: + type: boolean + description: >- + GetSyncingResponse is the response type for the Query/GetSyncing RPC + method. + cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse: + type: object + properties: + block_height: + type: string + format: int64 + validators: + type: array + items: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + description: Validator is the type for the validator-set. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + GetValidatorSetByHeightResponse is the response type for the + Query/GetValidatorSetByHeight RPC method. + cosmos.base.tendermint.v1beta1.Header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in the + blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer address, formatted as + a Bech32 string. + + In Tendermint, this type is `bytes`, but in the SDK, we convert it to + a Bech32 string + + for better UX. + + + original proposer of the block + description: Header defines the structure of a Tendermint block header. + cosmos.base.tendermint.v1beta1.Module: + type: object + properties: + path: + type: string + title: module path + version: + type: string + title: module version + sum: + type: string + title: checksum + title: Module is the type for VersionInfo + cosmos.base.tendermint.v1beta1.ProofOp: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + description: >- + ProofOp defines an operation used for calculating Merkle root. The data + could + + be arbitrary format, providing necessary data for example neighbouring + node + + hash. + + + Note: This type is a duplicate of the ProofOp proto type defined in + Tendermint. + cosmos.base.tendermint.v1beta1.ProofOps: + type: object + properties: + ops: + type: array + items: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + description: >- + ProofOp defines an operation used for calculating Merkle root. The + data could + + be arbitrary format, providing necessary data for example + neighbouring node + + hash. + + + Note: This type is a duplicate of the ProofOp proto type defined in + Tendermint. + description: >- + ProofOps is Merkle proof defined by the list of ProofOps. + + + Note: This type is a duplicate of the ProofOps proto type defined in + Tendermint. + cosmos.base.tendermint.v1beta1.Validator: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + description: Validator is the type for the validator-set. + cosmos.base.tendermint.v1beta1.VersionInfo: + type: object + properties: + name: + type: string + app_name: + type: string + version: + type: string + git_commit: + type: string + build_tags: + type: string + go_version: + type: string + build_deps: + type: array + items: + type: object + properties: + path: + type: string + title: module path + version: + type: string + title: module version + sum: + type: string + title: checksum + title: Module is the type for VersionInfo + cosmos_sdk_version: + type: string + title: 'Since: cosmos-sdk 0.43' + description: VersionInfo is the type for the GetNodeInfoResponse message. + tendermint.crypto.PublicKey: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + tendermint.p2p.DefaultNodeInfo: + type: object + properties: + protocol_version: + type: object + properties: + p2p: + type: string + format: uint64 + block: + type: string + format: uint64 + app: + type: string + format: uint64 + default_node_id: + type: string + listen_addr: + type: string + network: + type: string + version: + type: string + channels: + type: string + format: byte + moniker: + type: string + other: + type: object + properties: + tx_index: + type: string + rpc_address: + type: string + tendermint.p2p.DefaultNodeInfoOther: + type: object + properties: + tx_index: + type: string + rpc_address: + type: string + tendermint.p2p.ProtocolVersion: + type: object + properties: + p2p: + type: string + format: uint64 + block: + type: string + format: uint64 + app: + type: string + format: uint64 + tendermint.types.Block: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in + the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, + + including all blockchain data structures and + the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from + the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block was + committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set of + validators. + tendermint.types.BlockID: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + tendermint.types.BlockIDFlag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + tendermint.types.Commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set of + validators. + tendermint.types.CommitSig: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + tendermint.types.Data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the order + first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + tendermint.types.DuplicateVoteEvidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from validators + for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from validators + for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator signed two + conflicting votes. + tendermint.types.Evidence: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from + validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from + validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator signed two + conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was committed by + a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of validators + attempting to mislead a light client. + tendermint.types.EvidenceList: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from + validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from + validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator signed + two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, + + including all blockchain data structures and the + rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was + committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + tendermint.types.Header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in the + blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + tendermint.types.LightBlock: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + tendermint.types.LightClientAttackEvidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a + block in the blockchain, + + including all blockchain data structures and the rules of + the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the previous + block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the signature is + for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a + set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of validators + attempting to mislead a light client. + tendermint.types.PartSetHeader: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + tendermint.types.SignedHeader: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in + the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set of + validators. + tendermint.types.SignedMsgType: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + tendermint.types.Validator: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + tendermint.types.ValidatorSet: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + tendermint.types.Vote: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: |- + Vote represents a prevote, precommit, or commit vote from validators for + consensus. + tendermint.version.Consensus: + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in the + blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + cosmos.consensus.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + cosmos.consensus.v1.QueryParamsResponse: + type: object + properties: + params: + description: >- + params are the tendermint consensus params stored in the consensus + module. + + Please note that `params.version` is not populated in this response, + it is + + tracked separately in the x/upgrade module. + type: object + properties: + block: + type: object + properties: + max_bytes: + type: string + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: + type: string + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + evidence: + type: object + properties: + max_age_num_blocks: + type: string + format: int64 + description: >- + Max age of evidence, in blocks. + + + The basic formula for calculating this is: MaxAgeDuration / + {average block + + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. + + + It should correspond with an app's "unbonding period" or other + similar + + mechanism for handling [Nothing-At-Stake + + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes that can + be committed in a single block. + + and should fall comfortably under the max block bytes. + + Default is 1048576 or 1MB + description: EvidenceParams determine how we handle evidence of malfeasance. + validator: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: |- + ValidatorParams restrict the public key types validators can use. + NOTE: uses ABCI pubkey naming, not Amino names. + version: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. + description: >- + QueryParamsResponse defines the response type for querying x/consensus + parameters. + tendermint.types.BlockParams: + type: object + properties: + max_bytes: + type: string + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: + type: string + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + tendermint.types.ConsensusParams: + type: object + properties: + block: + type: object + properties: + max_bytes: + type: string + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: + type: string + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + evidence: + type: object + properties: + max_age_num_blocks: + type: string + format: int64 + description: >- + Max age of evidence, in blocks. + + + The basic formula for calculating this is: MaxAgeDuration / + {average block + + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. + + + It should correspond with an app's "unbonding period" or other + similar + + mechanism for handling [Nothing-At-Stake + + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes that can be + committed in a single block. + + and should fall comfortably under the max block bytes. + + Default is 1048576 or 1MB + description: EvidenceParams determine how we handle evidence of malfeasance. + validator: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: |- + ValidatorParams restrict the public key types validators can use. + NOTE: uses ABCI pubkey naming, not Amino names. + version: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. + description: |- + ConsensusParams contains consensus critical parameters that determine the + validity of blocks. + tendermint.types.EvidenceParams: + type: object + properties: + max_age_num_blocks: + type: string + format: int64 + description: >- + Max age of evidence, in blocks. + + + The basic formula for calculating this is: MaxAgeDuration / {average + block + + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. + + + It should correspond with an app's "unbonding period" or other similar + + mechanism for handling [Nothing-At-Stake + + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes that can be + committed in a single block. + + and should fall comfortably under the max block bytes. + + Default is 1048576 or 1MB + description: EvidenceParams determine how we handle evidence of malfeasance. + tendermint.types.ValidatorParams: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: |- + ValidatorParams restrict the public key types validators can use. + NOTE: uses ABCI pubkey naming, not Amino names. + tendermint.types.VersionParams: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. + cosmos.crisis.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.crisis.v1beta1.MsgVerifyInvariantResponse: + type: object + description: MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. + cosmos.base.v1beta1.DecCoin: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + cosmos.distribution.v1beta1.DelegationDelegatorReward: + type: object + properties: + validator_address: + type: string + reward: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: |- + DelegationDelegatorReward represents the properties + of a delegator's delegation reward. + cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse: + type: object + description: |- + MsgCommunityPoolSpendResponse defines the response to executing a + MsgCommunityPoolSpend message. + + Since: cosmos-sdk 0.47 + cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse: + type: object + description: >- + MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response + type. + cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse: + type: object + description: |- + MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + type. + cosmos.distribution.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse: + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: 'Since: cosmos-sdk 0.46' + description: |- + MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + response type. + cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse: + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: 'Since: cosmos-sdk 0.46' + description: |- + MsgWithdrawValidatorCommissionResponse defines the + Msg/WithdrawValidatorCommission response type. + cosmos.distribution.v1beta1.Params: + type: object + properties: + community_tax: + type: string + base_proposer_reward: + type: string + description: >- + Deprecated: The base_proposer_reward field is deprecated and is no + longer used + + in the x/distribution module's reward mechanism. + bonus_proposer_reward: + type: string + description: >- + Deprecated: The bonus_proposer_reward field is deprecated and is no + longer used + + in the x/distribution module's reward mechanism. + withdraw_addr_enabled: + type: boolean + description: Params defines the set of params for the distribution module. + cosmos.distribution.v1beta1.QueryCommunityPoolResponse: + type: object + properties: + pool: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: pool defines community pool's coins. + description: >- + QueryCommunityPoolResponse is the response type for the + Query/CommunityPool + + RPC method. + cosmos.distribution.v1beta1.QueryDelegationRewardsResponse: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: rewards defines the rewards accrued by a delegation. + description: |- + QueryDelegationRewardsResponse is the response type for the + Query/DelegationRewards RPC method. + cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + validator_address: + type: string + reward: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: |- + DelegationDelegatorReward represents the properties + of a delegator's delegation reward. + description: rewards defines all the rewards accrued by a delegator. + total: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: total defines the sum of all the rewards. + description: |- + QueryDelegationTotalRewardsResponse is the response type for the + Query/DelegationTotalRewards RPC method. + cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse: + type: object + properties: + validators: + type: array + items: + type: string + description: validators defines the validators a delegator is delegating for. + description: |- + QueryDelegatorValidatorsResponse is the response type for the + Query/DelegatorValidators RPC method. + cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse: + type: object + properties: + withdraw_address: + type: string + description: withdraw_address defines the delegator address to query for. + description: |- + QueryDelegatorWithdrawAddressResponse is the response type for the + Query/DelegatorWithdrawAddress RPC method. + cosmos.distribution.v1beta1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + community_tax: + type: string + base_proposer_reward: + type: string + description: >- + Deprecated: The base_proposer_reward field is deprecated and is no + longer used + + in the x/distribution module's reward mechanism. + bonus_proposer_reward: + type: string + description: >- + Deprecated: The bonus_proposer_reward field is deprecated and is + no longer used + + in the x/distribution module's reward mechanism. + withdraw_addr_enabled: + type: boolean + description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.distribution.v1beta1.QueryValidatorCommissionResponse: + type: object + properties: + commission: + description: commission defines the commission the validator received. + type: object + properties: + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + title: |- + QueryValidatorCommissionResponse is the response type for the + Query/ValidatorCommission RPC method + cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse: + type: object + properties: + operator_address: + type: string + description: operator_address defines the validator operator address. + self_bond_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: self_bond_rewards defines the self delegations rewards. + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: commission defines the commission the validator received. + description: >- + QueryValidatorDistributionInfoResponse is the response type for the + Query/ValidatorDistributionInfo RPC method. + cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse: + type: object + properties: + rewards: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + description: >- + ValidatorOutstandingRewards represents outstanding (un-withdrawn) + rewards + + for a validator inexpensive to track, allows simple sanity checks. + description: |- + QueryValidatorOutstandingRewardsResponse is the response type for the + Query/ValidatorOutstandingRewards RPC method. + cosmos.distribution.v1beta1.QueryValidatorSlashesResponse: + type: object + properties: + slashes: + type: array + items: + type: object + properties: + validator_period: + type: string + format: uint64 + fraction: + type: string + description: |- + ValidatorSlashEvent represents a validator slash event. + Height is implicit within the store key. + This is needed to calculate appropriate amount of staking tokens + for delegations which are withdrawn after a slash has occurred. + description: slashes defines the slashes the validator received. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryValidatorSlashesResponse is the response type for the + Query/ValidatorSlashes RPC method. + cosmos.distribution.v1beta1.ValidatorAccumulatedCommission: + type: object + properties: + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: |- + ValidatorAccumulatedCommission represents accumulated commission + for a validator kept as a running counter, can be withdrawn at any time. + cosmos.distribution.v1beta1.ValidatorOutstandingRewards: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: |- + ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + for a validator inexpensive to track, allows simple sanity checks. + cosmos.distribution.v1beta1.ValidatorSlashEvent: + type: object + properties: + validator_period: + type: string + format: uint64 + fraction: + type: string + description: |- + ValidatorSlashEvent represents a validator slash event. + Height is implicit within the store key. + This is needed to calculate appropriate amount of staking tokens + for delegations which are withdrawn after a slash has occurred. + cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse: + type: object + properties: + hash: + type: string + format: byte + description: hash defines the hash of the evidence. + description: MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. + cosmos.evidence.v1beta1.QueryAllEvidenceResponse: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: evidence returns all evidences. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllEvidenceResponse is the response type for the Query/AllEvidence + RPC + + method. + cosmos.evidence.v1beta1.QueryEvidenceResponse: + type: object + properties: + evidence: + description: evidence returns the requested evidence. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + QueryEvidenceResponse is the response type for the Query/Evidence RPC + method. + cosmos.feegrant.v1beta1.Grant: + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance of their + funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an allowance of + another user's funds. + allowance: + description: allowance can be any of basic, periodic, allowed fee allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + title: Grant is stored in the KVStore to record a grant with full context + cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse: + type: object + description: >- + MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response + type. + cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse: + type: object + description: >- + MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse + response type. + cosmos.feegrant.v1beta1.QueryAllowanceResponse: + type: object + properties: + allowance: + description: allowance is a allowance granted for grantee by granter. + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance of their + funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an allowance of + another user's funds. + allowance: + description: allowance can be any of basic, periodic, allowed fee allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + title: Grant is stored in the KVStore to record a grant with full context + description: >- + QueryAllowanceResponse is the response type for the Query/Allowance RPC + method. + cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse: + type: object + properties: + allowances: + type: array + items: + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance of + their funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an allowance of + another user's funds. + allowance: + description: allowance can be any of basic, periodic, allowed fee allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + title: Grant is stored in the KVStore to record a grant with full context + description: allowances that have been issued by the granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllowancesByGranterResponse is the response type for the + Query/AllowancesByGranter RPC method. + + + Since: cosmos-sdk 0.46 + cosmos.feegrant.v1beta1.QueryAllowancesResponse: + type: object + properties: + allowances: + type: array + items: + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance of + their funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an allowance of + another user's funds. + allowance: + description: allowance can be any of basic, periodic, allowed fee allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + title: Grant is stored in the KVStore to record a grant with full context + description: allowances are allowance's granted for grantee by granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllowancesResponse is the response type for the Query/Allowances RPC + method. + cosmos.gov.v1.Deposit: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: |- + Deposit defines an amount deposited by an account address to an active + proposal. + cosmos.gov.v1.DepositParams: + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + description: DepositParams defines the params for deposits on governance proposals. + cosmos.gov.v1.MsgDepositResponse: + type: object + description: MsgDepositResponse defines the Msg/Deposit response type. + cosmos.gov.v1.MsgExecLegacyContentResponse: + type: object + description: >- + MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response + type. + cosmos.gov.v1.MsgSubmitProposalResponse: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + description: MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. + cosmos.gov.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.gov.v1.MsgVoteResponse: + type: object + description: MsgVoteResponse defines the Msg/Vote response type. + cosmos.gov.v1.MsgVoteWeightedResponse: + type: object + description: MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + cosmos.gov.v1.Params: + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + voting_period: + type: string + description: Duration of the voting period. + quorum: + type: string + description: |- + Minimum percentage of total stake needed to vote for a result to be + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. Default value: + 0.5. + veto_threshold: + type: string + description: |- + Minimum value of Veto votes to Total votes ratio for proposal to be + vetoed. Default value: 1/3. + min_initial_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value that must + be paid at proposal submission. + burn_vote_quorum: + type: boolean + title: burn deposits if a proposal does not meet quorum + burn_proposal_deposit_prevote: + type: boolean + title: burn deposits if the proposal does not enter voting period + burn_vote_veto: + type: boolean + title: burn deposits if quorum with vote type no_veto is met + description: |- + Params defines the parameters for the x/gov module. + + Since: cosmos-sdk 0.47 + cosmos.gov.v1.Proposal: + type: object + properties: + id: + type: string + format: uint64 + description: id defines the unique id of the proposal. + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages are the arbitrary messages to be executed if the proposal + passes. + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: |- + final_tally_result is the final tally result of the proposal. When + querying a proposal via gRPC, this field is not populated until the + proposal's voting period has ended. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: abstain_count is the number of abstain votes on a proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + metadata: + type: string + description: metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter + description: Proposal defines the core field members of a governance proposal. + cosmos.gov.v1.ProposalStatus: + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + description: |- + ProposalStatus enumerates the valid statuses of a proposal. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + period. + - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + period. + - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + passed. + - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + been rejected. + - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + failed. + cosmos.gov.v1.QueryDepositResponse: + type: object + properties: + deposit: + description: deposit defines the requested deposit. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + QueryDepositResponse is the response type for the Query/Deposit RPC + method. + cosmos.gov.v1.QueryDepositsResponse: + type: object + properties: + deposits: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + Deposit defines an amount deposited by an account address to an + active + + proposal. + description: deposits defines the requested deposits. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDepositsResponse is the response type for the Query/Deposits RPC + method. + cosmos.gov.v1.QueryParamsResponse: + type: object + properties: + voting_params: + description: |- + Deprecated: Prefer to use `params` instead. + voting_params defines the parameters related to voting. + type: object + properties: + voting_period: + type: string + description: Duration of the voting period. + deposit_params: + description: |- + Deprecated: Prefer to use `params` instead. + deposit_params defines the parameters related to deposit. + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + tally_params: + description: |- + Deprecated: Prefer to use `params` instead. + tally_params defines the parameters related to tally. + type: object + properties: + quorum: + type: string + description: >- + Minimum percentage of total stake needed to vote for a result to + be + + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. Default + value: 0.5. + veto_threshold: + type: string + description: >- + Minimum value of Veto votes to Total votes ratio for proposal to + be + + vetoed. Default value: 1/3. + params: + description: |- + params defines all the paramaters of x/gov module. + + Since: cosmos-sdk 0.47 + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + voting_period: + type: string + description: Duration of the voting period. + quorum: + type: string + description: >- + Minimum percentage of total stake needed to vote for a result to + be + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. Default + value: 0.5. + veto_threshold: + type: string + description: >- + Minimum value of Veto votes to Total votes ratio for proposal to + be + vetoed. Default value: 1/3. + min_initial_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value that + must be paid at proposal submission. + burn_vote_quorum: + type: boolean + title: burn deposits if a proposal does not meet quorum + burn_proposal_deposit_prevote: + type: boolean + title: burn deposits if the proposal does not enter voting period + burn_vote_veto: + type: boolean + title: burn deposits if quorum with vote type no_veto is met + description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.gov.v1.QueryProposalResponse: + type: object + properties: + proposal: + description: proposal is the requested governance proposal. + type: object + properties: + id: + type: string + format: uint64 + description: id defines the unique id of the proposal. + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages are the arbitrary messages to be executed if the proposal + passes. + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the proposal. When + + querying a proposal via gRPC, this field is not populated until + the + + proposal's voting period has ended. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: abstain_count is the number of abstain votes on a proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + metadata: + type: string + description: metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter + description: >- + QueryProposalResponse is the response type for the Query/Proposal RPC + method. + cosmos.gov.v1.QueryProposalsResponse: + type: object + properties: + proposals: + type: array + items: + type: object + properties: + id: + type: string + format: uint64 + description: id defines the unique id of the proposal. + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages are the arbitrary messages to be executed if the + proposal passes. + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the proposal. + When + + querying a proposal via gRPC, this field is not populated until + the + + proposal's voting period has ended. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: abstain_count is the number of abstain votes on a proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + metadata: + type: string + description: metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter + description: Proposal defines the core field members of a governance proposal. + description: proposals defines all the requested governance proposals. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryProposalsResponse is the response type for the Query/Proposals RPC + method. + cosmos.gov.v1.QueryTallyResultResponse: + type: object + properties: + tally: + description: tally defines the requested tally. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: abstain_count is the number of abstain votes on a proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. + description: >- + QueryTallyResultResponse is the response type for the Query/Tally RPC + method. + cosmos.gov.v1.QueryVoteResponse: + type: object + properties: + vote: + description: vote defines the queried vote. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. + metadata: + type: string + description: metadata is any arbitrary metadata to attached to the vote. + description: QueryVoteResponse is the response type for the Query/Vote RPC method. + cosmos.gov.v1.QueryVotesResponse: + type: object + properties: + votes: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. + metadata: + type: string + description: metadata is any arbitrary metadata to attached to the vote. + description: |- + Vote defines a vote on a governance proposal. + A Vote consists of a proposal ID, the voter, and the vote option. + description: votes defines the queried votes. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: QueryVotesResponse is the response type for the Query/Votes RPC method. + cosmos.gov.v1.TallyParams: + type: object + properties: + quorum: + type: string + description: |- + Minimum percentage of total stake needed to vote for a result to be + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. Default value: + 0.5. + veto_threshold: + type: string + description: |- + Minimum value of Veto votes to Total votes ratio for proposal to be + vetoed. Default value: 1/3. + description: TallyParams defines the params for tallying votes on governance proposals. + cosmos.gov.v1.TallyResult: + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: abstain_count is the number of abstain votes on a proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: no_with_veto_count is the number of no with veto votes on a proposal. + description: TallyResult defines a standard tally for a governance proposal. + cosmos.gov.v1.Vote: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. + metadata: + type: string + description: metadata is any arbitrary metadata to attached to the vote. + description: |- + Vote defines a vote on a governance proposal. + A Vote consists of a proposal ID, the voter, and the vote option. + cosmos.gov.v1.VoteOption: + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + description: >- + VoteOption enumerates the valid vote options for a given governance + proposal. + + - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. + - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. + - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. + - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + cosmos.gov.v1.VotingParams: + type: object + properties: + voting_period: + type: string + description: Duration of the voting period. + description: VotingParams defines the params for voting on governance proposals. + cosmos.gov.v1.WeightedVoteOption: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain duplicate + vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: WeightedVoteOption defines a unit of vote for vote split. + cosmos.gov.v1beta1.Deposit: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: |- + Deposit defines an amount deposited by an account address to an active + proposal. + cosmos.gov.v1beta1.DepositParams: + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + description: DepositParams defines the params for deposits on governance proposals. + cosmos.gov.v1beta1.MsgDepositResponse: + type: object + description: MsgDepositResponse defines the Msg/Deposit response type. + cosmos.gov.v1beta1.MsgSubmitProposalResponse: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + description: MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. + cosmos.gov.v1beta1.MsgVoteResponse: + type: object + description: MsgVoteResponse defines the Msg/Vote response type. + cosmos.gov.v1beta1.MsgVoteWeightedResponse: + type: object + description: |- + MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + + Since: cosmos-sdk 0.43 + cosmos.gov.v1beta1.Proposal: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + content: + description: content is the proposal's content. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: |- + final_tally_result is the final tally result of the proposal. When + querying a proposal via gRPC, this field is not populated until the + proposal's voting period has ended. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: no_with_veto is the number of no with veto votes on a proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + description: Proposal defines the core field members of a governance proposal. + cosmos.gov.v1beta1.ProposalStatus: + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + description: |- + ProposalStatus enumerates the valid statuses of a proposal. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + period. + - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + period. + - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + passed. + - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + been rejected. + - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + failed. + cosmos.gov.v1beta1.QueryDepositResponse: + type: object + properties: + deposit: + description: deposit defines the requested deposit. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + QueryDepositResponse is the response type for the Query/Deposit RPC + method. + cosmos.gov.v1beta1.QueryDepositsResponse: + type: object + properties: + deposits: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + Deposit defines an amount deposited by an account address to an + active + + proposal. + description: deposits defines the requested deposits. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDepositsResponse is the response type for the Query/Deposits RPC + method. + cosmos.gov.v1beta1.QueryParamsResponse: + type: object + properties: + voting_params: + description: voting_params defines the parameters related to voting. + type: object + properties: + voting_period: + type: string + description: Duration of the voting period. + deposit_params: + description: deposit_params defines the parameters related to deposit. + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + tally_params: + description: tally_params defines the parameters related to tally. + type: object + properties: + quorum: + type: string + format: byte + description: >- + Minimum percentage of total stake needed to vote for a result to + be + + considered valid. + threshold: + type: string + format: byte + description: >- + Minimum proportion of Yes votes for proposal to pass. Default + value: 0.5. + veto_threshold: + type: string + format: byte + description: >- + Minimum value of Veto votes to Total votes ratio for proposal to + be + + vetoed. Default value: 1/3. + description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.gov.v1beta1.QueryProposalResponse: + type: object + properties: + proposal: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + content: + description: content is the proposal's content. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the proposal. When + + querying a proposal via gRPC, this field is not populated until + the + + proposal's voting period has ended. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + description: Proposal defines the core field members of a governance proposal. + description: >- + QueryProposalResponse is the response type for the Query/Proposal RPC + method. + cosmos.gov.v1beta1.QueryProposalsResponse: + type: object + properties: + proposals: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + content: + description: content is the proposal's content. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the proposal. + When + + querying a proposal via gRPC, this field is not populated until + the + + proposal's voting period has ended. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + description: Proposal defines the core field members of a governance proposal. + description: proposals defines all the requested governance proposals. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryProposalsResponse is the response type for the Query/Proposals RPC + method. + cosmos.gov.v1beta1.QueryTallyResultResponse: + type: object + properties: + tally: + description: tally defines the requested tally. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: no_with_veto is the number of no with veto votes on a proposal. + description: >- + QueryTallyResultResponse is the response type for the Query/Tally RPC + method. + cosmos.gov.v1beta1.QueryVoteResponse: + type: object + properties: + vote: + description: vote defines the queried vote. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + option: + description: >- + Deprecated: Prefer to use `options` instead. This field is set in + queries + + if and only if `len(options) == 1` and that option has weight 1. + In all + + other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: |- + WeightedVoteOption defines a unit of vote for vote split. + + Since: cosmos-sdk 0.43 + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 + description: QueryVoteResponse is the response type for the Query/Vote RPC method. + cosmos.gov.v1beta1.QueryVotesResponse: + type: object + properties: + votes: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + option: + description: >- + Deprecated: Prefer to use `options` instead. This field is set + in queries + + if and only if `len(options) == 1` and that option has weight 1. + In all + + other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: |- + WeightedVoteOption defines a unit of vote for vote split. + + Since: cosmos-sdk 0.43 + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 + description: |- + Vote defines a vote on a governance proposal. + A Vote consists of a proposal ID, the voter, and the vote option. + description: votes defines the queried votes. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: QueryVotesResponse is the response type for the Query/Votes RPC method. + cosmos.gov.v1beta1.TallyParams: + type: object + properties: + quorum: + type: string + format: byte + description: |- + Minimum percentage of total stake needed to vote for a result to be + considered valid. + threshold: + type: string + format: byte + description: >- + Minimum proportion of Yes votes for proposal to pass. Default value: + 0.5. + veto_threshold: + type: string + format: byte + description: |- + Minimum value of Veto votes to Total votes ratio for proposal to be + vetoed. Default value: 1/3. + description: TallyParams defines the params for tallying votes on governance proposals. + cosmos.gov.v1beta1.TallyResult: + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: no_with_veto is the number of no with veto votes on a proposal. + description: TallyResult defines a standard tally for a governance proposal. + cosmos.gov.v1beta1.Vote: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + option: + description: >- + Deprecated: Prefer to use `options` instead. This field is set in + queries + + if and only if `len(options) == 1` and that option has weight 1. In + all + + other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: |- + WeightedVoteOption defines a unit of vote for vote split. + + Since: cosmos-sdk 0.43 + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 + description: |- + Vote defines a vote on a governance proposal. + A Vote consists of a proposal ID, the voter, and the vote option. + cosmos.gov.v1beta1.VoteOption: + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + description: >- + VoteOption enumerates the valid vote options for a given governance + proposal. + + - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. + - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. + - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. + - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + cosmos.gov.v1beta1.VotingParams: + type: object + properties: + voting_period: + type: string + description: Duration of the voting period. + description: VotingParams defines the params for voting on governance proposals. + cosmos.gov.v1beta1.WeightedVoteOption: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain duplicate + vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: |- + WeightedVoteOption defines a unit of vote for vote split. + + Since: cosmos-sdk 0.43 + cosmos.mint.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.mint.v1beta1.Params: + type: object + properties: + mint_denom: + type: string + title: type of coin to mint + inflation_rate_change: + type: string + title: maximum annual change in inflation rate + inflation_max: + type: string + title: maximum inflation rate + inflation_min: + type: string + title: minimum inflation rate + goal_bonded: + type: string + title: goal of percent bonded atoms + blocks_per_year: + type: string + format: uint64 + title: expected blocks per year + description: Params defines the parameters for the x/mint module. + cosmos.mint.v1beta1.QueryAnnualProvisionsResponse: + type: object + properties: + annual_provisions: + type: string + format: byte + description: annual_provisions is the current minting annual provisions value. + description: |- + QueryAnnualProvisionsResponse is the response type for the + Query/AnnualProvisions RPC method. + cosmos.mint.v1beta1.QueryInflationResponse: + type: object + properties: + inflation: + type: string + format: byte + description: inflation is the current minting inflation value. + description: |- + QueryInflationResponse is the response type for the Query/Inflation RPC + method. + cosmos.mint.v1beta1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + mint_denom: + type: string + title: type of coin to mint + inflation_rate_change: + type: string + title: maximum annual change in inflation rate + inflation_max: + type: string + title: maximum inflation rate + inflation_min: + type: string + title: minimum inflation rate + goal_bonded: + type: string + title: goal of percent bonded atoms + blocks_per_year: + type: string + format: uint64 + title: expected blocks per year + description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.nft.v1beta1.Class: + type: object + properties: + id: + type: string + title: >- + id defines the unique identifier of the NFT classification, similar to + the contract address of ERC721 + name: + type: string + title: >- + name defines the human-readable name of the NFT classification. + Optional + symbol: + type: string + title: symbol is an abbreviated name for nft classification. Optional + description: + type: string + title: description is a brief description of nft classification. Optional + uri: + type: string + title: >- + uri for the class metadata stored off chain. It can define schema for + Class and NFT `Data` attributes. Optional + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri. Optional + data: + title: data is the app specific metadata of the NFT class. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: Class defines the class of the nft type. + cosmos.nft.v1beta1.MsgSendResponse: + type: object + description: MsgSendResponse defines the Msg/Send response type. + cosmos.nft.v1beta1.NFT: + type: object + properties: + class_id: + type: string + title: >- + class_id associated with the NFT, similar to the contract address of + ERC721 + id: + type: string + title: id is a unique identifier of the NFT + uri: + type: string + title: uri for the NFT metadata stored off chain + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri + data: + title: data is an app specific data of the NFT. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: NFT defines the NFT. + cosmos.nft.v1beta1.QueryBalanceResponse: + type: object + properties: + amount: + type: string + format: uint64 + title: amount is the number of all NFTs of a given class owned by the owner + title: QueryBalanceResponse is the response type for the Query/Balance RPC method + cosmos.nft.v1beta1.QueryClassResponse: + type: object + properties: + class: + description: class defines the class of the nft type. + type: object + properties: + id: + type: string + title: >- + id defines the unique identifier of the NFT classification, + similar to the contract address of ERC721 + name: + type: string + title: >- + name defines the human-readable name of the NFT classification. + Optional + symbol: + type: string + title: symbol is an abbreviated name for nft classification. Optional + description: + type: string + title: description is a brief description of nft classification. Optional + uri: + type: string + title: >- + uri for the class metadata stored off chain. It can define schema + for Class and NFT `Data` attributes. Optional + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri. Optional + data: + title: data is the app specific metadata of the NFT class. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: QueryClassResponse is the response type for the Query/Class RPC method + cosmos.nft.v1beta1.QueryClassesResponse: + type: object + properties: + classes: + type: array + items: + type: object + properties: + id: + type: string + title: >- + id defines the unique identifier of the NFT classification, + similar to the contract address of ERC721 + name: + type: string + title: >- + name defines the human-readable name of the NFT classification. + Optional + symbol: + type: string + title: symbol is an abbreviated name for nft classification. Optional + description: + type: string + title: >- + description is a brief description of nft classification. + Optional + uri: + type: string + title: >- + uri for the class metadata stored off chain. It can define + schema for Class and NFT `Data` attributes. Optional + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri. Optional + data: + title: data is the app specific metadata of the NFT class. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: Class defines the class of the nft type. + description: class defines the class of the nft type. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: QueryClassesResponse is the response type for the Query/Classes RPC method + cosmos.nft.v1beta1.QueryNFTResponse: + type: object + properties: + nft: + title: owner is the owner address of the nft + type: object + properties: + class_id: + type: string + title: >- + class_id associated with the NFT, similar to the contract address + of ERC721 + id: + type: string + title: id is a unique identifier of the NFT + uri: + type: string + title: uri for the NFT metadata stored off chain + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri + data: + title: data is an app specific data of the NFT. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: NFT defines the NFT. + title: QueryNFTResponse is the response type for the Query/NFT RPC method + cosmos.nft.v1beta1.QueryNFTsResponse: + type: object + properties: + nfts: + type: array + items: + type: object + properties: + class_id: + type: string + title: >- + class_id associated with the NFT, similar to the contract + address of ERC721 + id: + type: string + title: id is a unique identifier of the NFT + uri: + type: string + title: uri for the NFT metadata stored off chain + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri + data: + title: data is an app specific data of the NFT. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: NFT defines the NFT. + title: NFT defines the NFT + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: QueryNFTsResponse is the response type for the Query/NFTs RPC methods + cosmos.nft.v1beta1.QueryOwnerResponse: + type: object + properties: + owner: + type: string + title: owner is the owner address of the nft + title: QueryOwnerResponse is the response type for the Query/Owner RPC method + cosmos.nft.v1beta1.QuerySupplyResponse: + type: object + properties: + amount: + type: string + format: uint64 + title: amount is the number of all NFTs from the given class + title: QuerySupplyResponse is the response type for the Query/Supply RPC method + cosmos.params.v1beta1.ParamChange: + type: object + properties: + subspace: + type: string + key: + type: string + value: + type: string + description: |- + ParamChange defines an individual parameter change, for use in + ParameterChangeProposal. + cosmos.params.v1beta1.QueryParamsResponse: + type: object + properties: + param: + description: param defines the queried parameter. + type: object + properties: + subspace: + type: string + key: + type: string + value: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC method. + cosmos.params.v1beta1.QuerySubspacesResponse: + type: object + properties: + subspaces: + type: array + items: + type: object + properties: + subspace: + type: string + keys: + type: array + items: + type: string + description: >- + Subspace defines a parameter subspace name and all the keys that + exist for + + the subspace. + + + Since: cosmos-sdk 0.46 + description: |- + QuerySubspacesResponse defines the response types for querying for all + registered subspaces and all keys for a subspace. + + Since: cosmos-sdk 0.46 + cosmos.params.v1beta1.Subspace: + type: object + properties: + subspace: + type: string + keys: + type: array + items: + type: string + description: |- + Subspace defines a parameter subspace name and all the keys that exist for + the subspace. + + Since: cosmos-sdk 0.46 + cosmos.slashing.v1beta1.MsgUnjailResponse: + type: object + title: MsgUnjailResponse defines the Msg/Unjail response type + cosmos.slashing.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.slashing.v1beta1.Params: + type: object + properties: + signed_blocks_window: + type: string + format: int64 + min_signed_per_window: + type: string + format: byte + downtime_jail_duration: + type: string + slash_fraction_double_sign: + type: string + format: byte + slash_fraction_downtime: + type: string + format: byte + description: Params represents the parameters used for by the slashing module. + cosmos.slashing.v1beta1.QueryParamsResponse: + type: object + properties: + params: + type: object + properties: + signed_blocks_window: + type: string + format: int64 + min_signed_per_window: + type: string + format: byte + downtime_jail_duration: + type: string + slash_fraction_double_sign: + type: string + format: byte + slash_fraction_downtime: + type: string + format: byte + description: Params represents the parameters used for by the slashing module. + title: QueryParamsResponse is the response type for the Query/Params RPC method + cosmos.slashing.v1beta1.QuerySigningInfoResponse: + type: object + properties: + val_signing_info: + title: val_signing_info is the signing info of requested val cons address + type: object + properties: + address: + type: string + start_height: + type: string + format: int64 + title: Height at which validator was first a candidate OR was unjailed + index_offset: + type: string + format: int64 + description: >- + Index which is incremented each time the validator was a bonded + + in a block and may have signed a precommit or not. This in + conjunction with the + + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time + description: >- + Timestamp until which the validator is jailed due to liveness + downtime. + tombstoned: + type: boolean + description: >- + Whether or not a validator has been tombstoned (killed out of + validator set). It is set + + once the validator commits an equivocation or for any other + configured misbehiavor. + missed_blocks_counter: + type: string + format: int64 + description: >- + A counter kept to avoid unnecessary array reads. + + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. + description: >- + ValidatorSigningInfo defines a validator's signing info for monitoring + their + + liveness activity. + title: >- + QuerySigningInfoResponse is the response type for the Query/SigningInfo + RPC + + method + cosmos.slashing.v1beta1.QuerySigningInfosResponse: + type: object + properties: + info: + type: array + items: + type: object + properties: + address: + type: string + start_height: + type: string + format: int64 + title: Height at which validator was first a candidate OR was unjailed + index_offset: + type: string + format: int64 + description: >- + Index which is incremented each time the validator was a bonded + + in a block and may have signed a precommit or not. This in + conjunction with the + + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time + description: >- + Timestamp until which the validator is jailed due to liveness + downtime. + tombstoned: + type: boolean + description: >- + Whether or not a validator has been tombstoned (killed out of + validator set). It is set + + once the validator commits an equivocation or for any other + configured misbehiavor. + missed_blocks_counter: + type: string + format: int64 + description: >- + A counter kept to avoid unnecessary array reads. + + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. + description: >- + ValidatorSigningInfo defines a validator's signing info for + monitoring their + + liveness activity. + title: info is the signing info of all validators + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: >- + QuerySigningInfosResponse is the response type for the Query/SigningInfos + RPC + + method + cosmos.slashing.v1beta1.ValidatorSigningInfo: + type: object + properties: + address: + type: string + start_height: + type: string + format: int64 + title: Height at which validator was first a candidate OR was unjailed + index_offset: + type: string + format: int64 + description: >- + Index which is incremented each time the validator was a bonded + + in a block and may have signed a precommit or not. This in conjunction + with the + + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time + description: >- + Timestamp until which the validator is jailed due to liveness + downtime. + tombstoned: + type: boolean + description: >- + Whether or not a validator has been tombstoned (killed out of + validator set). It is set + + once the validator commits an equivocation or for any other configured + misbehiavor. + missed_blocks_counter: + type: string + format: int64 + description: >- + A counter kept to avoid unnecessary array reads. + + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. + description: >- + ValidatorSigningInfo defines a validator's signing info for monitoring + their + + liveness activity. + cosmos.staking.v1beta1.BondStatus: + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + description: |- + BondStatus is the status of a validator. + + - BOND_STATUS_UNSPECIFIED: UNSPECIFIED defines an invalid validator status. + - BOND_STATUS_UNBONDED: UNBONDED defines a validator that is not bonded. + - BOND_STATUS_UNBONDING: UNBONDING defines a validator that is unbonding. + - BOND_STATUS_BONDED: BONDED defines a validator that is bonded. + cosmos.staking.v1beta1.Commission: + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be used for + creating a validator. + type: object + properties: + rate: + type: string + description: rate is the commission rate charged to delegators, as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which validator can + ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of the + validator commission, as a fraction. + update_time: + type: string + format: date-time + description: update_time is the last time the commission rate was changed. + description: Commission defines commission parameters for a given validator. + cosmos.staking.v1beta1.CommissionRates: + type: object + properties: + rate: + type: string + description: rate is the commission rate charged to delegators, as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which validator can ever + charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of the validator + commission, as a fraction. + description: >- + CommissionRates defines the initial commission rates to be used for + creating + + a validator. + cosmos.staking.v1beta1.Delegation: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_address: + type: string + description: validator_address is the bech32-encoded address of the validator. + shares: + type: string + description: shares define the delegation shares received. + description: |- + Delegation represents the bond with tokens held by an account. It is + owned by one delegator, and is associated with the voting power of one + validator. + cosmos.staking.v1beta1.DelegationResponse: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_address: + type: string + description: validator_address is the bech32-encoded address of the validator. + shares: + type: string + description: shares define the delegation shares received. + description: |- + Delegation represents the bond with tokens held by an account. It is + owned by one delegator, and is associated with the voting power of one + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: |- + DelegationResponse is equivalent to Delegation except that it contains a + balance in addition to shares which is more suitable for client responses. + cosmos.staking.v1beta1.Description: + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort or + Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: security_contact defines an optional email for security contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + cosmos.staking.v1beta1.HistoricalInfo: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in + the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + valset: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort + or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be + used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of + the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum + self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator + description: >- + Validator defines a validator, together with the total amount of the + + Validator's bond shares and their exchange rate to coins. Slashing + results in + + a decrease in the exchange rate, allowing correct calculation of + future + + undelegations without iterating over delegators. When coins are + delegated to + + this validator, the validator is credited with a delegation whose + number of + + bond shares is based on the amount of coins delegated divided by the + current + + exchange rate. Voting power can be calculated as total bonded shares + + multiplied by exchange rate. + description: >- + HistoricalInfo contains header and validator information for a given + block. + + It is stored as part of staking module's state, which persists the `n` + most + + recent HistoricalInfo + + (`n` is set by the staking module's `historical_entries` parameter). + cosmos.staking.v1beta1.MsgBeginRedelegateResponse: + type: object + properties: + completion_time: + type: string + format: date-time + description: MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. + cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse: + type: object + description: 'Since: cosmos-sdk 0.46' + title: MsgCancelUnbondingDelegationResponse + cosmos.staking.v1beta1.MsgCreateValidatorResponse: + type: object + description: MsgCreateValidatorResponse defines the Msg/CreateValidator response type. + cosmos.staking.v1beta1.MsgDelegateResponse: + type: object + description: MsgDelegateResponse defines the Msg/Delegate response type. + cosmos.staking.v1beta1.MsgEditValidatorResponse: + type: object + description: MsgEditValidatorResponse defines the Msg/EditValidator response type. + cosmos.staking.v1beta1.MsgUndelegateResponse: + type: object + properties: + completion_time: + type: string + format: date-time + description: MsgUndelegateResponse defines the Msg/Undelegate response type. + cosmos.staking.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.staking.v1beta1.Params: + type: object + properties: + unbonding_time: + type: string + description: unbonding_time is the time duration of unbonding. + max_validators: + type: integer + format: int64 + description: max_validators is the maximum number of validators. + max_entries: + type: integer + format: int64 + description: >- + max_entries is the max entries for either unbonding delegation or + redelegation (per pair/trio). + historical_entries: + type: integer + format: int64 + description: historical_entries is the number of historical entries to persist. + bond_denom: + type: string + description: bond_denom defines the bondable coin denomination. + min_commission_rate: + type: string + title: >- + min_commission_rate is the chain-wide minimum commission rate that a + validator can charge their delegators + description: Params defines the parameters for the x/staking module. + cosmos.staking.v1beta1.Pool: + type: object + properties: + not_bonded_tokens: + type: string + bonded_tokens: + type: string + description: |- + Pool is used for tracking bonded and not-bonded token supply of the bond + denomination. + cosmos.staking.v1beta1.QueryDelegationResponse: + type: object + properties: + delegation_response: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an account. It + is + + owned by one delegator, and is associated with the voting power of + one + + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that it contains + a + + balance in addition to shares which is more suitable for client + responses. + description: >- + QueryDelegationResponse is response type for the Query/Delegation RPC + method. + cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse: + type: object + properties: + delegation_responses: + type: array + items: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an account. + It is + + owned by one delegator, and is associated with the voting power + of one + + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that it + contains a + + balance in addition to shares which is more suitable for client + responses. + description: delegation_responses defines all the delegations' info of a delegator. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryDelegatorDelegationsResponse is response type for the + Query/DelegatorDelegations RPC method. + cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse: + type: object + properties: + unbonding_responses: + type: array + items: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding took + place. + completion_time: + type: string + format: date-time + description: completion_time is the unix time for unbonding completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially scheduled to + receive at completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object with + relevant metadata. + description: entries are the unbonding delegation entries. + description: >- + UnbondingDelegation stores all of a single delegator's unbonding + bonds + + for a single validator in an time-ordered list. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryUnbondingDelegatorDelegationsResponse is response type for the + Query/UnbondingDelegatorDelegations RPC method. + cosmos.staking.v1beta1.QueryDelegatorValidatorResponse: + type: object + properties: + validator: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's operator; + bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort or + Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be + used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of the + validator commission, as a fraction. + update_time: + type: string + format: date-time + description: update_time is the last time the commission rate was changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum self + delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator + description: >- + Validator defines a validator, together with the total amount of the + + Validator's bond shares and their exchange rate to coins. Slashing + results in + + a decrease in the exchange rate, allowing correct calculation of + future + + undelegations without iterating over delegators. When coins are + delegated to + + this validator, the validator is credited with a delegation whose + number of + + bond shares is based on the amount of coins delegated divided by the + current + + exchange rate. Voting power can be calculated as total bonded shares + + multiplied by exchange rate. + description: |- + QueryDelegatorValidatorResponse response type for the + Query/DelegatorValidator RPC method. + cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse: + type: object + properties: + validators: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort + or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be + used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of + the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum + self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator + description: >- + Validator defines a validator, together with the total amount of the + + Validator's bond shares and their exchange rate to coins. Slashing + results in + + a decrease in the exchange rate, allowing correct calculation of + future + + undelegations without iterating over delegators. When coins are + delegated to + + this validator, the validator is credited with a delegation whose + number of + + bond shares is based on the amount of coins delegated divided by the + current + + exchange rate. Voting power can be calculated as total bonded shares + + multiplied by exchange rate. + description: validators defines the validators' info of a delegator. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryDelegatorValidatorsResponse is response type for the + Query/DelegatorValidators RPC method. + cosmos.staking.v1beta1.QueryHistoricalInfoResponse: + type: object + properties: + hist: + description: hist defines the historical info at the given height. + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + valset: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from + bonded status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which + this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to + be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, + as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase + of the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum + self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding + of this validator + description: >- + Validator defines a validator, together with the total amount of + the + + Validator's bond shares and their exchange rate to coins. + Slashing results in + + a decrease in the exchange rate, allowing correct calculation of + future + + undelegations without iterating over delegators. When coins are + delegated to + + this validator, the validator is credited with a delegation + whose number of + + bond shares is based on the amount of coins delegated divided by + the current + + exchange rate. Voting power can be calculated as total bonded + shares + + multiplied by exchange rate. + description: >- + QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo + RPC + + method. + cosmos.staking.v1beta1.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + unbonding_time: + type: string + description: unbonding_time is the time duration of unbonding. + max_validators: + type: integer + format: int64 + description: max_validators is the maximum number of validators. + max_entries: + type: integer + format: int64 + description: >- + max_entries is the max entries for either unbonding delegation or + redelegation (per pair/trio). + historical_entries: + type: integer + format: int64 + description: historical_entries is the number of historical entries to persist. + bond_denom: + type: string + description: bond_denom defines the bondable coin denomination. + min_commission_rate: + type: string + title: >- + min_commission_rate is the chain-wide minimum commission rate that + a validator can charge their delegators + description: QueryParamsResponse is response type for the Query/Params RPC method. + cosmos.staking.v1beta1.QueryPoolResponse: + type: object + properties: + pool: + description: pool defines the pool info. + type: object + properties: + not_bonded_tokens: + type: string + bonded_tokens: + type: string + description: QueryPoolResponse is response type for the Query/Pool RPC method. + cosmos.staking.v1beta1.QueryRedelegationsResponse: + type: object + properties: + redelegation_responses: + type: array + items: + type: object + properties: + redelegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_src_address: + type: string + description: >- + validator_src_address is the validator redelegation source + operator address. + validator_dst_address: + type: string + description: >- + validator_dst_address is the validator redelegation + destination operator address. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the + redelegation took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for redelegation + completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when + redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator + shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules + description: >- + RedelegationEntry defines a redelegation object with + relevant metadata. + description: entries are the redelegation entries. + description: >- + Redelegation contains the list of a particular delegator's + redelegating bonds + + from a particular source validator to a particular destination + validator. + entries: + type: array + items: + type: object + properties: + redelegation_entry: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the + redelegation took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for redelegation + completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when + redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator + shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules + description: >- + RedelegationEntry defines a redelegation object with + relevant metadata. + balance: + type: string + description: >- + RedelegationEntryResponse is equivalent to a RedelegationEntry + except that it + + contains a balance in addition to shares which is more + suitable for client + + responses. + description: >- + RedelegationResponse is equivalent to a Redelegation except that its + entries + + contain a balance in addition to shares which is more suitable for + client + + responses. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryRedelegationsResponse is response type for the Query/Redelegations + RPC + + method. + cosmos.staking.v1beta1.QueryUnbondingDelegationResponse: + type: object + properties: + unbond: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_address: + type: string + description: validator_address is the bech32-encoded address of the validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding took + place. + completion_time: + type: string + format: date-time + description: completion_time is the unix time for unbonding completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially scheduled to + receive at completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped + by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object with + relevant metadata. + description: entries are the unbonding delegation entries. + description: |- + UnbondingDelegation stores all of a single delegator's unbonding bonds + for a single validator in an time-ordered list. + description: |- + QueryDelegationResponse is response type for the Query/UnbondingDelegation + RPC method. + cosmos.staking.v1beta1.QueryValidatorDelegationsResponse: + type: object + properties: + delegation_responses: + type: array + items: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an account. + It is + + owned by one delegator, and is associated with the voting power + of one + + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that it + contains a + + balance in addition to shares which is more suitable for client + responses. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: |- + QueryValidatorDelegationsResponse is response type for the + Query/ValidatorDelegations RPC method + cosmos.staking.v1beta1.QueryValidatorResponse: + type: object + properties: + validator: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's operator; + bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort or + Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be + used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of the + validator commission, as a fraction. + update_time: + type: string + format: date-time + description: update_time is the last time the commission rate was changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum self + delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator + description: >- + Validator defines a validator, together with the total amount of the + + Validator's bond shares and their exchange rate to coins. Slashing + results in + + a decrease in the exchange rate, allowing correct calculation of + future + + undelegations without iterating over delegators. When coins are + delegated to + + this validator, the validator is credited with a delegation whose + number of + + bond shares is based on the amount of coins delegated divided by the + current + + exchange rate. Voting power can be calculated as total bonded shares + + multiplied by exchange rate. + title: QueryValidatorResponse is response type for the Query/Validator RPC method + cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse: + type: object + properties: + unbonding_responses: + type: array + items: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding took + place. + completion_time: + type: string + format: date-time + description: completion_time is the unix time for unbonding completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially scheduled to + receive at completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object with + relevant metadata. + description: entries are the unbonding delegation entries. + description: >- + UnbondingDelegation stores all of a single delegator's unbonding + bonds + + for a single validator in an time-ordered list. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryValidatorUnbondingDelegationsResponse is response type for the + Query/ValidatorUnbondingDelegations RPC method. + cosmos.staking.v1beta1.QueryValidatorsResponse: + type: object + properties: + validators: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort + or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be + used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of + the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum + self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator + description: >- + Validator defines a validator, together with the total amount of the + + Validator's bond shares and their exchange rate to coins. Slashing + results in + + a decrease in the exchange rate, allowing correct calculation of + future + + undelegations without iterating over delegators. When coins are + delegated to + + this validator, the validator is credited with a delegation whose + number of + + bond shares is based on the amount of coins delegated divided by the + current + + exchange rate. Voting power can be calculated as total bonded shares + + multiplied by exchange rate. + description: validators contains all the queried validators. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryValidatorsResponse is response type for the Query/Validators RPC + method + cosmos.staking.v1beta1.Redelegation: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_src_address: + type: string + description: >- + validator_src_address is the validator redelegation source operator + address. + validator_dst_address: + type: string + description: >- + validator_dst_address is the validator redelegation destination + operator address. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the redelegation took + place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for redelegation + completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when redelegation + started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator shares created + by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules + description: >- + RedelegationEntry defines a redelegation object with relevant + metadata. + description: entries are the redelegation entries. + description: >- + Redelegation contains the list of a particular delegator's redelegating + bonds + + from a particular source validator to a particular destination validator. + cosmos.staking.v1beta1.RedelegationEntry: + type: object + properties: + creation_height: + type: string + format: int64 + description: creation_height defines the height which the redelegation took place. + completion_time: + type: string + format: date-time + description: completion_time defines the unix time for redelegation completion. + initial_balance: + type: string + description: initial_balance defines the initial balance when redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator shares created by + redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules + description: RedelegationEntry defines a redelegation object with relevant metadata. + cosmos.staking.v1beta1.RedelegationEntryResponse: + type: object + properties: + redelegation_entry: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the redelegation took + place. + completion_time: + type: string + format: date-time + description: completion_time defines the unix time for redelegation completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when redelegation + started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator shares created + by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules + description: >- + RedelegationEntry defines a redelegation object with relevant + metadata. + balance: + type: string + description: >- + RedelegationEntryResponse is equivalent to a RedelegationEntry except that + it + + contains a balance in addition to shares which is more suitable for client + + responses. + cosmos.staking.v1beta1.RedelegationResponse: + type: object + properties: + redelegation: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_src_address: + type: string + description: >- + validator_src_address is the validator redelegation source + operator address. + validator_dst_address: + type: string + description: >- + validator_dst_address is the validator redelegation destination + operator address. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the redelegation + took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for redelegation + completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when + redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator shares + created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped + by external modules + description: >- + RedelegationEntry defines a redelegation object with relevant + metadata. + description: entries are the redelegation entries. + description: >- + Redelegation contains the list of a particular delegator's + redelegating bonds + + from a particular source validator to a particular destination + validator. + entries: + type: array + items: + type: object + properties: + redelegation_entry: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the redelegation + took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for redelegation + completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when + redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator shares + created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped + by external modules + description: >- + RedelegationEntry defines a redelegation object with relevant + metadata. + balance: + type: string + description: >- + RedelegationEntryResponse is equivalent to a RedelegationEntry + except that it + + contains a balance in addition to shares which is more suitable for + client + + responses. + description: >- + RedelegationResponse is equivalent to a Redelegation except that its + entries + + contain a balance in addition to shares which is more suitable for client + + responses. + cosmos.staking.v1beta1.UnbondingDelegation: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_address: + type: string + description: validator_address is the bech32-encoded address of the validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: creation_height is the height which the unbonding took place. + completion_time: + type: string + format: date-time + description: completion_time is the unix time for unbonding completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially scheduled to + receive at completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules + description: >- + UnbondingDelegationEntry defines an unbonding object with relevant + metadata. + description: entries are the unbonding delegation entries. + description: |- + UnbondingDelegation stores all of a single delegator's unbonding bonds + for a single validator in an time-ordered list. + cosmos.staking.v1beta1.UnbondingDelegationEntry: + type: object + properties: + creation_height: + type: string + format: int64 + description: creation_height is the height which the unbonding took place. + completion_time: + type: string + format: date-time + description: completion_time is the unix time for unbonding completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially scheduled to receive at + completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules + description: >- + UnbondingDelegationEntry defines an unbonding object with relevant + metadata. + cosmos.staking.v1beta1.Validator: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's operator; bech + encoded in JSON. + consensus_pubkey: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort or + Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: security_contact defines an optional email for security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the validator + to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be used + for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which validator + can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of the + validator commission, as a fraction. + update_time: + type: string + format: date-time + description: update_time is the last time the commission rate was changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum self + delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped by + external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of this + validator + description: >- + Validator defines a validator, together with the total amount of the + + Validator's bond shares and their exchange rate to coins. Slashing results + in + + a decrease in the exchange rate, allowing correct calculation of future + + undelegations without iterating over delegators. When coins are delegated + to + + this validator, the validator is credited with a delegation whose number + of + + bond shares is based on the amount of coins delegated divided by the + current + + exchange rate. Voting power can be calculated as total bonded shares + + multiplied by exchange rate. + cosmos.base.abci.v1beta1.ABCIMessageLog: + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where the key and value + are + + strings instead of raw bytes. + description: |- + StringEvent defines en Event object wrapper where all the attributes + contain key/value pairs that are strings instead of raw bytes. + description: |- + Events contains a slice of Event objects that were emitted during some + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed tx ABCI message + log. + cosmos.base.abci.v1beta1.Attribute: + type: object + properties: + key: + type: string + value: + type: string + description: |- + Attribute defines an attribute wrapper where the key and value are + strings instead of raw bytes. + cosmos.base.abci.v1beta1.GasInfo: + type: object + properties: + gas_wanted: + type: string + format: uint64 + description: GasWanted is the maximum units of work we allow this tx to perform. + gas_used: + type: string + format: uint64 + description: GasUsed is the amount of gas actually consumed. + description: GasInfo defines tx execution gas context. + cosmos.base.abci.v1beta1.Result: + type: object + properties: + data: + type: string + format: byte + description: >- + Data is any data returned from message or handler execution. It MUST + be + + length prefixed in order to separate data from multiple message + executions. + + Deprecated. This field is still populated, but prefer msg_response + instead + + because it also contains the Msg response typeURL. + log: + type: string + description: Log contains the log information from message or handler execution. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated with an + event. + description: >- + Event allows application developers to attach additional information + to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events contains a slice of Event objects that were emitted during + message + + or handler execution. + msg_responses: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + msg_responses contains the Msg handler responses type packed in Anys. + + Since: cosmos-sdk 0.46 + description: Result is the union of ResponseFormat and ResponseCheckTx. + cosmos.base.abci.v1beta1.StringEvent: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: |- + Attribute defines an attribute wrapper where the key and value are + strings instead of raw bytes. + description: |- + StringEvent defines en Event object wrapper where all the attributes + contain key/value pairs that are strings instead of raw bytes. + cosmos.base.abci.v1beta1.TxResponse: + type: object + properties: + height: + type: string + format: int64 + title: The block height + txhash: + type: string + description: The transaction hash. + codespace: + type: string + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. + data: + type: string + description: Result bytes, if any. + raw_log: + type: string + description: |- + The output of the application's logger (raw string). May be + non-deterministic. + logs: + type: array + items: + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where the key and + value are + + strings instead of raw bytes. + description: >- + StringEvent defines en Event object wrapper where all the + attributes + + contain key/value pairs that are strings instead of raw bytes. + description: >- + Events contains a slice of Event objects that were emitted + during some + + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed tx ABCI + message log. + description: >- + The output of the application's logger (typed). May be + non-deterministic. + info: + type: string + description: Additional information. May be non-deterministic. + gas_wanted: + type: string + format: int64 + description: Amount of gas requested for transaction. + gas_used: + type: string + format: int64 + description: Amount of gas consumed by transaction. + tx: + description: The request transaction bytes. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + timestamp: + type: string + description: >- + Time of the previous block. For heights > 1, it's the weighted median + of + + the timestamps of the valid votes in the block.LastCommit. For height + == 1, + + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated with an + event. + description: >- + Event allows application developers to attach additional information + to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a transaction. + Note, + + these events include those emitted by processing all the messages and + those + + emitted from the ante. Whereas Logs contains the events, with + + additional metadata, emitted only by processing the messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: >- + TxResponse defines a structure containing relevant tx data and metadata. + The + + tags are stringified and the log is JSON decoded. + cosmos.crypto.multisig.v1beta1.CompactBitArray: + type: object + properties: + extra_bits_stored: + type: integer + format: int64 + elems: + type: string + format: byte + description: |- + CompactBitArray is an implementation of a space efficient bit array. + This is used to ensure that the encoded data takes up a minimal amount of + space after proto encoding. + This is not thread safe, and is not intended for concurrent usage. + cosmos.tx.signing.v1beta1.SignMode: + type: string + enum: + - SIGN_MODE_UNSPECIFIED + - SIGN_MODE_DIRECT + - SIGN_MODE_TEXTUAL + - SIGN_MODE_DIRECT_AUX + - SIGN_MODE_LEGACY_AMINO_JSON + - SIGN_MODE_EIP_191 + default: SIGN_MODE_UNSPECIFIED + description: |- + SignMode represents a signing mode with its own security guarantees. + + This enum should be considered a registry of all known sign modes + in the Cosmos ecosystem. Apps are not expected to support all known + sign modes. Apps that would like to support custom sign modes are + encouraged to open a small PR against this file to add a new case + to this SignMode enum describing their sign mode so that different + apps have a consistent version of this enum. + + - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + rejected. + - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + verified with raw bytes from Tx. + - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some + human-readable textual representation on top of the binary representation + from SIGN_MODE_DIRECT. It is currently not supported. + - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not + require signers signing over other signers' `signer_info`. It also allows + for adding Tips in transactions. + + Since: cosmos-sdk 0.46 + - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + Amino JSON and will be removed in the future. + - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + + Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + but is not implemented on the SDK by default. To enable EIP-191, you need + to pass a custom `TxConfig` that has an implementation of + `SignModeHandler` for EIP-191. The SDK may decide to fully support + EIP-191 in the future. + + Since: cosmos-sdk 0.45.2 + cosmos.tx.v1beta1.AuthInfo: + type: object + properties: + signer_infos: + type: array + items: + type: object + $ref: '#/definitions/cosmos.tx.v1beta1.SignerInfo' + description: >- + signer_infos defines the signing modes for the required signers. The + number + + and order of elements must match the required signers from TxBody's + + messages. The first element is the primary signer and the one which + pays + + the fee. + fee: + description: >- + Fee is the fee and gas limit for the transaction. The first signer is + the + + primary signer and the one which pays the fee. The fee can be + calculated + + based on the cost of evaluating the body and doing signature + verification + + of the signers. This can be estimated via simulation. + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: amount is the amount of coins to be paid as a fee + gas_limit: + type: string + format: uint64 + title: >- + gas_limit is the maximum gas that can be used in transaction + processing + + before an out of gas error occurs + payer: + type: string + description: >- + if unset, the first signer is responsible for paying the fees. If + set, the specified account must pay the fees. + + the payer must be a tx signer (and thus have signed this field in + AuthInfo). + + setting this field does *not* change the ordering of required + signers for the transaction. + granter: + type: string + title: >- + if set, the fee payer (either the first signer or the value of the + payer field) requests that a fee grant be used + + to pay fees instead of the fee payer's own balance. If an + appropriate fee grant does not exist or the chain does + + not support fee grants, this will fail + tip: + description: >- + Tip is the optional tip used for transactions fees paid in another + denom. + + + This field is ignored if the chain didn't enable tips, i.e. didn't add + the + + `TipDecorator` in its posthandler. + + + Since: cosmos-sdk 0.46 + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: amount is the amount of the tip + tipper: + type: string + title: tipper is the address of the account paying for the tip + description: |- + AuthInfo describes the fee and signer modes that are used to sign a + transaction. + cosmos.tx.v1beta1.BroadcastMode: + type: string + enum: + - BROADCAST_MODE_UNSPECIFIED + - BROADCAST_MODE_BLOCK + - BROADCAST_MODE_SYNC + - BROADCAST_MODE_ASYNC + default: BROADCAST_MODE_UNSPECIFIED + description: >- + BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC + method. + + - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. + - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + a CheckTx execution response only. + - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + immediately. + cosmos.tx.v1beta1.BroadcastTxRequest: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + mode: + type: string + enum: + - BROADCAST_MODE_UNSPECIFIED + - BROADCAST_MODE_BLOCK + - BROADCAST_MODE_SYNC + - BROADCAST_MODE_ASYNC + default: BROADCAST_MODE_UNSPECIFIED + description: >- + BroadcastMode specifies the broadcast mode for the TxService.Broadcast + RPC method. + + - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. + - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + a CheckTx execution response only. + - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + immediately. + description: |- + BroadcastTxRequest is the request type for the Service.BroadcastTxRequest + RPC method. + cosmos.tx.v1beta1.BroadcastTxResponse: + type: object + properties: + tx_response: + description: tx_response is the queried TxResponses. + type: object + properties: + height: + type: string + format: int64 + title: The block height + txhash: + type: string + description: The transaction hash. + codespace: + type: string + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. + data: + type: string + description: Result bytes, if any. + raw_log: + type: string + description: |- + The output of the application's logger (raw string). May be + non-deterministic. + logs: + type: array + items: + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where the key + and value are + + strings instead of raw bytes. + description: >- + StringEvent defines en Event object wrapper where all the + attributes + + contain key/value pairs that are strings instead of raw + bytes. + description: >- + Events contains a slice of Event objects that were emitted + during some + + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed tx ABCI + message log. + description: >- + The output of the application's logger (typed). May be + non-deterministic. + info: + type: string + description: Additional information. May be non-deterministic. + gas_wanted: + type: string + format: int64 + description: Amount of gas requested for transaction. + gas_used: + type: string + format: int64 + description: Amount of gas consumed by transaction. + tx: + description: The request transaction bytes. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + timestamp: + type: string + description: >- + Time of the previous block. For heights > 1, it's the weighted + median of + + the timestamps of the valid votes in the block.LastCommit. For + height == 1, + + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated with + an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a transaction. + Note, + + these events include those emitted by processing all the messages + and those + + emitted from the ante. Whereas Logs contains the events, with + + additional metadata, emitted only by processing the messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: |- + BroadcastTxResponse is the response type for the + Service.BroadcastTx method. + cosmos.tx.v1beta1.Fee: + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: amount is the amount of coins to be paid as a fee + gas_limit: + type: string + format: uint64 + title: >- + gas_limit is the maximum gas that can be used in transaction + processing + + before an out of gas error occurs + payer: + type: string + description: >- + if unset, the first signer is responsible for paying the fees. If set, + the specified account must pay the fees. + + the payer must be a tx signer (and thus have signed this field in + AuthInfo). + + setting this field does *not* change the ordering of required signers + for the transaction. + granter: + type: string + title: >- + if set, the fee payer (either the first signer or the value of the + payer field) requests that a fee grant be used + + to pay fees instead of the fee payer's own balance. If an appropriate + fee grant does not exist or the chain does + + not support fee grants, this will fail + description: >- + Fee includes the amount of coins paid in fees and the maximum + + gas to be used by the transaction. The ratio yields an effective + "gasprice", + + which must be above some miminum to be accepted into the mempool. + cosmos.tx.v1beta1.GetBlockWithTxsResponse: + type: object + properties: + txs: + type: array + items: + type: object + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: txs are the transactions in the block. + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + block: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block + was committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + pagination: + description: pagination defines a pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + GetBlockWithTxsResponse is the response type for the + Service.GetBlockWithTxs method. + + + Since: cosmos-sdk 0.45.2 + cosmos.tx.v1beta1.GetTxResponse: + type: object + properties: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: tx is the queried transaction. + tx_response: + description: tx_response is the queried TxResponses. + type: object + properties: + height: + type: string + format: int64 + title: The block height + txhash: + type: string + description: The transaction hash. + codespace: + type: string + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. + data: + type: string + description: Result bytes, if any. + raw_log: + type: string + description: |- + The output of the application's logger (raw string). May be + non-deterministic. + logs: + type: array + items: + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where the key + and value are + + strings instead of raw bytes. + description: >- + StringEvent defines en Event object wrapper where all the + attributes + + contain key/value pairs that are strings instead of raw + bytes. + description: >- + Events contains a slice of Event objects that were emitted + during some + + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed tx ABCI + message log. + description: >- + The output of the application's logger (typed). May be + non-deterministic. + info: + type: string + description: Additional information. May be non-deterministic. + gas_wanted: + type: string + format: int64 + description: Amount of gas requested for transaction. + gas_used: + type: string + format: int64 + description: Amount of gas consumed by transaction. + tx: + description: The request transaction bytes. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + timestamp: + type: string + description: >- + Time of the previous block. For heights > 1, it's the weighted + median of + + the timestamps of the valid votes in the block.LastCommit. For + height == 1, + + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated with + an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a transaction. + Note, + + these events include those emitted by processing all the messages + and those + + emitted from the ante. Whereas Logs contains the events, with + + additional metadata, emitted only by processing the messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: GetTxResponse is the response type for the Service.GetTx method. + cosmos.tx.v1beta1.GetTxsEventResponse: + type: object + properties: + txs: + type: array + items: + type: object + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: txs is the list of queried transactions. + tx_responses: + type: array + items: + type: object + properties: + height: + type: string + format: int64 + title: The block height + txhash: + type: string + description: The transaction hash. + codespace: + type: string + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. + data: + type: string + description: Result bytes, if any. + raw_log: + type: string + description: |- + The output of the application's logger (raw string). May be + non-deterministic. + logs: + type: array + items: + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where the + key and value are + + strings instead of raw bytes. + description: >- + StringEvent defines en Event object wrapper where all + the attributes + + contain key/value pairs that are strings instead of raw + bytes. + description: >- + Events contains a slice of Event objects that were emitted + during some + + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed tx + ABCI message log. + description: >- + The output of the application's logger (typed). May be + non-deterministic. + info: + type: string + description: Additional information. May be non-deterministic. + gas_wanted: + type: string + format: int64 + description: Amount of gas requested for transaction. + gas_used: + type: string + format: int64 + description: Amount of gas consumed by transaction. + tx: + description: The request transaction bytes. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + timestamp: + type: string + description: >- + Time of the previous block. For heights > 1, it's the weighted + median of + + the timestamps of the valid votes in the block.LastCommit. For + height == 1, + + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated + with an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a + transaction. Note, + + these events include those emitted by processing all the + messages and those + + emitted from the ante. Whereas Logs contains the events, with + + additional metadata, emitted only by processing the messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: >- + TxResponse defines a structure containing relevant tx data and + metadata. The + + tags are stringified and the log is JSON decoded. + description: tx_responses is the list of queried TxResponses. + pagination: + description: |- + pagination defines a pagination for the response. + Deprecated post v0.46.x: use total instead. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + total: + type: string + format: uint64 + title: total is total number of results available + description: |- + GetTxsEventResponse is the response type for the Service.TxsByEvents + RPC method. + cosmos.tx.v1beta1.ModeInfo: + type: object + properties: + single: + title: single represents a single signer + type: object + properties: + mode: + title: mode is the signing mode of the single signer + type: string + enum: + - SIGN_MODE_UNSPECIFIED + - SIGN_MODE_DIRECT + - SIGN_MODE_TEXTUAL + - SIGN_MODE_DIRECT_AUX + - SIGN_MODE_LEGACY_AMINO_JSON + - SIGN_MODE_EIP_191 + default: SIGN_MODE_UNSPECIFIED + description: >- + SignMode represents a signing mode with its own security + guarantees. + + + This enum should be considered a registry of all known sign modes + + in the Cosmos ecosystem. Apps are not expected to support all + known + + sign modes. Apps that would like to support custom sign modes are + + encouraged to open a small PR against this file to add a new case + + to this SignMode enum describing their sign mode so that different + + apps have a consistent version of this enum. + + - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + rejected. + - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + verified with raw bytes from Tx. + - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some + human-readable textual representation on top of the binary + representation + + from SIGN_MODE_DIRECT. It is currently not supported. + - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode + does not + + require signers signing over other signers' `signer_info`. It also + allows + + for adding Tips in transactions. + + + Since: cosmos-sdk 0.46 + - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + Amino JSON and will be removed in the future. + - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + + + Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum + variant, + + but is not implemented on the SDK by default. To enable EIP-191, + you need + + to pass a custom `TxConfig` that has an implementation of + + `SignModeHandler` for EIP-191. The SDK may decide to fully support + + EIP-191 in the future. + + + Since: cosmos-sdk 0.45.2 + multi: + $ref: '#/definitions/cosmos.tx.v1beta1.ModeInfo.Multi' + title: multi represents a nested multisig signer + description: ModeInfo describes the signing mode of a single or nested multisig signer. + cosmos.tx.v1beta1.ModeInfo.Multi: + type: object + properties: + bitarray: + title: bitarray specifies which keys within the multisig are signing + type: object + properties: + extra_bits_stored: + type: integer + format: int64 + elems: + type: string + format: byte + description: >- + CompactBitArray is an implementation of a space efficient bit array. + + This is used to ensure that the encoded data takes up a minimal amount + of + + space after proto encoding. + + This is not thread safe, and is not intended for concurrent usage. + mode_infos: + type: array + items: + type: object + $ref: '#/definitions/cosmos.tx.v1beta1.ModeInfo' + title: |- + mode_infos is the corresponding modes of the signers of the multisig + which could include nested multisig public keys + title: Multi is the mode info for a multisig public key + cosmos.tx.v1beta1.ModeInfo.Single: + type: object + properties: + mode: + title: mode is the signing mode of the single signer + type: string + enum: + - SIGN_MODE_UNSPECIFIED + - SIGN_MODE_DIRECT + - SIGN_MODE_TEXTUAL + - SIGN_MODE_DIRECT_AUX + - SIGN_MODE_LEGACY_AMINO_JSON + - SIGN_MODE_EIP_191 + default: SIGN_MODE_UNSPECIFIED + description: >- + SignMode represents a signing mode with its own security guarantees. + + + This enum should be considered a registry of all known sign modes + + in the Cosmos ecosystem. Apps are not expected to support all known + + sign modes. Apps that would like to support custom sign modes are + + encouraged to open a small PR against this file to add a new case + + to this SignMode enum describing their sign mode so that different + + apps have a consistent version of this enum. + + - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + rejected. + - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + verified with raw bytes from Tx. + - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some + human-readable textual representation on top of the binary + representation + + from SIGN_MODE_DIRECT. It is currently not supported. + - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does + not + + require signers signing over other signers' `signer_info`. It also + allows + + for adding Tips in transactions. + + + Since: cosmos-sdk 0.46 + - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + Amino JSON and will be removed in the future. + - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + + + Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + + but is not implemented on the SDK by default. To enable EIP-191, you + need + + to pass a custom `TxConfig` that has an implementation of + + `SignModeHandler` for EIP-191. The SDK may decide to fully support + + EIP-191 in the future. + + + Since: cosmos-sdk 0.45.2 + title: |- + Single is the mode info for a single signer. It is structured as a message + to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + future + cosmos.tx.v1beta1.OrderBy: + type: string + enum: + - ORDER_BY_UNSPECIFIED + - ORDER_BY_ASC + - ORDER_BY_DESC + default: ORDER_BY_UNSPECIFIED + description: >- + - ORDER_BY_UNSPECIFIED: ORDER_BY_UNSPECIFIED specifies an unknown sorting + order. OrderBy defaults to ASC in this case. + - ORDER_BY_ASC: ORDER_BY_ASC defines ascending order + - ORDER_BY_DESC: ORDER_BY_DESC defines descending order + title: OrderBy defines the sorting order + cosmos.tx.v1beta1.SignerInfo: + type: object + properties: + public_key: + description: >- + public_key is the public key of the signer. It is optional for + accounts + + that already exist in state. If unset, the verifier can use the + required \ + + signer address for this position and lookup the public key. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + mode_info: + $ref: '#/definitions/cosmos.tx.v1beta1.ModeInfo' + title: |- + mode_info describes the signing mode of the signer and is a nested + structure to support nested multisig pubkey's + sequence: + type: string + format: uint64 + description: >- + sequence is the sequence of the account, which describes the + + number of committed transactions signed by a given address. It is used + to + + prevent replay attacks. + description: |- + SignerInfo describes the public key and signing mode of a single top-level + signer. + cosmos.tx.v1beta1.SimulateRequest: + type: object + properties: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: |- + tx is the transaction to simulate. + Deprecated. Send raw tx bytes instead. + tx_bytes: + type: string + format: byte + description: |- + tx_bytes is the raw transaction. + + Since: cosmos-sdk 0.43 + description: |- + SimulateRequest is the request type for the Service.Simulate + RPC method. + cosmos.tx.v1beta1.SimulateResponse: + type: object + properties: + gas_info: + description: gas_info is the information about gas used in the simulation. + type: object + properties: + gas_wanted: + type: string + format: uint64 + description: >- + GasWanted is the maximum units of work we allow this tx to + perform. + gas_used: + type: string + format: uint64 + description: GasUsed is the amount of gas actually consumed. + result: + description: result is the result of the simulation. + type: object + properties: + data: + type: string + format: byte + description: >- + Data is any data returned from message or handler execution. It + MUST be + + length prefixed in order to separate data from multiple message + executions. + + Deprecated. This field is still populated, but prefer msg_response + instead + + because it also contains the Msg response typeURL. + log: + type: string + description: >- + Log contains the log information from message or handler + execution. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated with + an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events contains a slice of Event objects that were emitted during + message + + or handler execution. + msg_responses: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + msg_responses contains the Msg handler responses type packed in + Anys. + + + Since: cosmos-sdk 0.46 + description: |- + SimulateResponse is the response type for the + Service.SimulateRPC method. + cosmos.tx.v1beta1.Tip: + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: amount is the amount of the tip + tipper: + type: string + title: tipper is the address of the account paying for the tip + description: |- + Tip is the tip used for meta-transactions. + + Since: cosmos-sdk 0.46 + cosmos.tx.v1beta1.Tx: + type: object + properties: + body: + title: body is the processable content of the transaction + type: object + properties: + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages is a list of messages to be executed. The required + signers of + + those messages define the number and order of elements in + AuthInfo's + + signer_infos and Tx's signatures. Each required signer address is + added to + + the list only the first time it occurs. + + By convention, the first required signer (usually from the first + message) + + is referred to as the primary signer and pays the fee for the + whole + + transaction. + memo: + type: string + description: >- + memo is any arbitrary note/comment to be added to the transaction. + + WARNING: in clients, any publicly exposed text should not be + called memo, + + but should be called `note` instead (see + https://github.com/cosmos/cosmos-sdk/issues/9122). + timeout_height: + type: string + format: uint64 + title: |- + timeout is the block height after which this transaction will not + be processed by the chain + extension_options: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + extension_options are arbitrary options that can be added by + chains + + when the default options are not sufficient. If any of these are + present + + and can't be handled, the transaction will be rejected + non_critical_extension_options: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + extension_options are arbitrary options that can be added by + chains + + when the default options are not sufficient. If any of these are + present + + and can't be handled, they will be ignored + description: TxBody is the body of a transaction that all signers sign over. + auth_info: + $ref: '#/definitions/cosmos.tx.v1beta1.AuthInfo' + title: |- + auth_info is the authorization related content of the transaction, + specifically signers, signer modes and fee + signatures: + type: array + items: + type: string + format: byte + description: >- + signatures is a list of signatures that matches the length and order + of + + AuthInfo's signer_infos to allow connecting signature meta information + like + + public key and signing mode by position. + description: Tx is the standard type used for broadcasting transactions. + cosmos.tx.v1beta1.TxBody: + type: object + properties: + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages is a list of messages to be executed. The required signers of + + those messages define the number and order of elements in AuthInfo's + + signer_infos and Tx's signatures. Each required signer address is + added to + + the list only the first time it occurs. + + By convention, the first required signer (usually from the first + message) + + is referred to as the primary signer and pays the fee for the whole + + transaction. + memo: + type: string + description: >- + memo is any arbitrary note/comment to be added to the transaction. + + WARNING: in clients, any publicly exposed text should not be called + memo, + + but should be called `note` instead (see + https://github.com/cosmos/cosmos-sdk/issues/9122). + timeout_height: + type: string + format: uint64 + title: |- + timeout is the block height after which this transaction will not + be processed by the chain + extension_options: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + extension_options are arbitrary options that can be added by chains + + when the default options are not sufficient. If any of these are + present + + and can't be handled, the transaction will be rejected + non_critical_extension_options: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + extension_options are arbitrary options that can be added by chains + + when the default options are not sufficient. If any of these are + present + + and can't be handled, they will be ignored + description: TxBody is the body of a transaction that all signers sign over. + cosmos.tx.v1beta1.TxDecodeAminoRequest: + type: object + properties: + amino_binary: + type: string + format: byte + description: |- + TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxDecodeAminoResponse: + type: object + properties: + amino_json: + type: string + description: |- + TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxDecodeRequest: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + description: |- + TxDecodeRequest is the request type for the Service.TxDecode + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxDecodeResponse: + type: object + properties: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: tx is the decoded transaction. + description: |- + TxDecodeResponse is the response type for the + Service.TxDecode method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeAminoRequest: + type: object + properties: + amino_json: + type: string + description: |- + TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeAminoResponse: + type: object + properties: + amino_binary: + type: string + format: byte + description: |- + TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeRequest: + type: object + properties: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: tx is the transaction to encode. + description: |- + TxEncodeRequest is the request type for the Service.TxEncode + RPC method. + + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeResponse: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the encoded transaction bytes. + description: |- + TxEncodeResponse is the response type for the + Service.TxEncode method. + + Since: cosmos-sdk 0.47 + tendermint.abci.Event: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: EventAttribute is a single key-value pair, associated with an event. + description: >- + Event allows application developers to attach additional information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + tendermint.abci.EventAttribute: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: EventAttribute is a single key-value pair, associated with an event. + cosmos.upgrade.v1beta1.ModuleVersion: + type: object + properties: + name: + type: string + title: name of the app module + version: + type: string + format: uint64 + title: consensus version of the app module + description: |- + ModuleVersion specifies a module and its consensus version. + + Since: cosmos-sdk 0.43 + cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse: + type: object + description: |- + MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + + Since: cosmos-sdk 0.46 + cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse: + type: object + description: |- + MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + + Since: cosmos-sdk 0.46 + cosmos.upgrade.v1beta1.Plan: + type: object + properties: + name: + type: string + description: >- + Sets the name for the upgrade. This name will be used by the upgraded + + version of the software to apply any special "on-upgrade" commands + during + + the first BeginBlock method after the upgrade is applied. It is also + used + + to detect whether a software version can handle a given upgrade. If no + + upgrade handler with this name has been set in the software, it will + be + + assumed that the software is out-of-date when the upgrade Time or + Height is + + reached and the software will exit. + time: + type: string + format: date-time + description: >- + Deprecated: Time based upgrades have been deprecated. Time based + upgrade logic + + has been removed from the SDK. + + If this field is not empty, an error will be thrown. + height: + type: string + format: int64 + description: The height at which the upgrade must be performed. + info: + type: string + title: |- + Any application specific upgrade info to be included on-chain + such as a git commit that validators could automatically upgrade to + upgraded_client_state: + description: >- + Deprecated: UpgradedClientState field has been deprecated. IBC upgrade + logic has been + + moved to the IBC module in the sub module 02-client. + + If this field is not empty, an error will be thrown. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + Plan specifies information about a planned upgrade and when it should + occur. + cosmos.upgrade.v1beta1.QueryAppliedPlanResponse: + type: object + properties: + height: + type: string + format: int64 + description: height is the block height at which the plan was applied. + description: >- + QueryAppliedPlanResponse is the response type for the Query/AppliedPlan + RPC + + method. + cosmos.upgrade.v1beta1.QueryAuthorityResponse: + type: object + properties: + address: + type: string + description: 'Since: cosmos-sdk 0.46' + title: QueryAuthorityResponse is the response type for Query/Authority + cosmos.upgrade.v1beta1.QueryCurrentPlanResponse: + type: object + properties: + plan: + description: plan is the current upgrade plan. + type: object + properties: + name: + type: string + description: >- + Sets the name for the upgrade. This name will be used by the + upgraded + + version of the software to apply any special "on-upgrade" commands + during + + the first BeginBlock method after the upgrade is applied. It is + also used + + to detect whether a software version can handle a given upgrade. + If no + + upgrade handler with this name has been set in the software, it + will be + + assumed that the software is out-of-date when the upgrade Time or + Height is + + reached and the software will exit. + time: + type: string + format: date-time + description: >- + Deprecated: Time based upgrades have been deprecated. Time based + upgrade logic + + has been removed from the SDK. + + If this field is not empty, an error will be thrown. + height: + type: string + format: int64 + description: The height at which the upgrade must be performed. + info: + type: string + title: >- + Any application specific upgrade info to be included on-chain + + such as a git commit that validators could automatically upgrade + to + upgraded_client_state: + description: >- + Deprecated: UpgradedClientState field has been deprecated. IBC + upgrade logic has been + + moved to the IBC module in the sub module 02-client. + + If this field is not empty, an error will be thrown. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + QueryCurrentPlanResponse is the response type for the Query/CurrentPlan + RPC + + method. + cosmos.upgrade.v1beta1.QueryModuleVersionsResponse: + type: object + properties: + module_versions: + type: array + items: + type: object + properties: + name: + type: string + title: name of the app module + version: + type: string + format: uint64 + title: consensus version of the app module + description: |- + ModuleVersion specifies a module and its consensus version. + + Since: cosmos-sdk 0.43 + description: >- + module_versions is a list of module names with their consensus + versions. + description: >- + QueryModuleVersionsResponse is the response type for the + Query/ModuleVersions + + RPC method. + + + Since: cosmos-sdk 0.43 + cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse: + type: object + properties: + upgraded_consensus_state: + type: string + format: byte + title: 'Since: cosmos-sdk 0.43' + description: >- + QueryUpgradedConsensusStateResponse is the response type for the + Query/UpgradedConsensusState + + RPC method. + cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse: + type: object + description: >- + MsgCreateVestingAccountResponse defines the + Msg/CreatePeriodicVestingAccount + + response type. + + + Since: cosmos-sdk 0.46 + cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse: + type: object + description: >- + MsgCreatePermanentLockedAccountResponse defines the + Msg/CreatePermanentLockedAccount response type. + + + Since: cosmos-sdk 0.46 + cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse: + type: object + description: >- + MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount + response type. + cosmos.vesting.v1beta1.Period: + type: object + properties: + length: + type: string + format: int64 + description: Period duration in seconds. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Period defines a length of time and amount of coins that will vest. + ethermint.feemarket.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + ethermint.feemarket.v1.Params: + type: object + properties: + no_base_fee: + type: boolean + title: >- + no_base_fee forces the EIP-1559 base fee to 0 (needed for 0 price + calls) + base_fee_change_denominator: + type: integer + format: int64 + description: |- + base_fee_change_denominator bounds the amount the base fee can change + between blocks. + elasticity_multiplier: + type: integer + format: int64 + description: >- + elasticity_multiplier bounds the maximum gas limit an EIP-1559 block + may + + have. + enable_height: + type: string + format: int64 + description: >- + enable_height defines at which block height the base fee calculation + is enabled. + base_fee: + type: string + description: base_fee for EIP-1559 blocks. + min_gas_price: + type: string + title: >- + min_gas_price defines the minimum gas price value for cosmos and eth + transactions + min_gas_multiplier: + type: string + title: |- + min_gas_multiplier bounds the minimum gas used to be charged + to senders based on gas limit + title: Params defines the EVM module parameters + ethermint.feemarket.v1.QueryBaseFeeResponse: + type: object + properties: + base_fee: + type: string + title: base_fee is the EIP1559 base fee + description: QueryBaseFeeResponse returns the EIP1559 base fee. + ethermint.feemarket.v1.QueryBlockGasResponse: + type: object + properties: + gas: + type: string + format: int64 + title: gas is the returned block gas + description: QueryBlockGasResponse returns block gas used for a given height. + ethermint.feemarket.v1.QueryParamsResponse: + type: object + properties: + params: + description: params define the evm module parameters. + type: object + properties: + no_base_fee: + type: boolean + title: >- + no_base_fee forces the EIP-1559 base fee to 0 (needed for 0 price + calls) + base_fee_change_denominator: + type: integer + format: int64 + description: >- + base_fee_change_denominator bounds the amount the base fee can + change + + between blocks. + elasticity_multiplier: + type: integer + format: int64 + description: >- + elasticity_multiplier bounds the maximum gas limit an EIP-1559 + block may + + have. + enable_height: + type: string + format: int64 + description: >- + enable_height defines at which block height the base fee + calculation is enabled. + base_fee: + type: string + description: base_fee for EIP-1559 blocks. + min_gas_price: + type: string + title: >- + min_gas_price defines the minimum gas price value for cosmos and + eth transactions + min_gas_multiplier: + type: string + title: |- + min_gas_multiplier bounds the minimum gas used to be charged + to senders based on gas limit + title: Params defines the EVM module parameters + description: >- + QueryParamsResponse defines the response type for querying x/evm + parameters. + evmos.claims.v1.Action: + type: string + enum: + - ACTION_UNSPECIFIED + - ACTION_VOTE + - ACTION_DELEGATE + - ACTION_EVM + - ACTION_IBC_TRANSFER + default: ACTION_UNSPECIFIED + description: |- + Action defines the list of available actions to claim the airdrop tokens. + + - ACTION_UNSPECIFIED: ACTION_UNSPECIFIED defines an invalid action. + - ACTION_VOTE: ACTION_VOTE defines a proposal vote. + - ACTION_DELEGATE: ACTION_DELEGATE defines an staking delegation. + - ACTION_EVM: ACTION_EVM defines an EVM transaction. + - ACTION_IBC_TRANSFER: ACTION_IBC_TRANSFER defines a fungible token transfer transaction via IBC. + evmos.claims.v1.Claim: + type: object + properties: + action: + title: action enum + type: string + enum: + - ACTION_UNSPECIFIED + - ACTION_VOTE + - ACTION_DELEGATE + - ACTION_EVM + - ACTION_IBC_TRANSFER + default: ACTION_UNSPECIFIED + description: >- + Action defines the list of available actions to claim the airdrop + tokens. + + - ACTION_UNSPECIFIED: ACTION_UNSPECIFIED defines an invalid action. + - ACTION_VOTE: ACTION_VOTE defines a proposal vote. + - ACTION_DELEGATE: ACTION_DELEGATE defines an staking delegation. + - ACTION_EVM: ACTION_EVM defines an EVM transaction. + - ACTION_IBC_TRANSFER: ACTION_IBC_TRANSFER defines a fungible token transfer transaction via IBC. + completed: + type: boolean + title: completed is true if the action has been completed + claimable_amount: + type: string + title: claimable_amount of tokens for the action. Zero if completed + description: >- + Claim defines the action, completed flag and the remaining claimable + amount + + for a given user. This is only used during client queries. + evmos.claims.v1.ClaimsRecordAddress: + type: object + properties: + address: + type: string + title: address of claiming user in either bech32 or hex format + initial_claimable_amount: + type: string + title: initial_claimable_amount for the user + actions_completed: + type: array + items: + type: boolean + title: >- + actions_completed is a slice that describes which actions were + completed + description: |- + ClaimsRecordAddress is the claims metadata per address that is used at + Genesis. + evmos.claims.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + evmos.claims.v1.Params: + type: object + properties: + enable_claims: + type: boolean + title: enable_claims is the parameter to enable the claiming process + airdrop_start_time: + type: string + format: date-time + title: airdrop_start_time defines the timestamp of the airdrop start + duration_until_decay: + type: string + title: duration_until_decay of claimable tokens begin + duration_of_decay: + type: string + title: duration_of_decay for token claim decay period + claims_denom: + type: string + title: claims_denom is the denomination of the claimable coin + authorized_channels: + type: array + items: + type: string + description: >- + authorized_channels is the list of authorized channel identifiers that + can perform address + + attestations via IBC. + evm_channels: + type: array + items: + type: string + title: >- + evm_channels is the list of channel identifiers from EVM compatible + chains + description: Params defines the claims module's parameters. + evmos.claims.v1.QueryClaimsRecordResponse: + type: object + properties: + initial_claimable_amount: + type: string + title: initial_claimable_amount of the user + claims: + type: array + items: + type: object + properties: + action: + title: action enum + type: string + enum: + - ACTION_UNSPECIFIED + - ACTION_VOTE + - ACTION_DELEGATE + - ACTION_EVM + - ACTION_IBC_TRANSFER + default: ACTION_UNSPECIFIED + description: >- + Action defines the list of available actions to claim the + airdrop tokens. + + - ACTION_UNSPECIFIED: ACTION_UNSPECIFIED defines an invalid action. + - ACTION_VOTE: ACTION_VOTE defines a proposal vote. + - ACTION_DELEGATE: ACTION_DELEGATE defines an staking delegation. + - ACTION_EVM: ACTION_EVM defines an EVM transaction. + - ACTION_IBC_TRANSFER: ACTION_IBC_TRANSFER defines a fungible token transfer transaction via IBC. + completed: + type: boolean + title: completed is true if the action has been completed + claimable_amount: + type: string + title: claimable_amount of tokens for the action. Zero if completed + description: >- + Claim defines the action, completed flag and the remaining claimable + amount + + for a given user. This is only used during client queries. + title: claims of the user + description: >- + QueryClaimsRecordResponse is the response type for the Query/ClaimsRecord + RPC + + method. + evmos.claims.v1.QueryClaimsRecordsResponse: + type: object + properties: + claims: + type: array + items: + type: object + properties: + address: + type: string + title: address of claiming user in either bech32 or hex format + initial_claimable_amount: + type: string + title: initial_claimable_amount for the user + actions_completed: + type: array + items: + type: boolean + title: >- + actions_completed is a slice that describes which actions were + completed + description: >- + ClaimsRecordAddress is the claims metadata per address that is used + at + + Genesis. + title: claims defines all claims records + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryClaimsRecordsResponse is the response type for the + Query/ClaimsRecords + + RPC method. + evmos.claims.v1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + enable_claims: + type: boolean + title: enable_claims is the parameter to enable the claiming process + airdrop_start_time: + type: string + format: date-time + title: airdrop_start_time defines the timestamp of the airdrop start + duration_until_decay: + type: string + title: duration_until_decay of claimable tokens begin + duration_of_decay: + type: string + title: duration_of_decay for token claim decay period + claims_denom: + type: string + title: claims_denom is the denomination of the claimable coin + authorized_channels: + type: array + items: + type: string + description: >- + authorized_channels is the list of authorized channel identifiers + that can perform address + + attestations via IBC. + evm_channels: + type: array + items: + type: string + title: >- + evm_channels is the list of channel identifiers from EVM + compatible chains + description: QueryParamsResponse is the response type for the Query/Params RPC method. + evmos.claims.v1.QueryTotalUnclaimedResponse: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: coins defines the unclaimed coins + description: >- + QueryTotalUnclaimedResponse is the response type for the + Query/TotalUnclaimed + + RPC method. + evmos.epochs.v1.EpochInfo: + type: object + properties: + identifier: + type: string + title: identifier of the epoch + start_time: + type: string + format: date-time + title: start_time of the epoch + duration: + type: string + title: duration of the epoch + current_epoch: + type: string + format: int64 + title: current_epoch is the integer identifier of the epoch + current_epoch_start_time: + type: string + format: date-time + title: >- + current_epoch_start_time defines the timestamp of the start of the + epoch + epoch_counting_started: + type: boolean + title: >- + epoch_counting_started reflects if the counting for the epoch has + started + current_epoch_start_height: + type: string + format: int64 + title: current_epoch_start_height of the epoch + description: >- + EpochInfo defines the message interface containing the relevant + informations about + + an epoch. + evmos.epochs.v1.QueryCurrentEpochResponse: + type: object + properties: + current_epoch: + type: string + format: int64 + title: current_epoch is the number of the current epoch + description: >- + QueryCurrentEpochResponse is the response type for the Query/EpochInfos + RPC + + method. + evmos.epochs.v1.QueryEpochsInfoResponse: + type: object + properties: + epochs: + type: array + items: + type: object + properties: + identifier: + type: string + title: identifier of the epoch + start_time: + type: string + format: date-time + title: start_time of the epoch + duration: + type: string + title: duration of the epoch + current_epoch: + type: string + format: int64 + title: current_epoch is the integer identifier of the epoch + current_epoch_start_time: + type: string + format: date-time + title: >- + current_epoch_start_time defines the timestamp of the start of + the epoch + epoch_counting_started: + type: boolean + title: >- + epoch_counting_started reflects if the counting for the epoch + has started + current_epoch_start_height: + type: string + format: int64 + title: current_epoch_start_height of the epoch + description: >- + EpochInfo defines the message interface containing the relevant + informations about + + an epoch. + title: epochs is a slice of all EpochInfos + pagination: + description: pagination defines an optional pagination for the request. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryEpochsInfoResponse is the response type for the Query/EpochInfos RPC + method. + evmos.erc20.v1.MsgConvertCoinResponse: + type: object + title: MsgConvertCoinResponse returns no fields + evmos.erc20.v1.MsgConvertERC20Response: + type: object + title: MsgConvertERC20Response returns no fields + evmos.erc20.v1.MsgUpdateParamsResponse: + type: object + title: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + Since: cosmos-sdk 0.47 + evmos.erc20.v1.Owner: + type: string + enum: + - OWNER_UNSPECIFIED + - OWNER_MODULE + - OWNER_EXTERNAL + default: OWNER_UNSPECIFIED + description: |- + Owner enumerates the ownership of a ERC20 contract. + + - OWNER_UNSPECIFIED: OWNER_UNSPECIFIED defines an invalid/undefined owner. + - OWNER_MODULE: OWNER_MODULE - erc20 is owned by the erc20 module account. + - OWNER_EXTERNAL: OWNER_EXTERNAL - erc20 is owned by an external account. + evmos.erc20.v1.Params: + type: object + properties: + enable_erc20: + type: boolean + description: >- + enable_erc20 is the parameter to enable the conversion of Cosmos coins + <--> ERC20 tokens. + enable_evm_hook: + type: boolean + description: >- + enable_evm_hook is the parameter to enable the EVM hook that converts + an ERC20 token to a Cosmos + + Coin by transferring the Tokens through a MsgEthereumTx to the + ModuleAddress Ethereum address. + title: Params defines the erc20 module params + evmos.erc20.v1.QueryParamsResponse: + type: object + properties: + params: + title: params are the erc20 module parameters + type: object + properties: + enable_erc20: + type: boolean + description: >- + enable_erc20 is the parameter to enable the conversion of Cosmos + coins <--> ERC20 tokens. + enable_evm_hook: + type: boolean + description: >- + enable_evm_hook is the parameter to enable the EVM hook that + converts an ERC20 token to a Cosmos + + Coin by transferring the Tokens through a MsgEthereumTx to the + ModuleAddress Ethereum address. + description: |- + QueryParamsResponse is the response type for the Query/Params RPC + method. + evmos.erc20.v1.QueryTokenPairResponse: + type: object + properties: + token_pair: + type: object + properties: + erc20_address: + type: string + title: erc20_address is the hex address of ERC20 contract token + denom: + type: string + title: denom defines the cosmos base denomination to be mapped to + enabled: + type: boolean + title: enabled defines the token mapping enable status + contract_owner: + title: >- + contract_owner is the an ENUM specifying the type of ERC20 owner + (0 invalid, 1 ModuleAccount, 2 external address) + type: string + enum: + - OWNER_UNSPECIFIED + - OWNER_MODULE + - OWNER_EXTERNAL + default: OWNER_UNSPECIFIED + description: |- + Owner enumerates the ownership of a ERC20 contract. + + - OWNER_UNSPECIFIED: OWNER_UNSPECIFIED defines an invalid/undefined owner. + - OWNER_MODULE: OWNER_MODULE - erc20 is owned by the erc20 module account. + - OWNER_EXTERNAL: OWNER_EXTERNAL - erc20 is owned by an external account. + description: >- + TokenPair defines an instance that records a pairing consisting of a + native + + Cosmos Coin and an ERC20 token address. + title: >- + token_pairs returns the info about a registered token pair for the + erc20 module + description: |- + QueryTokenPairResponse is the response type for the Query/TokenPair RPC + method. + evmos.erc20.v1.QueryTokenPairsResponse: + type: object + properties: + token_pairs: + type: array + items: + type: object + properties: + erc20_address: + type: string + title: erc20_address is the hex address of ERC20 contract token + denom: + type: string + title: denom defines the cosmos base denomination to be mapped to + enabled: + type: boolean + title: enabled defines the token mapping enable status + contract_owner: + title: >- + contract_owner is the an ENUM specifying the type of ERC20 owner + (0 invalid, 1 ModuleAccount, 2 external address) + type: string + enum: + - OWNER_UNSPECIFIED + - OWNER_MODULE + - OWNER_EXTERNAL + default: OWNER_UNSPECIFIED + description: |- + Owner enumerates the ownership of a ERC20 contract. + + - OWNER_UNSPECIFIED: OWNER_UNSPECIFIED defines an invalid/undefined owner. + - OWNER_MODULE: OWNER_MODULE - erc20 is owned by the erc20 module account. + - OWNER_EXTERNAL: OWNER_EXTERNAL - erc20 is owned by an external account. + description: >- + TokenPair defines an instance that records a pairing consisting of a + native + + Cosmos Coin and an ERC20 token address. + title: token_pairs is a slice of registered token pairs for the erc20 module + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryTokenPairsResponse is the response type for the Query/TokenPairs RPC + method. + evmos.erc20.v1.TokenPair: + type: object + properties: + erc20_address: + type: string + title: erc20_address is the hex address of ERC20 contract token + denom: + type: string + title: denom defines the cosmos base denomination to be mapped to + enabled: + type: boolean + title: enabled defines the token mapping enable status + contract_owner: + title: >- + contract_owner is the an ENUM specifying the type of ERC20 owner (0 + invalid, 1 ModuleAccount, 2 external address) + type: string + enum: + - OWNER_UNSPECIFIED + - OWNER_MODULE + - OWNER_EXTERNAL + default: OWNER_UNSPECIFIED + description: |- + Owner enumerates the ownership of a ERC20 contract. + + - OWNER_UNSPECIFIED: OWNER_UNSPECIFIED defines an invalid/undefined owner. + - OWNER_MODULE: OWNER_MODULE - erc20 is owned by the erc20 module account. + - OWNER_EXTERNAL: OWNER_EXTERNAL - erc20 is owned by an external account. + description: >- + TokenPair defines an instance that records a pairing consisting of a + native + + Cosmos Coin and an ERC20 token address. + evmos.incentives.v1.GasMeter: + type: object + properties: + contract: + type: string + title: contract is the hex address of the incentivized smart contract + participant: + type: string + title: participant address that interacts with the incentive + cumulative_gas: + type: string + format: uint64 + title: cumulative_gas spent during the epoch + title: GasMeter tracks the cumulative gas spent per participant in one epoch + evmos.incentives.v1.Incentive: + type: object + properties: + contract: + type: string + title: contract address of the smart contract to be incentivized + allocations: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + title: >- + allocations is a slice of denoms and percentages of rewards to be + allocated + epochs: + type: integer + format: int64 + title: epochs defines the number of remaining epochs for the incentive + start_time: + type: string + format: date-time + title: start_time of the incentive distribution + total_gas: + type: string + format: uint64 + title: >- + total_gas is the cumulative gas spent by all gas meters of the + incentive during the epoch + title: |- + Incentive defines an instance that organizes distribution conditions for a + given smart contract + evmos.incentives.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + evmos.incentives.v1.Params: + type: object + properties: + enable_incentives: + type: boolean + title: enable_incentives is the parameter to enable incentives + allocation_limit: + type: string + title: >- + allocation_limit is the maximum percentage an incentive can allocate + per denomination + incentives_epoch_identifier: + type: string + title: incentives_epoch_identifier for the epochs module hooks + reward_scaler: + type: string + title: reward_scaler is the scaling factor for capping rewards + title: Params defines the incentives module params + evmos.incentives.v1.QueryAllocationMeterResponse: + type: object + properties: + allocation_meter: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + title: allocation_meter defines the allocation of the queried denom + description: |- + QueryAllocationMeterResponse is the response type for the + Query/AllocationMeter RPC method. + evmos.incentives.v1.QueryAllocationMetersResponse: + type: object + properties: + allocation_meters: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + title: allocation_meters is a slice of all allocations + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryAllocationMetersResponse is the response type for the + Query/AllocationMeters RPC method. + evmos.incentives.v1.QueryGasMeterResponse: + type: object + properties: + gas_meter: + type: string + format: uint64 + title: >- + gas_meter is a gas meter for one participant on an incentivized smart + contract + description: |- + QueryGasMeterResponse is the response type for the Query/Incentive RPC + method. + evmos.incentives.v1.QueryGasMetersResponse: + type: object + properties: + gas_meters: + type: array + items: + type: object + properties: + contract: + type: string + title: contract is the hex address of the incentivized smart contract + participant: + type: string + title: participant address that interacts with the incentive + cumulative_gas: + type: string + format: uint64 + title: cumulative_gas spent during the epoch + title: >- + GasMeter tracks the cumulative gas spent per participant in one + epoch + title: >- + gas_meters is a slice of the gas meters for an incentivized smart + contract + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryGasMetersResponse is the response type for the Query/Incentives RPC + method. + evmos.incentives.v1.QueryIncentiveResponse: + type: object + properties: + incentive: + type: object + properties: + contract: + type: string + title: contract address of the smart contract to be incentivized + allocations: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + title: >- + allocations is a slice of denoms and percentages of rewards to be + allocated + epochs: + type: integer + format: int64 + title: epochs defines the number of remaining epochs for the incentive + start_time: + type: string + format: date-time + title: start_time of the incentive distribution + total_gas: + type: string + format: uint64 + title: >- + total_gas is the cumulative gas spent by all gas meters of the + incentive during the epoch + title: >- + Incentive defines an instance that organizes distribution conditions + for a + + given smart contract + description: |- + QueryIncentiveResponse is the response type for the Query/Incentive RPC + method. + evmos.incentives.v1.QueryIncentivesResponse: + type: object + properties: + incentives: + type: array + items: + type: object + properties: + contract: + type: string + title: contract address of the smart contract to be incentivized + allocations: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. + + + NOTE: The amount field is an Dec which implements the custom + method + + signatures required by gogoproto. + title: >- + allocations is a slice of denoms and percentages of rewards to + be allocated + epochs: + type: integer + format: int64 + title: epochs defines the number of remaining epochs for the incentive + start_time: + type: string + format: date-time + title: start_time of the incentive distribution + total_gas: + type: string + format: uint64 + title: >- + total_gas is the cumulative gas spent by all gas meters of the + incentive during the epoch + title: >- + Incentive defines an instance that organizes distribution conditions + for a + + given smart contract + title: incentives is a slice of all incentives + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryIncentivesResponse is the response type for the Query/Incentives RPC + method. + evmos.incentives.v1.QueryParamsResponse: + type: object + properties: + params: + title: params are the incentives module parameters + type: object + properties: + enable_incentives: + type: boolean + title: enable_incentives is the parameter to enable incentives + allocation_limit: + type: string + title: >- + allocation_limit is the maximum percentage an incentive can + allocate per denomination + incentives_epoch_identifier: + type: string + title: incentives_epoch_identifier for the epochs module hooks + reward_scaler: + type: string + title: reward_scaler is the scaling factor for capping rewards + description: |- + QueryParamsResponse is the response type for the Query/Params RPC + method. + evmos.inflation.v1.ExponentialCalculation: + type: object + properties: + a: + type: string + title: a defines the initial value + r: + type: string + title: r defines the reduction factor + c: + type: string + title: c defines the parameter for long term inflation + bonding_target: + type: string + title: bonding_target + max_variance: + type: string + title: max_variance + title: >- + ExponentialCalculation holds factors to calculate exponential inflation on + + each period. Calculation reference: + + periodProvision = exponentialDecay * bondingIncentive + + f(x) = (a * (1 - r) ^ x + c) * (1 + max_variance - + bondedRatio * + + (max_variance / bonding_target)) + evmos.inflation.v1.InflationDistribution: + type: object + properties: + staking_rewards: + type: string + title: >- + staking_rewards defines the proportion of the minted minted_denom that + is + + to be allocated as staking rewards + usage_incentives: + type: string + title: >- + usage_incentives defines the proportion of the minted minted_denom + that is + + to be allocated to the incentives module address + community_pool: + type: string + title: >- + community_pool defines the proportion of the minted minted_denom that + is to + + be allocated to the community pool + title: >- + InflationDistribution defines the distribution in which inflation is + + allocated through minting on each epoch (staking, incentives, community). + It + + excludes the team vesting distribution, as this is minted once at genesis. + + The initial InflationDistribution can be calculated from the Evmos Token + + Model like this: + + mintDistribution1 = distribution1 / (1 - teamVestingDistribution) + + 0.5333333 = 40% / (1 - 25%) + evmos.inflation.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + evmos.inflation.v1.Params: + type: object + properties: + mint_denom: + type: string + title: mint_denom specifies the type of coin to mint + exponential_calculation: + title: >- + exponential_calculation takes in the variables to calculate + exponential inflation + type: object + properties: + a: + type: string + title: a defines the initial value + r: + type: string + title: r defines the reduction factor + c: + type: string + title: c defines the parameter for long term inflation + bonding_target: + type: string + title: bonding_target + max_variance: + type: string + title: max_variance + inflation_distribution: + title: inflation_distribution of the minted denom + type: object + properties: + staking_rewards: + type: string + title: >- + staking_rewards defines the proportion of the minted minted_denom + that is + + to be allocated as staking rewards + usage_incentives: + type: string + title: >- + usage_incentives defines the proportion of the minted minted_denom + that is + + to be allocated to the incentives module address + community_pool: + type: string + title: >- + community_pool defines the proportion of the minted minted_denom + that is to + + be allocated to the community pool + enable_inflation: + type: boolean + title: >- + enable_inflation is the parameter that enables inflation and halts + increasing the skipped_epochs + description: Params holds parameters for the inflation module. + evmos.inflation.v1.QueryCirculatingSupplyResponse: + type: object + properties: + circulating_supply: + title: circulating_supply is the total amount of coins in circulation + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: |- + QueryCirculatingSupplyResponse is the response type for the + Query/CirculatingSupply RPC method. + evmos.inflation.v1.QueryEpochMintProvisionResponse: + type: object + properties: + epoch_mint_provision: + description: epoch_mint_provision is the current minting per epoch provision value. + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + QueryEpochMintProvisionResponse is the response type for the + Query/EpochMintProvision RPC method. + evmos.inflation.v1.QueryInflationRateResponse: + type: object + properties: + inflation_rate: + type: string + title: inflation_rate by which the total supply increases within one period + description: >- + QueryInflationRateResponse is the response type for the + Query/InflationRate + + RPC method. + evmos.inflation.v1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + mint_denom: + type: string + title: mint_denom specifies the type of coin to mint + exponential_calculation: + title: >- + exponential_calculation takes in the variables to calculate + exponential inflation + type: object + properties: + a: + type: string + title: a defines the initial value + r: + type: string + title: r defines the reduction factor + c: + type: string + title: c defines the parameter for long term inflation + bonding_target: + type: string + title: bonding_target + max_variance: + type: string + title: max_variance + inflation_distribution: + title: inflation_distribution of the minted denom + type: object + properties: + staking_rewards: + type: string + title: >- + staking_rewards defines the proportion of the minted + minted_denom that is + + to be allocated as staking rewards + usage_incentives: + type: string + title: >- + usage_incentives defines the proportion of the minted + minted_denom that is + + to be allocated to the incentives module address + community_pool: + type: string + title: >- + community_pool defines the proportion of the minted + minted_denom that is to + + be allocated to the community pool + enable_inflation: + type: boolean + title: >- + enable_inflation is the parameter that enables inflation and halts + increasing the skipped_epochs + description: QueryParamsResponse is the response type for the Query/Params RPC method. + evmos.inflation.v1.QueryPeriodResponse: + type: object + properties: + period: + type: string + format: uint64 + description: period is the current minting per epoch provision value. + description: QueryPeriodResponse is the response type for the Query/Period RPC method. + evmos.inflation.v1.QuerySkippedEpochsResponse: + type: object + properties: + skipped_epochs: + type: string + format: uint64 + description: >- + skipped_epochs is the number of epochs that the inflation module has + been disabled. + description: >- + QuerySkippedEpochsResponse is the response type for the + Query/SkippedEpochs + + RPC method. + evmos.recovery.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + evmos.recovery.v1.Params: + type: object + properties: + enable_recovery: + type: boolean + title: enable_recovery IBC middleware + packet_timeout_duration: + type: string + title: >- + packet_timeout_duration is the duration added to timeout timestamp for + balances recovered via IBC packets + title: Params holds parameters for the recovery module + evmos.recovery.v1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + enable_recovery: + type: boolean + title: enable_recovery IBC middleware + packet_timeout_duration: + type: string + title: >- + packet_timeout_duration is the duration added to timeout timestamp + for balances recovered via IBC packets + title: Params holds parameters for the recovery module + description: QueryParamsResponse is the response type for the Query/Params RPC method. + evmos.vesting.v2.MsgClawbackResponse: + type: object + properties: + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: coins is the slice of clawed back coins + description: MsgClawbackResponse defines the MsgClawback response type. + evmos.vesting.v2.MsgConvertVestingAccountResponse: + type: object + description: >- + MsgConvertVestingAccountResponse defines the MsgConvertVestingAccount + response type. + evmos.vesting.v2.MsgCreateClawbackVestingAccountResponse: + type: object + description: |- + MsgCreateClawbackVestingAccountResponse defines the + MsgCreateClawbackVestingAccount response type. + evmos.vesting.v2.MsgFundVestingAccountResponse: + type: object + description: |- + MsgFundVestingAccountResponse defines the + MsgFundVestingAccount response type. + evmos.vesting.v2.MsgUpdateVestingFunderResponse: + type: object + description: |- + MsgUpdateVestingFunderResponse defines the MsgUpdateVestingFunder response + type. + evmos.vesting.v2.QueryBalancesResponse: + type: object + properties: + locked: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: locked defines the current amount of locked tokens + unvested: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: unvested defines the current amount of unvested tokens + vested: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: vested defines the current amount of vested tokens + description: |- + QueryBalancesResponse is the response type for the Query/Balances RPC + method. + exocore.delegation.v1.DelegationAmounts: + type: object + properties: + CanUndelegationAmount: + type: string + WaitUndelegationAmount: + type: string + exocore.delegation.v1.DelegationApproveInfo: + type: object + properties: + signature: + type: string + salt: + type: string + exocore.delegation.v1.DelegationIncOrDecInfo: + type: object + properties: + fromAddress: + type: string + perOperatorAmounts: + type: object + additionalProperties: + type: object + properties: + Amount: + type: string + exocore.delegation.v1.DelegationResponse: + type: object + exocore.delegation.v1.OperatorInfo: + type: object + properties: + EarningsAddr: + type: string + ApproveAddr: + type: string + OperatorMetaInfo: + type: string + ClientChainEarningsAddr: + type: object + properties: + EarningInfoList: + type: array + items: + type: object + properties: + lzClientChainID: + type: string + format: uint64 + clientChainEarningAddr: + type: string + exocore.delegation.v1.QueryDelegationInfoResponse: + type: object + properties: + TotalDelegatedAmount: + type: string + delegationInfos: + type: object + additionalProperties: + type: object + properties: + CanUndelegationAmount: + type: string + WaitUndelegationAmount: + type: string + exocore.delegation.v1.RegisterOperatorResponse: + type: object + exocore.delegation.v1.UndelegationResponse: + type: object + exocore.delegation.v1.ValueField: + type: object + properties: + Amount: + type: string + exocore.delegation.v1.clientChainEarningAddrInfo: + type: object + properties: + lzClientChainID: + type: string + format: uint64 + clientChainEarningAddr: + type: string + exocore.delegation.v1.clientChainEarningAddrList: + type: object + properties: + EarningInfoList: + type: array + items: + type: object + properties: + lzClientChainID: + type: string + format: uint64 + clientChainEarningAddr: + type: string + exocore.deposit.v1.MsgUpdateParamsResponse: + type: object + title: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + Since: cosmos-sdk 0.47 + exocore.deposit.v1.Params: + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: GenesisState defines the restaking_assets_manage module's genesis state. + exocore.deposit.v1.QueryParamsResponse: + type: object + properties: + params: + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: >- + GenesisState defines the restaking_assets_manage module's genesis + state. + description: |- + QueryParamsResponse is the response type for the Query/Params RPC + method. + exocore.oracle.MsgCreatePriceResponse: + type: object + exocore.oracle.Params: + type: object + description: Params defines the parameters for the module. + exocore.oracle.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + description: QueryParamsResponse is response type for the Query/Params RPC method. + exocore.restaking_assets_manage.v1.AssetInfo: + type: object + properties: + Name: + type: string + Symbol: + type: string + Address: + type: string + Decimals: + type: integer + format: int64 + TotalSupply: + type: string + LayerZeroChainID: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + MetaInfo: + type: string + exocore.restaking_assets_manage.v1.ClientChainInfo: + type: object + properties: + Name: + type: string + MetaInfo: + type: string + ChainId: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + FinalizationBlocks: + type: string + format: uint64 + LayerZeroChainID: + type: string + format: uint64 + SignatureType: + type: string + AddressLength: + type: integer + format: int64 + exocore.restaking_assets_manage.v1.MsgSetExoCoreAddrResponse: + type: object + exocore.restaking_assets_manage.v1.OperatorSingleAssetOrChangeInfo: + type: object + properties: + TotalAmountOrWantChangeValue: + type: string + OperatorOwnAmountOrWantChangeValue: + type: string + title: >- + todo: the field is used to mark operator's own assets and is not + temporarily used now + WaitUndelegationAmountOrWantChangeValue: + type: string + exocore.restaking_assets_manage.v1.QueryAllClientChainInfoResponse: + type: object + properties: + allClientChainInfos: + type: object + additionalProperties: + type: object + properties: + Name: + type: string + MetaInfo: + type: string + ChainId: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + FinalizationBlocks: + type: string + format: uint64 + LayerZeroChainID: + type: string + format: uint64 + SignatureType: + type: string + AddressLength: + type: integer + format: int64 + exocore.restaking_assets_manage.v1.QueryAllStakingAssetsInfoResponse: + type: object + properties: + allStakingAssetsInfo: + type: object + additionalProperties: + type: object + properties: + AssetBasicInfo: + type: object + properties: + Name: + type: string + Symbol: + type: string + Address: + type: string + Decimals: + type: integer + format: int64 + TotalSupply: + type: string + LayerZeroChainID: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + MetaInfo: + type: string + StakingTotalAmount: + type: string + exocore.restaking_assets_manage.v1.QueryAssetInfoResponse: + type: object + properties: + assetInfos: + type: object + additionalProperties: + type: object + properties: + TotalDepositAmountOrWantChangeValue: + type: string + CanWithdrawAmountOrWantChangeValue: + type: string + WaitUndelegationAmountOrWantChangeValue: + type: string + exocore.restaking_assets_manage.v1.QueryOperatorAssetInfosResponse: + type: object + properties: + assetInfos: + type: object + additionalProperties: + type: object + properties: + TotalAmountOrWantChangeValue: + type: string + OperatorOwnAmountOrWantChangeValue: + type: string + title: >- + todo: the field is used to mark operator's own assets and is not + temporarily used now + WaitUndelegationAmountOrWantChangeValue: + type: string + exocore.restaking_assets_manage.v1.QueryStakerExCoreAddrResponse: + type: object + properties: + ExCoreAddr: + type: string + exocore.restaking_assets_manage.v1.RegisterAssetResponse: + type: object + exocore.restaking_assets_manage.v1.RegisterClientChainResponse: + type: object + exocore.restaking_assets_manage.v1.StakerSingleAssetOrChangeInfo: + type: object + properties: + TotalDepositAmountOrWantChangeValue: + type: string + CanWithdrawAmountOrWantChangeValue: + type: string + WaitUndelegationAmountOrWantChangeValue: + type: string + exocore.restaking_assets_manage.v1.StakingAssetInfo: + type: object + properties: + AssetBasicInfo: + type: object + properties: + Name: + type: string + Symbol: + type: string + Address: + type: string + Decimals: + type: integer + format: int64 + TotalSupply: + type: string + LayerZeroChainID: + type: string + format: uint64 + ExoCoreChainIndex: + type: string + format: uint64 + MetaInfo: + type: string + StakingTotalAmount: + type: string + exocore.reward.MsgUpdateParamsResponse: + type: object + title: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + Since: cosmos-sdk 0.47 + exocore.reward.Params: + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: Params defines the parameters for the module. + exocore.reward.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC method. + exocore.slash.MsgUpdateParamsResponse: + type: object + title: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + Since: cosmos-sdk 0.47 + exocore.slash.Params: + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: Params defines the parameters for the module. + exocore.slash.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC method. + exocore.withdraw.MsgUpdateParamsResponse: + type: object + title: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + Since: cosmos-sdk 0.47 + exocore.withdraw.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + exoCoreLzAppAddress: + type: string + exoCoreLzAppEventTopic: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC method. + ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse: + type: object + properties: + channel_id: + type: string + port_id: + type: string + title: >- + MsgRegisterInterchainAccountResponse defines the response for + Msg/RegisterAccount + ibc.applications.interchain_accounts.controller.v1.MsgSendTxResponse: + type: object + properties: + sequence: + type: string + format: uint64 + title: MsgSendTxResponse defines the response for MsgSendTx + ibc.applications.interchain_accounts.controller.v1.Params: + type: object + properties: + controller_enabled: + type: boolean + description: controller_enabled enables or disables the controller submodule. + description: |- + Params defines the set of on-chain interchain accounts parameters. + The following parameters may be used to disable the controller submodule. + ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse: + type: object + properties: + address: + type: string + description: >- + QueryInterchainAccountResponse the response type for the + Query/InterchainAccount RPC method. + ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + controller_enabled: + type: boolean + description: controller_enabled enables or disables the controller submodule. + description: QueryParamsResponse is the response type for the Query/Params RPC method. + ibc.applications.interchain_accounts.v1.InterchainAccountPacketData: + type: object + properties: + type: + type: string + enum: + - TYPE_UNSPECIFIED + - TYPE_EXECUTE_TX + default: TYPE_UNSPECIFIED + description: |- + - TYPE_UNSPECIFIED: Default zero value enumeration + - TYPE_EXECUTE_TX: Execute a transaction on an interchain accounts host chain + title: >- + Type defines a classification of message issued from a controller + chain to its associated interchain accounts + + host + data: + type: string + format: byte + memo: + type: string + description: >- + InterchainAccountPacketData is comprised of a raw transaction, type of + transaction and optional memo field. + ibc.applications.interchain_accounts.v1.Type: + type: string + enum: + - TYPE_UNSPECIFIED + - TYPE_EXECUTE_TX + default: TYPE_UNSPECIFIED + description: |- + - TYPE_UNSPECIFIED: Default zero value enumeration + - TYPE_EXECUTE_TX: Execute a transaction on an interchain accounts host chain + title: >- + Type defines a classification of message issued from a controller chain to + its associated interchain accounts + + host + ibc.applications.interchain_accounts.host.v1.Params: + type: object + properties: + host_enabled: + type: boolean + description: host_enabled enables or disables the host submodule. + allow_messages: + type: array + items: + type: string + description: >- + allow_messages defines a list of sdk message typeURLs allowed to be + executed on a host chain. + description: |- + Params defines the set of on-chain interchain accounts parameters. + The following parameters may be used to disable the host submodule. + ibc.applications.interchain_accounts.host.v1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + host_enabled: + type: boolean + description: host_enabled enables or disables the host submodule. + allow_messages: + type: array + items: + type: string + description: >- + allow_messages defines a list of sdk message typeURLs allowed to + be executed on a host chain. + description: QueryParamsResponse is the response type for the Query/Params RPC method. + ibc.core.channel.v1.Channel: + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: |- + State defines if a channel is in one of the following states: + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: |- + - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other end of the + channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: |- + list of connection identifiers, in order, along which packets sent on + this channel will travel + version: + type: string + title: opaque channel version, which is agreed upon during the handshake + description: |- + Channel defines pipeline for exactly-once packet delivery between specific + modules on separate blockchains, which has at least one end capable of + sending packets and one end capable of receiving packets. + ibc.core.channel.v1.Counterparty: + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other end of the + channel. + channel_id: + type: string + title: channel end on the counterparty chain + title: Counterparty defines a channel end counterparty + ibc.core.channel.v1.IdentifiedChannel: + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: |- + State defines if a channel is in one of the following states: + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: |- + - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other end of the + channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: |- + list of connection identifiers, in order, along which packets sent on + this channel will travel + version: + type: string + title: opaque channel version, which is agreed upon during the handshake + port_id: + type: string + title: port identifier + channel_id: + type: string + title: channel identifier + description: |- + IdentifiedChannel defines a channel with additional port and channel + identifier fields. + ibc.core.channel.v1.MsgAcknowledgementResponse: + type: object + properties: + result: + type: string + enum: + - RESPONSE_RESULT_TYPE_UNSPECIFIED + - RESPONSE_RESULT_TYPE_NOOP + - RESPONSE_RESULT_TYPE_SUCCESS + default: RESPONSE_RESULT_TYPE_UNSPECIFIED + description: |- + - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration + - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully + title: >- + ResponseResultType defines the possible outcomes of the execution of a + message + description: MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. + ibc.core.channel.v1.MsgChannelCloseConfirmResponse: + type: object + description: >- + MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm + response + + type. + ibc.core.channel.v1.MsgChannelCloseInitResponse: + type: object + description: >- + MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response + type. + ibc.core.channel.v1.MsgChannelOpenAckResponse: + type: object + description: MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. + ibc.core.channel.v1.MsgChannelOpenConfirmResponse: + type: object + description: |- + MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response + type. + ibc.core.channel.v1.MsgChannelOpenInitResponse: + type: object + properties: + channel_id: + type: string + version: + type: string + description: MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. + ibc.core.channel.v1.MsgChannelOpenTryResponse: + type: object + properties: + version: + type: string + channel_id: + type: string + description: MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. + ibc.core.channel.v1.MsgRecvPacketResponse: + type: object + properties: + result: + type: string + enum: + - RESPONSE_RESULT_TYPE_UNSPECIFIED + - RESPONSE_RESULT_TYPE_NOOP + - RESPONSE_RESULT_TYPE_SUCCESS + default: RESPONSE_RESULT_TYPE_UNSPECIFIED + description: |- + - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration + - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully + title: >- + ResponseResultType defines the possible outcomes of the execution of a + message + description: MsgRecvPacketResponse defines the Msg/RecvPacket response type. + ibc.core.channel.v1.MsgTimeoutOnCloseResponse: + type: object + properties: + result: + type: string + enum: + - RESPONSE_RESULT_TYPE_UNSPECIFIED + - RESPONSE_RESULT_TYPE_NOOP + - RESPONSE_RESULT_TYPE_SUCCESS + default: RESPONSE_RESULT_TYPE_UNSPECIFIED + description: |- + - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration + - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully + title: >- + ResponseResultType defines the possible outcomes of the execution of a + message + description: MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. + ibc.core.channel.v1.MsgTimeoutResponse: + type: object + properties: + result: + type: string + enum: + - RESPONSE_RESULT_TYPE_UNSPECIFIED + - RESPONSE_RESULT_TYPE_NOOP + - RESPONSE_RESULT_TYPE_SUCCESS + default: RESPONSE_RESULT_TYPE_UNSPECIFIED + description: |- + - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration + - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully + title: >- + ResponseResultType defines the possible outcomes of the execution of a + message + description: MsgTimeoutResponse defines the Msg/Timeout response type. + ibc.core.channel.v1.Order: + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: |- + - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + title: Order defines if a channel is ORDERED or UNORDERED + ibc.core.channel.v1.Packet: + type: object + properties: + sequence: + type: string + format: uint64 + description: >- + number corresponds to the order of sends and receives, where a Packet + + with an earlier sequence number must be sent and received before a + Packet + + with a later sequence number. + source_port: + type: string + description: identifies the port on the sending chain. + source_channel: + type: string + description: identifies the channel end on the sending chain. + destination_port: + type: string + description: identifies the port on the receiving chain. + destination_channel: + type: string + description: identifies the channel end on the receiving chain. + data: + type: string + format: byte + title: actual opaque bytes transferred directly to the application module + timeout_height: + title: block height after which the packet times out + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + timeout_timestamp: + type: string + format: uint64 + title: block timestamp (in nanoseconds) after which the packet times out + title: >- + Packet defines a type that carries data across different chains through + IBC + ibc.core.channel.v1.PacketState: + type: object + properties: + port_id: + type: string + description: channel port identifier. + channel_id: + type: string + description: channel unique identifier. + sequence: + type: string + format: uint64 + description: packet sequence. + data: + type: string + format: byte + description: embedded data that represents packet state. + description: |- + PacketState defines the generic type necessary to retrieve and store + packet commitments, acknowledgements, and receipts. + Caller is responsible for knowing the context necessary to interpret this + state as a commitment, acknowledgement, or a receipt. + ibc.core.channel.v1.QueryChannelClientStateResponse: + type: object + properties: + identified_client_state: + title: client state associated with the channel + type: object + properties: + client_id: + type: string + title: client identifier + client_state: + title: client state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + IdentifiedClientState defines a client state with an additional client + identifier field. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryChannelClientStateResponse is the Response type for the + Query/QueryChannelClientState RPC method + ibc.core.channel.v1.QueryChannelConsensusStateResponse: + type: object + properties: + consensus_state: + title: consensus state associated with the channel + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + client_id: + type: string + title: client ID associated with the consensus state + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryChannelClientStateResponse is the Response type for the + Query/QueryChannelClientState RPC method + ibc.core.channel.v1.QueryChannelResponse: + type: object + properties: + channel: + title: channel associated with the request identifiers + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: |- + State defines if a channel is in one of the following states: + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: |- + - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other end of the + channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: >- + list of connection identifiers, in order, along which packets sent + on + + this channel will travel + version: + type: string + title: opaque channel version, which is agreed upon during the handshake + description: >- + Channel defines pipeline for exactly-once packet delivery between + specific + + modules on separate blockchains, which has at least one end capable of + + sending packets and one end capable of receiving packets. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryChannelResponse is the response type for the Query/Channel RPC + method. + + Besides the Channel end, it includes a proof and the height from which the + + proof was retrieved. + ibc.core.channel.v1.QueryChannelsResponse: + type: object + properties: + channels: + type: array + items: + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: |- + State defines if a channel is in one of the following states: + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: |- + - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other end of + the channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: >- + list of connection identifiers, in order, along which packets + sent on + + this channel will travel + version: + type: string + title: >- + opaque channel version, which is agreed upon during the + handshake + port_id: + type: string + title: port identifier + channel_id: + type: string + title: channel identifier + description: |- + IdentifiedChannel defines a channel with additional port and channel + identifier fields. + description: list of stored channels of the chain. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryChannelsResponse is the response type for the Query/Channels RPC + method. + ibc.core.channel.v1.QueryConnectionChannelsResponse: + type: object + properties: + channels: + type: array + items: + type: object + properties: + state: + title: current state of the channel end + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: |- + State defines if a channel is in one of the following states: + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ordering: + title: whether the channel is ordered or unordered + type: string + enum: + - ORDER_NONE_UNSPECIFIED + - ORDER_UNORDERED + - ORDER_ORDERED + default: ORDER_NONE_UNSPECIFIED + description: |- + - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + which they were sent. + - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + counterparty: + title: counterparty channel end + type: object + properties: + port_id: + type: string + description: >- + port on the counterparty chain which owns the other end of + the channel. + channel_id: + type: string + title: channel end on the counterparty chain + connection_hops: + type: array + items: + type: string + title: >- + list of connection identifiers, in order, along which packets + sent on + + this channel will travel + version: + type: string + title: >- + opaque channel version, which is agreed upon during the + handshake + port_id: + type: string + title: port identifier + channel_id: + type: string + title: channel identifier + description: |- + IdentifiedChannel defines a channel with additional port and channel + identifier fields. + description: list of channels associated with a connection. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryConnectionChannelsResponse is the Response type for the + Query/QueryConnectionChannels RPC method + ibc.core.channel.v1.QueryNextSequenceReceiveResponse: + type: object + properties: + next_sequence_receive: + type: string + format: uint64 + title: next sequence receive number + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QuerySequenceResponse is the request type for the + Query/QueryNextSequenceReceiveResponse RPC method + ibc.core.channel.v1.QueryPacketAcknowledgementResponse: + type: object + properties: + acknowledgement: + type: string + format: byte + title: packet associated with the request fields + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryPacketAcknowledgementResponse defines the client query response for a + packet which also includes a proof and the height from which the + proof was retrieved + ibc.core.channel.v1.QueryPacketAcknowledgementsResponse: + type: object + properties: + acknowledgements: + type: array + items: + type: object + properties: + port_id: + type: string + description: channel port identifier. + channel_id: + type: string + description: channel unique identifier. + sequence: + type: string + format: uint64 + description: packet sequence. + data: + type: string + format: byte + description: embedded data that represents packet state. + description: >- + PacketState defines the generic type necessary to retrieve and store + + packet commitments, acknowledgements, and receipts. + + Caller is responsible for knowing the context necessary to interpret + this + + state as a commitment, acknowledgement, or a receipt. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryPacketAcknowledgemetsResponse is the request type for the + Query/QueryPacketAcknowledgements RPC method + ibc.core.channel.v1.QueryPacketCommitmentResponse: + type: object + properties: + commitment: + type: string + format: byte + title: packet associated with the request fields + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + QueryPacketCommitmentResponse defines the client query response for a + packet + + which also includes a proof and the height from which the proof was + + retrieved + ibc.core.channel.v1.QueryPacketCommitmentsResponse: + type: object + properties: + commitments: + type: array + items: + type: object + properties: + port_id: + type: string + description: channel port identifier. + channel_id: + type: string + description: channel unique identifier. + sequence: + type: string + format: uint64 + description: packet sequence. + data: + type: string + format: byte + description: embedded data that represents packet state. + description: >- + PacketState defines the generic type necessary to retrieve and store + + packet commitments, acknowledgements, and receipts. + + Caller is responsible for knowing the context necessary to interpret + this + + state as a commitment, acknowledgement, or a receipt. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryPacketCommitmentsResponse is the request type for the + Query/QueryPacketCommitments RPC method + ibc.core.channel.v1.QueryPacketReceiptResponse: + type: object + properties: + received: + type: boolean + title: success flag for if receipt exists + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + QueryPacketReceiptResponse defines the client query response for a packet + + receipt which also includes a proof, and the height from which the proof + was + + retrieved + ibc.core.channel.v1.QueryUnreceivedAcksResponse: + type: object + properties: + sequences: + type: array + items: + type: string + format: uint64 + title: list of unreceived acknowledgement sequences + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryUnreceivedAcksResponse is the response type for the + Query/UnreceivedAcks RPC method + ibc.core.channel.v1.QueryUnreceivedPacketsResponse: + type: object + properties: + sequences: + type: array + items: + type: string + format: uint64 + title: list of unreceived packet sequences + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryUnreceivedPacketsResponse is the response type for the + Query/UnreceivedPacketCommitments RPC method + ibc.core.channel.v1.ResponseResultType: + type: string + enum: + - RESPONSE_RESULT_TYPE_UNSPECIFIED + - RESPONSE_RESULT_TYPE_NOOP + - RESPONSE_RESULT_TYPE_SUCCESS + default: RESPONSE_RESULT_TYPE_UNSPECIFIED + description: |- + - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration + - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully + title: >- + ResponseResultType defines the possible outcomes of the execution of a + message + ibc.core.channel.v1.State: + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED + description: |- + State defines if a channel is in one of the following states: + CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A channel has just started the opening handshake. + - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + - STATE_OPEN: A channel has completed the handshake. Open channels are + ready to send and receive packets. + - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + packets. + ibc.core.client.v1.Height: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: |- + Normally the RevisionHeight is incremented at each height while keeping + RevisionNumber the same. However some consensus algorithms may choose to + reset the height in certain conditions e.g. hard forks, state-machine + breaking changes In these cases, the RevisionNumber is incremented so that + height continues to be monitonically increasing even as the RevisionHeight + gets reset + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes of updating + and + + freezing clients + ibc.core.client.v1.IdentifiedClientState: + type: object + properties: + client_id: + type: string + title: client identifier + client_state: + title: client state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + IdentifiedClientState defines a client state with an additional client + identifier field. + ibc.core.client.v1.ConsensusStateWithHeight: + type: object + properties: + height: + title: consensus state height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + consensus_state: + title: consensus state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + ConsensusStateWithHeight defines a consensus state with an additional + height + + field. + ibc.core.client.v1.MsgCreateClientResponse: + type: object + description: MsgCreateClientResponse defines the Msg/CreateClient response type. + ibc.core.client.v1.MsgSubmitMisbehaviourResponse: + type: object + description: |- + MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + type. + ibc.core.client.v1.MsgUpdateClientResponse: + type: object + description: MsgUpdateClientResponse defines the Msg/UpdateClient response type. + ibc.core.client.v1.MsgUpgradeClientResponse: + type: object + description: MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. + ibc.core.client.v1.Params: + type: object + properties: + allowed_clients: + type: array + items: + type: string + description: >- + allowed_clients defines the list of allowed client state types which + can be created + + and interacted with. If a client type is removed from the allowed + clients list, usage + + of this client will be disabled until it is added again to the list. + description: Params defines the set of IBC light client parameters. + ibc.core.client.v1.QueryClientParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + allowed_clients: + type: array + items: + type: string + description: >- + allowed_clients defines the list of allowed client state types + which can be created + + and interacted with. If a client type is removed from the allowed + clients list, usage + + of this client will be disabled until it is added again to the + list. + description: >- + QueryClientParamsResponse is the response type for the Query/ClientParams + RPC + + method. + ibc.core.client.v1.QueryClientStateResponse: + type: object + properties: + client_state: + title: client state associated with the request identifier + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryClientStateResponse is the response type for the Query/ClientState + RPC + + method. Besides the client state, it includes a proof and the height from + + which the proof was retrieved. + ibc.core.client.v1.QueryClientStatesResponse: + type: object + properties: + client_states: + type: array + items: + type: object + properties: + client_id: + type: string + title: client identifier + client_state: + title: client state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + IdentifiedClientState defines a client state with an additional + client + + identifier field. + description: list of stored ClientStates of the chain. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + description: >- + QueryClientStatesResponse is the response type for the Query/ClientStates + RPC + + method. + ibc.core.client.v1.QueryClientStatusResponse: + type: object + properties: + status: + type: string + description: >- + QueryClientStatusResponse is the response type for the Query/ClientStatus + RPC + + method. It returns the current status of the IBC client. + ibc.core.client.v1.QueryConsensusStateHeightsResponse: + type: object + properties: + consensus_state_heights: + type: array + items: + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is incremented + so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + Height is a monotonically increasing data type + + that can be compared against another Height for the purposes of + updating and + + freezing clients + title: consensus state heights + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: |- + QueryConsensusStateHeightsResponse is the response type for the + Query/ConsensusStateHeights RPC method + ibc.core.client.v1.QueryConsensusStateResponse: + type: object + properties: + consensus_state: + title: >- + consensus state associated with the client identifier at the given + height + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: >- + QueryConsensusStateResponse is the response type for the + Query/ConsensusState + + RPC method + ibc.core.client.v1.QueryConsensusStatesResponse: + type: object + properties: + consensus_states: + type: array + items: + type: object + properties: + height: + title: consensus state height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may + choose to + + reset the height in certain conditions e.g. hard forks, + state-machine + + breaking changes In these cases, the RevisionNumber is + incremented so that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + consensus_state: + title: consensus state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + ConsensusStateWithHeight defines a consensus state with an + additional height + + field. + title: consensus states associated with the identifier + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: |- + QueryConsensusStatesResponse is the response type for the + Query/ConsensusStates RPC method + ibc.core.client.v1.QueryUpgradedClientStateResponse: + type: object + properties: + upgraded_client_state: + title: client state associated with the request identifier + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + QueryUpgradedClientStateResponse is the response type for the + Query/UpgradedClientState RPC method. + ibc.core.client.v1.QueryUpgradedConsensusStateResponse: + type: object + properties: + upgraded_consensus_state: + title: Consensus state associated with the request identifier + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + QueryUpgradedConsensusStateResponse is the response type for the + Query/UpgradedConsensusState RPC method. + ibc.core.commitment.v1.MerklePrefix: + type: object + properties: + key_prefix: + type: string + format: byte + title: |- + MerklePrefix is merkle path prefixed to the key. + The constructed key from the Path and the key will be append(Path.KeyPath, + append(Path.KeyPrefix, key...)) + ibc.core.connection.v1.ConnectionEnd: + type: object + properties: + client_id: + type: string + description: client associated with this connection. + versions: + type: array + items: + type: object + properties: + identifier: + type: string + title: unique version identifier + features: + type: array + items: + type: string + title: list of features compatible with the specified identifier + description: >- + Version defines the versioning scheme used to negotiate the IBC + verison in + + the connection handshake. + description: >- + IBC version which can be utilised to determine encodings or protocols + for + + channels or packets utilising this connection. + state: + description: current state of the connection end. + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + default: STATE_UNINITIALIZED_UNSPECIFIED + counterparty: + description: counterparty chain associated with this connection. + type: object + properties: + client_id: + type: string + description: >- + identifies the client on the counterparty chain associated with a + given + + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty chain associated + with a + + given connection. + prefix: + description: commitment merkle prefix of the counterparty chain. + type: object + properties: + key_prefix: + type: string + format: byte + title: >- + MerklePrefix is merkle path prefixed to the key. + + The constructed key from the Path and the key will be + append(Path.KeyPath, + + append(Path.KeyPrefix, key...)) + delay_period: + type: string + format: uint64 + description: >- + delay period that must pass before a consensus state can be used for + + packet-verification NOTE: delay period logic is only implemented by + some + + clients. + description: |- + ConnectionEnd defines a stateful object on a chain connected to another + separate one. + NOTE: there must only be 2 defined ConnectionEnds to establish + a connection between two chains. + ibc.core.connection.v1.Counterparty: + type: object + properties: + client_id: + type: string + description: >- + identifies the client on the counterparty chain associated with a + given + + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty chain associated + with a + + given connection. + prefix: + description: commitment merkle prefix of the counterparty chain. + type: object + properties: + key_prefix: + type: string + format: byte + title: >- + MerklePrefix is merkle path prefixed to the key. + + The constructed key from the Path and the key will be + append(Path.KeyPath, + + append(Path.KeyPrefix, key...)) + description: >- + Counterparty defines the counterparty chain associated with a connection + end. + ibc.core.connection.v1.IdentifiedConnection: + type: object + properties: + id: + type: string + description: connection identifier. + client_id: + type: string + description: client associated with this connection. + versions: + type: array + items: + type: object + properties: + identifier: + type: string + title: unique version identifier + features: + type: array + items: + type: string + title: list of features compatible with the specified identifier + description: >- + Version defines the versioning scheme used to negotiate the IBC + verison in + + the connection handshake. + title: >- + IBC version which can be utilised to determine encodings or protocols + for + + channels or packets utilising this connection + state: + description: current state of the connection end. + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + default: STATE_UNINITIALIZED_UNSPECIFIED + counterparty: + description: counterparty chain associated with this connection. + type: object + properties: + client_id: + type: string + description: >- + identifies the client on the counterparty chain associated with a + given + + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty chain associated + with a + + given connection. + prefix: + description: commitment merkle prefix of the counterparty chain. + type: object + properties: + key_prefix: + type: string + format: byte + title: >- + MerklePrefix is merkle path prefixed to the key. + + The constructed key from the Path and the key will be + append(Path.KeyPath, + + append(Path.KeyPrefix, key...)) + delay_period: + type: string + format: uint64 + description: delay period associated with this connection. + description: |- + IdentifiedConnection defines a connection with additional connection + identifier field. + ibc.core.connection.v1.MsgConnectionOpenAckResponse: + type: object + description: >- + MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response + type. + ibc.core.connection.v1.MsgConnectionOpenConfirmResponse: + type: object + description: |- + MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + response type. + ibc.core.connection.v1.MsgConnectionOpenInitResponse: + type: object + description: |- + MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + type. + ibc.core.connection.v1.MsgConnectionOpenTryResponse: + type: object + description: >- + MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response + type. + ibc.core.connection.v1.Params: + type: object + properties: + max_expected_time_per_block: + type: string + format: uint64 + description: >- + maximum expected time per block (in nanoseconds), used to enforce + block delay. This parameter should reflect the + + largest amount of time that the chain might reasonably take to produce + the next block under normal operating + + conditions. A safe choice is 3-5x the expected time per block. + description: Params defines the set of Connection parameters. + ibc.core.connection.v1.QueryClientConnectionsResponse: + type: object + properties: + connection_paths: + type: array + items: + type: string + description: slice of all the connection paths associated with a client. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was generated + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryClientConnectionsResponse is the response type for the + Query/ClientConnections RPC method + ibc.core.connection.v1.QueryConnectionClientStateResponse: + type: object + properties: + identified_client_state: + title: client state associated with the channel + type: object + properties: + client_id: + type: string + title: client identifier + client_state: + title: client state + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + IdentifiedClientState defines a client state with an additional client + identifier field. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryConnectionClientStateResponse is the response type for the + Query/ConnectionClientState RPC method + ibc.core.connection.v1.QueryConnectionConsensusStateResponse: + type: object + properties: + consensus_state: + title: consensus state associated with the channel + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + client_id: + type: string + title: client ID associated with the consensus state + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + title: |- + QueryConnectionConsensusStateResponse is the response type for the + Query/ConnectionConsensusState RPC method + ibc.core.connection.v1.QueryConnectionParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + max_expected_time_per_block: + type: string + format: uint64 + description: >- + maximum expected time per block (in nanoseconds), used to enforce + block delay. This parameter should reflect the + + largest amount of time that the chain might reasonably take to + produce the next block under normal operating + + conditions. A safe choice is 3-5x the expected time per block. + description: >- + QueryConnectionParamsResponse is the response type for the + Query/ConnectionParams RPC method. + ibc.core.connection.v1.QueryConnectionResponse: + type: object + properties: + connection: + title: connection associated with the request identifier + type: object + properties: + client_id: + type: string + description: client associated with this connection. + versions: + type: array + items: + type: object + properties: + identifier: + type: string + title: unique version identifier + features: + type: array + items: + type: string + title: list of features compatible with the specified identifier + description: >- + Version defines the versioning scheme used to negotiate the IBC + verison in + + the connection handshake. + description: >- + IBC version which can be utilised to determine encodings or + protocols for + + channels or packets utilising this connection. + state: + description: current state of the connection end. + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + default: STATE_UNINITIALIZED_UNSPECIFIED + counterparty: + description: counterparty chain associated with this connection. + type: object + properties: + client_id: + type: string + description: >- + identifies the client on the counterparty chain associated + with a given + + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty chain + associated with a + + given connection. + prefix: + description: commitment merkle prefix of the counterparty chain. + type: object + properties: + key_prefix: + type: string + format: byte + title: >- + MerklePrefix is merkle path prefixed to the key. + + The constructed key from the Path and the key will be + append(Path.KeyPath, + + append(Path.KeyPrefix, key...)) + delay_period: + type: string + format: uint64 + description: >- + delay period that must pass before a consensus state can be used + for + + packet-verification NOTE: delay period logic is only implemented + by some + + clients. + description: >- + ConnectionEnd defines a stateful object on a chain connected to + another + + separate one. + + NOTE: there must only be 2 defined ConnectionEnds to establish + + a connection between two chains. + proof: + type: string + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryConnectionResponse is the response type for the Query/Connection RPC + + method. Besides the connection end, it includes a proof and the height + from + + which the proof was retrieved. + ibc.core.connection.v1.QueryConnectionsResponse: + type: object + properties: + connections: + type: array + items: + type: object + properties: + id: + type: string + description: connection identifier. + client_id: + type: string + description: client associated with this connection. + versions: + type: array + items: + type: object + properties: + identifier: + type: string + title: unique version identifier + features: + type: array + items: + type: string + title: list of features compatible with the specified identifier + description: >- + Version defines the versioning scheme used to negotiate the + IBC verison in + + the connection handshake. + title: >- + IBC version which can be utilised to determine encodings or + protocols for + + channels or packets utilising this connection + state: + description: current state of the connection end. + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + default: STATE_UNINITIALIZED_UNSPECIFIED + counterparty: + description: counterparty chain associated with this connection. + type: object + properties: + client_id: + type: string + description: >- + identifies the client on the counterparty chain associated + with a given + + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty chain + associated with a + + given connection. + prefix: + description: commitment merkle prefix of the counterparty chain. + type: object + properties: + key_prefix: + type: string + format: byte + title: >- + MerklePrefix is merkle path prefixed to the key. + + The constructed key from the Path and the key will be + append(Path.KeyPath, + + append(Path.KeyPrefix, key...)) + delay_period: + type: string + format: uint64 + description: delay period associated with this connection. + description: |- + IdentifiedConnection defines a connection with additional connection + identifier field. + description: list of stored connections of the chain. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + height: + title: query block height + type: object + properties: + revision_number: + type: string + format: uint64 + title: the revision that the client is currently on + revision_height: + type: string + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping + + RevisionNumber the same. However some consensus algorithms may choose + to + + reset the height in certain conditions e.g. hard forks, state-machine + + breaking changes In these cases, the RevisionNumber is incremented so + that + + height continues to be monitonically increasing even as the + RevisionHeight + + gets reset + description: >- + QueryConnectionsResponse is the response type for the Query/Connections + RPC + + method. + ibc.core.connection.v1.State: + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + default: STATE_UNINITIALIZED_UNSPECIFIED + description: |- + State defines if a connection is in one of the following states: + INIT, TRYOPEN, OPEN or UNINITIALIZED. + + - STATE_UNINITIALIZED_UNSPECIFIED: Default State + - STATE_INIT: A connection end has just started the opening handshake. + - STATE_TRYOPEN: A connection end has acknowledged the handshake step on the counterparty + chain. + - STATE_OPEN: A connection end has completed the handshake. + ibc.core.connection.v1.Version: + type: object + properties: + identifier: + type: string + title: unique version identifier + features: + type: array + items: + type: string + title: list of features compatible with the specified identifier + description: |- + Version defines the versioning scheme used to negotiate the IBC verison in + the connection handshake. diff --git a/go.mod b/go.mod index ff463418a..76c2659cc 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/ExocoreNetwork/exocore go 1.21 require ( + bou.ke/monkey v1.0.2 cosmossdk.io/errors v1.0.0 cosmossdk.io/math v1.0.1 cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d @@ -20,15 +21,18 @@ require ( github.com/golang/protobuf v1.5.4 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 github.com/onsi/ginkgo/v2 v2.15.0 github.com/onsi/gomega v1.31.1 github.com/pkg/errors v0.9.1 github.com/rakyll/statik v0.1.7 + github.com/smartystreets/goconvey v1.6.4 github.com/spf13/cast v1.5.1 github.com/spf13/cobra v1.7.0 github.com/spf13/viper v1.16.0 github.com/stretchr/testify v1.8.4 go.opencensus.io v0.24.0 + go.uber.org/mock v0.4.0 golang.org/x/crypto v0.21.0 golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 @@ -105,6 +109,7 @@ require ( github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect + github.com/ghodss/yaml v1.0.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect @@ -126,6 +131,7 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect github.com/googleapis/gax-go/v2 v2.11.0 // indirect + github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect @@ -146,6 +152,7 @@ require ( github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect + github.com/jtolds/gls v4.20.0+incompatible // indirect github.com/klauspost/compress v1.16.7 // indirect github.com/lib/pq v1.10.9 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect @@ -176,6 +183,7 @@ require ( github.com/rs/zerolog v1.29.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect + github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect diff --git a/go.sum b/go.sum index bb081e135..1d55e9f97 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +bou.ke/monkey v1.0.2 h1:kWcnsrCNUatbxncxR/ThdYqbytgOIArtYWqcQLQzKLI= +bou.ke/monkey v1.0.2/go.mod h1:OqickVX3tNx6t33n1xvtTtu85YN5s6cKwVug+oHMaIA= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -835,6 +837,7 @@ github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= 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= @@ -1035,6 +1038,7 @@ github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cU github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= @@ -1056,6 +1060,7 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t 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/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= 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= @@ -1152,6 +1157,7 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= 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= @@ -1418,7 +1424,9 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= 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 h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= @@ -1549,6 +1557,8 @@ 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.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.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= diff --git a/proto/exocore/oracle/genesis.proto b/proto/exocore/oracle/genesis.proto new file mode 100644 index 000000000..173fd9372 --- /dev/null +++ b/proto/exocore/oracle/genesis.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package exocore.oracle; + +import "gogoproto/gogo.proto"; +import "exocore/oracle/params.proto"; +import "exocore/oracle/prices.proto"; +import "exocore/oracle/validator_update_block.proto"; +import "exocore/oracle/index_recent_params.proto"; +import "exocore/oracle/index_recent_msg.proto"; +import "exocore/oracle/recent_msg.proto"; +import "exocore/oracle/recent_params.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +// GenesisState defines the oracle module's genesis state. +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + repeated Prices pricesList = 2 [(gogoproto.nullable) = false]; + + //TODO: userDefinedTokenFeeder + ValidatorUpdateBlock validatorUpdateBlock = 4; + IndexRecentParams indexRecentParams = 5; + IndexRecentMsg indexRecentMsg = 6; + repeated RecentMsg recentMsgList = 7 [(gogoproto.nullable) = false]; + repeated RecentParams recentParamsList = 8 [(gogoproto.nullable) = false]; +} + diff --git a/proto/exocore/oracle/index_recent_msg.proto b/proto/exocore/oracle/index_recent_msg.proto new file mode 100644 index 000000000..feaa90eb2 --- /dev/null +++ b/proto/exocore/oracle/index_recent_msg.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package exocore.oracle; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message IndexRecentMsg { + repeated uint64 index = 1; +} diff --git a/proto/exocore/oracle/index_recent_params.proto b/proto/exocore/oracle/index_recent_params.proto new file mode 100644 index 000000000..2612adcf8 --- /dev/null +++ b/proto/exocore/oracle/index_recent_params.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package exocore.oracle; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message IndexRecentParams { + repeated uint64 index = 1; +} diff --git a/proto/exocore/oracle/info.proto b/proto/exocore/oracle/info.proto new file mode 100644 index 000000000..0d77c1895 --- /dev/null +++ b/proto/exocore/oracle/info.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package exocore.oracle; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message Chain{ + //eg."bitcoin" + string name = 1; + //TODO: metadata + string desc = 2; +} + +message Token{ + string name = 1; + //id refer to chainList's index + int32 chain_id = 2; + //if any, like erc20 tokens + string contract_address = 3; + int32 decimal = 4; + //set false when we stop official price oracle service for a specified token + bool active = 5; +} + +message Endpoint{ + //url int refer to TokenList.ID, 0 reprents default for all (as fall back) + //key refer to tokenID, 1->"https://chainlink.../eth" + map offchain = 1; + //url int refer to TokenList.ID, 0 reprents default for all (as fall back) + //key refer to tokenID, 1->"eth://0xabc...def" + map onchain = 2; + +} + +message Source { + string name = 1; + Endpoint entry = 2; + //set false when the source is out of service or reject to accept this source for official service + bool valid = 3; + bool deterministic = 4; +} diff --git a/proto/exocore/oracle/params.proto b/proto/exocore/oracle/params.proto new file mode 100644 index 000000000..eb7b2b747 --- /dev/null +++ b/proto/exocore/oracle/params.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package exocore.oracle; + +import "gogoproto/gogo.proto"; +import "exocore/oracle/info.proto"; +import "exocore/oracle/token_feeder.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +// Params defines the parameters for the module. +message Params { + option (gogoproto.goproto_stringer) = false; + repeated Chain chains = 1; + repeated Token tokens = 2; + repeated Source sources = 3; + repeated RuleWithSource rules = 4; + repeated TokenFeeder TokenFeeders = 5; +} diff --git a/proto/exocore/oracle/price.proto b/proto/exocore/oracle/price.proto new file mode 100644 index 000000000..7c728a606 --- /dev/null +++ b/proto/exocore/oracle/price.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; + +package exocore.oracle; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +//token price with timestamp fetched from source +//{price:"12345",decimal:"2"}->price: 123.45 usdt +message PriceWithTimeAndDetId { + string price = 1; + int32 decimal = 2; + string timestamp = 3; + string det_id = 4; +} + +message PriceWithSource{ + //refer to id from Params.SourceList, where this price fetched from, 0 is reserved for custom usage + int32 source_id = 1; + //if source is deteministic like chainlink with roundID, set this value with which returned from source + //up to 3 values in case of the async of network, to give more time for oracle nodes(validators) get into consensus + //eg.with deterministic source, this array will contian 3 continuous values up to latest + //for non-deterministic source, it's a choice by v2 rules. + repeated PriceWithTimeAndDetId prices = 2; + //used for 0-sourceID-customDefinedSource + string desc = 3; +} + +message PriceWithTimeAndRound { + string price = 1; + int32 decimal = 2; + string timestamp = 3; + uint64 round_id = 4; +} diff --git a/proto/exocore/oracle/prices.proto b/proto/exocore/oracle/prices.proto new file mode 100644 index 000000000..798493742 --- /dev/null +++ b/proto/exocore/oracle/prices.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package exocore.oracle; + +import "exocore/oracle/price.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message Prices { + int32 token_id = 1; + uint64 next_rount_id = 2; + repeated PriceWithTimeAndRound price_list = 3; +} diff --git a/proto/exocore/oracle/query.proto b/proto/exocore/oracle/query.proto new file mode 100644 index 000000000..411c7f234 --- /dev/null +++ b/proto/exocore/oracle/query.proto @@ -0,0 +1,153 @@ +syntax = "proto3"; + +package exocore.oracle; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "exocore/oracle/params.proto"; +import "exocore/oracle/prices.proto"; +import "exocore/oracle/validator_update_block.proto"; +import "exocore/oracle/index_recent_params.proto"; +import "exocore/oracle/index_recent_msg.proto"; +import "exocore/oracle/recent_msg.proto"; +import "exocore/oracle/recent_params.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +// Query defines the gRPC querier service. +service Query { + + // Parameters queries the parameters of the module. + rpc Params (QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/params"; + + } + + // Queries a list of Prices items. + rpc Prices (QueryGetPricesRequest) returns (QueryGetPricesResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/prices/{tokenId}"; + + } +// rpc PricesAll (QueryAllPricesRequest) returns (QueryAllPricesResponse) { +// option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/prices"; +// +// } + + // Queries a ValidatorUpdateBlock by index. + rpc ValidatorUpdateBlock (QueryGetValidatorUpdateBlockRequest) returns (QueryGetValidatorUpdateBlockResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/validator_update_block"; + + } + + // Queries a IndexRecentParams by index. + rpc IndexRecentParams (QueryGetIndexRecentParamsRequest) returns (QueryGetIndexRecentParamsResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/index_recent_params"; + + } + + // Queries a IndexRecentMsg by index. + rpc IndexRecentMsg (QueryGetIndexRecentMsgRequest) returns (QueryGetIndexRecentMsgResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/index_recent_msg"; + + } + + // Queries a list of RecentMsg items. + rpc RecentMsg (QueryGetRecentMsgRequest) returns (QueryGetRecentMsgResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/recent_msg/{block}"; + + } + rpc RecentMsgAll (QueryAllRecentMsgRequest) returns (QueryAllRecentMsgResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/recent_msg"; + + } + + // Queries a list of RecentParams items. + rpc RecentParams (QueryGetRecentParamsRequest) returns (QueryGetRecentParamsResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/recent_params/{block}"; + + } + rpc RecentParamsAll (QueryAllRecentParamsRequest) returns (QueryAllRecentParamsResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/oracle/recent_params"; + + } +} +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + + // params holds all the parameters of this module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +message QueryGetPricesRequest { + int32 tokenId = 1; +} + +message QueryGetPricesResponse { + Prices prices = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllPricesRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllPricesResponse { + repeated Prices prices = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetValidatorUpdateBlockRequest {} + +message QueryGetValidatorUpdateBlockResponse { + ValidatorUpdateBlock ValidatorUpdateBlock = 1 [(gogoproto.nullable) = false]; +} + +message QueryGetIndexRecentParamsRequest {} + +message QueryGetIndexRecentParamsResponse { + IndexRecentParams IndexRecentParams = 1 [(gogoproto.nullable) = false]; +} + +message QueryGetIndexRecentMsgRequest {} + +message QueryGetIndexRecentMsgResponse { + IndexRecentMsg IndexRecentMsg = 1 [(gogoproto.nullable) = false]; +} + +message QueryGetRecentMsgRequest { + uint64 block = 1; +} + +message QueryGetRecentMsgResponse { + RecentMsg recentMsg = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllRecentMsgRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllRecentMsgResponse { + repeated RecentMsg recentMsg = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetRecentParamsRequest { + uint64 block = 1; +} + +message QueryGetRecentParamsResponse { + RecentParams recentParams = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllRecentParamsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllRecentParamsResponse { + repeated RecentParams recentParams = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + diff --git a/proto/exocore/oracle/recent_msg.proto b/proto/exocore/oracle/recent_msg.proto new file mode 100644 index 000000000..60ac48436 --- /dev/null +++ b/proto/exocore/oracle/recent_msg.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package exocore.oracle; + +import "exocore/oracle/price.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message RecentMsg { + uint64 block = 1; + repeated MsgItem msgs = 2; +// int32 feeder_id = 2; + // repeated PriceWithSource p_sources = 3; + // string validator = 4; +} + +message MsgItem{ + int32 feeder_id = 2; + repeated PriceWithSource p_sources = 3; + string validator = 4; +} + + + diff --git a/proto/exocore/oracle/recent_params.proto b/proto/exocore/oracle/recent_params.proto new file mode 100644 index 000000000..ec260a68c --- /dev/null +++ b/proto/exocore/oracle/recent_params.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package exocore.oracle; + +import "exocore/oracle/params.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message RecentParams { + uint64 block = 1; + Params params = 2; +} + diff --git a/proto/exocore/oracle/token_feeder.proto b/proto/exocore/oracle/token_feeder.proto new file mode 100644 index 000000000..818e3867f --- /dev/null +++ b/proto/exocore/oracle/token_feeder.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package exocore.oracle; + +import "gogoproto/gogo.proto"; +import "exocore/oracle/info.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +//n out of m required source +message NOMSource{ + //required source set, refer to params.sourceList, 1st set to 0 means all valid sources + repeated int32 source_ids = 1; + //minimum number from the required sources to be fullfiled + int32 minimum = 2; +} + +//specify data from which source is needed +//rule_1: specified sources +//rule_2: n out of total sources are required +message RuleWithSource{ + //refer to params.sourceList.ID, when length>0, ignore the other field, when 1st set to 0, means all valid sources, length==0->check next field:minimum + repeated int32 source_ids = 1; + //n out of total sources are required + NOMSource nom = 2; +} + +//Tokenfeeder represents a price oracle for one token +message TokenFeeder{ + //refer to params.tokenList, from 1 + int32 token_id = 1; + //refer to params.ruleList, 0 means no restriction, accept any source including customer defined + int32 rule_id = 2; + //include, from 1, when some token's feeder had been stop and then restart, the token_id will be continuous from previous one + int64 start_round_id = 3; + //include, first block which start_round_id can be settled is at least start_base_block+1 + int64 start_base_block = 4; + //set as count of blocks, for how many blocks interval the price will be update once + int64 interval = 5; + //tokenfeeder is initialized with forever live, update the End parameters by voting, and will off service by the end + //this is set by updateParams, and the EndRoundID will be update by related. excluded, will not work if current height >=EndBlock + int64 end_block = 6; +} diff --git a/proto/exocore/oracle/tx.proto b/proto/exocore/oracle/tx.proto new file mode 100644 index 000000000..5d1d8252d --- /dev/null +++ b/proto/exocore/oracle/tx.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package exocore.oracle; + +import "exocore/oracle/price.proto"; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +// Msg defines the Msg service. +service Msg { +//create price for a new oracle round + rpc CreatePrice (MsgCreatePrice) returns (MsgCreatePriceResponse); +} +message MsgCreatePrice { + string creator = 1; + //refer to id from Params.TokenFeeders, 0 is reserved, invalid to use + int32 feeder_id = 2; + repeated PriceWithSource prices = 3; + //on which block commit does this message be built on + uint64 based_block = 4; + int32 nonce = 5; +} + +message MsgCreatePriceResponse {} diff --git a/proto/exocore/oracle/validator_update_block.proto b/proto/exocore/oracle/validator_update_block.proto new file mode 100644 index 000000000..85f011dc9 --- /dev/null +++ b/proto/exocore/oracle/validator_update_block.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package exocore.oracle; + +option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; + +message ValidatorUpdateBlock { + uint64 block = 1; +} diff --git a/testutil/keeper/oracle.go b/testutil/keeper/oracle.go new file mode 100644 index 000000000..a0a65338f --- /dev/null +++ b/testutil/keeper/oracle.go @@ -0,0 +1,54 @@ +package keeper + +import ( + "testing" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + tmdb "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/libs/log" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/store" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + typesparams "github.com/cosmos/cosmos-sdk/x/params/types" + stakingKeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/stretchr/testify/require" +) + +func OracleKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { + storeKey := sdk.NewKVStoreKey(types.StoreKey) + memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) + + db := tmdb.NewMemDB() + stateStore := store.NewCommitMultiStore(db) + stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) + stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) + require.NoError(t, stateStore.LoadLatestVersion()) + + registry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(registry) + + paramsSubspace := typesparams.NewSubspace(cdc, + types.Amino, + storeKey, + memStoreKey, + "OracleParams", + ) + k := keeper.NewKeeper( + cdc, + storeKey, + memStoreKey, + paramsSubspace, + stakingKeeper.Keeper{}, + ) + + ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) + + // Initialize params + k.SetParams(ctx, types.DefaultParams()) + + return &k, ctx +} diff --git a/testutil/nullify/nullify.go b/testutil/nullify/nullify.go new file mode 100644 index 000000000..3b968c09c --- /dev/null +++ b/testutil/nullify/nullify.go @@ -0,0 +1,57 @@ +// Package nullify provides methods to init nil values structs for test assertion. +package nullify + +import ( + "reflect" + "unsafe" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + coinType = reflect.TypeOf(sdk.Coin{}) + coinsType = reflect.TypeOf(sdk.Coins{}) +) + +// Fill analyze all struct fields and slices with +// reflection and initialize the nil and empty slices, +// structs, and pointers. +func Fill(x interface{}) interface{} { + v := reflect.Indirect(reflect.ValueOf(x)) + switch v.Kind() { + case reflect.Slice: + for i := 0; i < v.Len(); i++ { + obj := v.Index(i) + objPt := reflect.NewAt(obj.Type(), unsafe.Pointer(obj.UnsafeAddr())).Interface() + objPt = Fill(objPt) + obj.Set(reflect.ValueOf(objPt)) + } + case reflect.Struct: + for i := 0; i < v.NumField(); i++ { + f := reflect.Indirect(v.Field(i)) + if !f.CanSet() { + continue + } + switch f.Kind() { + case reflect.Slice: + f.Set(reflect.MakeSlice(f.Type(), 0, 0)) + case reflect.Struct: + switch f.Type() { + case coinType: + coin := reflect.New(coinType).Interface() + s := reflect.ValueOf(coin).Elem() + f.Set(s) + case coinsType: + coins := reflect.New(coinsType).Interface() + s := reflect.ValueOf(coins).Elem() + f.Set(s) + default: + objPt := reflect.NewAt(f.Type(), unsafe.Pointer(f.UnsafeAddr())).Interface() + s := Fill(objPt) + f.Set(reflect.ValueOf(s)) + } + } + } + } + return reflect.Indirect(v).Interface() +} diff --git a/testutil/sample/sample.go b/testutil/sample/sample.go new file mode 100644 index 000000000..98f2153ed --- /dev/null +++ b/testutil/sample/sample.go @@ -0,0 +1,13 @@ +package sample + +import ( + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// AccAddress returns a sample account address +func AccAddress() string { + pk := ed25519.GenPrivKey().PubKey() + addr := pk.Address() + return sdk.AccAddress(addr).String() +} diff --git a/tools/tools.go b/tools/tools.go new file mode 100644 index 000000000..6e7a12d40 --- /dev/null +++ b/tools/tools.go @@ -0,0 +1,11 @@ +//go:build tools + +package tools + +import ( + _ "github.com/cosmos/gogoproto/protoc-gen-gocosmos" + _ "github.com/golang/protobuf/protoc-gen-go" + _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway" + _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2" +) From a945c0b5d85ffa128b81750a4318aa927320218f Mon Sep 17 00:00:00 2001 From: leonz789 Date: Wed, 3 Apr 2024 02:36:20 +0800 Subject: [PATCH 30/37] feat(oracle-proto): add oracle types, mainly proto generated files --- x/oracle/client/cli/query.go | 40 + x/oracle/client/cli/query_index_recent_msg.go | 38 + .../client/cli/query_index_recent_msg_test.go | 71 + .../client/cli/query_index_recent_params.go | 38 + .../cli/query_index_recent_params_test.go | 71 + x/oracle/client/cli/query_params.go | 36 + x/oracle/client/cli/query_prices.go | 82 + x/oracle/client/cli/query_prices_test.go | 159 + x/oracle/client/cli/query_recent_msg.go | 82 + x/oracle/client/cli/query_recent_msg_test.go | 160 + x/oracle/client/cli/query_recent_params.go | 82 + .../client/cli/query_recent_params_test.go | 160 + .../cli/query_validator_update_block.go | 38 + .../cli/query_validator_update_block_test.go | 71 + x/oracle/client/cli/tx.go | 37 + x/oracle/client/cli/tx_create_price.go | 40 + x/oracle/genesis.go | 65 + x/oracle/genesis_test.go | 86 + x/oracle/module.go | 201 + x/oracle/module_simulation.go | 87 + x/oracle/simulation/create_price.go | 29 + x/oracle/simulation/helpers.go | 15 + x/oracle/types/codec.go | 28 + x/oracle/types/errors.go | 12 + x/oracle/types/expected_keepers.go | 18 + x/oracle/types/genesis.go | 60 + x/oracle/types/genesis.pb.go | 701 +++ x/oracle/types/genesis_test.go | 110 + x/oracle/types/index_recent_msg.pb.go | 375 ++ x/oracle/types/index_recent_params.pb.go | 375 ++ x/oracle/types/info.pb.go | 1450 ++++++ x/oracle/types/key_prices.go | 35 + x/oracle/types/key_recent_msg.go | 24 + x/oracle/types/key_recent_params.go | 24 + x/oracle/types/keys.go | 39 + x/oracle/types/message_create_price.go | 45 + x/oracle/types/message_create_price_test.go | 40 + x/oracle/types/params.go | 114 + x/oracle/types/params.pb.go | 583 +++ x/oracle/types/price.pb.go | 1027 +++++ x/oracle/types/prices.pb.go | 401 ++ x/oracle/types/query.pb.go | 3989 +++++++++++++++++ x/oracle/types/query.pb.gw.go | 817 ++++ x/oracle/types/recent_msg.pb.go | 636 +++ x/oracle/types/recent_params.pb.go | 362 ++ x/oracle/types/token_feeder.pb.go | 1057 +++++ x/oracle/types/tx.pb.go | 699 +++ x/oracle/types/types.go | 9 + x/oracle/types/validator_update_block.pb.go | 301 ++ x/oracle/types/validators.pb.go | 586 +++ 50 files changed, 15605 insertions(+) create mode 100644 x/oracle/client/cli/query.go create mode 100644 x/oracle/client/cli/query_index_recent_msg.go create mode 100644 x/oracle/client/cli/query_index_recent_msg_test.go create mode 100644 x/oracle/client/cli/query_index_recent_params.go create mode 100644 x/oracle/client/cli/query_index_recent_params_test.go create mode 100644 x/oracle/client/cli/query_params.go create mode 100644 x/oracle/client/cli/query_prices.go create mode 100644 x/oracle/client/cli/query_prices_test.go create mode 100644 x/oracle/client/cli/query_recent_msg.go create mode 100644 x/oracle/client/cli/query_recent_msg_test.go create mode 100644 x/oracle/client/cli/query_recent_params.go create mode 100644 x/oracle/client/cli/query_recent_params_test.go create mode 100644 x/oracle/client/cli/query_validator_update_block.go create mode 100644 x/oracle/client/cli/query_validator_update_block_test.go create mode 100644 x/oracle/client/cli/tx.go create mode 100644 x/oracle/client/cli/tx_create_price.go create mode 100644 x/oracle/genesis.go create mode 100644 x/oracle/genesis_test.go create mode 100644 x/oracle/module.go create mode 100644 x/oracle/module_simulation.go create mode 100644 x/oracle/simulation/create_price.go create mode 100644 x/oracle/simulation/helpers.go create mode 100644 x/oracle/types/codec.go create mode 100644 x/oracle/types/errors.go create mode 100644 x/oracle/types/expected_keepers.go create mode 100644 x/oracle/types/genesis.go create mode 100644 x/oracle/types/genesis.pb.go create mode 100644 x/oracle/types/genesis_test.go create mode 100644 x/oracle/types/index_recent_msg.pb.go create mode 100644 x/oracle/types/index_recent_params.pb.go create mode 100644 x/oracle/types/info.pb.go create mode 100644 x/oracle/types/key_prices.go create mode 100644 x/oracle/types/key_recent_msg.go create mode 100644 x/oracle/types/key_recent_params.go create mode 100644 x/oracle/types/keys.go create mode 100644 x/oracle/types/message_create_price.go create mode 100644 x/oracle/types/message_create_price_test.go create mode 100644 x/oracle/types/params.go create mode 100644 x/oracle/types/params.pb.go create mode 100644 x/oracle/types/price.pb.go create mode 100644 x/oracle/types/prices.pb.go create mode 100644 x/oracle/types/query.pb.go create mode 100644 x/oracle/types/query.pb.gw.go create mode 100644 x/oracle/types/recent_msg.pb.go create mode 100644 x/oracle/types/recent_params.pb.go create mode 100644 x/oracle/types/token_feeder.pb.go create mode 100644 x/oracle/types/tx.pb.go create mode 100644 x/oracle/types/types.go create mode 100644 x/oracle/types/validator_update_block.pb.go create mode 100644 x/oracle/types/validators.pb.go diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go new file mode 100644 index 000000000..81d7a0d12 --- /dev/null +++ b/x/oracle/client/cli/query.go @@ -0,0 +1,40 @@ +package cli + +import ( + "fmt" + // "strings" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + // sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd(queryRoute string) *cobra.Command { + // Group oracle queries under a subcommand + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(CmdQueryParams()) + //cmd.AddCommand(CmdListPrices()) + cmd.AddCommand(CmdShowPrices()) + cmd.AddCommand(CmdShowValidatorUpdateBlock()) + cmd.AddCommand(CmdShowIndexRecentParams()) + cmd.AddCommand(CmdShowIndexRecentMsg()) + cmd.AddCommand(CmdListRecentMsg()) + cmd.AddCommand(CmdShowRecentMsg()) + cmd.AddCommand(CmdListRecentParams()) + cmd.AddCommand(CmdShowRecentParams()) + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/oracle/client/cli/query_index_recent_msg.go b/x/oracle/client/cli/query_index_recent_msg.go new file mode 100644 index 000000000..26d62a767 --- /dev/null +++ b/x/oracle/client/cli/query_index_recent_msg.go @@ -0,0 +1,38 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func CmdShowIndexRecentMsg() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-index-recent-msg", + Short: "shows indexRecentMsg", + 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) + + params := &types.QueryGetIndexRecentMsgRequest{} + + res, err := queryClient.IndexRecentMsg(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_index_recent_msg_test.go b/x/oracle/client/cli/query_index_recent_msg_test.go new file mode 100644 index 000000000..bed12b0cc --- /dev/null +++ b/x/oracle/client/cli/query_index_recent_msg_test.go @@ -0,0 +1,71 @@ +package cli_test + +import ( + "fmt" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func networkWithIndexRecentMsgObjects(t *testing.T) (*network.Network, types.IndexRecentMsg) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + indexRecentMsg := &types.IndexRecentMsg{} + nullify.Fill(&indexRecentMsg) + state.IndexRecentMsg = indexRecentMsg + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), *state.IndexRecentMsg +} + +func TestShowIndexRecentMsg(t *testing.T) { + net, obj := networkWithIndexRecentMsgObjects(t) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + args []string + err error + obj types.IndexRecentMsg + }{ + { + desc: "get", + args: common, + obj: obj, + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + var args []string + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowIndexRecentMsg(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetIndexRecentMsgResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.IndexRecentMsg) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.IndexRecentMsg), + ) + } + }) + } +} diff --git a/x/oracle/client/cli/query_index_recent_params.go b/x/oracle/client/cli/query_index_recent_params.go new file mode 100644 index 000000000..15a9a6575 --- /dev/null +++ b/x/oracle/client/cli/query_index_recent_params.go @@ -0,0 +1,38 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func CmdShowIndexRecentParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-index-recent-params", + Short: "shows indexRecentParams", + 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) + + params := &types.QueryGetIndexRecentParamsRequest{} + + res, err := queryClient.IndexRecentParams(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_index_recent_params_test.go b/x/oracle/client/cli/query_index_recent_params_test.go new file mode 100644 index 000000000..3d61343a5 --- /dev/null +++ b/x/oracle/client/cli/query_index_recent_params_test.go @@ -0,0 +1,71 @@ +package cli_test + +import ( + "fmt" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func networkWithIndexRecentParamsObjects(t *testing.T) (*network.Network, types.IndexRecentParams) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + indexRecentParams := &types.IndexRecentParams{} + nullify.Fill(&indexRecentParams) + state.IndexRecentParams = indexRecentParams + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), *state.IndexRecentParams +} + +func TestShowIndexRecentParams(t *testing.T) { + net, obj := networkWithIndexRecentParamsObjects(t) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + args []string + err error + obj types.IndexRecentParams + }{ + { + desc: "get", + args: common, + obj: obj, + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + var args []string + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowIndexRecentParams(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetIndexRecentParamsResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.IndexRecentParams) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.IndexRecentParams), + ) + } + }) + } +} diff --git a/x/oracle/client/cli/query_params.go b/x/oracle/client/cli/query_params.go new file mode 100644 index 000000000..84bfc3da5 --- /dev/null +++ b/x/oracle/client/cli/query_params.go @@ -0,0 +1,36 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func CmdQueryParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "params", + Short: "shows the parameters of the 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) + + res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_prices.go b/x/oracle/client/cli/query_prices.go new file mode 100644 index 000000000..50050446b --- /dev/null +++ b/x/oracle/client/cli/query_prices.go @@ -0,0 +1,82 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/spf13/cast" +) + +//func CmdListPrices() *cobra.Command { +// cmd := &cobra.Command{ +// Use: "list-prices", +// Short: "list all prices", +// RunE: func(cmd *cobra.Command, args []string) error { +// clientCtx, err := client.GetClientQueryContext(cmd) +// if err != nil { +// return err +// } +// +// pageReq, err := client.ReadPageRequest(cmd.Flags()) +// if err != nil { +// return err +// } +// +// queryClient := types.NewQueryClient(clientCtx) +// +// params := &types.QueryAllPricesRequest{ +// Pagination: pageReq, +// } +// +// res, err := queryClient.PricesAll(cmd.Context(), params) +// if err != nil { +// return err +// } +// +// return clientCtx.PrintProto(res) +// }, +// } +// +// flags.AddPaginationFlagsToCmd(cmd, cmd.Use) +// flags.AddQueryFlagsToCmd(cmd) +// +// return cmd +//} + +func CmdShowPrices() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-prices [token-id]", + Short: "shows a prices", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + argTokenId, err := cast.ToInt32E(args[0]) + if err != nil { + return err + } + + params := &types.QueryGetPricesRequest{ + TokenId: argTokenId, + } + + res, err := queryClient.Prices(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_prices_test.go b/x/oracle/client/cli/query_prices_test.go new file mode 100644 index 000000000..48346ecb2 --- /dev/null +++ b/x/oracle/client/cli/query_prices_test.go @@ -0,0 +1,159 @@ +package cli_test + +import ( + "fmt" + "strconv" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func networkWithPricesObjects(t *testing.T, n int) (*network.Network, []types.Prices) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + for i := 0; i < n; i++ { + prices := types.Prices{ + TokenId: int32(i), + } + nullify.Fill(&prices) + state.PricesList = append(state.PricesList, prices) + } + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.PricesList +} + +func TestShowPrices(t *testing.T) { + net, objs := networkWithPricesObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + idTokenId int32 + + args []string + err error + obj types.Prices + }{ + { + desc: "found", + idTokenId: objs[0].TokenId, + + args: common, + obj: objs[0], + }, + { + desc: "not found", + idTokenId: 100000, + + args: common, + err: status.Error(codes.NotFound, "not found"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + args := []string{ + strconv.Itoa(int(tc.idTokenId)), + } + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowPrices(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetPricesResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.Prices) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.Prices), + ) + } + }) + } +} + +//func TestListPrices(t *testing.T) { +// net, objs := networkWithPricesObjects(t, 5) +// +// ctx := net.Validators[0].ClientCtx +// request := func(next []byte, offset, limit uint64, total bool) []string { +// args := []string{ +// fmt.Sprintf("--%s=json", tmcli.OutputFlag), +// } +// if next == nil { +// args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) +// } else { +// args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) +// } +// args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) +// if total { +// args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) +// } +// return args +// } +// t.Run("ByOffset", func(t *testing.T) { +// step := 2 +// for i := 0; i < len(objs); i += step { +// args := request(nil, uint64(i), uint64(step), false) +// out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListPrices(), args) +// require.NoError(t, err) +// var resp types.QueryAllPricesResponse +// require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) +// require.LessOrEqual(t, len(resp.Prices), step) +// require.Subset(t, +// nullify.Fill(objs), +// nullify.Fill(resp.Prices), +// ) +// } +// }) +// t.Run("ByKey", func(t *testing.T) { +// step := 2 +// var next []byte +// for i := 0; i < len(objs); i += step { +// args := request(next, 0, uint64(step), false) +// out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListPrices(), args) +// require.NoError(t, err) +// var resp types.QueryAllPricesResponse +// require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) +// require.LessOrEqual(t, len(resp.Prices), step) +// require.Subset(t, +// nullify.Fill(objs), +// nullify.Fill(resp.Prices), +// ) +// next = resp.Pagination.NextKey +// } +// }) +// t.Run("Total", func(t *testing.T) { +// args := request(nil, 0, uint64(len(objs)), true) +// out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListPrices(), args) +// require.NoError(t, err) +// var resp types.QueryAllPricesResponse +// require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) +// require.NoError(t, err) +// require.Equal(t, len(objs), int(resp.Pagination.Total)) +// require.ElementsMatch(t, +// nullify.Fill(objs), +// nullify.Fill(resp.Prices), +// ) +// }) +//} diff --git a/x/oracle/client/cli/query_recent_msg.go b/x/oracle/client/cli/query_recent_msg.go new file mode 100644 index 000000000..bdad4a8b1 --- /dev/null +++ b/x/oracle/client/cli/query_recent_msg.go @@ -0,0 +1,82 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/spf13/cast" +) + +func CmdListRecentMsg() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-recent-msg", + Short: "list all recentMsg", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllRecentMsgRequest{ + Pagination: pageReq, + } + + res, err := queryClient.RecentMsgAll(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowRecentMsg() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-recent-msg [block]", + Short: "shows a recentMsg", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + argBlock, err := cast.ToUint64E(args[0]) + if err != nil { + return err + } + + params := &types.QueryGetRecentMsgRequest{ + Block: argBlock, + } + + res, err := queryClient.RecentMsg(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_recent_msg_test.go b/x/oracle/client/cli/query_recent_msg_test.go new file mode 100644 index 000000000..4d2623958 --- /dev/null +++ b/x/oracle/client/cli/query_recent_msg_test.go @@ -0,0 +1,160 @@ +package cli_test + +import ( + "fmt" + "strconv" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func networkWithRecentMsgObjects(t *testing.T, n int) (*network.Network, []types.RecentMsg) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + for i := 0; i < n; i++ { + recentMsg := types.RecentMsg{ + Block: uint64(i), + } + nullify.Fill(&recentMsg) + state.RecentMsgList = append(state.RecentMsgList, recentMsg) + } + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.RecentMsgList +} + +func TestShowRecentMsg(t *testing.T) { + net, objs := networkWithRecentMsgObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + idBlock uint64 + + args []string + err error + obj types.RecentMsg + }{ + { + desc: "found", + idBlock: objs[0].Block, + + args: common, + obj: objs[0], + }, + { + desc: "not found", + idBlock: 100000, + + args: common, + err: status.Error(codes.NotFound, "not found"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + args := []string{ + strconv.Itoa(int(tc.idBlock)), + } + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowRecentMsg(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetRecentMsgResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.RecentMsg) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.RecentMsg), + ) + } + }) + } +} + +func TestListRecentMsg(t *testing.T) { + net, objs := networkWithRecentMsgObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(objs); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRecentMsg(), args) + require.NoError(t, err) + var resp types.QueryAllRecentMsgResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.RecentMsg), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.RecentMsg), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRecentMsg(), args) + require.NoError(t, err) + var resp types.QueryAllRecentMsgResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.RecentMsg), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.RecentMsg), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(objs)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRecentMsg(), args) + require.NoError(t, err) + var resp types.QueryAllRecentMsgResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(objs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(objs), + nullify.Fill(resp.RecentMsg), + ) + }) +} diff --git a/x/oracle/client/cli/query_recent_params.go b/x/oracle/client/cli/query_recent_params.go new file mode 100644 index 000000000..04f848658 --- /dev/null +++ b/x/oracle/client/cli/query_recent_params.go @@ -0,0 +1,82 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/spf13/cast" +) + +func CmdListRecentParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-recent-params", + Short: "list all recentParams", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllRecentParamsRequest{ + Pagination: pageReq, + } + + res, err := queryClient.RecentParamsAll(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowRecentParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-recent-params [block]", + Short: "shows a recentParams", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + argBlock, err := cast.ToUint64E(args[0]) + if err != nil { + return err + } + + params := &types.QueryGetRecentParamsRequest{ + Block: argBlock, + } + + res, err := queryClient.RecentParams(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_recent_params_test.go b/x/oracle/client/cli/query_recent_params_test.go new file mode 100644 index 000000000..332910d90 --- /dev/null +++ b/x/oracle/client/cli/query_recent_params_test.go @@ -0,0 +1,160 @@ +package cli_test + +import ( + "fmt" + "strconv" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func networkWithRecentParamsObjects(t *testing.T, n int) (*network.Network, []types.RecentParams) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + for i := 0; i < n; i++ { + recentParams := types.RecentParams{ + Block: uint64(i), + } + nullify.Fill(&recentParams) + state.RecentParamsList = append(state.RecentParamsList, recentParams) + } + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.RecentParamsList +} + +func TestShowRecentParams(t *testing.T) { + net, objs := networkWithRecentParamsObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + idBlock uint64 + + args []string + err error + obj types.RecentParams + }{ + { + desc: "found", + idBlock: objs[0].Block, + + args: common, + obj: objs[0], + }, + { + desc: "not found", + idBlock: 100000, + + args: common, + err: status.Error(codes.NotFound, "not found"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + args := []string{ + strconv.Itoa(int(tc.idBlock)), + } + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowRecentParams(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetRecentParamsResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.RecentParams) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.RecentParams), + ) + } + }) + } +} + +func TestListRecentParams(t *testing.T) { + net, objs := networkWithRecentParamsObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(objs); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRecentParams(), args) + require.NoError(t, err) + var resp types.QueryAllRecentParamsResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.RecentParams), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.RecentParams), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRecentParams(), args) + require.NoError(t, err) + var resp types.QueryAllRecentParamsResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.RecentParams), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.RecentParams), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(objs)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListRecentParams(), args) + require.NoError(t, err) + var resp types.QueryAllRecentParamsResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(objs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(objs), + nullify.Fill(resp.RecentParams), + ) + }) +} diff --git a/x/oracle/client/cli/query_validator_update_block.go b/x/oracle/client/cli/query_validator_update_block.go new file mode 100644 index 000000000..c6ed7ff9d --- /dev/null +++ b/x/oracle/client/cli/query_validator_update_block.go @@ -0,0 +1,38 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func CmdShowValidatorUpdateBlock() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-validator-update-block", + Short: "shows validatorUpdateBlock", + 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) + + params := &types.QueryGetValidatorUpdateBlockRequest{} + + res, err := queryClient.ValidatorUpdateBlock(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/client/cli/query_validator_update_block_test.go b/x/oracle/client/cli/query_validator_update_block_test.go new file mode 100644 index 000000000..02ed90808 --- /dev/null +++ b/x/oracle/client/cli/query_validator_update_block_test.go @@ -0,0 +1,71 @@ +package cli_test + +import ( + "fmt" + "testing" + + tmcli "github.com/cometbft/cometbft/libs/cli" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/status" + + "github.com/ExocoreNetwork/exocore/testutil/network" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func networkWithValidatorUpdateBlockObjects(t *testing.T) (*network.Network, types.ValidatorUpdateBlock) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + validatorUpdateBlock := &types.ValidatorUpdateBlock{} + nullify.Fill(&validatorUpdateBlock) + state.ValidatorUpdateBlock = validatorUpdateBlock + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), *state.ValidatorUpdateBlock +} + +func TestShowValidatorUpdateBlock(t *testing.T) { + net, obj := networkWithValidatorUpdateBlockObjects(t) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + args []string + err error + obj types.ValidatorUpdateBlock + }{ + { + desc: "get", + args: common, + obj: obj, + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + var args []string + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowValidatorUpdateBlock(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetValidatorUpdateBlockResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.ValidatorUpdateBlock) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.ValidatorUpdateBlock), + ) + } + }) + } +} diff --git a/x/oracle/client/cli/tx.go b/x/oracle/client/cli/tx.go new file mode 100644 index 000000000..dbcac318e --- /dev/null +++ b/x/oracle/client/cli/tx.go @@ -0,0 +1,37 @@ +package cli + +import ( + "fmt" + "time" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +var ( + DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) +) + +const ( + flagPacketTimeoutTimestamp = "packet-timeout-timestamp" + listSeparator = "," +) + +// GetTxCmd returns the transaction commands for this module +func GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(CmdCreatePrice()) + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/oracle/client/cli/tx_create_price.go b/x/oracle/client/cli/tx_create_price.go new file mode 100644 index 000000000..75b30e996 --- /dev/null +++ b/x/oracle/client/cli/tx_create_price.go @@ -0,0 +1,40 @@ +package cli + +import ( + "strconv" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdCreatePrice() *cobra.Command { + cmd := &cobra.Command{ + Use: "create-price", + Short: "Broadcast message create-price", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgCreatePrice( + clientCtx.GetFromAddress().String(), + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/oracle/genesis.go b/x/oracle/genesis.go new file mode 100644 index 000000000..d3037f960 --- /dev/null +++ b/x/oracle/genesis.go @@ -0,0 +1,65 @@ +package oracle + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// InitGenesis initializes the module's state from a provided genesis state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + // Set all the prices + for _, elem := range genState.PricesList { + k.SetPrices(ctx, elem) + } + // Set if defined + if genState.ValidatorUpdateBlock != nil { + k.SetValidatorUpdateBlock(ctx, *genState.ValidatorUpdateBlock) + } + // Set if defined + if genState.IndexRecentParams != nil { + k.SetIndexRecentParams(ctx, *genState.IndexRecentParams) + } + // Set if defined + if genState.IndexRecentMsg != nil { + k.SetIndexRecentMsg(ctx, *genState.IndexRecentMsg) + } + // Set all the recentMsg + for _, elem := range genState.RecentMsgList { + k.SetRecentMsg(ctx, elem) + } + // Set all the recentParams + for _, elem := range genState.RecentParamsList { + k.SetRecentParams(ctx, elem) + } + // this line is used by starport scaffolding # genesis/module/init + k.SetParams(ctx, genState.Params) +} + +// ExportGenesis returns the module's exported genesis +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + genesis := types.DefaultGenesis() + genesis.Params = k.GetParams(ctx) + + genesis.PricesList = k.GetAllPrices(ctx) + // Get all validatorUpdateBlock + validatorUpdateBlock, found := k.GetValidatorUpdateBlock(ctx) + if found { + genesis.ValidatorUpdateBlock = &validatorUpdateBlock + } + // Get all indexRecentParams + indexRecentParams, found := k.GetIndexRecentParams(ctx) + if found { + genesis.IndexRecentParams = &indexRecentParams + } + // Get all indexRecentMsg + indexRecentMsg, found := k.GetIndexRecentMsg(ctx) + if found { + genesis.IndexRecentMsg = &indexRecentMsg + } + genesis.RecentMsgList = k.GetAllRecentMsg(ctx) + genesis.RecentParamsList = k.GetAllRecentParams(ctx) + // this line is used by starport scaffolding # genesis/module/export + + return genesis +} diff --git a/x/oracle/genesis_test.go b/x/oracle/genesis_test.go new file mode 100644 index 000000000..23f63bbb6 --- /dev/null +++ b/x/oracle/genesis_test.go @@ -0,0 +1,86 @@ +package oracle_test + +import ( + "testing" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/stretchr/testify/require" +) + +func TestGenesis(t *testing.T) { + genesisState := types.GenesisState{ + Params: types.DefaultParams(), + + PricesList: []types.Prices{ + { + TokenId: 1, + PriceList: []*types.PriceWithTimeAndRound{ + { + Price: "100", + Decimal: 1, + Timestamp: "-", + RoundId: 1, + }, + }, + NextRountId: 2, + }, + { + TokenId: 2, + PriceList: []*types.PriceWithTimeAndRound{ + { + Price: "109", + Decimal: 1, + Timestamp: "-", + RoundId: 1, + }, + { + Price: "119", + Decimal: 1, + Timestamp: "-", + RoundId: 2, + }, + }, + NextRountId: 3, + }, + }, + ValidatorUpdateBlock: &types.ValidatorUpdateBlock{}, + IndexRecentParams: &types.IndexRecentParams{}, + IndexRecentMsg: &types.IndexRecentMsg{}, + RecentMsgList: []types.RecentMsg{ + { + Block: 0, + }, + { + Block: 1, + }, + }, + RecentParamsList: []types.RecentParams{ + { + Block: 0, + }, + { + Block: 1, + }, + }, + // this line is used by starport scaffolding # genesis/test/state + } + + k, ctx := keepertest.OracleKeeper(t) + oracle.InitGenesis(ctx, *k, genesisState) + got := oracle.ExportGenesis(ctx, *k) + require.NotNil(t, got) + + nullify.Fill(&genesisState) + nullify.Fill(got) + + require.ElementsMatch(t, genesisState.PricesList, got.PricesList) + require.Equal(t, genesisState.ValidatorUpdateBlock, got.ValidatorUpdateBlock) + require.Equal(t, genesisState.IndexRecentParams, got.IndexRecentParams) + require.Equal(t, genesisState.IndexRecentMsg, got.IndexRecentMsg) + require.ElementsMatch(t, genesisState.RecentMsgList, got.RecentMsgList) + require.ElementsMatch(t, genesisState.RecentParamsList, got.RecentParamsList) + // this line is used by starport scaffolding # genesis/test/assert +} diff --git a/x/oracle/module.go b/x/oracle/module.go new file mode 100644 index 000000000..2b6b2aec3 --- /dev/null +++ b/x/oracle/module.go @@ -0,0 +1,201 @@ +package oracle + +import ( + "context" + "encoding/json" + "fmt" + "math/big" + + // this line is used by starport scaffolding # 1 + + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + "github.com/ExocoreNetwork/exocore/x/oracle/client/cli" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/cache" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "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/module" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface that defines the independent methods a Cosmos SDK module needs to implement. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the name of the module as a string +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec registers the amino codec for the module, which is used to marshal and unmarshal structs to/from []byte in order to persist them in the module's KVStore +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +// RegisterInterfaces registers a module's interface types and their concrete implementations as proto.Message +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns a default GenesisState for the module, marshalled to json.RawMessage. The default GenesisState need to be defined by the module developer and is primarily used for testing +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis used to validate the GenesisState, given in its json.RawMessage form +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) +} + +// GetTxCmd returns the root Tx command for the module. The subcommands of this root command are used by end-users to generate new transactions containing messages defined in the module +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the root query command for the module. The subcommands of this root command are used by end-users to generate new queries to the subset of the state defined by the module +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd(types.StoreKey) +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface that defines the inter-dependent methods that modules need to implement +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper +} + +func NewAppModule( + cdc codec.Codec, + keeper keeper.Keeper, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + } +} + +// RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted) +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the module's genesis initialization. It returns no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, genState) + + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +// 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 (AppModule) ConsensusVersion() uint64 { return 1 } + +// BeginBlock contains the logic that is automatically triggered at the beginning of each block +func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} + +// EndBlock contains the logic that is automatically triggered at the end of each block +func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + //TODO: + //1. check validator update + //if {validatorSetUpdate} -> update roundInfo(seal all active) + //check roundInfo -> seal {success, fail} + //{params} -> prepareRoundInfo + //sealRounds() -> prepareRounds() + // am.keeper.GetCaches().CommitCache(ctx, true, am.keeper) + //TODO: udpate the validatorset first + cs := keeper.GetCaches() + validatorUpdates := am.keeper.GetValidatorUpdates(ctx) + forceSeal := false + agc := keeper.GetAggregatorContext(ctx, am.keeper) + + if len(validatorUpdates) > 0 { + //validatorUpdates := am.keeper.GetValidatorUpdates(ctx) + validatorList := make(map[string]*big.Int) + for _, vu := range validatorUpdates { + pubKey, _ := cryptocodec.FromTmProtoPublicKey(vu.PubKey) + validator, _ := am.keeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pubKey)) + validatorList[validator.OperatorAddress] = big.NewInt(vu.Power) + } + // cs.AddCache(validatorList, am.keeper) + validatorPowers := make(map[string]*big.Int) + cs.GetCache(cache.CacheItemV(validatorPowers)) + //update validatorPowerList in aggregatorContext + // keeper.GetAggregatorContext(ctx, am.keeper).SetValidatorPowers(validatorPowers) + // agc := keeper.GetAggregatorContext(ctx, am.keeper) + agc.SetValidatorPowers(validatorPowers) + //TODO: seal all alive round since validatorSet changed here + forceSeal = true + } + + //TODO: for v1 use mode==1, just check the failed feeders + _, failed := agc.SealRound(ctx, forceSeal) + //append new round with previous price for fail-seal token + for _, tokenId := range failed { + if pTR, ok := am.keeper.GetPriceTRLatest(ctx, tokenId); ok { + pTR.RoundId++ + am.keeper.AppendPriceTR(ctx, tokenId, pTR) + } else { + nextRoundId := am.keeper.GetNextRoundId(ctx, tokenId) + am.keeper.AppendPriceTR(ctx, tokenId, types.PriceWithTimeAndRound{ + RoundId: nextRoundId, + }) + } + } + + agc.PrepareRound(ctx, 0) + + cs.CommitCache(ctx, true, am.keeper) + return []abci.ValidatorUpdate{} +} diff --git a/x/oracle/module_simulation.go b/x/oracle/module_simulation.go new file mode 100644 index 000000000..8301eba8f --- /dev/null +++ b/x/oracle/module_simulation.go @@ -0,0 +1,87 @@ +package oracle + +import ( + "math/rand" + + "github.com/ExocoreNetwork/exocore/testutil/sample" + oraclesimulation "github.com/ExocoreNetwork/exocore/x/oracle/simulation" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" +) + +// avoid unused import issue +var ( + _ = sample.AccAddress + _ = oraclesimulation.FindAccount + _ = simulation.MsgEntryKind + _ = baseapp.Paramspace + _ = rand.Rand{} +) + +const ( + opWeightMsgCreatePrice = "op_weight_msg_create_price" + // TODO: Determine the simulation weight value + defaultWeightMsgCreatePrice int = 100 + + // this line is used by starport scaffolding # simapp/module/const +) + +// GenerateGenesisState creates a randomized GenState of the module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + accs := make([]string, len(simState.Accounts)) + for i, acc := range simState.Accounts { + accs[i] = acc.Address.String() + } + oracleGenesis := types.GenesisState{ + Params: types.DefaultParams(), + // this line is used by starport scaffolding # simapp/module/genesisState + } + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&oracleGenesis) +} + +// RegisterStoreDecoder registers a decoder. +func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} + +// ProposalContents doesn't return any content functions for governance proposals. +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + operations := make([]simtypes.WeightedOperation, 0) + + var weightMsgCreatePrice int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgCreatePrice, &weightMsgCreatePrice, nil, + func(_ *rand.Rand) { + weightMsgCreatePrice = defaultWeightMsgCreatePrice + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgCreatePrice, + oraclesimulation.SimulateMsgCreatePrice(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + // this line is used by starport scaffolding # simapp/module/operation + + return operations +} + +// ProposalMsgs returns msgs used for governance proposals for simulations. +func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { + return []simtypes.WeightedProposalMsg{ + simulation.NewWeightedProposalMsg( + opWeightMsgCreatePrice, + defaultWeightMsgCreatePrice, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + oraclesimulation.SimulateMsgCreatePrice(am.accountKeeper, am.bankKeeper, am.keeper) + return nil + }, + ), + // this line is used by starport scaffolding # simapp/module/OpMsg + } +} diff --git a/x/oracle/simulation/create_price.go b/x/oracle/simulation/create_price.go new file mode 100644 index 000000000..55047e3ca --- /dev/null +++ b/x/oracle/simulation/create_price.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +func SimulateMsgCreatePrice( + ak types.AccountKeeper, + bk types.BankKeeper, + k 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) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgCreatePrice{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the CreatePrice simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "CreatePrice simulation not implemented"), nil, nil + } +} diff --git a/x/oracle/simulation/helpers.go b/x/oracle/simulation/helpers.go new file mode 100644 index 000000000..92c437c0d --- /dev/null +++ b/x/oracle/simulation/helpers.go @@ -0,0 +1,15 @@ +package simulation + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +// FindAccount find a specific address from an account list +func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { + creator, err := sdk.AccAddressFromBech32(address) + if err != nil { + panic(err) + } + return simtypes.FindAccount(accs, creator) +} diff --git a/x/oracle/types/codec.go b/x/oracle/types/codec.go new file mode 100644 index 000000000..d8e9b828d --- /dev/null +++ b/x/oracle/types/codec.go @@ -0,0 +1,28 @@ +package types + +import ( + "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/msgservice" +) + +func RegisterCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgCreatePrice{}, "oracle/CreatePrice", nil) + cdc.RegisterConcrete(Params{}, "exocore/x/oracle/Params", nil) + // this line is used by starport scaffolding # 2 +} + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgCreatePrice{}, + ) + // this line is used by starport scaffolding # 3 + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + Amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) +) diff --git a/x/oracle/types/errors.go b/x/oracle/types/errors.go new file mode 100644 index 000000000..6d57a417b --- /dev/null +++ b/x/oracle/types/errors.go @@ -0,0 +1,12 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// x/oracle module sentinel errors +var ( + ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") +) diff --git a/x/oracle/types/expected_keepers.go b/x/oracle/types/expected_keepers.go new file mode 100644 index 000000000..6aa6e9778 --- /dev/null +++ b/x/oracle/types/expected_keepers.go @@ -0,0 +1,18 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +// AccountKeeper defines the expected account keeper used for simulations (noalias) +type AccountKeeper interface { + GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + // Methods imported from account should be defined here +} + +// BankKeeper defines the expected interface needed to retrieve account balances. +type BankKeeper interface { + SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + // Methods imported from bank should be defined here +} diff --git a/x/oracle/types/genesis.go b/x/oracle/types/genesis.go new file mode 100644 index 000000000..bec448bcc --- /dev/null +++ b/x/oracle/types/genesis.go @@ -0,0 +1,60 @@ +package types + +import ( + "fmt" +) + +// DefaultIndex is the default global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + PricesList: []Prices{}, + ValidatorUpdateBlock: nil, + IndexRecentParams: nil, + IndexRecentMsg: nil, + RecentMsgList: []RecentMsg{}, + RecentParamsList: []RecentParams{}, + // this line is used by starport scaffolding # genesis/types/default + Params: DefaultParams(), + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + // Check for duplicated index in prices + pricesIndexMap := make(map[string]struct{}) + + for _, elem := range gs.PricesList { + index := string(PricesKey(elem.TokenId)) + if _, ok := pricesIndexMap[index]; ok { + return fmt.Errorf("duplicated index for prices") + } + pricesIndexMap[index] = struct{}{} + } + // Check for duplicated index in recentMsg + recentMsgIndexMap := make(map[string]struct{}) + + for _, elem := range gs.RecentMsgList { + index := string(RecentMsgKey(elem.Block)) + if _, ok := recentMsgIndexMap[index]; ok { + return fmt.Errorf("duplicated index for recentMsg") + } + recentMsgIndexMap[index] = struct{}{} + } + // Check for duplicated index in recentParams + recentParamsIndexMap := make(map[string]struct{}) + + for _, elem := range gs.RecentParamsList { + index := string(RecentParamsKey(elem.Block)) + if _, ok := recentParamsIndexMap[index]; ok { + return fmt.Errorf("duplicated index for recentParams") + } + recentParamsIndexMap[index] = struct{}{} + } + // this line is used by starport scaffolding # genesis/types/validate + + return gs.Params.Validate() +} diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go new file mode 100644 index 000000000..1006ad547 --- /dev/null +++ b/x/oracle/types/genesis.pb.go @@ -0,0 +1,701 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the oracle module's genesis state. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + PricesList []Prices `protobuf:"bytes,2,rep,name=pricesList,proto3" json:"pricesList"` + //TODO: userDefinedTokenFeeder + ValidatorUpdateBlock *ValidatorUpdateBlock `protobuf:"bytes,4,opt,name=validatorUpdateBlock,proto3" json:"validatorUpdateBlock,omitempty"` + IndexRecentParams *IndexRecentParams `protobuf:"bytes,5,opt,name=indexRecentParams,proto3" json:"indexRecentParams,omitempty"` + IndexRecentMsg *IndexRecentMsg `protobuf:"bytes,6,opt,name=indexRecentMsg,proto3" json:"indexRecentMsg,omitempty"` + RecentMsgList []RecentMsg `protobuf:"bytes,7,rep,name=recentMsgList,proto3" json:"recentMsgList"` + RecentParamsList []RecentParams `protobuf:"bytes,8,rep,name=recentParamsList,proto3" json:"recentParamsList"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_dbe067676c4dc0de, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetPricesList() []Prices { + if m != nil { + return m.PricesList + } + return nil +} + +func (m *GenesisState) GetValidatorUpdateBlock() *ValidatorUpdateBlock { + if m != nil { + return m.ValidatorUpdateBlock + } + return nil +} + +func (m *GenesisState) GetIndexRecentParams() *IndexRecentParams { + if m != nil { + return m.IndexRecentParams + } + return nil +} + +func (m *GenesisState) GetIndexRecentMsg() *IndexRecentMsg { + if m != nil { + return m.IndexRecentMsg + } + return nil +} + +func (m *GenesisState) GetRecentMsgList() []RecentMsg { + if m != nil { + return m.RecentMsgList + } + return nil +} + +func (m *GenesisState) GetRecentParamsList() []RecentParams { + if m != nil { + return m.RecentParamsList + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "exocore.oracle.GenesisState") +} + +func init() { proto.RegisterFile("exocore/oracle/genesis.proto", fileDescriptor_dbe067676c4dc0de) } + +var fileDescriptor_dbe067676c4dc0de = []byte{ + // 401 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xcf, 0x4a, 0xeb, 0x40, + 0x18, 0xc5, 0x93, 0x7b, 0x6b, 0x95, 0x51, 0x8b, 0x0e, 0x45, 0x62, 0x2d, 0x69, 0x2d, 0x0a, 0x05, + 0x21, 0x11, 0x75, 0xe9, 0xaa, 0x50, 0x45, 0xb1, 0x55, 0x22, 0x8a, 0xb8, 0x09, 0x69, 0x3a, 0xc4, + 0xd0, 0x3f, 0x13, 0x66, 0xa6, 0x5a, 0xdf, 0xc1, 0x85, 0x8f, 0xd5, 0x65, 0x97, 0xae, 0x44, 0xda, + 0x17, 0x91, 0xce, 0x24, 0x25, 0x99, 0xc6, 0xee, 0x92, 0x9c, 0xdf, 0x39, 0xf3, 0xe5, 0xcc, 0x07, + 0x8a, 0x68, 0x88, 0x5d, 0x4c, 0x90, 0x89, 0x89, 0xe3, 0x76, 0x91, 0xe9, 0xa1, 0x3e, 0xa2, 0x3e, + 0x35, 0x02, 0x82, 0x19, 0x86, 0xb9, 0x50, 0x35, 0x84, 0x5a, 0xc8, 0x7b, 0xd8, 0xc3, 0x5c, 0x32, + 0x67, 0x4f, 0x82, 0x2a, 0xec, 0x49, 0x19, 0x81, 0x43, 0x9c, 0x1e, 0xfd, 0x4b, 0x24, 0xbe, 0x8b, + 0x22, 0xf1, 0x48, 0x12, 0x5f, 0x9d, 0xae, 0xdf, 0x76, 0x18, 0x26, 0xf6, 0x20, 0x68, 0x3b, 0x0c, + 0xd9, 0xad, 0x2e, 0x76, 0x3b, 0x21, 0x5c, 0x95, 0x60, 0xbf, 0xdf, 0x46, 0x43, 0x9b, 0x20, 0x17, + 0xf5, 0x99, 0x9d, 0x38, 0xf3, 0x70, 0x19, 0xd9, 0xa3, 0x5e, 0x88, 0x95, 0x24, 0x6c, 0x01, 0xa8, + 0xa4, 0x03, 0xf1, 0xb3, 0x2a, 0x1f, 0x19, 0xb0, 0x71, 0x29, 0x4a, 0xbb, 0x67, 0x0e, 0x43, 0xf0, + 0x0c, 0x64, 0x05, 0xa0, 0xa9, 0x65, 0xb5, 0xba, 0x7e, 0xb2, 0x63, 0x24, 0x4b, 0x34, 0xee, 0xb8, + 0x5a, 0xcb, 0x8c, 0xbe, 0x4b, 0x8a, 0x15, 0xb2, 0xf0, 0x1c, 0x00, 0xd1, 0xcc, 0x8d, 0x4f, 0x99, + 0xf6, 0xaf, 0xfc, 0x3f, 0xd5, 0xc9, 0x89, 0xd0, 0x19, 0xe3, 0xe1, 0x13, 0xc8, 0xcf, 0xab, 0x7b, + 0xe0, 0xcd, 0xd5, 0x66, 0xc5, 0x69, 0x19, 0x3e, 0xc1, 0x81, 0x9c, 0xf3, 0x98, 0xc2, 0x5a, 0xa9, + 0x09, 0xf0, 0x16, 0x6c, 0xf3, 0xf6, 0x2c, 0xfe, 0xeb, 0x62, 0x74, 0x6d, 0x85, 0xc7, 0xee, 0xcb, + 0xb1, 0x57, 0x32, 0x68, 0x2d, 0x7a, 0xe1, 0x05, 0xc8, 0xc5, 0x3e, 0x36, 0xa8, 0xa7, 0x65, 0x79, + 0x9a, 0xbe, 0x24, 0xad, 0x41, 0x3d, 0x4b, 0x72, 0xc1, 0x3a, 0xd8, 0x24, 0xd1, 0x0b, 0xef, 0x6c, + 0x95, 0x77, 0xb6, 0x2b, 0xc7, 0xcc, 0x1d, 0x61, 0x6d, 0x49, 0x17, 0x6c, 0x82, 0x2d, 0x12, 0x1b, + 0x8f, 0x27, 0xad, 0xf1, 0xa4, 0x62, 0x7a, 0x52, 0xe2, 0xf6, 0x16, 0xbc, 0xb5, 0xeb, 0xd1, 0x44, + 0x57, 0xc7, 0x13, 0x5d, 0xfd, 0x99, 0xe8, 0xea, 0xe7, 0x54, 0x57, 0xc6, 0x53, 0x5d, 0xf9, 0x9a, + 0xea, 0xca, 0xf3, 0xb1, 0xe7, 0xb3, 0x97, 0x41, 0xcb, 0x70, 0x71, 0xcf, 0xac, 0x8b, 0xe4, 0x26, + 0x62, 0x6f, 0x98, 0x74, 0xcc, 0x68, 0xcd, 0x86, 0xd1, 0xa2, 0xb1, 0xf7, 0x00, 0xd1, 0x56, 0x96, + 0x6f, 0xd8, 0xe9, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x16, 0x5e, 0xb3, 0x10, 0xa4, 0x03, 0x00, + 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RecentParamsList) > 0 { + for iNdEx := len(m.RecentParamsList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RecentParamsList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if len(m.RecentMsgList) > 0 { + for iNdEx := len(m.RecentMsgList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RecentMsgList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if m.IndexRecentMsg != nil { + { + size, err := m.IndexRecentMsg.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.IndexRecentParams != nil { + { + size, err := m.IndexRecentParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.ValidatorUpdateBlock != nil { + { + size, err := m.ValidatorUpdateBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.PricesList) > 0 { + for iNdEx := len(m.PricesList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PricesList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.PricesList) > 0 { + for _, e := range m.PricesList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.ValidatorUpdateBlock != nil { + l = m.ValidatorUpdateBlock.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.IndexRecentParams != nil { + l = m.IndexRecentParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.IndexRecentMsg != nil { + l = m.IndexRecentMsg.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.RecentMsgList) > 0 { + for _, e := range m.RecentMsgList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.RecentParamsList) > 0 { + for _, e := range m.RecentParamsList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PricesList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PricesList = append(m.PricesList, Prices{}) + if err := m.PricesList[len(m.PricesList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorUpdateBlock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorUpdateBlock == nil { + m.ValidatorUpdateBlock = &ValidatorUpdateBlock{} + } + if err := m.ValidatorUpdateBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IndexRecentParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IndexRecentParams == nil { + m.IndexRecentParams = &IndexRecentParams{} + } + if err := m.IndexRecentParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IndexRecentMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IndexRecentMsg == nil { + m.IndexRecentMsg = &IndexRecentMsg{} + } + if err := m.IndexRecentMsg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecentMsgList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RecentMsgList = append(m.RecentMsgList, RecentMsg{}) + if err := m.RecentMsgList[len(m.RecentMsgList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecentParamsList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RecentParamsList = append(m.RecentParamsList, RecentParams{}) + if err := m.RecentParamsList[len(m.RecentParamsList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/genesis_test.go b/x/oracle/types/genesis_test.go new file mode 100644 index 000000000..5190f66f3 --- /dev/null +++ b/x/oracle/types/genesis_test.go @@ -0,0 +1,110 @@ +package types_test + +import ( + "testing" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/stretchr/testify/require" +) + +func TestGenesisState_Validate(t *testing.T) { + tests := []struct { + desc string + genState *types.GenesisState + valid bool + }{ + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + + PricesList: []types.Prices{ + { + TokenId: 0, + }, + { + TokenId: 1, + }, + }, + ValidatorUpdateBlock: &types.ValidatorUpdateBlock{}, + IndexRecentParams: &types.IndexRecentParams{}, + IndexRecentMsg: &types.IndexRecentMsg{}, + RecentMsgList: []types.RecentMsg{ + { + Block: 0, + }, + { + Block: 1, + }, + }, + RecentParamsList: []types.RecentParams{ + { + Block: 0, + }, + { + Block: 1, + }, + }, + // this line is used by starport scaffolding # types/genesis/validField + }, + valid: true, + }, + { + desc: "duplicated prices", + genState: &types.GenesisState{ + PricesList: []types.Prices{ + { + TokenId: 0, + }, + { + TokenId: 0, + }, + }, + }, + valid: false, + }, + { + desc: "duplicated recentMsg", + genState: &types.GenesisState{ + RecentMsgList: []types.RecentMsg{ + { + Block: 0, + }, + { + Block: 0, + }, + }, + }, + valid: false, + }, + { + desc: "duplicated recentParams", + genState: &types.GenesisState{ + RecentParamsList: []types.RecentParams{ + { + Block: 0, + }, + { + Block: 0, + }, + }, + }, + valid: false, + }, + // this line is used by starport scaffolding # types/genesis/testcase + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} diff --git a/x/oracle/types/index_recent_msg.pb.go b/x/oracle/types/index_recent_msg.pb.go new file mode 100644 index 000000000..379fbdc5d --- /dev/null +++ b/x/oracle/types/index_recent_msg.pb.go @@ -0,0 +1,375 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/index_recent_msg.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type IndexRecentMsg struct { + Index []uint64 `protobuf:"varint,1,rep,packed,name=index,proto3" json:"index,omitempty"` +} + +func (m *IndexRecentMsg) Reset() { *m = IndexRecentMsg{} } +func (m *IndexRecentMsg) String() string { return proto.CompactTextString(m) } +func (*IndexRecentMsg) ProtoMessage() {} +func (*IndexRecentMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_5de0367cab17dc5d, []int{0} +} +func (m *IndexRecentMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IndexRecentMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IndexRecentMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IndexRecentMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndexRecentMsg.Merge(m, src) +} +func (m *IndexRecentMsg) XXX_Size() int { + return m.Size() +} +func (m *IndexRecentMsg) XXX_DiscardUnknown() { + xxx_messageInfo_IndexRecentMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_IndexRecentMsg proto.InternalMessageInfo + +func (m *IndexRecentMsg) GetIndex() []uint64 { + if m != nil { + return m.Index + } + return nil +} + +func init() { + proto.RegisterType((*IndexRecentMsg)(nil), "exocore.oracle.IndexRecentMsg") +} + +func init() { + proto.RegisterFile("exocore/oracle/index_recent_msg.proto", fileDescriptor_5de0367cab17dc5d) +} + +var fileDescriptor_5de0367cab17dc5d = []byte{ + // 165 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0xcf, 0xcc, 0x4b, 0x49, 0xad, + 0x88, 0x2f, 0x4a, 0x4d, 0x4e, 0xcd, 0x2b, 0x89, 0xcf, 0x2d, 0x4e, 0xd7, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0xe2, 0x83, 0x2a, 0xd3, 0x83, 0x28, 0x53, 0x52, 0xe3, 0xe2, 0xf3, 0x04, 0xa9, 0x0c, + 0x02, 0x2b, 0xf4, 0x2d, 0x4e, 0x17, 0x12, 0xe1, 0x62, 0x05, 0xeb, 0x95, 0x60, 0x54, 0x60, 0xd6, + 0x60, 0x09, 0x82, 0x70, 0x9c, 0xbc, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, + 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, + 0xca, 0x20, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0xdf, 0x15, 0x62, 0xb8, + 0x5f, 0x6a, 0x49, 0x79, 0x7e, 0x51, 0xb6, 0x3e, 0xcc, 0x49, 0x15, 0x30, 0x47, 0x95, 0x54, 0x16, + 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x9d, 0x62, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xaf, 0xa3, 0x86, + 0x65, 0xb3, 0x00, 0x00, 0x00, +} + +func (m *IndexRecentMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IndexRecentMsg) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IndexRecentMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Index) > 0 { + dAtA2 := make([]byte, len(m.Index)*10) + var j1 int + for _, num := range m.Index { + for num >= 1<<7 { + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA2[j1] = uint8(num) + j1++ + } + i -= j1 + copy(dAtA[i:], dAtA2[:j1]) + i = encodeVarintIndexRecentMsg(dAtA, i, uint64(j1)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintIndexRecentMsg(dAtA []byte, offset int, v uint64) int { + offset -= sovIndexRecentMsg(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *IndexRecentMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Index) > 0 { + l = 0 + for _, e := range m.Index { + l += sovIndexRecentMsg(uint64(e)) + } + n += 1 + sovIndexRecentMsg(uint64(l)) + l + } + return n +} + +func sovIndexRecentMsg(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozIndexRecentMsg(x uint64) (n int) { + return sovIndexRecentMsg(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *IndexRecentMsg) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIndexRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IndexRecentMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IndexRecentMsg: 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 ErrIntOverflowIndexRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Index = append(m.Index, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIndexRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthIndexRecentMsg + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthIndexRecentMsg + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Index) == 0 { + m.Index = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIndexRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Index = append(m.Index, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipIndexRecentMsg(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIndexRecentMsg + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipIndexRecentMsg(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowIndexRecentMsg + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowIndexRecentMsg + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowIndexRecentMsg + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthIndexRecentMsg + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupIndexRecentMsg + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthIndexRecentMsg + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthIndexRecentMsg = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowIndexRecentMsg = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupIndexRecentMsg = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/index_recent_params.pb.go b/x/oracle/types/index_recent_params.pb.go new file mode 100644 index 000000000..e718b1a85 --- /dev/null +++ b/x/oracle/types/index_recent_params.pb.go @@ -0,0 +1,375 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/index_recent_params.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type IndexRecentParams struct { + Index []uint64 `protobuf:"varint,1,rep,packed,name=index,proto3" json:"index,omitempty"` +} + +func (m *IndexRecentParams) Reset() { *m = IndexRecentParams{} } +func (m *IndexRecentParams) String() string { return proto.CompactTextString(m) } +func (*IndexRecentParams) ProtoMessage() {} +func (*IndexRecentParams) Descriptor() ([]byte, []int) { + return fileDescriptor_1e3da2c92dc64d5c, []int{0} +} +func (m *IndexRecentParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IndexRecentParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IndexRecentParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IndexRecentParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndexRecentParams.Merge(m, src) +} +func (m *IndexRecentParams) XXX_Size() int { + return m.Size() +} +func (m *IndexRecentParams) XXX_DiscardUnknown() { + xxx_messageInfo_IndexRecentParams.DiscardUnknown(m) +} + +var xxx_messageInfo_IndexRecentParams proto.InternalMessageInfo + +func (m *IndexRecentParams) GetIndex() []uint64 { + if m != nil { + return m.Index + } + return nil +} + +func init() { + proto.RegisterType((*IndexRecentParams)(nil), "exocore.oracle.IndexRecentParams") +} + +func init() { + proto.RegisterFile("exocore/oracle/index_recent_params.proto", fileDescriptor_1e3da2c92dc64d5c) +} + +var fileDescriptor_1e3da2c92dc64d5c = []byte{ + // 168 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x48, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0xcf, 0xcc, 0x4b, 0x49, 0xad, + 0x88, 0x2f, 0x4a, 0x4d, 0x4e, 0xcd, 0x2b, 0x89, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xaa, 0xd4, 0x83, 0xa8, 0x54, 0xd2, 0xe4, 0x12, 0xf4, + 0x04, 0x29, 0x0e, 0x02, 0xab, 0x0d, 0x00, 0x2b, 0x15, 0x12, 0xe1, 0x62, 0x05, 0x9b, 0x20, 0xc1, + 0xa8, 0xc0, 0xac, 0xc1, 0x12, 0x04, 0xe1, 0x38, 0x79, 0x9d, 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, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0xbe, + 0x2b, 0xc4, 0x7c, 0xbf, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0x98, 0xc3, 0x2a, 0x60, 0x4e, + 0x2b, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0xbb, 0xc6, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, + 0x47, 0xfe, 0xbc, 0x91, 0xb9, 0x00, 0x00, 0x00, +} + +func (m *IndexRecentParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IndexRecentParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IndexRecentParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Index) > 0 { + dAtA2 := make([]byte, len(m.Index)*10) + var j1 int + for _, num := range m.Index { + for num >= 1<<7 { + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA2[j1] = uint8(num) + j1++ + } + i -= j1 + copy(dAtA[i:], dAtA2[:j1]) + i = encodeVarintIndexRecentParams(dAtA, i, uint64(j1)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintIndexRecentParams(dAtA []byte, offset int, v uint64) int { + offset -= sovIndexRecentParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *IndexRecentParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Index) > 0 { + l = 0 + for _, e := range m.Index { + l += sovIndexRecentParams(uint64(e)) + } + n += 1 + sovIndexRecentParams(uint64(l)) + l + } + return n +} + +func sovIndexRecentParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozIndexRecentParams(x uint64) (n int) { + return sovIndexRecentParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *IndexRecentParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIndexRecentParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IndexRecentParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IndexRecentParams: 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 ErrIntOverflowIndexRecentParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Index = append(m.Index, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIndexRecentParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthIndexRecentParams + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthIndexRecentParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Index) == 0 { + m.Index = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIndexRecentParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Index = append(m.Index, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipIndexRecentParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIndexRecentParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipIndexRecentParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowIndexRecentParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowIndexRecentParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowIndexRecentParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthIndexRecentParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupIndexRecentParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthIndexRecentParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthIndexRecentParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowIndexRecentParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupIndexRecentParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/info.pb.go b/x/oracle/types/info.pb.go new file mode 100644 index 000000000..98fbd0aeb --- /dev/null +++ b/x/oracle/types/info.pb.go @@ -0,0 +1,1450 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/info.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Chain struct { + // eg."bitcoin" + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // TODO: metadata + Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` +} + +func (m *Chain) Reset() { *m = Chain{} } +func (m *Chain) String() string { return proto.CompactTextString(m) } +func (*Chain) ProtoMessage() {} +func (*Chain) Descriptor() ([]byte, []int) { + return fileDescriptor_a9bbae837d8caf59, []int{0} +} +func (m *Chain) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Chain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Chain.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Chain) XXX_Merge(src proto.Message) { + xxx_messageInfo_Chain.Merge(m, src) +} +func (m *Chain) XXX_Size() int { + return m.Size() +} +func (m *Chain) XXX_DiscardUnknown() { + xxx_messageInfo_Chain.DiscardUnknown(m) +} + +var xxx_messageInfo_Chain proto.InternalMessageInfo + +func (m *Chain) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Chain) GetDesc() string { + if m != nil { + return m.Desc + } + return "" +} + +type Token struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // id refer to chainList's index + ChainId int32 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // if any, like erc20 tokens + ContractAddress string `protobuf:"bytes,3,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` + Decimal int32 `protobuf:"varint,4,opt,name=decimal,proto3" json:"decimal,omitempty"` + // set false when we stop official price oracle service for a specified token + Active bool `protobuf:"varint,5,opt,name=active,proto3" json:"active,omitempty"` +} + +func (m *Token) Reset() { *m = Token{} } +func (m *Token) String() string { return proto.CompactTextString(m) } +func (*Token) ProtoMessage() {} +func (*Token) Descriptor() ([]byte, []int) { + return fileDescriptor_a9bbae837d8caf59, []int{1} +} +func (m *Token) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Token.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Token) XXX_Merge(src proto.Message) { + xxx_messageInfo_Token.Merge(m, src) +} +func (m *Token) XXX_Size() int { + return m.Size() +} +func (m *Token) XXX_DiscardUnknown() { + xxx_messageInfo_Token.DiscardUnknown(m) +} + +var xxx_messageInfo_Token proto.InternalMessageInfo + +func (m *Token) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Token) GetChainId() int32 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *Token) GetContractAddress() string { + if m != nil { + return m.ContractAddress + } + return "" +} + +func (m *Token) GetDecimal() int32 { + if m != nil { + return m.Decimal + } + return 0 +} + +func (m *Token) GetActive() bool { + if m != nil { + return m.Active + } + return false +} + +type Endpoint struct { + // url int refer to TokenList.ID, 0 reprents default for all (as fall back) + // key refer to tokenID, 1->"https://chainlink.../eth" + Offchain map[int32]string `protobuf:"bytes,1,rep,name=offchain,proto3" json:"offchain,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // url int refer to TokenList.ID, 0 reprents default for all (as fall back) + // key refer to tokenID, 1->"eth://0xabc...def" + Onchain map[int32]string `protobuf:"bytes,2,rep,name=onchain,proto3" json:"onchain,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *Endpoint) Reset() { *m = Endpoint{} } +func (m *Endpoint) String() string { return proto.CompactTextString(m) } +func (*Endpoint) ProtoMessage() {} +func (*Endpoint) Descriptor() ([]byte, []int) { + return fileDescriptor_a9bbae837d8caf59, []int{2} +} +func (m *Endpoint) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Endpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Endpoint.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Endpoint) XXX_Merge(src proto.Message) { + xxx_messageInfo_Endpoint.Merge(m, src) +} +func (m *Endpoint) XXX_Size() int { + return m.Size() +} +func (m *Endpoint) XXX_DiscardUnknown() { + xxx_messageInfo_Endpoint.DiscardUnknown(m) +} + +var xxx_messageInfo_Endpoint proto.InternalMessageInfo + +func (m *Endpoint) GetOffchain() map[int32]string { + if m != nil { + return m.Offchain + } + return nil +} + +func (m *Endpoint) GetOnchain() map[int32]string { + if m != nil { + return m.Onchain + } + return nil +} + +type Source struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Entry *Endpoint `protobuf:"bytes,2,opt,name=entry,proto3" json:"entry,omitempty"` + // set false when the source is out of service or reject to accept this source for official service + Valid bool `protobuf:"varint,3,opt,name=valid,proto3" json:"valid,omitempty"` + Deterministic bool `protobuf:"varint,4,opt,name=deterministic,proto3" json:"deterministic,omitempty"` +} + +func (m *Source) Reset() { *m = Source{} } +func (m *Source) String() string { return proto.CompactTextString(m) } +func (*Source) ProtoMessage() {} +func (*Source) Descriptor() ([]byte, []int) { + return fileDescriptor_a9bbae837d8caf59, []int{3} +} +func (m *Source) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Source) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Source.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Source) XXX_Merge(src proto.Message) { + xxx_messageInfo_Source.Merge(m, src) +} +func (m *Source) XXX_Size() int { + return m.Size() +} +func (m *Source) XXX_DiscardUnknown() { + xxx_messageInfo_Source.DiscardUnknown(m) +} + +var xxx_messageInfo_Source proto.InternalMessageInfo + +func (m *Source) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Source) GetEntry() *Endpoint { + if m != nil { + return m.Entry + } + return nil +} + +func (m *Source) GetValid() bool { + if m != nil { + return m.Valid + } + return false +} + +func (m *Source) GetDeterministic() bool { + if m != nil { + return m.Deterministic + } + return false +} + +func init() { + proto.RegisterType((*Chain)(nil), "exocore.oracle.Chain") + proto.RegisterType((*Token)(nil), "exocore.oracle.Token") + proto.RegisterType((*Endpoint)(nil), "exocore.oracle.Endpoint") + proto.RegisterMapType((map[int32]string)(nil), "exocore.oracle.Endpoint.OffchainEntry") + proto.RegisterMapType((map[int32]string)(nil), "exocore.oracle.Endpoint.OnchainEntry") + proto.RegisterType((*Source)(nil), "exocore.oracle.Source") +} + +func init() { proto.RegisterFile("exocore/oracle/info.proto", fileDescriptor_a9bbae837d8caf59) } + +var fileDescriptor_a9bbae837d8caf59 = []byte{ + // 429 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0xb3, 0x49, 0x9d, 0x98, 0x29, 0x85, 0x6a, 0x55, 0x21, 0x37, 0x07, 0x2b, 0x8a, 0x00, + 0x85, 0x8b, 0x8d, 0xca, 0x05, 0x95, 0x03, 0xa2, 0x28, 0x07, 0x38, 0x80, 0x64, 0x38, 0x71, 0xa9, + 0xdc, 0xdd, 0x49, 0xba, 0x4a, 0xbc, 0x13, 0xad, 0x37, 0xa5, 0x79, 0x83, 0x1e, 0x91, 0x78, 0x29, + 0x8e, 0x3d, 0x72, 0x44, 0xc9, 0x8b, 0x20, 0xef, 0xda, 0xa8, 0x91, 0x9a, 0x03, 0xb7, 0x99, 0x7f, + 0xe6, 0xff, 0xd6, 0x9e, 0x19, 0x38, 0xc6, 0x6b, 0x12, 0x64, 0x30, 0x25, 0x93, 0x8b, 0x39, 0xa6, + 0x4a, 0x4f, 0x28, 0x59, 0x18, 0xb2, 0xc4, 0x1f, 0xd5, 0xa5, 0xc4, 0x97, 0xfa, 0x47, 0x53, 0x9a, + 0x92, 0x2b, 0xa5, 0x55, 0xe4, 0xbb, 0x86, 0x29, 0x04, 0xef, 0x2f, 0x73, 0xa5, 0x39, 0x87, 0x3d, + 0x9d, 0x17, 0x18, 0xb1, 0x01, 0x1b, 0x3d, 0xc8, 0x5c, 0x5c, 0x69, 0x12, 0x4b, 0x11, 0xb5, 0xbd, + 0x56, 0xc5, 0xc3, 0x9f, 0x0c, 0x82, 0xaf, 0x34, 0xc3, 0xfb, 0x1d, 0xc7, 0x10, 0x8a, 0x0a, 0x77, + 0xae, 0xa4, 0x73, 0x05, 0x59, 0xcf, 0xe5, 0x1f, 0x24, 0x7f, 0x01, 0x87, 0x82, 0xb4, 0x35, 0xb9, + 0xb0, 0xe7, 0xb9, 0x94, 0x06, 0xcb, 0x32, 0xea, 0x38, 0xeb, 0xe3, 0x46, 0x7f, 0xe7, 0x65, 0x1e, + 0x41, 0x4f, 0xa2, 0x50, 0x45, 0x3e, 0x8f, 0xf6, 0x3c, 0xa4, 0x4e, 0xf9, 0x13, 0xe8, 0xe6, 0xc2, + 0xaa, 0x2b, 0x8c, 0x82, 0x01, 0x1b, 0x85, 0x59, 0x9d, 0x0d, 0x6f, 0xda, 0x10, 0x8e, 0xb5, 0x5c, + 0x90, 0xd2, 0x96, 0x9f, 0x41, 0x48, 0x93, 0x89, 0x7b, 0x37, 0x62, 0x83, 0xce, 0x68, 0xff, 0xe4, + 0x79, 0xb2, 0x3d, 0x8c, 0xa4, 0xe9, 0x4d, 0x3e, 0xd7, 0x8d, 0x63, 0x6d, 0xcd, 0x2a, 0xfb, 0xe7, + 0xe3, 0x6f, 0xa1, 0x47, 0xda, 0x23, 0xda, 0x0e, 0xf1, 0x6c, 0x37, 0x42, 0xdf, 0x21, 0x34, 0xae, + 0xfe, 0x1b, 0x38, 0xd8, 0x62, 0xf3, 0x43, 0xe8, 0xcc, 0x70, 0xe5, 0xa6, 0x15, 0x64, 0x55, 0xc8, + 0x8f, 0x20, 0xb8, 0xca, 0xe7, 0x4b, 0xac, 0xe7, 0xeb, 0x93, 0xd3, 0xf6, 0x6b, 0xd6, 0x3f, 0x85, + 0x87, 0x77, 0xa9, 0xff, 0xe3, 0x1d, 0xde, 0x30, 0xe8, 0x7e, 0xa1, 0xa5, 0x11, 0x78, 0xef, 0x86, + 0x12, 0x08, 0xb0, 0x62, 0x3a, 0xe3, 0xfe, 0x49, 0xb4, 0xeb, 0xb7, 0x32, 0xdf, 0x56, 0x3f, 0xa4, + 0xa4, 0xdb, 0x55, 0x98, 0xf9, 0x84, 0x3f, 0x85, 0x03, 0x89, 0x16, 0x4d, 0xa1, 0xb4, 0x2a, 0xad, + 0x12, 0x6e, 0x4f, 0x61, 0xb6, 0x2d, 0x9e, 0x7d, 0xfc, 0xb5, 0x8e, 0xd9, 0xed, 0x3a, 0x66, 0x7f, + 0xd6, 0x31, 0xfb, 0xb1, 0x89, 0x5b, 0xb7, 0x9b, 0xb8, 0xf5, 0x7b, 0x13, 0xb7, 0xbe, 0xbd, 0x9c, + 0x2a, 0x7b, 0xb9, 0xbc, 0x48, 0x04, 0x15, 0xe9, 0xd8, 0x7f, 0xc0, 0x27, 0xb4, 0xdf, 0xc9, 0xcc, + 0xd2, 0xe6, 0xa2, 0xaf, 0x9b, 0x9b, 0xb6, 0xab, 0x05, 0x96, 0x17, 0x5d, 0x77, 0xaf, 0xaf, 0xfe, + 0x06, 0x00, 0x00, 0xff, 0xff, 0xe8, 0x9c, 0x27, 0x52, 0xf2, 0x02, 0x00, 0x00, +} + +func (m *Chain) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Chain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Chain) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Desc) > 0 { + i -= len(m.Desc) + copy(dAtA[i:], m.Desc) + i = encodeVarintInfo(dAtA, i, uint64(len(m.Desc))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintInfo(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Token) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Token) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Token) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Active { + i-- + if m.Active { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.Decimal != 0 { + i = encodeVarintInfo(dAtA, i, uint64(m.Decimal)) + i-- + dAtA[i] = 0x20 + } + if len(m.ContractAddress) > 0 { + i -= len(m.ContractAddress) + copy(dAtA[i:], m.ContractAddress) + i = encodeVarintInfo(dAtA, i, uint64(len(m.ContractAddress))) + i-- + dAtA[i] = 0x1a + } + if m.ChainId != 0 { + i = encodeVarintInfo(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintInfo(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Endpoint) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Endpoint) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Onchain) > 0 { + for k := range m.Onchain { + v := m.Onchain[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintInfo(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i = encodeVarintInfo(dAtA, i, uint64(k)) + i-- + dAtA[i] = 0x8 + i = encodeVarintInfo(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Offchain) > 0 { + for k := range m.Offchain { + v := m.Offchain[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintInfo(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i = encodeVarintInfo(dAtA, i, uint64(k)) + i-- + dAtA[i] = 0x8 + i = encodeVarintInfo(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Source) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Source) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Source) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Deterministic { + i-- + if m.Deterministic { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.Valid { + i-- + if m.Valid { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.Entry != nil { + { + size, err := m.Entry.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintInfo(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintInfo(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintInfo(dAtA []byte, offset int, v uint64) int { + offset -= sovInfo(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Chain) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovInfo(uint64(l)) + } + l = len(m.Desc) + if l > 0 { + n += 1 + l + sovInfo(uint64(l)) + } + return n +} + +func (m *Token) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovInfo(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovInfo(uint64(m.ChainId)) + } + l = len(m.ContractAddress) + if l > 0 { + n += 1 + l + sovInfo(uint64(l)) + } + if m.Decimal != 0 { + n += 1 + sovInfo(uint64(m.Decimal)) + } + if m.Active { + n += 2 + } + return n +} + +func (m *Endpoint) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Offchain) > 0 { + for k, v := range m.Offchain { + _ = k + _ = v + mapEntrySize := 1 + sovInfo(uint64(k)) + 1 + len(v) + sovInfo(uint64(len(v))) + n += mapEntrySize + 1 + sovInfo(uint64(mapEntrySize)) + } + } + if len(m.Onchain) > 0 { + for k, v := range m.Onchain { + _ = k + _ = v + mapEntrySize := 1 + sovInfo(uint64(k)) + 1 + len(v) + sovInfo(uint64(len(v))) + n += mapEntrySize + 1 + sovInfo(uint64(mapEntrySize)) + } + } + return n +} + +func (m *Source) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovInfo(uint64(l)) + } + if m.Entry != nil { + l = m.Entry.Size() + n += 1 + l + sovInfo(uint64(l)) + } + if m.Valid { + n += 2 + } + if m.Deterministic { + n += 2 + } + return n +} + +func sovInfo(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozInfo(x uint64) (n int) { + return sovInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Chain) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Chain: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Chain: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Desc", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Desc = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Token) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Token: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Token: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Decimal", wireType) + } + m.Decimal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Decimal |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Active", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Active = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Endpoint) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Endpoint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Endpoint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Offchain", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Offchain == nil { + m.Offchain = make(map[int32]string) + } + var mapkey int32 + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapkey |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthInfo + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthInfo + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthInfo + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Offchain[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Onchain", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Onchain == nil { + m.Onchain = make(map[int32]string) + } + var mapkey int32 + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapkey |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthInfo + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthInfo + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthInfo + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Onchain[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Source) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Source: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Source: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entry", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Entry == nil { + m.Entry = &Endpoint{} + } + if err := m.Entry.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Valid", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Valid = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Deterministic", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Deterministic = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipInfo(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthInfo + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupInfo + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthInfo + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthInfo = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowInfo = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupInfo = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/key_prices.go b/x/oracle/types/key_prices.go new file mode 100644 index 000000000..02ecf8204 --- /dev/null +++ b/x/oracle/types/key_prices.go @@ -0,0 +1,35 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // PricesKeyPrefix is the prefix to retrieve all Prices + PricesKeyPrefix = "Prices/value/" +) + +// PricesNextRoundIdKey is the key set for each tokenId storeKV to store the next round id +var PricesNextRountIdKey = []byte("nextRoundId/") + +// PricesKey returns the store key to retrieve a Prices from the index fields +// this key is actually used as the prefix for kvsotre, TODO: refactor to PriceTokenPrefix +func PricesKey( + tokenId int32, +) []byte { + var key []byte + + tokenIdBytes := make([]byte, 4) + binary.BigEndian.PutUint32(tokenIdBytes, uint32(tokenId)) + key = append(key, tokenIdBytes...) + key = append(key, []byte("/")...) + + return key +} + +// PricesRoundKey returns the store key to retrieve a PriceWithTimeAndRound from the index fields +func PricesRoundKey( + roundId uint64, +) []byte { + return append(Uint64Bytes(roundId), []byte("/")...) +} diff --git a/x/oracle/types/key_recent_msg.go b/x/oracle/types/key_recent_msg.go new file mode 100644 index 000000000..54b0cf28e --- /dev/null +++ b/x/oracle/types/key_recent_msg.go @@ -0,0 +1,24 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // RecentMsgKeyPrefix is the prefix to retrieve all RecentMsg + RecentMsgKeyPrefix = "RecentMsg/value/" +) + +// RecentMsgKey returns the store key to retrieve a RecentMsg from the index fields +func RecentMsgKey( + block uint64, +) []byte { + var key []byte + + blockBytes := make([]byte, 8) + binary.BigEndian.PutUint64(blockBytes, block) + key = append(key, blockBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/oracle/types/key_recent_params.go b/x/oracle/types/key_recent_params.go new file mode 100644 index 000000000..ad82f1cbe --- /dev/null +++ b/x/oracle/types/key_recent_params.go @@ -0,0 +1,24 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // RecentParamsKeyPrefix is the prefix to retrieve all RecentParams + RecentParamsKeyPrefix = "RecentParams/value/" +) + +// RecentParamsKey returns the store key to retrieve a RecentParams from the index fields +func RecentParamsKey( + block uint64, +) []byte { + var key []byte + + blockBytes := make([]byte, 8) + binary.BigEndian.PutUint64(blockBytes, block) + key = append(key, blockBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/oracle/types/keys.go b/x/oracle/types/keys.go new file mode 100644 index 000000000..eba4197e8 --- /dev/null +++ b/x/oracle/types/keys.go @@ -0,0 +1,39 @@ +package types + +const ( + // ModuleName defines the module name + ModuleName = "oracle" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // RouterKey defines the module's message routing key + RouterKey = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_oracle" +) + +var ( + ParamsKey = []byte{0x11} +) + +func KeyPrefix(p string) []byte { + return []byte(p) +} + +const ( + ValidatorsKey = "Validators/value/" +) + +const ( + ValidatorUpdateBlockKey = "ValidatorUpdateBlock/value/" +) + +const ( + IndexRecentParamsKey = "IndexRecentParams/value/" +) + +const ( + IndexRecentMsgKey = "IndexRecentMsg/value/" +) diff --git a/x/oracle/types/message_create_price.go b/x/oracle/types/message_create_price.go new file mode 100644 index 000000000..3a88484fe --- /dev/null +++ b/x/oracle/types/message_create_price.go @@ -0,0 +1,45 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgCreatePrice = "create_price" + +var _ sdk.Msg = &MsgCreatePrice{} + +func NewMsgCreatePrice(creator string) *MsgCreatePrice { + return &MsgCreatePrice{ + Creator: creator, + } +} + +func (msg *MsgCreatePrice) Route() string { + return RouterKey +} + +func (msg *MsgCreatePrice) Type() string { + return TypeMsgCreatePrice +} + +func (msg *MsgCreatePrice) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgCreatePrice) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgCreatePrice) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + return nil +} diff --git a/x/oracle/types/message_create_price_test.go b/x/oracle/types/message_create_price_test.go new file mode 100644 index 000000000..a4a804163 --- /dev/null +++ b/x/oracle/types/message_create_price_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + "github.com/ExocoreNetwork/exocore/testutil/sample" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgCreatePrice_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgCreatePrice + err error + }{ + { + name: "invalid address", + msg: MsgCreatePrice{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgCreatePrice{ + Creator: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/oracle/types/params.go b/x/oracle/types/params.go new file mode 100644 index 000000000..3a7dc729b --- /dev/null +++ b/x/oracle/types/params.go @@ -0,0 +1,114 @@ +package types + +import ( + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "gopkg.in/yaml.v2" +) + +var ( + KeyChains = []byte("Chains") + KeyTokens = []byte("Tokens") + KeySources = []byte("Sources") + KeyRules = []byte("Rules") + KeyTokenFeeders = []byte("TokenFeeders") +) + +var _ paramtypes.ParamSet = (*Params)(nil) + +// ParamKeyTable the param key table for launch module +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// NewParams creates a new Params instance +func NewParams() Params { + return Params{} +} + +// DefaultParams returns a default set of parameters +func DefaultParams() Params { + return Params{ + Chains: []*Chain{ + {Name: "-", Desc: "-"}, + {Name: "Ethereum", Desc: "-"}, + }, + Tokens: []*Token{ + { + Name: "ETH", + ChainId: 1, + ContractAddress: "0x", + Decimal: 18, + Active: true, + }, + { + Name: "SHIBA INU", + ChainId: 1, + ContractAddress: "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE", + Decimal: 18, + Active: true, + }, + }, + Sources: []*Source{ + { + Name: "0 position is reserved", + }, + { + Name: "Chainlink", + Entry: &Endpoint{ + Offchain: map[int32]string{0: ""}, + }, + Valid: true, + Deterministic: true, + }, + }, + Rules: []*RuleWithSource{ + //0 is reserved + { + SourceIds: []int32{-1}, + }, + { + //all sources math + SourceIds: []int32{0}, + }, + }, + TokenFeeders: []*TokenFeeder{ + {}, + { + TokenId: 1, + RuleId: 1, + StartRoundId: 1, + StartBaseBlock: 1, + Interval: 10, + }, + { + TokenId: 2, + RuleId: 1, + StartRoundId: 1, + StartBaseBlock: 5, + Interval: 10, + }, + }, + } +} + +// ParamSetPairs get the params.ParamSet +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{ + paramtypes.NewParamSetPair(KeyChains, &p.Chains, func(_ interface{}) error { return nil }), + paramtypes.NewParamSetPair(KeyTokens, &p.Tokens, func(_ interface{}) error { return nil }), + paramtypes.NewParamSetPair(KeySources, &p.Sources, func(_ interface{}) error { return nil }), + paramtypes.NewParamSetPair(KeyRules, &p.Rules, func(_ interface{}) error { return nil }), + paramtypes.NewParamSetPair(KeyTokenFeeders, &p.TokenFeeders, func(_ interface{}) error { return nil }), + } +} + +// Validate validates the set of params +func (p Params) Validate() error { + return nil +} + +// String implements the Stringer interface. +func (p Params) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} diff --git a/x/oracle/types/params.pb.go b/x/oracle/types/params.pb.go new file mode 100644 index 000000000..0c7e24347 --- /dev/null +++ b/x/oracle/types/params.pb.go @@ -0,0 +1,583 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the parameters for the module. +type Params struct { + Chains []*Chain `protobuf:"bytes,1,rep,name=chains,proto3" json:"chains,omitempty"` + Tokens []*Token `protobuf:"bytes,2,rep,name=tokens,proto3" json:"tokens,omitempty"` + Sources []*Source `protobuf:"bytes,3,rep,name=sources,proto3" json:"sources,omitempty"` + Rules []*RuleWithSource `protobuf:"bytes,4,rep,name=rules,proto3" json:"rules,omitempty"` + TokenFeeders []*TokenFeeder `protobuf:"bytes,5,rep,name=TokenFeeders,proto3" json:"TokenFeeders,omitempty"` +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_ba212ceb89f5e6b2, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetChains() []*Chain { + if m != nil { + return m.Chains + } + return nil +} + +func (m *Params) GetTokens() []*Token { + if m != nil { + return m.Tokens + } + return nil +} + +func (m *Params) GetSources() []*Source { + if m != nil { + return m.Sources + } + return nil +} + +func (m *Params) GetRules() []*RuleWithSource { + if m != nil { + return m.Rules + } + return nil +} + +func (m *Params) GetTokenFeeders() []*TokenFeeder { + if m != nil { + return m.TokenFeeders + } + return nil +} + +func init() { + proto.RegisterType((*Params)(nil), "exocore.oracle.Params") +} + +func init() { proto.RegisterFile("exocore/oracle/params.proto", fileDescriptor_ba212ceb89f5e6b2) } + +var fileDescriptor_ba212ceb89f5e6b2 = []byte{ + // 298 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, + 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xea, 0x41, 0x24, 0xa5, 0x44, + 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x94, 0x24, 0x9a, 0x11, 0x99, + 0x79, 0x69, 0x30, 0x29, 0x45, 0x34, 0xa9, 0x92, 0xfc, 0xec, 0xd4, 0xbc, 0xf8, 0xb4, 0xd4, 0xd4, + 0x94, 0xd4, 0x22, 0x88, 0x12, 0xa5, 0xa9, 0x4c, 0x5c, 0x6c, 0x01, 0x60, 0x4b, 0x85, 0x74, 0xb9, + 0xd8, 0x92, 0x33, 0x12, 0x33, 0xf3, 0x8a, 0x25, 0x18, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0x44, 0xf5, + 0x50, 0xed, 0xd7, 0x73, 0x06, 0xc9, 0x06, 0x41, 0x15, 0x81, 0x94, 0x83, 0xcd, 0x2b, 0x96, 0x60, + 0xc2, 0xae, 0x3c, 0x04, 0x24, 0x1b, 0x04, 0x55, 0x24, 0x64, 0xc0, 0xc5, 0x5e, 0x9c, 0x5f, 0x5a, + 0x94, 0x9c, 0x5a, 0x2c, 0xc1, 0x0c, 0x56, 0x2f, 0x86, 0xae, 0x3e, 0x18, 0x2c, 0x1d, 0x04, 0x53, + 0x26, 0x64, 0xc2, 0xc5, 0x5a, 0x54, 0x9a, 0x93, 0x5a, 0x2c, 0xc1, 0x02, 0x56, 0x2f, 0x87, 0xae, + 0x3e, 0xa8, 0x34, 0x27, 0x35, 0x3c, 0xb3, 0x24, 0x03, 0xaa, 0x0f, 0xa2, 0x58, 0xc8, 0x9e, 0x8b, + 0x07, 0x6c, 0xb1, 0x1b, 0xd8, 0x97, 0xc5, 0x12, 0xac, 0x60, 0xcd, 0xd2, 0x58, 0x1d, 0x07, 0x51, + 0x13, 0x84, 0xa2, 0xc1, 0x8a, 0x65, 0xc6, 0x02, 0x79, 0x06, 0x27, 0xaf, 0x13, 0x8f, 0xe4, 0x18, + 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, + 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x32, 0x48, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, + 0xcf, 0xd5, 0x77, 0x85, 0x18, 0xea, 0x97, 0x5a, 0x52, 0x9e, 0x5f, 0x94, 0xad, 0x0f, 0x0b, 0xee, + 0x0a, 0x78, 0x80, 0x57, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x83, 0xda, 0x18, 0x10, 0x00, 0x00, + 0xff, 0xff, 0x84, 0xc4, 0x4f, 0xd9, 0xed, 0x01, 0x00, 0x00, +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TokenFeeders) > 0 { + for iNdEx := len(m.TokenFeeders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TokenFeeders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.Rules) > 0 { + for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Sources) > 0 { + for iNdEx := len(m.Sources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Sources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Tokens) > 0 { + for iNdEx := len(m.Tokens) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tokens[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Chains) > 0 { + for iNdEx := len(m.Chains) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Chains[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Chains) > 0 { + for _, e := range m.Chains { + l = e.Size() + n += 1 + l + sovParams(uint64(l)) + } + } + if len(m.Tokens) > 0 { + for _, e := range m.Tokens { + l = e.Size() + n += 1 + l + sovParams(uint64(l)) + } + } + if len(m.Sources) > 0 { + for _, e := range m.Sources { + l = e.Size() + n += 1 + l + sovParams(uint64(l)) + } + } + if len(m.Rules) > 0 { + for _, e := range m.Rules { + l = e.Size() + n += 1 + l + sovParams(uint64(l)) + } + } + if len(m.TokenFeeders) > 0 { + for _, e := range m.TokenFeeders { + l = e.Size() + n += 1 + l + sovParams(uint64(l)) + } + } + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chains", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Chains = append(m.Chains, &Chain{}) + if err := m.Chains[len(m.Chains)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tokens", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tokens = append(m.Tokens, &Token{}) + if err := m.Tokens[len(m.Tokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sources = append(m.Sources, &Source{}) + if err := m.Sources[len(m.Sources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rules = append(m.Rules, &RuleWithSource{}) + if err := m.Rules[len(m.Rules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenFeeders", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokenFeeders = append(m.TokenFeeders, &TokenFeeder{}) + if err := m.TokenFeeders[len(m.TokenFeeders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/price.pb.go b/x/oracle/types/price.pb.go new file mode 100644 index 000000000..f9fc239f1 --- /dev/null +++ b/x/oracle/types/price.pb.go @@ -0,0 +1,1027 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/price.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// token price with timestamp fetched from source +// {price:"12345",decimal:"2"}->price: 123.45 usdt +type PriceWithTimeAndDetId struct { + Price string `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"` + Decimal int32 `protobuf:"varint,2,opt,name=decimal,proto3" json:"decimal,omitempty"` + Timestamp string `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + DetId string `protobuf:"bytes,4,opt,name=det_id,json=detId,proto3" json:"det_id,omitempty"` +} + +func (m *PriceWithTimeAndDetId) Reset() { *m = PriceWithTimeAndDetId{} } +func (m *PriceWithTimeAndDetId) String() string { return proto.CompactTextString(m) } +func (*PriceWithTimeAndDetId) ProtoMessage() {} +func (*PriceWithTimeAndDetId) Descriptor() ([]byte, []int) { + return fileDescriptor_6755466c800b64fc, []int{0} +} +func (m *PriceWithTimeAndDetId) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PriceWithTimeAndDetId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PriceWithTimeAndDetId.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PriceWithTimeAndDetId) XXX_Merge(src proto.Message) { + xxx_messageInfo_PriceWithTimeAndDetId.Merge(m, src) +} +func (m *PriceWithTimeAndDetId) XXX_Size() int { + return m.Size() +} +func (m *PriceWithTimeAndDetId) XXX_DiscardUnknown() { + xxx_messageInfo_PriceWithTimeAndDetId.DiscardUnknown(m) +} + +var xxx_messageInfo_PriceWithTimeAndDetId proto.InternalMessageInfo + +func (m *PriceWithTimeAndDetId) GetPrice() string { + if m != nil { + return m.Price + } + return "" +} + +func (m *PriceWithTimeAndDetId) GetDecimal() int32 { + if m != nil { + return m.Decimal + } + return 0 +} + +func (m *PriceWithTimeAndDetId) GetTimestamp() string { + if m != nil { + return m.Timestamp + } + return "" +} + +func (m *PriceWithTimeAndDetId) GetDetId() string { + if m != nil { + return m.DetId + } + return "" +} + +type PriceWithSource struct { + //refer to id from Params.SourceList, where this price fetched from, 0 is reserved for custom usage + SourceId int32 `protobuf:"varint,1,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + //if source is deteministic like chainlink with roundID, set this value with which returned from source + //up to 3 values in case of the async of network, to give more time for oracle nodes(validators) get into consensus + //eg.with deterministic source, this array will contian 3 continuous values up to latest + //for non-deterministic source, it's a choice by v2 rules. + Prices []*PriceWithTimeAndDetId `protobuf:"bytes,2,rep,name=prices,proto3" json:"prices,omitempty"` + //used for 0-sourceID-customDefinedSource + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` +} + +func (m *PriceWithSource) Reset() { *m = PriceWithSource{} } +func (m *PriceWithSource) String() string { return proto.CompactTextString(m) } +func (*PriceWithSource) ProtoMessage() {} +func (*PriceWithSource) Descriptor() ([]byte, []int) { + return fileDescriptor_6755466c800b64fc, []int{1} +} +func (m *PriceWithSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PriceWithSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PriceWithSource.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PriceWithSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_PriceWithSource.Merge(m, src) +} +func (m *PriceWithSource) XXX_Size() int { + return m.Size() +} +func (m *PriceWithSource) XXX_DiscardUnknown() { + xxx_messageInfo_PriceWithSource.DiscardUnknown(m) +} + +var xxx_messageInfo_PriceWithSource proto.InternalMessageInfo + +func (m *PriceWithSource) GetSourceId() int32 { + if m != nil { + return m.SourceId + } + return 0 +} + +func (m *PriceWithSource) GetPrices() []*PriceWithTimeAndDetId { + if m != nil { + return m.Prices + } + return nil +} + +func (m *PriceWithSource) GetDesc() string { + if m != nil { + return m.Desc + } + return "" +} + +type PriceWithTimeAndRound struct { + Price string `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"` + Decimal int32 `protobuf:"varint,2,opt,name=decimal,proto3" json:"decimal,omitempty"` + Timestamp string `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + RoundId uint64 `protobuf:"varint,4,opt,name=round_id,json=roundId,proto3" json:"round_id,omitempty"` +} + +func (m *PriceWithTimeAndRound) Reset() { *m = PriceWithTimeAndRound{} } +func (m *PriceWithTimeAndRound) String() string { return proto.CompactTextString(m) } +func (*PriceWithTimeAndRound) ProtoMessage() {} +func (*PriceWithTimeAndRound) Descriptor() ([]byte, []int) { + return fileDescriptor_6755466c800b64fc, []int{2} +} +func (m *PriceWithTimeAndRound) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PriceWithTimeAndRound) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PriceWithTimeAndRound.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PriceWithTimeAndRound) XXX_Merge(src proto.Message) { + xxx_messageInfo_PriceWithTimeAndRound.Merge(m, src) +} +func (m *PriceWithTimeAndRound) XXX_Size() int { + return m.Size() +} +func (m *PriceWithTimeAndRound) XXX_DiscardUnknown() { + xxx_messageInfo_PriceWithTimeAndRound.DiscardUnknown(m) +} + +var xxx_messageInfo_PriceWithTimeAndRound proto.InternalMessageInfo + +func (m *PriceWithTimeAndRound) GetPrice() string { + if m != nil { + return m.Price + } + return "" +} + +func (m *PriceWithTimeAndRound) GetDecimal() int32 { + if m != nil { + return m.Decimal + } + return 0 +} + +func (m *PriceWithTimeAndRound) GetTimestamp() string { + if m != nil { + return m.Timestamp + } + return "" +} + +func (m *PriceWithTimeAndRound) GetRoundId() uint64 { + if m != nil { + return m.RoundId + } + return 0 +} + +func init() { + proto.RegisterType((*PriceWithTimeAndDetId)(nil), "exocore.oracle.PriceWithTimeAndDetId") + proto.RegisterType((*PriceWithSource)(nil), "exocore.oracle.PriceWithSource") + proto.RegisterType((*PriceWithTimeAndRound)(nil), "exocore.oracle.PriceWithTimeAndRound") +} + +func init() { proto.RegisterFile("exocore/oracle/price.proto", fileDescriptor_6755466c800b64fc) } + +var fileDescriptor_6755466c800b64fc = []byte{ + // 315 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x4c, 0x4e, + 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xca, 0xe9, 0x41, 0xe4, 0x94, 0x6a, 0xb8, + 0x44, 0x03, 0x40, 0xd2, 0xe1, 0x99, 0x25, 0x19, 0x21, 0x99, 0xb9, 0xa9, 0x8e, 0x79, 0x29, 0x2e, + 0xa9, 0x25, 0x9e, 0x29, 0x42, 0x22, 0x5c, 0xac, 0x60, 0x7d, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, + 0x41, 0x10, 0x8e, 0x90, 0x04, 0x17, 0x7b, 0x4a, 0x6a, 0x72, 0x66, 0x6e, 0x62, 0x8e, 0x04, 0x93, + 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x8c, 0x2b, 0x24, 0xc3, 0xc5, 0x59, 0x92, 0x99, 0x9b, 0x5a, 0x5c, + 0x92, 0x98, 0x5b, 0x20, 0xc1, 0x0c, 0xd6, 0x83, 0x10, 0x10, 0x12, 0xe5, 0x62, 0x4b, 0x49, 0x2d, + 0x89, 0xcf, 0x4c, 0x91, 0x60, 0x81, 0x18, 0x97, 0x02, 0xb2, 0x44, 0xa9, 0x91, 0x91, 0x8b, 0x1f, + 0x6e, 0x7d, 0x70, 0x7e, 0x69, 0x51, 0x72, 0xaa, 0x90, 0x34, 0x17, 0x67, 0x31, 0x98, 0x05, 0x52, + 0xcd, 0x08, 0xb6, 0x84, 0x03, 0x22, 0xe0, 0x99, 0x22, 0x64, 0xcb, 0xc5, 0x06, 0x76, 0x48, 0xb1, + 0x04, 0x93, 0x02, 0xb3, 0x06, 0xb7, 0x91, 0xaa, 0x1e, 0xaa, 0x7f, 0xf4, 0xb0, 0x7a, 0x26, 0x08, + 0xaa, 0x49, 0x48, 0x88, 0x8b, 0x25, 0x25, 0xb5, 0x38, 0x19, 0xea, 0x3e, 0x30, 0x5b, 0xa9, 0x81, + 0x11, 0x33, 0x08, 0x82, 0xf2, 0x4b, 0xf3, 0xa8, 0x1d, 0x04, 0x92, 0x5c, 0x1c, 0x45, 0x20, 0x63, + 0x61, 0x81, 0xc0, 0x12, 0xc4, 0x0e, 0xe6, 0x7b, 0xa6, 0x38, 0x79, 0x9d, 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, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, + 0xae, 0xbe, 0x2b, 0xc4, 0xa7, 0x7e, 0xa9, 0x25, 0xe5, 0xf9, 0x45, 0xd9, 0xfa, 0xb0, 0x48, 0xae, + 0x80, 0x45, 0x73, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x9e, 0x8d, 0x01, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xa6, 0x63, 0xc2, 0xdd, 0x05, 0x02, 0x00, 0x00, +} + +func (m *PriceWithTimeAndDetId) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PriceWithTimeAndDetId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PriceWithTimeAndDetId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DetId) > 0 { + i -= len(m.DetId) + copy(dAtA[i:], m.DetId) + i = encodeVarintPrice(dAtA, i, uint64(len(m.DetId))) + i-- + dAtA[i] = 0x22 + } + if len(m.Timestamp) > 0 { + i -= len(m.Timestamp) + copy(dAtA[i:], m.Timestamp) + i = encodeVarintPrice(dAtA, i, uint64(len(m.Timestamp))) + i-- + dAtA[i] = 0x1a + } + if m.Decimal != 0 { + i = encodeVarintPrice(dAtA, i, uint64(m.Decimal)) + i-- + dAtA[i] = 0x10 + } + if len(m.Price) > 0 { + i -= len(m.Price) + copy(dAtA[i:], m.Price) + i = encodeVarintPrice(dAtA, i, uint64(len(m.Price))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PriceWithSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PriceWithSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PriceWithSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Desc) > 0 { + i -= len(m.Desc) + copy(dAtA[i:], m.Desc) + i = encodeVarintPrice(dAtA, i, uint64(len(m.Desc))) + i-- + dAtA[i] = 0x1a + } + if len(m.Prices) > 0 { + for iNdEx := len(m.Prices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Prices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPrice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.SourceId != 0 { + i = encodeVarintPrice(dAtA, i, uint64(m.SourceId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PriceWithTimeAndRound) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PriceWithTimeAndRound) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PriceWithTimeAndRound) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RoundId != 0 { + i = encodeVarintPrice(dAtA, i, uint64(m.RoundId)) + i-- + dAtA[i] = 0x20 + } + if len(m.Timestamp) > 0 { + i -= len(m.Timestamp) + copy(dAtA[i:], m.Timestamp) + i = encodeVarintPrice(dAtA, i, uint64(len(m.Timestamp))) + i-- + dAtA[i] = 0x1a + } + if m.Decimal != 0 { + i = encodeVarintPrice(dAtA, i, uint64(m.Decimal)) + i-- + dAtA[i] = 0x10 + } + if len(m.Price) > 0 { + i -= len(m.Price) + copy(dAtA[i:], m.Price) + i = encodeVarintPrice(dAtA, i, uint64(len(m.Price))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintPrice(dAtA []byte, offset int, v uint64) int { + offset -= sovPrice(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PriceWithTimeAndDetId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Price) + if l > 0 { + n += 1 + l + sovPrice(uint64(l)) + } + if m.Decimal != 0 { + n += 1 + sovPrice(uint64(m.Decimal)) + } + l = len(m.Timestamp) + if l > 0 { + n += 1 + l + sovPrice(uint64(l)) + } + l = len(m.DetId) + if l > 0 { + n += 1 + l + sovPrice(uint64(l)) + } + return n +} + +func (m *PriceWithSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SourceId != 0 { + n += 1 + sovPrice(uint64(m.SourceId)) + } + if len(m.Prices) > 0 { + for _, e := range m.Prices { + l = e.Size() + n += 1 + l + sovPrice(uint64(l)) + } + } + l = len(m.Desc) + if l > 0 { + n += 1 + l + sovPrice(uint64(l)) + } + return n +} + +func (m *PriceWithTimeAndRound) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Price) + if l > 0 { + n += 1 + l + sovPrice(uint64(l)) + } + if m.Decimal != 0 { + n += 1 + sovPrice(uint64(m.Decimal)) + } + l = len(m.Timestamp) + if l > 0 { + n += 1 + l + sovPrice(uint64(l)) + } + if m.RoundId != 0 { + n += 1 + sovPrice(uint64(m.RoundId)) + } + return n +} + +func sovPrice(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPrice(x uint64) (n int) { + return sovPrice(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PriceWithTimeAndDetId) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PriceWithTimeAndDetId: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PriceWithTimeAndDetId: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrice + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPrice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Price = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Decimal", wireType) + } + m.Decimal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Decimal |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrice + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPrice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Timestamp = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DetId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrice + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPrice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DetId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPrice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPrice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PriceWithSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PriceWithSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PriceWithSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceId", wireType) + } + m.SourceId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SourceId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPrice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPrice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prices = append(m.Prices, &PriceWithTimeAndDetId{}) + if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Desc", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrice + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPrice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Desc = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPrice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPrice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PriceWithTimeAndRound) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PriceWithTimeAndRound: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PriceWithTimeAndRound: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrice + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPrice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Price = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Decimal", wireType) + } + m.Decimal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Decimal |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrice + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPrice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Timestamp = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RoundId", wireType) + } + m.RoundId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RoundId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipPrice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPrice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPrice(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPrice + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPrice + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPrice + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthPrice + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPrice + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPrice + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPrice = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPrice = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPrice = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/prices.pb.go b/x/oracle/types/prices.pb.go new file mode 100644 index 000000000..ee1256037 --- /dev/null +++ b/x/oracle/types/prices.pb.go @@ -0,0 +1,401 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/prices.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Prices struct { + TokenId int32 `protobuf:"varint,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` + NextRountId uint64 `protobuf:"varint,2,opt,name=next_rount_id,json=nextRountId,proto3" json:"next_rount_id,omitempty"` + PriceList []*PriceWithTimeAndRound `protobuf:"bytes,3,rep,name=price_list,json=priceList,proto3" json:"price_list,omitempty"` +} + +func (m *Prices) Reset() { *m = Prices{} } +func (m *Prices) String() string { return proto.CompactTextString(m) } +func (*Prices) ProtoMessage() {} +func (*Prices) Descriptor() ([]byte, []int) { + return fileDescriptor_50cc9ccc8f92b87a, []int{0} +} +func (m *Prices) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Prices) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Prices.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Prices) XXX_Merge(src proto.Message) { + xxx_messageInfo_Prices.Merge(m, src) +} +func (m *Prices) XXX_Size() int { + return m.Size() +} +func (m *Prices) XXX_DiscardUnknown() { + xxx_messageInfo_Prices.DiscardUnknown(m) +} + +var xxx_messageInfo_Prices proto.InternalMessageInfo + +func (m *Prices) GetTokenId() int32 { + if m != nil { + return m.TokenId + } + return 0 +} + +func (m *Prices) GetNextRountId() uint64 { + if m != nil { + return m.NextRountId + } + return 0 +} + +func (m *Prices) GetPriceList() []*PriceWithTimeAndRound { + if m != nil { + return m.PriceList + } + return nil +} + +func init() { + proto.RegisterType((*Prices)(nil), "exocore.oracle.Prices") +} + +func init() { proto.RegisterFile("exocore/oracle/prices.proto", fileDescriptor_50cc9ccc8f92b87a) } + +var fileDescriptor_50cc9ccc8f92b87a = []byte{ + // 242 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x4c, 0x4e, + 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xea, 0x41, 0x24, 0xa5, 0xa4, + 0xb0, 0x29, 0x86, 0xa8, 0x55, 0xea, 0x65, 0xe4, 0x62, 0x0b, 0x00, 0x6b, 0x16, 0x92, 0xe4, 0xe2, + 0x28, 0xc9, 0xcf, 0x4e, 0xcd, 0x8b, 0xcf, 0x4c, 0x91, 0x60, 0x54, 0x60, 0xd4, 0x60, 0x0d, 0x62, + 0x07, 0xf3, 0x3d, 0x53, 0x84, 0x94, 0xb8, 0x78, 0xf3, 0x52, 0x2b, 0x4a, 0xe2, 0x8b, 0xf2, 0x4b, + 0xf3, 0x4a, 0x40, 0xf2, 0x4c, 0x0a, 0x8c, 0x1a, 0x2c, 0x41, 0xdc, 0x20, 0xc1, 0x20, 0x90, 0x98, + 0x67, 0x8a, 0x90, 0x0b, 0x17, 0x17, 0xd8, 0xe0, 0xf8, 0x9c, 0xcc, 0xe2, 0x12, 0x09, 0x66, 0x05, + 0x66, 0x0d, 0x6e, 0x23, 0x55, 0x3d, 0x54, 0xa7, 0xe8, 0x81, 0xad, 0x0a, 0xcf, 0x2c, 0xc9, 0x08, + 0xc9, 0xcc, 0x4d, 0x75, 0xcc, 0x4b, 0x01, 0x69, 0x4e, 0x09, 0xe2, 0x04, 0x6b, 0xf4, 0xc9, 0x2c, + 0x2e, 0x71, 0xf2, 0x3a, 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, 0x83, 0xf4, + 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x57, 0x88, 0xa9, 0x7e, 0xa9, 0x25, + 0xe5, 0xf9, 0x45, 0xd9, 0xfa, 0x30, 0xff, 0x55, 0xc0, 0x7c, 0x58, 0x52, 0x59, 0x90, 0x5a, 0x9c, + 0xc4, 0x06, 0xf6, 0xa2, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x4f, 0x26, 0xa8, 0xb4, 0x2d, 0x01, + 0x00, 0x00, +} + +func (m *Prices) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Prices) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Prices) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PriceList) > 0 { + for iNdEx := len(m.PriceList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PriceList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPrices(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.NextRountId != 0 { + i = encodeVarintPrices(dAtA, i, uint64(m.NextRountId)) + i-- + dAtA[i] = 0x10 + } + if m.TokenId != 0 { + i = encodeVarintPrices(dAtA, i, uint64(m.TokenId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintPrices(dAtA []byte, offset int, v uint64) int { + offset -= sovPrices(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Prices) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovPrices(uint64(m.TokenId)) + } + if m.NextRountId != 0 { + n += 1 + sovPrices(uint64(m.NextRountId)) + } + if len(m.PriceList) > 0 { + for _, e := range m.PriceList { + l = e.Size() + n += 1 + l + sovPrices(uint64(l)) + } + } + return n +} + +func sovPrices(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPrices(x uint64) (n int) { + return sovPrices(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Prices) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Prices: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Prices: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + } + m.TokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TokenId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextRountId", wireType) + } + m.NextRountId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextRountId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriceList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrices + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPrices + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPrices + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PriceList = append(m.PriceList, &PriceWithTimeAndRound{}) + if err := m.PriceList[len(m.PriceList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPrices(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPrices + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPrices(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPrices + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPrices + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPrices + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthPrices + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPrices + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPrices + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPrices = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPrices = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPrices = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go new file mode 100644 index 000000000..054cec294 --- /dev/null +++ b/x/oracle/types/query.pb.go @@ -0,0 +1,3989 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/query.proto + +package types + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +type QueryGetPricesRequest struct { + TokenId int32 `protobuf:"varint,1,opt,name=tokenId,proto3" json:"tokenId,omitempty"` +} + +func (m *QueryGetPricesRequest) Reset() { *m = QueryGetPricesRequest{} } +func (m *QueryGetPricesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetPricesRequest) ProtoMessage() {} +func (*QueryGetPricesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{2} +} +func (m *QueryGetPricesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetPricesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetPricesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetPricesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetPricesRequest.Merge(m, src) +} +func (m *QueryGetPricesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetPricesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetPricesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetPricesRequest proto.InternalMessageInfo + +func (m *QueryGetPricesRequest) GetTokenId() int32 { + if m != nil { + return m.TokenId + } + return 0 +} + +type QueryGetPricesResponse struct { + Prices Prices `protobuf:"bytes,1,opt,name=prices,proto3" json:"prices"` +} + +func (m *QueryGetPricesResponse) Reset() { *m = QueryGetPricesResponse{} } +func (m *QueryGetPricesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetPricesResponse) ProtoMessage() {} +func (*QueryGetPricesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{3} +} +func (m *QueryGetPricesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetPricesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetPricesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetPricesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetPricesResponse.Merge(m, src) +} +func (m *QueryGetPricesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetPricesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetPricesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetPricesResponse proto.InternalMessageInfo + +func (m *QueryGetPricesResponse) GetPrices() Prices { + if m != nil { + return m.Prices + } + return Prices{} +} + +type QueryAllPricesRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllPricesRequest) Reset() { *m = QueryAllPricesRequest{} } +func (m *QueryAllPricesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllPricesRequest) ProtoMessage() {} +func (*QueryAllPricesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{4} +} +func (m *QueryAllPricesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllPricesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllPricesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllPricesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllPricesRequest.Merge(m, src) +} +func (m *QueryAllPricesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllPricesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllPricesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllPricesRequest proto.InternalMessageInfo + +func (m *QueryAllPricesRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllPricesResponse struct { + Prices []Prices `protobuf:"bytes,1,rep,name=prices,proto3" json:"prices"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllPricesResponse) Reset() { *m = QueryAllPricesResponse{} } +func (m *QueryAllPricesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllPricesResponse) ProtoMessage() {} +func (*QueryAllPricesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{5} +} +func (m *QueryAllPricesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllPricesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllPricesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllPricesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllPricesResponse.Merge(m, src) +} +func (m *QueryAllPricesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllPricesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllPricesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllPricesResponse proto.InternalMessageInfo + +func (m *QueryAllPricesResponse) GetPrices() []Prices { + if m != nil { + return m.Prices + } + return nil +} + +func (m *QueryAllPricesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryGetValidatorUpdateBlockRequest struct { +} + +func (m *QueryGetValidatorUpdateBlockRequest) Reset() { *m = QueryGetValidatorUpdateBlockRequest{} } +func (m *QueryGetValidatorUpdateBlockRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetValidatorUpdateBlockRequest) ProtoMessage() {} +func (*QueryGetValidatorUpdateBlockRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{6} +} +func (m *QueryGetValidatorUpdateBlockRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetValidatorUpdateBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetValidatorUpdateBlockRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetValidatorUpdateBlockRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetValidatorUpdateBlockRequest.Merge(m, src) +} +func (m *QueryGetValidatorUpdateBlockRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetValidatorUpdateBlockRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetValidatorUpdateBlockRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetValidatorUpdateBlockRequest proto.InternalMessageInfo + +type QueryGetValidatorUpdateBlockResponse struct { + ValidatorUpdateBlock ValidatorUpdateBlock `protobuf:"bytes,1,opt,name=ValidatorUpdateBlock,proto3" json:"ValidatorUpdateBlock"` +} + +func (m *QueryGetValidatorUpdateBlockResponse) Reset() { *m = QueryGetValidatorUpdateBlockResponse{} } +func (m *QueryGetValidatorUpdateBlockResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetValidatorUpdateBlockResponse) ProtoMessage() {} +func (*QueryGetValidatorUpdateBlockResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{7} +} +func (m *QueryGetValidatorUpdateBlockResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetValidatorUpdateBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetValidatorUpdateBlockResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetValidatorUpdateBlockResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetValidatorUpdateBlockResponse.Merge(m, src) +} +func (m *QueryGetValidatorUpdateBlockResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetValidatorUpdateBlockResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetValidatorUpdateBlockResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetValidatorUpdateBlockResponse proto.InternalMessageInfo + +func (m *QueryGetValidatorUpdateBlockResponse) GetValidatorUpdateBlock() ValidatorUpdateBlock { + if m != nil { + return m.ValidatorUpdateBlock + } + return ValidatorUpdateBlock{} +} + +type QueryGetIndexRecentParamsRequest struct { +} + +func (m *QueryGetIndexRecentParamsRequest) Reset() { *m = QueryGetIndexRecentParamsRequest{} } +func (m *QueryGetIndexRecentParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetIndexRecentParamsRequest) ProtoMessage() {} +func (*QueryGetIndexRecentParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{8} +} +func (m *QueryGetIndexRecentParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetIndexRecentParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetIndexRecentParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetIndexRecentParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetIndexRecentParamsRequest.Merge(m, src) +} +func (m *QueryGetIndexRecentParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetIndexRecentParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetIndexRecentParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetIndexRecentParamsRequest proto.InternalMessageInfo + +type QueryGetIndexRecentParamsResponse struct { + IndexRecentParams IndexRecentParams `protobuf:"bytes,1,opt,name=IndexRecentParams,proto3" json:"IndexRecentParams"` +} + +func (m *QueryGetIndexRecentParamsResponse) Reset() { *m = QueryGetIndexRecentParamsResponse{} } +func (m *QueryGetIndexRecentParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetIndexRecentParamsResponse) ProtoMessage() {} +func (*QueryGetIndexRecentParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{9} +} +func (m *QueryGetIndexRecentParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetIndexRecentParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetIndexRecentParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetIndexRecentParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetIndexRecentParamsResponse.Merge(m, src) +} +func (m *QueryGetIndexRecentParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetIndexRecentParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetIndexRecentParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetIndexRecentParamsResponse proto.InternalMessageInfo + +func (m *QueryGetIndexRecentParamsResponse) GetIndexRecentParams() IndexRecentParams { + if m != nil { + return m.IndexRecentParams + } + return IndexRecentParams{} +} + +type QueryGetIndexRecentMsgRequest struct { +} + +func (m *QueryGetIndexRecentMsgRequest) Reset() { *m = QueryGetIndexRecentMsgRequest{} } +func (m *QueryGetIndexRecentMsgRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetIndexRecentMsgRequest) ProtoMessage() {} +func (*QueryGetIndexRecentMsgRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{10} +} +func (m *QueryGetIndexRecentMsgRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetIndexRecentMsgRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetIndexRecentMsgRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetIndexRecentMsgRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetIndexRecentMsgRequest.Merge(m, src) +} +func (m *QueryGetIndexRecentMsgRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetIndexRecentMsgRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetIndexRecentMsgRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetIndexRecentMsgRequest proto.InternalMessageInfo + +type QueryGetIndexRecentMsgResponse struct { + IndexRecentMsg IndexRecentMsg `protobuf:"bytes,1,opt,name=IndexRecentMsg,proto3" json:"IndexRecentMsg"` +} + +func (m *QueryGetIndexRecentMsgResponse) Reset() { *m = QueryGetIndexRecentMsgResponse{} } +func (m *QueryGetIndexRecentMsgResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetIndexRecentMsgResponse) ProtoMessage() {} +func (*QueryGetIndexRecentMsgResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{11} +} +func (m *QueryGetIndexRecentMsgResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetIndexRecentMsgResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetIndexRecentMsgResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetIndexRecentMsgResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetIndexRecentMsgResponse.Merge(m, src) +} +func (m *QueryGetIndexRecentMsgResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetIndexRecentMsgResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetIndexRecentMsgResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetIndexRecentMsgResponse proto.InternalMessageInfo + +func (m *QueryGetIndexRecentMsgResponse) GetIndexRecentMsg() IndexRecentMsg { + if m != nil { + return m.IndexRecentMsg + } + return IndexRecentMsg{} +} + +type QueryGetRecentMsgRequest struct { + Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` +} + +func (m *QueryGetRecentMsgRequest) Reset() { *m = QueryGetRecentMsgRequest{} } +func (m *QueryGetRecentMsgRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetRecentMsgRequest) ProtoMessage() {} +func (*QueryGetRecentMsgRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{12} +} +func (m *QueryGetRecentMsgRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRecentMsgRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRecentMsgRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetRecentMsgRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRecentMsgRequest.Merge(m, src) +} +func (m *QueryGetRecentMsgRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRecentMsgRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRecentMsgRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRecentMsgRequest proto.InternalMessageInfo + +func (m *QueryGetRecentMsgRequest) GetBlock() uint64 { + if m != nil { + return m.Block + } + return 0 +} + +type QueryGetRecentMsgResponse struct { + RecentMsg RecentMsg `protobuf:"bytes,1,opt,name=recentMsg,proto3" json:"recentMsg"` +} + +func (m *QueryGetRecentMsgResponse) Reset() { *m = QueryGetRecentMsgResponse{} } +func (m *QueryGetRecentMsgResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetRecentMsgResponse) ProtoMessage() {} +func (*QueryGetRecentMsgResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{13} +} +func (m *QueryGetRecentMsgResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRecentMsgResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRecentMsgResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetRecentMsgResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRecentMsgResponse.Merge(m, src) +} +func (m *QueryGetRecentMsgResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRecentMsgResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRecentMsgResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRecentMsgResponse proto.InternalMessageInfo + +func (m *QueryGetRecentMsgResponse) GetRecentMsg() RecentMsg { + if m != nil { + return m.RecentMsg + } + return RecentMsg{} +} + +type QueryAllRecentMsgRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRecentMsgRequest) Reset() { *m = QueryAllRecentMsgRequest{} } +func (m *QueryAllRecentMsgRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllRecentMsgRequest) ProtoMessage() {} +func (*QueryAllRecentMsgRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{14} +} +func (m *QueryAllRecentMsgRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRecentMsgRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRecentMsgRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllRecentMsgRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRecentMsgRequest.Merge(m, src) +} +func (m *QueryAllRecentMsgRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRecentMsgRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRecentMsgRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRecentMsgRequest proto.InternalMessageInfo + +func (m *QueryAllRecentMsgRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllRecentMsgResponse struct { + RecentMsg []RecentMsg `protobuf:"bytes,1,rep,name=recentMsg,proto3" json:"recentMsg"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRecentMsgResponse) Reset() { *m = QueryAllRecentMsgResponse{} } +func (m *QueryAllRecentMsgResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllRecentMsgResponse) ProtoMessage() {} +func (*QueryAllRecentMsgResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{15} +} +func (m *QueryAllRecentMsgResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRecentMsgResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRecentMsgResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllRecentMsgResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRecentMsgResponse.Merge(m, src) +} +func (m *QueryAllRecentMsgResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRecentMsgResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRecentMsgResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRecentMsgResponse proto.InternalMessageInfo + +func (m *QueryAllRecentMsgResponse) GetRecentMsg() []RecentMsg { + if m != nil { + return m.RecentMsg + } + return nil +} + +func (m *QueryAllRecentMsgResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryGetRecentParamsRequest struct { + Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` +} + +func (m *QueryGetRecentParamsRequest) Reset() { *m = QueryGetRecentParamsRequest{} } +func (m *QueryGetRecentParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetRecentParamsRequest) ProtoMessage() {} +func (*QueryGetRecentParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{16} +} +func (m *QueryGetRecentParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRecentParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRecentParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetRecentParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRecentParamsRequest.Merge(m, src) +} +func (m *QueryGetRecentParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRecentParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRecentParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRecentParamsRequest proto.InternalMessageInfo + +func (m *QueryGetRecentParamsRequest) GetBlock() uint64 { + if m != nil { + return m.Block + } + return 0 +} + +type QueryGetRecentParamsResponse struct { + RecentParams RecentParams `protobuf:"bytes,1,opt,name=recentParams,proto3" json:"recentParams"` +} + +func (m *QueryGetRecentParamsResponse) Reset() { *m = QueryGetRecentParamsResponse{} } +func (m *QueryGetRecentParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetRecentParamsResponse) ProtoMessage() {} +func (*QueryGetRecentParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{17} +} +func (m *QueryGetRecentParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRecentParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRecentParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetRecentParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRecentParamsResponse.Merge(m, src) +} +func (m *QueryGetRecentParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRecentParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRecentParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRecentParamsResponse proto.InternalMessageInfo + +func (m *QueryGetRecentParamsResponse) GetRecentParams() RecentParams { + if m != nil { + return m.RecentParams + } + return RecentParams{} +} + +type QueryAllRecentParamsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRecentParamsRequest) Reset() { *m = QueryAllRecentParamsRequest{} } +func (m *QueryAllRecentParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllRecentParamsRequest) ProtoMessage() {} +func (*QueryAllRecentParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{18} +} +func (m *QueryAllRecentParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRecentParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRecentParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllRecentParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRecentParamsRequest.Merge(m, src) +} +func (m *QueryAllRecentParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRecentParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRecentParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRecentParamsRequest proto.InternalMessageInfo + +func (m *QueryAllRecentParamsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllRecentParamsResponse struct { + RecentParams []RecentParams `protobuf:"bytes,1,rep,name=recentParams,proto3" json:"recentParams"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRecentParamsResponse) Reset() { *m = QueryAllRecentParamsResponse{} } +func (m *QueryAllRecentParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllRecentParamsResponse) ProtoMessage() {} +func (*QueryAllRecentParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f604621c8da1a6f3, []int{19} +} +func (m *QueryAllRecentParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRecentParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRecentParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllRecentParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRecentParamsResponse.Merge(m, src) +} +func (m *QueryAllRecentParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRecentParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRecentParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRecentParamsResponse proto.InternalMessageInfo + +func (m *QueryAllRecentParamsResponse) GetRecentParams() []RecentParams { + if m != nil { + return m.RecentParams + } + return nil +} + +func (m *QueryAllRecentParamsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "exocore.oracle.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "exocore.oracle.QueryParamsResponse") + proto.RegisterType((*QueryGetPricesRequest)(nil), "exocore.oracle.QueryGetPricesRequest") + proto.RegisterType((*QueryGetPricesResponse)(nil), "exocore.oracle.QueryGetPricesResponse") + proto.RegisterType((*QueryAllPricesRequest)(nil), "exocore.oracle.QueryAllPricesRequest") + proto.RegisterType((*QueryAllPricesResponse)(nil), "exocore.oracle.QueryAllPricesResponse") + proto.RegisterType((*QueryGetValidatorUpdateBlockRequest)(nil), "exocore.oracle.QueryGetValidatorUpdateBlockRequest") + proto.RegisterType((*QueryGetValidatorUpdateBlockResponse)(nil), "exocore.oracle.QueryGetValidatorUpdateBlockResponse") + proto.RegisterType((*QueryGetIndexRecentParamsRequest)(nil), "exocore.oracle.QueryGetIndexRecentParamsRequest") + proto.RegisterType((*QueryGetIndexRecentParamsResponse)(nil), "exocore.oracle.QueryGetIndexRecentParamsResponse") + proto.RegisterType((*QueryGetIndexRecentMsgRequest)(nil), "exocore.oracle.QueryGetIndexRecentMsgRequest") + proto.RegisterType((*QueryGetIndexRecentMsgResponse)(nil), "exocore.oracle.QueryGetIndexRecentMsgResponse") + proto.RegisterType((*QueryGetRecentMsgRequest)(nil), "exocore.oracle.QueryGetRecentMsgRequest") + proto.RegisterType((*QueryGetRecentMsgResponse)(nil), "exocore.oracle.QueryGetRecentMsgResponse") + proto.RegisterType((*QueryAllRecentMsgRequest)(nil), "exocore.oracle.QueryAllRecentMsgRequest") + proto.RegisterType((*QueryAllRecentMsgResponse)(nil), "exocore.oracle.QueryAllRecentMsgResponse") + proto.RegisterType((*QueryGetRecentParamsRequest)(nil), "exocore.oracle.QueryGetRecentParamsRequest") + proto.RegisterType((*QueryGetRecentParamsResponse)(nil), "exocore.oracle.QueryGetRecentParamsResponse") + proto.RegisterType((*QueryAllRecentParamsRequest)(nil), "exocore.oracle.QueryAllRecentParamsRequest") + proto.RegisterType((*QueryAllRecentParamsResponse)(nil), "exocore.oracle.QueryAllRecentParamsResponse") +} + +func init() { proto.RegisterFile("exocore/oracle/query.proto", fileDescriptor_f604621c8da1a6f3) } + +var fileDescriptor_f604621c8da1a6f3 = []byte{ + // 948 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xc7, 0x3d, 0x4d, 0x13, 0xd4, 0x69, 0x55, 0xc4, 0x60, 0xaa, 0x74, 0x1b, 0x36, 0xed, 0xb4, + 0x6e, 0x53, 0xdc, 0xee, 0xc6, 0xb1, 0xa1, 0x02, 0xd1, 0x43, 0x22, 0xd1, 0xaa, 0x40, 0xa3, 0x60, + 0x29, 0x1c, 0x72, 0xc0, 0x5a, 0xdb, 0xc3, 0x62, 0x65, 0xbd, 0xe3, 0xec, 0xae, 0x43, 0x42, 0x14, + 0x09, 0x71, 0xe0, 0x1c, 0x09, 0x09, 0x0e, 0xdc, 0xe0, 0x00, 0x37, 0x2e, 0x7c, 0x00, 0x8e, 0x39, + 0x46, 0xe2, 0xc2, 0x09, 0xa1, 0x84, 0x0f, 0x82, 0x3c, 0xfb, 0xd6, 0xf6, 0xce, 0xce, 0xae, 0xd7, + 0xc8, 0xb7, 0xec, 0xbe, 0xff, 0x7b, 0xef, 0xf7, 0xde, 0x3c, 0xef, 0x9b, 0x60, 0x8d, 0x1d, 0xf0, + 0x16, 0xf7, 0x98, 0xc9, 0x3d, 0xab, 0xe5, 0x30, 0x73, 0xaf, 0xcf, 0xbc, 0x43, 0xa3, 0xe7, 0xf1, + 0x80, 0x93, 0xeb, 0x60, 0x33, 0x42, 0x9b, 0x56, 0xb4, 0xb9, 0xcd, 0x85, 0xc9, 0x1c, 0xfc, 0x15, + 0xaa, 0xb4, 0x25, 0x9b, 0x73, 0xdb, 0x61, 0xa6, 0xd5, 0xeb, 0x98, 0x96, 0xeb, 0xf2, 0xc0, 0x0a, + 0x3a, 0xdc, 0xf5, 0xc1, 0xfa, 0x56, 0x8b, 0xfb, 0x5d, 0xee, 0x9b, 0x4d, 0xcb, 0x87, 0xe0, 0xe6, + 0x7e, 0xa5, 0xc9, 0x02, 0xab, 0x62, 0xf6, 0x2c, 0xbb, 0xe3, 0x0a, 0x31, 0x68, 0x6f, 0x49, 0x2c, + 0x3d, 0xcb, 0xb3, 0xba, 0x7e, 0x9a, 0xd1, 0xeb, 0xb4, 0x58, 0x64, 0x2c, 0x4b, 0xc6, 0x7d, 0xcb, + 0xe9, 0xb4, 0xad, 0x80, 0x7b, 0x8d, 0x7e, 0xaf, 0x6d, 0x05, 0xac, 0xd1, 0x74, 0x78, 0x6b, 0x17, + 0xc4, 0x2b, 0x92, 0xb8, 0xe3, 0xb6, 0xd9, 0x41, 0xc3, 0x63, 0x2d, 0xe6, 0x06, 0x8d, 0x58, 0xce, + 0x52, 0x96, 0xb2, 0xeb, 0xdb, 0x20, 0x5b, 0x96, 0x64, 0x09, 0x01, 0x55, 0x0b, 0xc6, 0x73, 0xd1, + 0x22, 0x26, 0x9f, 0x0c, 0xda, 0xb3, 0x25, 0x5e, 0xd6, 0xd9, 0x5e, 0x9f, 0xf9, 0x01, 0xfd, 0x08, + 0xbf, 0x1e, 0x7b, 0xeb, 0xf7, 0xb8, 0xeb, 0x33, 0x52, 0xc3, 0x0b, 0xa1, 0xf3, 0x22, 0xba, 0x8d, + 0x56, 0xae, 0xae, 0xdd, 0x30, 0xe2, 0x47, 0x65, 0x84, 0xfa, 0x8d, 0xcb, 0xa7, 0x7f, 0x2f, 0x17, + 0xea, 0xa0, 0xa5, 0x15, 0xfc, 0x86, 0x08, 0xf6, 0x9c, 0x05, 0x5b, 0xa2, 0x7b, 0x90, 0x85, 0x2c, + 0xe2, 0x57, 0x02, 0xbe, 0xcb, 0xdc, 0x17, 0x6d, 0x11, 0x6f, 0xbe, 0x1e, 0x3d, 0xd2, 0x4d, 0x7c, + 0x43, 0x76, 0x19, 0x43, 0x10, 0x6f, 0x52, 0x11, 0x84, 0x75, 0x88, 0x20, 0x9e, 0x68, 0x03, 0x10, + 0xd6, 0x1d, 0x27, 0x8e, 0xf0, 0x0c, 0xe3, 0xd1, 0x3c, 0x40, 0xc8, 0xfb, 0x46, 0x38, 0x3c, 0xc6, + 0x60, 0x78, 0x8c, 0x70, 0x32, 0x61, 0x78, 0x8c, 0x2d, 0xcb, 0x66, 0xe0, 0x5b, 0x1f, 0xf3, 0xa4, + 0x3f, 0x20, 0x20, 0x1e, 0xcb, 0xa0, 0x20, 0x9e, 0xcb, 0x4b, 0x4c, 0x9e, 0xc7, 0xc0, 0x2e, 0x09, + 0xb0, 0x07, 0x13, 0xc1, 0xc2, 0x94, 0x31, 0xb2, 0x12, 0xbe, 0x1b, 0xb5, 0xf2, 0xd3, 0x68, 0x3c, + 0xb7, 0xc5, 0x74, 0x6e, 0x0c, 0x86, 0x33, 0x3a, 0xf1, 0x6f, 0x11, 0xbe, 0x97, 0xad, 0x83, 0x72, + 0x3e, 0xc3, 0x45, 0x95, 0x1d, 0x7a, 0x77, 0x4f, 0x2e, 0x4e, 0xa5, 0x85, 0x52, 0x95, 0x71, 0x28, + 0xc5, 0xb7, 0x23, 0x8e, 0x17, 0x83, 0xb9, 0xaf, 0x8b, 0xa1, 0x8d, 0x8f, 0xe7, 0x57, 0xf8, 0x4e, + 0x86, 0x06, 0x40, 0xb7, 0xf1, 0x6b, 0x09, 0x23, 0x50, 0xde, 0x91, 0x29, 0x13, 0x42, 0x40, 0x4c, + 0x46, 0xa0, 0xcb, 0xf8, 0x4d, 0x45, 0xee, 0x97, 0xbe, 0x1d, 0xc1, 0xb9, 0x58, 0x4f, 0x13, 0x00, + 0xd9, 0xc7, 0xf8, 0x7a, 0xdc, 0x02, 0x58, 0x7a, 0x06, 0xd6, 0x4b, 0xdf, 0x06, 0x26, 0xc9, 0x97, + 0xae, 0xe2, 0xc5, 0x28, 0x9f, 0xcc, 0x42, 0x8a, 0x78, 0xbe, 0x39, 0x3c, 0x9d, 0xcb, 0xf5, 0xf0, + 0x81, 0xee, 0xe0, 0x9b, 0x0a, 0x0f, 0x80, 0x7b, 0x8a, 0xaf, 0x78, 0x12, 0xd7, 0x4d, 0x99, 0x4b, + 0x46, 0x1a, 0x79, 0xd0, 0x26, 0xd0, 0xac, 0x3b, 0x4e, 0x82, 0x66, 0x56, 0x3f, 0xb6, 0x9f, 0x11, + 0x14, 0x10, 0x4f, 0xa2, 0x2e, 0x60, 0x6e, 0xba, 0x02, 0x66, 0xf7, 0xc3, 0xab, 0xe2, 0x5b, 0xf1, + 0x2e, 0xc7, 0x66, 0x38, 0xe5, 0x68, 0x3e, 0xc7, 0x4b, 0x6a, 0x27, 0x28, 0xee, 0x19, 0xbe, 0xe6, + 0x25, 0xe7, 0x79, 0x49, 0x5d, 0x5f, 0x6c, 0x94, 0x63, 0x7e, 0x94, 0x01, 0xdc, 0xb0, 0x83, 0x71, + 0xb8, 0x59, 0x9d, 0xd4, 0x6f, 0x08, 0xea, 0x49, 0xe4, 0x49, 0xad, 0x67, 0xee, 0xff, 0xd4, 0x33, + 0xb3, 0x53, 0x5b, 0x3b, 0xbd, 0x8a, 0xe7, 0x05, 0x31, 0xf9, 0x1a, 0xe1, 0x05, 0x88, 0x4e, 0x65, + 0x9e, 0xe4, 0xca, 0xd4, 0xee, 0x66, 0x6a, 0xc2, 0x4c, 0xf4, 0xf1, 0x37, 0x7f, 0xfe, 0xfb, 0xdd, + 0xa5, 0x07, 0xa4, 0x64, 0x7e, 0x10, 0x8a, 0x37, 0x59, 0xf0, 0x25, 0xf7, 0x76, 0x4d, 0xe5, 0x15, + 0x84, 0x9c, 0x0c, 0x10, 0xc2, 0x7d, 0x50, 0x52, 0x86, 0x97, 0x57, 0xaa, 0x76, 0x7f, 0x92, 0x0c, + 0x40, 0x9e, 0x08, 0x90, 0x0a, 0x31, 0x27, 0x81, 0x08, 0x37, 0xf3, 0x08, 0x16, 0xf3, 0x31, 0xf9, + 0x03, 0xa9, 0xbf, 0xff, 0xa4, 0x9a, 0x96, 0x39, 0x63, 0xeb, 0x68, 0xb5, 0xe9, 0x9c, 0x00, 0xfe, + 0xa9, 0x80, 0x7f, 0x42, 0xde, 0x9e, 0x00, 0xaf, 0xbe, 0x8e, 0x91, 0xdf, 0x91, 0x62, 0x33, 0x90, + 0xd5, 0x34, 0x94, 0xb4, 0x2d, 0xa4, 0x55, 0xa6, 0xf0, 0x00, 0xf2, 0xf7, 0x04, 0x79, 0x8d, 0xac, + 0x4d, 0x20, 0x57, 0xdc, 0x0d, 0xc9, 0xaf, 0x48, 0x5e, 0x1b, 0xe4, 0x71, 0x0e, 0x82, 0xd1, 0xf7, + 0x57, 0x33, 0xf2, 0xca, 0xa7, 0x1c, 0x12, 0xf9, 0x7e, 0x4a, 0x7e, 0x44, 0xf8, 0xca, 0x88, 0x72, + 0x25, 0x2d, 0x6d, 0x02, 0xf0, 0x61, 0x0e, 0x25, 0xb0, 0xbd, 0x2b, 0xd8, 0xaa, 0xa4, 0x32, 0x81, + 0x6d, 0x44, 0x65, 0x1e, 0x89, 0xe3, 0x3f, 0x26, 0xdf, 0x23, 0x7c, 0x6d, 0x18, 0x70, 0xdd, 0x71, + 0x52, 0x00, 0x15, 0x1b, 0x2c, 0x05, 0x50, 0xb5, 0x86, 0x68, 0x45, 0x00, 0x96, 0xc9, 0xc3, 0xdc, + 0x80, 0xe4, 0x97, 0x21, 0x18, 0xcc, 0x64, 0x39, 0xbb, 0x1f, 0xf1, 0x71, 0x7c, 0x94, 0x4f, 0x0c, + 0x78, 0xef, 0x0b, 0xbc, 0x77, 0x48, 0x2d, 0x1f, 0x5e, 0x38, 0x83, 0xc3, 0x16, 0xfe, 0x84, 0xf0, + 0xab, 0xe3, 0x61, 0x07, 0x5d, 0x2c, 0x67, 0xf7, 0x26, 0x0f, 0x6c, 0xca, 0x96, 0xa0, 0x35, 0x01, + 0x6b, 0x90, 0x47, 0xd3, 0xc0, 0x6e, 0x7c, 0x78, 0x7a, 0xae, 0xa3, 0xb3, 0x73, 0x1d, 0xfd, 0x73, + 0xae, 0xa3, 0x93, 0x0b, 0xbd, 0x70, 0x76, 0xa1, 0x17, 0xfe, 0xba, 0xd0, 0x0b, 0x3b, 0xab, 0x76, + 0x27, 0xf8, 0xa2, 0xdf, 0x34, 0x5a, 0xbc, 0x9b, 0x16, 0xf1, 0x20, 0x8a, 0x19, 0x1c, 0xf6, 0x98, + 0xdf, 0x5c, 0x10, 0xff, 0x2d, 0x55, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x5c, 0xa1, 0xc6, + 0xb8, 0x0e, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Queries a list of Prices items. + Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) + // Queries a ValidatorUpdateBlock by index. + ValidatorUpdateBlock(ctx context.Context, in *QueryGetValidatorUpdateBlockRequest, opts ...grpc.CallOption) (*QueryGetValidatorUpdateBlockResponse, error) + // Queries a IndexRecentParams by index. + IndexRecentParams(ctx context.Context, in *QueryGetIndexRecentParamsRequest, opts ...grpc.CallOption) (*QueryGetIndexRecentParamsResponse, error) + // Queries a IndexRecentMsg by index. + IndexRecentMsg(ctx context.Context, in *QueryGetIndexRecentMsgRequest, opts ...grpc.CallOption) (*QueryGetIndexRecentMsgResponse, error) + // Queries a list of RecentMsg items. + RecentMsg(ctx context.Context, in *QueryGetRecentMsgRequest, opts ...grpc.CallOption) (*QueryGetRecentMsgResponse, error) + RecentMsgAll(ctx context.Context, in *QueryAllRecentMsgRequest, opts ...grpc.CallOption) (*QueryAllRecentMsgResponse, error) + // Queries a list of RecentParams items. + RecentParams(ctx context.Context, in *QueryGetRecentParamsRequest, opts ...grpc.CallOption) (*QueryGetRecentParamsResponse, error) + RecentParamsAll(ctx context.Context, in *QueryAllRecentParamsRequest, opts ...grpc.CallOption) (*QueryAllRecentParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) 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, "/exocore.oracle.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Prices(ctx context.Context, in *QueryGetPricesRequest, opts ...grpc.CallOption) (*QueryGetPricesResponse, error) { + out := new(QueryGetPricesResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/Prices", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ValidatorUpdateBlock(ctx context.Context, in *QueryGetValidatorUpdateBlockRequest, opts ...grpc.CallOption) (*QueryGetValidatorUpdateBlockResponse, error) { + out := new(QueryGetValidatorUpdateBlockResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/ValidatorUpdateBlock", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) IndexRecentParams(ctx context.Context, in *QueryGetIndexRecentParamsRequest, opts ...grpc.CallOption) (*QueryGetIndexRecentParamsResponse, error) { + out := new(QueryGetIndexRecentParamsResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/IndexRecentParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) IndexRecentMsg(ctx context.Context, in *QueryGetIndexRecentMsgRequest, opts ...grpc.CallOption) (*QueryGetIndexRecentMsgResponse, error) { + out := new(QueryGetIndexRecentMsgResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/IndexRecentMsg", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RecentMsg(ctx context.Context, in *QueryGetRecentMsgRequest, opts ...grpc.CallOption) (*QueryGetRecentMsgResponse, error) { + out := new(QueryGetRecentMsgResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RecentMsg", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RecentMsgAll(ctx context.Context, in *QueryAllRecentMsgRequest, opts ...grpc.CallOption) (*QueryAllRecentMsgResponse, error) { + out := new(QueryAllRecentMsgResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RecentMsgAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RecentParams(ctx context.Context, in *QueryGetRecentParamsRequest, opts ...grpc.CallOption) (*QueryGetRecentParamsResponse, error) { + out := new(QueryGetRecentParamsResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RecentParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RecentParamsAll(ctx context.Context, in *QueryAllRecentParamsRequest, opts ...grpc.CallOption) (*QueryAllRecentParamsResponse, error) { + out := new(QueryAllRecentParamsResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Query/RecentParamsAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a list of Prices items. + Prices(context.Context, *QueryGetPricesRequest) (*QueryGetPricesResponse, error) + // Queries a ValidatorUpdateBlock by index. + ValidatorUpdateBlock(context.Context, *QueryGetValidatorUpdateBlockRequest) (*QueryGetValidatorUpdateBlockResponse, error) + // Queries a IndexRecentParams by index. + IndexRecentParams(context.Context, *QueryGetIndexRecentParamsRequest) (*QueryGetIndexRecentParamsResponse, error) + // Queries a IndexRecentMsg by index. + IndexRecentMsg(context.Context, *QueryGetIndexRecentMsgRequest) (*QueryGetIndexRecentMsgResponse, error) + // Queries a list of RecentMsg items. + RecentMsg(context.Context, *QueryGetRecentMsgRequest) (*QueryGetRecentMsgResponse, error) + RecentMsgAll(context.Context, *QueryAllRecentMsgRequest) (*QueryAllRecentMsgResponse, error) + // Queries a list of RecentParams items. + RecentParams(context.Context, *QueryGetRecentParamsRequest) (*QueryGetRecentParamsResponse, error) + RecentParamsAll(context.Context, *QueryAllRecentParamsRequest) (*QueryAllRecentParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) Prices(ctx context.Context, req *QueryGetPricesRequest) (*QueryGetPricesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Prices not implemented") +} +func (*UnimplementedQueryServer) ValidatorUpdateBlock(ctx context.Context, req *QueryGetValidatorUpdateBlockRequest) (*QueryGetValidatorUpdateBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorUpdateBlock not implemented") +} +func (*UnimplementedQueryServer) IndexRecentParams(ctx context.Context, req *QueryGetIndexRecentParamsRequest) (*QueryGetIndexRecentParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IndexRecentParams not implemented") +} +func (*UnimplementedQueryServer) IndexRecentMsg(ctx context.Context, req *QueryGetIndexRecentMsgRequest) (*QueryGetIndexRecentMsgResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IndexRecentMsg not implemented") +} +func (*UnimplementedQueryServer) RecentMsg(ctx context.Context, req *QueryGetRecentMsgRequest) (*QueryGetRecentMsgResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RecentMsg not implemented") +} +func (*UnimplementedQueryServer) RecentMsgAll(ctx context.Context, req *QueryAllRecentMsgRequest) (*QueryAllRecentMsgResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RecentMsgAll not implemented") +} +func (*UnimplementedQueryServer) RecentParams(ctx context.Context, req *QueryGetRecentParamsRequest) (*QueryGetRecentParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RecentParams not implemented") +} +func (*UnimplementedQueryServer) RecentParamsAll(ctx context.Context, req *QueryAllRecentParamsRequest) (*QueryAllRecentParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RecentParamsAll not implemented") +} + +func RegisterQueryServer(s grpc1.Server, 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: "/exocore.oracle.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Prices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetPricesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Prices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/Prices", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Prices(ctx, req.(*QueryGetPricesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ValidatorUpdateBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetValidatorUpdateBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ValidatorUpdateBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/ValidatorUpdateBlock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ValidatorUpdateBlock(ctx, req.(*QueryGetValidatorUpdateBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_IndexRecentParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetIndexRecentParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).IndexRecentParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/IndexRecentParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).IndexRecentParams(ctx, req.(*QueryGetIndexRecentParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_IndexRecentMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetIndexRecentMsgRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).IndexRecentMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/IndexRecentMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).IndexRecentMsg(ctx, req.(*QueryGetIndexRecentMsgRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RecentMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetRecentMsgRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RecentMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/RecentMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RecentMsg(ctx, req.(*QueryGetRecentMsgRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RecentMsgAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllRecentMsgRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RecentMsgAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/RecentMsgAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RecentMsgAll(ctx, req.(*QueryAllRecentMsgRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RecentParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetRecentParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RecentParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/RecentParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RecentParams(ctx, req.(*QueryGetRecentParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RecentParamsAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllRecentParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RecentParamsAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Query/RecentParamsAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RecentParamsAll(ctx, req.(*QueryAllRecentParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "exocore.oracle.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Prices", + Handler: _Query_Prices_Handler, + }, + { + MethodName: "ValidatorUpdateBlock", + Handler: _Query_ValidatorUpdateBlock_Handler, + }, + { + MethodName: "IndexRecentParams", + Handler: _Query_IndexRecentParams_Handler, + }, + { + MethodName: "IndexRecentMsg", + Handler: _Query_IndexRecentMsg_Handler, + }, + { + MethodName: "RecentMsg", + Handler: _Query_RecentMsg_Handler, + }, + { + MethodName: "RecentMsgAll", + Handler: _Query_RecentMsgAll_Handler, + }, + { + MethodName: "RecentParams", + Handler: _Query_RecentParams_Handler, + }, + { + MethodName: "RecentParamsAll", + Handler: _Query_RecentParamsAll_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "exocore/oracle/query.proto", +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetPricesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetPricesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TokenId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.TokenId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryGetPricesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetPricesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Prices.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAllPricesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllPricesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllPricesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllPricesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Prices) > 0 { + for iNdEx := len(m.Prices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Prices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryGetValidatorUpdateBlockRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetValidatorUpdateBlockRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetValidatorUpdateBlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryGetValidatorUpdateBlockResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetValidatorUpdateBlockResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetValidatorUpdateBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ValidatorUpdateBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetIndexRecentParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetIndexRecentParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetIndexRecentParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryGetIndexRecentParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetIndexRecentParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetIndexRecentParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.IndexRecentParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetIndexRecentMsgRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetIndexRecentMsgRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetIndexRecentMsgRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryGetIndexRecentMsgResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetIndexRecentMsgResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetIndexRecentMsgResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.IndexRecentMsg.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetRecentMsgRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetRecentMsgRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRecentMsgRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Block != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryGetRecentMsgResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetRecentMsgResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRecentMsgResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.RecentMsg.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAllRecentMsgRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllRecentMsgRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRecentMsgRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllRecentMsgResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllRecentMsgResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRecentMsgResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.RecentMsg) > 0 { + for iNdEx := len(m.RecentMsg) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RecentMsg[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryGetRecentParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetRecentParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRecentParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Block != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryGetRecentParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetRecentParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRecentParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.RecentParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAllRecentParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllRecentParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRecentParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllRecentParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllRecentParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRecentParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.RecentParams) > 0 { + for iNdEx := len(m.RecentParams) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RecentParams[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetPricesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovQuery(uint64(m.TokenId)) + } + return n +} + +func (m *QueryGetPricesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Prices.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllPricesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllPricesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Prices) > 0 { + for _, e := range m.Prices { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetValidatorUpdateBlockRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryGetValidatorUpdateBlockResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ValidatorUpdateBlock.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetIndexRecentParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryGetIndexRecentParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.IndexRecentParams.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetIndexRecentMsgRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryGetIndexRecentMsgResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.IndexRecentMsg.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetRecentMsgRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Block != 0 { + n += 1 + sovQuery(uint64(m.Block)) + } + return n +} + +func (m *QueryGetRecentMsgResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.RecentMsg.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllRecentMsgRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllRecentMsgResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RecentMsg) > 0 { + for _, e := range m.RecentMsg { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetRecentParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Block != 0 { + n += 1 + sovQuery(uint64(m.Block)) + } + return n +} + +func (m *QueryGetRecentParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.RecentParams.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllRecentParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllRecentParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RecentParams) > 0 { + for _, e := range m.RecentParams { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetPricesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetPricesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + } + m.TokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TokenId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetPricesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetPricesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Prices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllPricesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllPricesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllPricesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllPricesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prices = append(m.Prices, Prices{}) + if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetValidatorUpdateBlockRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetValidatorUpdateBlockRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetValidatorUpdateBlockRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetValidatorUpdateBlockResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetValidatorUpdateBlockResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetValidatorUpdateBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorUpdateBlock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ValidatorUpdateBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetIndexRecentParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetIndexRecentParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetIndexRecentParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetIndexRecentParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetIndexRecentParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetIndexRecentParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IndexRecentParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.IndexRecentParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetIndexRecentMsgRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetIndexRecentMsgRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetIndexRecentMsgRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetIndexRecentMsgResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetIndexRecentMsgResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetIndexRecentMsgResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IndexRecentMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.IndexRecentMsg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetRecentMsgRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetRecentMsgRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetRecentMsgRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + m.Block = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Block |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetRecentMsgResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetRecentMsgResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetRecentMsgResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecentMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RecentMsg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllRecentMsgRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllRecentMsgRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllRecentMsgRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllRecentMsgResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllRecentMsgResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllRecentMsgResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecentMsg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RecentMsg = append(m.RecentMsg, RecentMsg{}) + if err := m.RecentMsg[len(m.RecentMsg)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetRecentParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetRecentParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetRecentParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + m.Block = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Block |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetRecentParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetRecentParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetRecentParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecentParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RecentParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllRecentParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllRecentParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllRecentParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllRecentParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllRecentParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllRecentParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecentParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RecentParams = append(m.RecentParams, RecentParams{}) + if err := m.RecentParams[len(m.RecentParams)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go new file mode 100644 index 000000000..f23ccd96f --- /dev/null +++ b/x/oracle/types/query.pb.gw.go @@ -0,0 +1,817 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: exocore/oracle/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Prices_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetPricesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tokenId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tokenId") + } + + protoReq.TokenId, err = runtime.Int32(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tokenId", err) + } + + msg, err := client.Prices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Prices_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetPricesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["tokenId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tokenId") + } + + protoReq.TokenId, err = runtime.Int32(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tokenId", err) + } + + msg, err := server.Prices(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_ValidatorUpdateBlock_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetValidatorUpdateBlockRequest + var metadata runtime.ServerMetadata + + msg, err := client.ValidatorUpdateBlock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ValidatorUpdateBlock_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetValidatorUpdateBlockRequest + var metadata runtime.ServerMetadata + + msg, err := server.ValidatorUpdateBlock(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_IndexRecentParams_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetIndexRecentParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.IndexRecentParams(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_IndexRecentParams_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetIndexRecentParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.IndexRecentParams(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_IndexRecentMsg_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetIndexRecentMsgRequest + var metadata runtime.ServerMetadata + + msg, err := client.IndexRecentMsg(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_IndexRecentMsg_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetIndexRecentMsgRequest + var metadata runtime.ServerMetadata + + msg, err := server.IndexRecentMsg(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_RecentMsg_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRecentMsgRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["block"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "block") + } + + protoReq.Block, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "block", err) + } + + msg, err := client.RecentMsg(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RecentMsg_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRecentMsgRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["block"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "block") + } + + protoReq.Block, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "block", err) + } + + msg, err := server.RecentMsg(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_RecentMsgAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_RecentMsgAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRecentMsgRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RecentMsgAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RecentMsgAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RecentMsgAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRecentMsgRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RecentMsgAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RecentMsgAll(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_RecentParams_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRecentParamsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["block"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "block") + } + + protoReq.Block, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "block", err) + } + + msg, err := client.RecentParams(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RecentParams_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRecentParamsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["block"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "block") + } + + protoReq.Block, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "block", err) + } + + msg, err := server.RecentParams(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_RecentParamsAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_RecentParamsAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRecentParamsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RecentParamsAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RecentParamsAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RecentParamsAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRecentParamsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RecentParamsAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RecentParamsAll(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Prices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Prices_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Prices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ValidatorUpdateBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ValidatorUpdateBlock_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ValidatorUpdateBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IndexRecentParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_IndexRecentParams_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IndexRecentParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IndexRecentMsg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_IndexRecentMsg_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IndexRecentMsg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentMsg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RecentMsg_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentMsg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentMsgAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RecentMsgAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentMsgAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RecentParams_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentParamsAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RecentParamsAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentParamsAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Prices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Prices_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Prices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ValidatorUpdateBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ValidatorUpdateBlock_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ValidatorUpdateBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IndexRecentParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_IndexRecentParams_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IndexRecentParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IndexRecentMsg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_IndexRecentMsg_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IndexRecentMsg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentMsg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RecentMsg_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentMsg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentMsgAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RecentMsgAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentMsgAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RecentParams_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RecentParamsAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RecentParamsAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RecentParamsAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "params"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Prices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "prices", "tokenId"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_ValidatorUpdateBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "validator_update_block"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_IndexRecentParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "index_recent_params"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_IndexRecentMsg_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "index_recent_msg"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RecentMsg_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "recent_msg", "block"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RecentMsgAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "recent_msg"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RecentParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ExocoreNetwork", "exocore", "oracle", "recent_params", "block"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_RecentParamsAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "oracle", "recent_params"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_Prices_0 = runtime.ForwardResponseMessage + + forward_Query_ValidatorUpdateBlock_0 = runtime.ForwardResponseMessage + + forward_Query_IndexRecentParams_0 = runtime.ForwardResponseMessage + + forward_Query_IndexRecentMsg_0 = runtime.ForwardResponseMessage + + forward_Query_RecentMsg_0 = runtime.ForwardResponseMessage + + forward_Query_RecentMsgAll_0 = runtime.ForwardResponseMessage + + forward_Query_RecentParams_0 = runtime.ForwardResponseMessage + + forward_Query_RecentParamsAll_0 = runtime.ForwardResponseMessage +) diff --git a/x/oracle/types/recent_msg.pb.go b/x/oracle/types/recent_msg.pb.go new file mode 100644 index 000000000..bbd95c4ad --- /dev/null +++ b/x/oracle/types/recent_msg.pb.go @@ -0,0 +1,636 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/recent_msg.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type RecentMsg struct { + Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` + Msgs []*MsgItem `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"` +} + +func (m *RecentMsg) Reset() { *m = RecentMsg{} } +func (m *RecentMsg) String() string { return proto.CompactTextString(m) } +func (*RecentMsg) ProtoMessage() {} +func (*RecentMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_fa7a51ad934a6cc3, []int{0} +} +func (m *RecentMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RecentMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RecentMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RecentMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_RecentMsg.Merge(m, src) +} +func (m *RecentMsg) XXX_Size() int { + return m.Size() +} +func (m *RecentMsg) XXX_DiscardUnknown() { + xxx_messageInfo_RecentMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_RecentMsg proto.InternalMessageInfo + +func (m *RecentMsg) GetBlock() uint64 { + if m != nil { + return m.Block + } + return 0 +} + +func (m *RecentMsg) GetMsgs() []*MsgItem { + if m != nil { + return m.Msgs + } + return nil +} + +type MsgItem struct { + FeederId int32 `protobuf:"varint,2,opt,name=feeder_id,json=feederId,proto3" json:"feeder_id,omitempty"` + PSources []*PriceWithSource `protobuf:"bytes,3,rep,name=p_sources,json=pSources,proto3" json:"p_sources,omitempty"` + Validator string `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` +} + +func (m *MsgItem) Reset() { *m = MsgItem{} } +func (m *MsgItem) String() string { return proto.CompactTextString(m) } +func (*MsgItem) ProtoMessage() {} +func (*MsgItem) Descriptor() ([]byte, []int) { + return fileDescriptor_fa7a51ad934a6cc3, []int{1} +} +func (m *MsgItem) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgItem.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgItem.Merge(m, src) +} +func (m *MsgItem) XXX_Size() int { + return m.Size() +} +func (m *MsgItem) XXX_DiscardUnknown() { + xxx_messageInfo_MsgItem.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgItem proto.InternalMessageInfo + +func (m *MsgItem) GetFeederId() int32 { + if m != nil { + return m.FeederId + } + return 0 +} + +func (m *MsgItem) GetPSources() []*PriceWithSource { + if m != nil { + return m.PSources + } + return nil +} + +func (m *MsgItem) GetValidator() string { + if m != nil { + return m.Validator + } + return "" +} + +func init() { + proto.RegisterType((*RecentMsg)(nil), "exocore.oracle.RecentMsg") + proto.RegisterType((*MsgItem)(nil), "exocore.oracle.MsgItem") +} + +func init() { proto.RegisterFile("exocore/oracle/recent_msg.proto", fileDescriptor_fa7a51ad934a6cc3) } + +var fileDescriptor_fa7a51ad934a6cc3 = []byte{ + // 290 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0x41, 0x4b, 0xc3, 0x40, + 0x10, 0x85, 0xbb, 0x6d, 0xaa, 0xcd, 0x0a, 0x1e, 0x16, 0xc1, 0x50, 0x65, 0x1b, 0x7a, 0x0a, 0x08, + 0x89, 0xe8, 0xd5, 0x93, 0xe0, 0xa1, 0x42, 0x8b, 0xac, 0x07, 0xc1, 0x4b, 0x48, 0x36, 0x63, 0x1a, + 0x9a, 0xb8, 0x61, 0x77, 0xab, 0xf5, 0xea, 0x2f, 0xf0, 0x67, 0x79, 0xec, 0xd1, 0xa3, 0x24, 0x7f, + 0x44, 0xdc, 0x6d, 0x11, 0x7b, 0x9b, 0x79, 0x7c, 0xef, 0xcd, 0xf0, 0xf0, 0x08, 0x56, 0x82, 0x0b, + 0x09, 0x91, 0x90, 0x09, 0x2f, 0x21, 0x92, 0xc0, 0xe1, 0x59, 0xc7, 0x95, 0xca, 0xc3, 0x5a, 0x0a, + 0x2d, 0xc8, 0xe1, 0x06, 0x08, 0x2d, 0x30, 0x1c, 0xee, 0x18, 0x6a, 0x59, 0x70, 0xb0, 0xec, 0x78, + 0x86, 0x5d, 0x66, 0xfc, 0x53, 0x95, 0x93, 0x23, 0xdc, 0x4f, 0x4b, 0xc1, 0x17, 0x1e, 0xf2, 0x51, + 0xe0, 0x30, 0xbb, 0x90, 0x33, 0xec, 0x54, 0x2a, 0x57, 0x5e, 0xd7, 0xef, 0x05, 0x07, 0x17, 0xc7, + 0xe1, 0xff, 0xf4, 0x70, 0xaa, 0xf2, 0x89, 0x86, 0x8a, 0x19, 0x68, 0xfc, 0x8e, 0xf0, 0xfe, 0x46, + 0x21, 0x27, 0xd8, 0x7d, 0x02, 0xc8, 0x40, 0xc6, 0x45, 0xe6, 0x75, 0x7d, 0x14, 0xf4, 0xd9, 0xc0, + 0x0a, 0x93, 0x8c, 0x5c, 0x61, 0xb7, 0x8e, 0x95, 0x58, 0x4a, 0x0e, 0xca, 0xeb, 0x99, 0xe8, 0xd1, + 0x6e, 0xf4, 0xdd, 0xef, 0xa3, 0x0f, 0x85, 0x9e, 0xdf, 0x1b, 0x8e, 0x0d, 0x6a, 0x3b, 0x28, 0x72, + 0x8a, 0xdd, 0x97, 0xa4, 0x2c, 0xb2, 0x44, 0x0b, 0xe9, 0x39, 0x3e, 0x0a, 0x5c, 0xf6, 0x27, 0x5c, + 0xdf, 0x7e, 0x36, 0x14, 0xad, 0x1b, 0x8a, 0xbe, 0x1b, 0x8a, 0x3e, 0x5a, 0xda, 0x59, 0xb7, 0xb4, + 0xf3, 0xd5, 0xd2, 0xce, 0xe3, 0x79, 0x5e, 0xe8, 0xf9, 0x32, 0x0d, 0xb9, 0xa8, 0xa2, 0x1b, 0x7b, + 0x6c, 0x06, 0xfa, 0x55, 0xc8, 0x45, 0xb4, 0x2d, 0x69, 0xb5, 0xad, 0x49, 0xbf, 0xd5, 0xa0, 0xd2, + 0x3d, 0xd3, 0xd3, 0xe5, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x33, 0x0b, 0xb0, 0xb3, 0x76, 0x01, + 0x00, 0x00, +} + +func (m *RecentMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RecentMsg) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RecentMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Msgs) > 0 { + for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRecentMsg(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Block != 0 { + i = encodeVarintRecentMsg(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgItem) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgItem) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Validator) > 0 { + i -= len(m.Validator) + copy(dAtA[i:], m.Validator) + i = encodeVarintRecentMsg(dAtA, i, uint64(len(m.Validator))) + i-- + dAtA[i] = 0x22 + } + if len(m.PSources) > 0 { + for iNdEx := len(m.PSources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PSources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRecentMsg(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.FeederId != 0 { + i = encodeVarintRecentMsg(dAtA, i, uint64(m.FeederId)) + i-- + dAtA[i] = 0x10 + } + return len(dAtA) - i, nil +} + +func encodeVarintRecentMsg(dAtA []byte, offset int, v uint64) int { + offset -= sovRecentMsg(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RecentMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Block != 0 { + n += 1 + sovRecentMsg(uint64(m.Block)) + } + if len(m.Msgs) > 0 { + for _, e := range m.Msgs { + l = e.Size() + n += 1 + l + sovRecentMsg(uint64(l)) + } + } + return n +} + +func (m *MsgItem) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FeederId != 0 { + n += 1 + sovRecentMsg(uint64(m.FeederId)) + } + if len(m.PSources) > 0 { + for _, e := range m.PSources { + l = e.Size() + n += 1 + l + sovRecentMsg(uint64(l)) + } + } + l = len(m.Validator) + if l > 0 { + n += 1 + l + sovRecentMsg(uint64(l)) + } + return n +} + +func sovRecentMsg(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRecentMsg(x uint64) (n int) { + return sovRecentMsg(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RecentMsg) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RecentMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RecentMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + m.Block = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Block |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msgs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRecentMsg + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRecentMsg + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msgs = append(m.Msgs, &MsgItem{}) + if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRecentMsg(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecentMsg + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgItem) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FeederId", wireType) + } + m.FeederId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FeederId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PSources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRecentMsg + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRecentMsg + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PSources = append(m.PSources, &PriceWithSource{}) + if err := m.PSources[len(m.PSources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRecentMsg + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecentMsg + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRecentMsg(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecentMsg + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRecentMsg(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecentMsg + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthRecentMsg + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRecentMsg + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRecentMsg + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRecentMsg = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRecentMsg = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRecentMsg = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/recent_params.pb.go b/x/oracle/types/recent_params.pb.go new file mode 100644 index 000000000..1f4ffe2c2 --- /dev/null +++ b/x/oracle/types/recent_params.pb.go @@ -0,0 +1,362 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/recent_params.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type RecentParams struct { + Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (m *RecentParams) Reset() { *m = RecentParams{} } +func (m *RecentParams) String() string { return proto.CompactTextString(m) } +func (*RecentParams) ProtoMessage() {} +func (*RecentParams) Descriptor() ([]byte, []int) { + return fileDescriptor_3ba826a0c619fc62, []int{0} +} +func (m *RecentParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RecentParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RecentParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RecentParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_RecentParams.Merge(m, src) +} +func (m *RecentParams) XXX_Size() int { + return m.Size() +} +func (m *RecentParams) XXX_DiscardUnknown() { + xxx_messageInfo_RecentParams.DiscardUnknown(m) +} + +var xxx_messageInfo_RecentParams proto.InternalMessageInfo + +func (m *RecentParams) GetBlock() uint64 { + if m != nil { + return m.Block + } + return 0 +} + +func (m *RecentParams) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + +func init() { + proto.RegisterType((*RecentParams)(nil), "exocore.oracle.RecentParams") +} + +func init() { + proto.RegisterFile("exocore/oracle/recent_params.proto", fileDescriptor_3ba826a0c619fc62) +} + +var fileDescriptor_3ba826a0c619fc62 = []byte{ + // 192 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x4a, 0x4d, 0x4e, 0xcd, + 0x2b, 0x89, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, + 0x83, 0xaa, 0xd1, 0x83, 0xa8, 0x91, 0x92, 0x46, 0xd3, 0x83, 0xac, 0x58, 0x29, 0x84, 0x8b, 0x27, + 0x08, 0x6c, 0x46, 0x00, 0x58, 0x54, 0x48, 0x84, 0x8b, 0x35, 0x29, 0x27, 0x3f, 0x39, 0x5b, 0x82, + 0x51, 0x81, 0x51, 0x83, 0x25, 0x08, 0xc2, 0x11, 0xd2, 0xe3, 0x62, 0x83, 0xe8, 0x92, 0x60, 0x52, + 0x60, 0xd4, 0xe0, 0x36, 0x12, 0xd3, 0x43, 0xb5, 0x43, 0x0f, 0xa2, 0x3b, 0x08, 0xaa, 0xca, 0xc9, + 0xeb, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, + 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x0c, 0xd2, 0x33, 0x4b, 0x32, + 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x5d, 0x21, 0x66, 0xf8, 0xa5, 0x96, 0x94, 0xe7, 0x17, + 0x65, 0xeb, 0xc3, 0x9c, 0x59, 0x01, 0x73, 0x68, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, + 0xa1, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6a, 0xb1, 0x06, 0x17, 0xfb, 0x00, 0x00, 0x00, +} + +func (m *RecentParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RecentParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RecentParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRecentParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Block != 0 { + i = encodeVarintRecentParams(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintRecentParams(dAtA []byte, offset int, v uint64) int { + offset -= sovRecentParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RecentParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Block != 0 { + n += 1 + sovRecentParams(uint64(m.Block)) + } + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovRecentParams(uint64(l)) + } + return n +} + +func sovRecentParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRecentParams(x uint64) (n int) { + return sovRecentParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RecentParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RecentParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RecentParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + m.Block = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Block |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecentParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRecentParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRecentParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRecentParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecentParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRecentParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecentParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecentParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecentParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthRecentParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRecentParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRecentParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRecentParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRecentParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRecentParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/token_feeder.pb.go b/x/oracle/types/token_feeder.pb.go new file mode 100644 index 000000000..1d9152292 --- /dev/null +++ b/x/oracle/types/token_feeder.pb.go @@ -0,0 +1,1057 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/token_feeder.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// n out of m required source +type NOMSource struct { + //required source set, refer to params.sourceList, 1st set to 0 means all valid sources + SourceIds []int32 `protobuf:"varint,1,rep,packed,name=source_ids,json=sourceIds,proto3" json:"source_ids,omitempty"` + //minimum number from the required sources to be fullfiled + Minimum int32 `protobuf:"varint,2,opt,name=minimum,proto3" json:"minimum,omitempty"` +} + +func (m *NOMSource) Reset() { *m = NOMSource{} } +func (m *NOMSource) String() string { return proto.CompactTextString(m) } +func (*NOMSource) ProtoMessage() {} +func (*NOMSource) Descriptor() ([]byte, []int) { + return fileDescriptor_1cc86055064704d5, []int{0} +} +func (m *NOMSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NOMSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NOMSource.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NOMSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_NOMSource.Merge(m, src) +} +func (m *NOMSource) XXX_Size() int { + return m.Size() +} +func (m *NOMSource) XXX_DiscardUnknown() { + xxx_messageInfo_NOMSource.DiscardUnknown(m) +} + +var xxx_messageInfo_NOMSource proto.InternalMessageInfo + +func (m *NOMSource) GetSourceIds() []int32 { + if m != nil { + return m.SourceIds + } + return nil +} + +func (m *NOMSource) GetMinimum() int32 { + if m != nil { + return m.Minimum + } + return 0 +} + +// specify data from which source is needed +// rule_1: specified sources +// rule_2: n out of total sources are required +type RuleWithSource struct { + //refer to params.sourceList.ID, when length>0, ignore the other field, when 1st set to 0, means all valid sources, length==0->check next field:minimum + SourceIds []int32 `protobuf:"varint,1,rep,packed,name=source_ids,json=sourceIds,proto3" json:"source_ids,omitempty"` + //n out of total sources are required + Nom *NOMSource `protobuf:"bytes,2,opt,name=nom,proto3" json:"nom,omitempty"` +} + +func (m *RuleWithSource) Reset() { *m = RuleWithSource{} } +func (m *RuleWithSource) String() string { return proto.CompactTextString(m) } +func (*RuleWithSource) ProtoMessage() {} +func (*RuleWithSource) Descriptor() ([]byte, []int) { + return fileDescriptor_1cc86055064704d5, []int{1} +} +func (m *RuleWithSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RuleWithSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RuleWithSource.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RuleWithSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_RuleWithSource.Merge(m, src) +} +func (m *RuleWithSource) XXX_Size() int { + return m.Size() +} +func (m *RuleWithSource) XXX_DiscardUnknown() { + xxx_messageInfo_RuleWithSource.DiscardUnknown(m) +} + +var xxx_messageInfo_RuleWithSource proto.InternalMessageInfo + +func (m *RuleWithSource) GetSourceIds() []int32 { + if m != nil { + return m.SourceIds + } + return nil +} + +func (m *RuleWithSource) GetNom() *NOMSource { + if m != nil { + return m.Nom + } + return nil +} + +// Tokenfeeder represents a price oracle for one token +type TokenFeeder struct { + //refer to params.tokenList, from 1 + TokenId int32 `protobuf:"varint,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` + //refer to params.ruleList, 0 means no restriction, accept any source including customer defined + RuleId int32 `protobuf:"varint,2,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"` + //include, from 1, when some token's feeder had been stop and then restart, the token_id will be continuous from previous one + StartRoundId int64 `protobuf:"varint,3,opt,name=start_round_id,json=startRoundId,proto3" json:"start_round_id,omitempty"` + //include, first block which start_round_id can be settled is at least start_base_block+1 + StartBaseBlock int64 `protobuf:"varint,4,opt,name=start_base_block,json=startBaseBlock,proto3" json:"start_base_block,omitempty"` + //set as count of blocks, for how many blocks interval the price will be update once + Interval int64 `protobuf:"varint,5,opt,name=interval,proto3" json:"interval,omitempty"` + //tokenfeeder is initialized with forever live, update the End parameters by voting, and will off service by the end + //this is set by updateParams, and the EndRoundID will be update by related. excluded, will not work if current height >=EndBlock + EndBlock int64 `protobuf:"varint,6,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` +} + +func (m *TokenFeeder) Reset() { *m = TokenFeeder{} } +func (m *TokenFeeder) String() string { return proto.CompactTextString(m) } +func (*TokenFeeder) ProtoMessage() {} +func (*TokenFeeder) Descriptor() ([]byte, []int) { + return fileDescriptor_1cc86055064704d5, []int{2} +} +func (m *TokenFeeder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TokenFeeder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TokenFeeder.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TokenFeeder) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenFeeder.Merge(m, src) +} +func (m *TokenFeeder) XXX_Size() int { + return m.Size() +} +func (m *TokenFeeder) XXX_DiscardUnknown() { + xxx_messageInfo_TokenFeeder.DiscardUnknown(m) +} + +var xxx_messageInfo_TokenFeeder proto.InternalMessageInfo + +func (m *TokenFeeder) GetTokenId() int32 { + if m != nil { + return m.TokenId + } + return 0 +} + +func (m *TokenFeeder) GetRuleId() int32 { + if m != nil { + return m.RuleId + } + return 0 +} + +func (m *TokenFeeder) GetStartRoundId() int64 { + if m != nil { + return m.StartRoundId + } + return 0 +} + +func (m *TokenFeeder) GetStartBaseBlock() int64 { + if m != nil { + return m.StartBaseBlock + } + return 0 +} + +func (m *TokenFeeder) GetInterval() int64 { + if m != nil { + return m.Interval + } + return 0 +} + +func (m *TokenFeeder) GetEndBlock() int64 { + if m != nil { + return m.EndBlock + } + return 0 +} + +func init() { + proto.RegisterType((*NOMSource)(nil), "exocore.oracle.NOMSource") + proto.RegisterType((*RuleWithSource)(nil), "exocore.oracle.RuleWithSource") + proto.RegisterType((*TokenFeeder)(nil), "exocore.oracle.TokenFeeder") +} + +func init() { proto.RegisterFile("exocore/oracle/token_feeder.proto", fileDescriptor_1cc86055064704d5) } + +var fileDescriptor_1cc86055064704d5 = []byte{ + // 371 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xdd, 0x6a, 0xdb, 0x30, + 0x14, 0x8e, 0xe6, 0xe5, 0x4f, 0x19, 0x61, 0x88, 0xc1, 0x9c, 0x8c, 0x99, 0x2c, 0xec, 0xc2, 0x30, + 0xb0, 0xc7, 0xf6, 0x06, 0x61, 0x1b, 0x78, 0xb0, 0x0c, 0xbc, 0x41, 0xa1, 0x14, 0x8c, 0x6d, 0x9d, + 0x24, 0x22, 0xb6, 0x14, 0x64, 0xb9, 0x4d, 0xdf, 0xa2, 0x8f, 0x55, 0x7a, 0x95, 0xcb, 0x5e, 0x96, + 0xe4, 0x45, 0x8a, 0x24, 0x27, 0xd0, 0x5e, 0xf5, 0xee, 0x7c, 0x3f, 0xe7, 0xe8, 0xfc, 0x08, 0x7f, + 0x82, 0xad, 0xc8, 0x85, 0x84, 0x50, 0xc8, 0x34, 0x2f, 0x20, 0x54, 0x62, 0x0d, 0x3c, 0x59, 0x00, + 0x50, 0x90, 0xc1, 0x46, 0x0a, 0x25, 0xc8, 0xb0, 0xb1, 0x04, 0xd6, 0x32, 0x7e, 0xb7, 0x14, 0x4b, + 0x61, 0xa4, 0x50, 0x47, 0xd6, 0x35, 0x1e, 0x3d, 0x2b, 0xc4, 0xf8, 0xa2, 0x91, 0xa6, 0x3f, 0x70, + 0x7f, 0xfe, 0xf7, 0xcf, 0x3f, 0x51, 0xcb, 0x1c, 0xc8, 0x47, 0x8c, 0x2b, 0x13, 0x25, 0x8c, 0x56, + 0x2e, 0x9a, 0x38, 0x7e, 0x3b, 0xee, 0x5b, 0x26, 0xa2, 0x15, 0x71, 0x71, 0xb7, 0x64, 0x9c, 0x95, + 0x75, 0xe9, 0xbe, 0x9a, 0x20, 0xbf, 0x1d, 0x1f, 0xe1, 0xf4, 0x02, 0x0f, 0xe3, 0xba, 0x80, 0x33, + 0xa6, 0x56, 0x2f, 0x2b, 0xf5, 0x05, 0x3b, 0x5c, 0xd8, 0x32, 0x83, 0x6f, 0xa3, 0xe0, 0xe9, 0x14, + 0xc1, 0xa9, 0xa3, 0x58, 0xbb, 0xa6, 0x77, 0x08, 0x0f, 0xfe, 0xeb, 0xd9, 0x7f, 0x99, 0xd1, 0xc9, + 0x08, 0xf7, 0xec, 0x2a, 0x18, 0x75, 0x91, 0x6d, 0xc4, 0xe0, 0x88, 0x92, 0xf7, 0xb8, 0x2b, 0xeb, + 0x42, 0x3f, 0xda, 0xb4, 0xd8, 0xd1, 0x30, 0xa2, 0xe4, 0x33, 0x1e, 0x56, 0x2a, 0x95, 0x2a, 0x91, + 0xa2, 0xe6, 0x54, 0xeb, 0xce, 0x04, 0xf9, 0x4e, 0xfc, 0xc6, 0xb0, 0xb1, 0x26, 0x23, 0x4a, 0x7c, + 0xfc, 0xd6, 0xba, 0xb2, 0xb4, 0x82, 0x24, 0x2b, 0x44, 0xbe, 0x76, 0x5f, 0x1b, 0x9f, 0xcd, 0x9e, + 0xa5, 0x15, 0xcc, 0x34, 0x4b, 0xc6, 0xb8, 0xc7, 0xb8, 0x02, 0x79, 0x99, 0x16, 0x6e, 0xdb, 0x38, + 0x4e, 0x98, 0x7c, 0xc0, 0x7d, 0xe0, 0xb4, 0x49, 0xef, 0x58, 0x11, 0x38, 0x35, 0x89, 0xb3, 0xdf, + 0xb7, 0x7b, 0x0f, 0xed, 0xf6, 0x1e, 0x7a, 0xd8, 0x7b, 0xe8, 0xe6, 0xe0, 0xb5, 0x76, 0x07, 0xaf, + 0x75, 0x7f, 0xf0, 0x5a, 0xe7, 0x5f, 0x97, 0x4c, 0xad, 0xea, 0x2c, 0xc8, 0x45, 0x19, 0xfe, 0xb4, + 0x0b, 0x99, 0x83, 0xba, 0x12, 0x72, 0x1d, 0x1e, 0xef, 0xb7, 0x3d, 0x7d, 0x85, 0xeb, 0x0d, 0x54, + 0x59, 0xc7, 0xdc, 0xf0, 0xfb, 0x63, 0x00, 0x00, 0x00, 0xff, 0xff, 0x05, 0xf1, 0x12, 0xb2, 0x29, + 0x02, 0x00, 0x00, +} + +func (m *NOMSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NOMSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NOMSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Minimum != 0 { + i = encodeVarintTokenFeeder(dAtA, i, uint64(m.Minimum)) + i-- + dAtA[i] = 0x10 + } + if len(m.SourceIds) > 0 { + dAtA2 := make([]byte, len(m.SourceIds)*10) + var j1 int + for _, num1 := range m.SourceIds { + num := uint64(num1) + for num >= 1<<7 { + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA2[j1] = uint8(num) + j1++ + } + i -= j1 + copy(dAtA[i:], dAtA2[:j1]) + i = encodeVarintTokenFeeder(dAtA, i, uint64(j1)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RuleWithSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RuleWithSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RuleWithSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Nom != nil { + { + size, err := m.Nom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTokenFeeder(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.SourceIds) > 0 { + dAtA5 := make([]byte, len(m.SourceIds)*10) + var j4 int + for _, num1 := range m.SourceIds { + num := uint64(num1) + for num >= 1<<7 { + dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j4++ + } + dAtA5[j4] = uint8(num) + j4++ + } + i -= j4 + copy(dAtA[i:], dAtA5[:j4]) + i = encodeVarintTokenFeeder(dAtA, i, uint64(j4)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TokenFeeder) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TokenFeeder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TokenFeeder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EndBlock != 0 { + i = encodeVarintTokenFeeder(dAtA, i, uint64(m.EndBlock)) + i-- + dAtA[i] = 0x30 + } + if m.Interval != 0 { + i = encodeVarintTokenFeeder(dAtA, i, uint64(m.Interval)) + i-- + dAtA[i] = 0x28 + } + if m.StartBaseBlock != 0 { + i = encodeVarintTokenFeeder(dAtA, i, uint64(m.StartBaseBlock)) + i-- + dAtA[i] = 0x20 + } + if m.StartRoundId != 0 { + i = encodeVarintTokenFeeder(dAtA, i, uint64(m.StartRoundId)) + i-- + dAtA[i] = 0x18 + } + if m.RuleId != 0 { + i = encodeVarintTokenFeeder(dAtA, i, uint64(m.RuleId)) + i-- + dAtA[i] = 0x10 + } + if m.TokenId != 0 { + i = encodeVarintTokenFeeder(dAtA, i, uint64(m.TokenId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintTokenFeeder(dAtA []byte, offset int, v uint64) int { + offset -= sovTokenFeeder(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *NOMSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SourceIds) > 0 { + l = 0 + for _, e := range m.SourceIds { + l += sovTokenFeeder(uint64(e)) + } + n += 1 + sovTokenFeeder(uint64(l)) + l + } + if m.Minimum != 0 { + n += 1 + sovTokenFeeder(uint64(m.Minimum)) + } + return n +} + +func (m *RuleWithSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SourceIds) > 0 { + l = 0 + for _, e := range m.SourceIds { + l += sovTokenFeeder(uint64(e)) + } + n += 1 + sovTokenFeeder(uint64(l)) + l + } + if m.Nom != nil { + l = m.Nom.Size() + n += 1 + l + sovTokenFeeder(uint64(l)) + } + return n +} + +func (m *TokenFeeder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenId != 0 { + n += 1 + sovTokenFeeder(uint64(m.TokenId)) + } + if m.RuleId != 0 { + n += 1 + sovTokenFeeder(uint64(m.RuleId)) + } + if m.StartRoundId != 0 { + n += 1 + sovTokenFeeder(uint64(m.StartRoundId)) + } + if m.StartBaseBlock != 0 { + n += 1 + sovTokenFeeder(uint64(m.StartBaseBlock)) + } + if m.Interval != 0 { + n += 1 + sovTokenFeeder(uint64(m.Interval)) + } + if m.EndBlock != 0 { + n += 1 + sovTokenFeeder(uint64(m.EndBlock)) + } + return n +} + +func sovTokenFeeder(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTokenFeeder(x uint64) (n int) { + return sovTokenFeeder(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *NOMSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NOMSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NOMSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SourceIds = append(m.SourceIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthTokenFeeder + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthTokenFeeder + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.SourceIds) == 0 { + m.SourceIds = make([]int32, 0, elementCount) + } + for iNdEx < postIndex { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SourceIds = append(m.SourceIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field SourceIds", wireType) + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Minimum", wireType) + } + m.Minimum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Minimum |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTokenFeeder(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTokenFeeder + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RuleWithSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RuleWithSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RuleWithSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SourceIds = append(m.SourceIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthTokenFeeder + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthTokenFeeder + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.SourceIds) == 0 { + m.SourceIds = make([]int32, 0, elementCount) + } + for iNdEx < postIndex { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SourceIds = append(m.SourceIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field SourceIds", wireType) + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTokenFeeder + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTokenFeeder + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nom == nil { + m.Nom = &NOMSource{} + } + if err := m.Nom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTokenFeeder(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTokenFeeder + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TokenFeeder) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TokenFeeder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TokenFeeder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + } + m.TokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TokenId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RuleId", wireType) + } + m.RuleId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RuleId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartRoundId", wireType) + } + m.StartRoundId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartRoundId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartBaseBlock", wireType) + } + m.StartBaseBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartBaseBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + } + m.Interval = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Interval |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) + } + m.EndBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EndBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTokenFeeder(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTokenFeeder + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTokenFeeder(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTokenFeeder + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTokenFeeder + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTokenFeeder + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTokenFeeder + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTokenFeeder = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTokenFeeder = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTokenFeeder = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go new file mode 100644 index 000000000..b9d95cad0 --- /dev/null +++ b/x/oracle/types/tx.pb.go @@ -0,0 +1,699 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MsgCreatePrice struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + //refer to id from Params.TokenFeeders, 0 is reserved, invalid to use + FeederId int32 `protobuf:"varint,2,opt,name=feeder_id,json=feederId,proto3" json:"feeder_id,omitempty"` + Prices []*PriceWithSource `protobuf:"bytes,3,rep,name=prices,proto3" json:"prices,omitempty"` + //on which block commit does this message be built on + BasedBlock uint64 `protobuf:"varint,4,opt,name=based_block,json=basedBlock,proto3" json:"based_block,omitempty"` + Nonce int32 `protobuf:"varint,5,opt,name=nonce,proto3" json:"nonce,omitempty"` +} + +func (m *MsgCreatePrice) Reset() { *m = MsgCreatePrice{} } +func (m *MsgCreatePrice) String() string { return proto.CompactTextString(m) } +func (*MsgCreatePrice) ProtoMessage() {} +func (*MsgCreatePrice) Descriptor() ([]byte, []int) { + return fileDescriptor_02cf64aff79d2288, []int{0} +} +func (m *MsgCreatePrice) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreatePrice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreatePrice.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreatePrice) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreatePrice.Merge(m, src) +} +func (m *MsgCreatePrice) XXX_Size() int { + return m.Size() +} +func (m *MsgCreatePrice) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreatePrice.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreatePrice proto.InternalMessageInfo + +func (m *MsgCreatePrice) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgCreatePrice) GetFeederId() int32 { + if m != nil { + return m.FeederId + } + return 0 +} + +func (m *MsgCreatePrice) GetPrices() []*PriceWithSource { + if m != nil { + return m.Prices + } + return nil +} + +func (m *MsgCreatePrice) GetBasedBlock() uint64 { + if m != nil { + return m.BasedBlock + } + return 0 +} + +func (m *MsgCreatePrice) GetNonce() int32 { + if m != nil { + return m.Nonce + } + return 0 +} + +type MsgCreatePriceResponse struct { +} + +func (m *MsgCreatePriceResponse) Reset() { *m = MsgCreatePriceResponse{} } +func (m *MsgCreatePriceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreatePriceResponse) ProtoMessage() {} +func (*MsgCreatePriceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_02cf64aff79d2288, []int{1} +} +func (m *MsgCreatePriceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreatePriceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreatePriceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreatePriceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreatePriceResponse.Merge(m, src) +} +func (m *MsgCreatePriceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreatePriceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreatePriceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreatePriceResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgCreatePrice)(nil), "exocore.oracle.MsgCreatePrice") + proto.RegisterType((*MsgCreatePriceResponse)(nil), "exocore.oracle.MsgCreatePriceResponse") +} + +func init() { proto.RegisterFile("exocore/oracle/tx.proto", fileDescriptor_02cf64aff79d2288) } + +var fileDescriptor_02cf64aff79d2288 = []byte{ + // 308 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x51, 0xcd, 0x4a, 0xf3, 0x40, + 0x14, 0xed, 0x7c, 0xfd, 0xf9, 0xec, 0x14, 0xba, 0x18, 0x44, 0x87, 0x0a, 0xd3, 0xd0, 0x85, 0x64, + 0x95, 0x48, 0x5d, 0xb8, 0xaf, 0xb8, 0x50, 0xa8, 0x48, 0x44, 0x04, 0x11, 0x4a, 0x33, 0xb9, 0xb6, + 0xa1, 0xb5, 0x37, 0xcc, 0x4c, 0x31, 0xbe, 0x85, 0x6f, 0xe3, 0x2b, 0xb8, 0xec, 0xd2, 0xa5, 0x24, + 0x2f, 0x22, 0x49, 0x1a, 0x31, 0x5d, 0xb8, 0x3c, 0x3f, 0x73, 0xe6, 0x5c, 0x0e, 0x3d, 0x84, 0x18, + 0x25, 0x2a, 0x70, 0x51, 0x4d, 0xe5, 0x12, 0x5c, 0x13, 0x3b, 0x91, 0x42, 0x83, 0xac, 0xbb, 0x15, + 0x9c, 0x42, 0xe8, 0xf5, 0x76, 0x8c, 0x91, 0x0a, 0x25, 0x14, 0xde, 0xc1, 0x3b, 0xa1, 0xdd, 0xb1, + 0x9e, 0x9d, 0x2b, 0x98, 0x1a, 0xb8, 0xc9, 0x04, 0xc6, 0xe9, 0x7f, 0x99, 0x41, 0x54, 0x9c, 0x58, + 0xc4, 0x6e, 0x7b, 0x25, 0x64, 0x47, 0xb4, 0xfd, 0x04, 0x10, 0x80, 0x9a, 0x84, 0x01, 0xff, 0x67, + 0x11, 0xbb, 0xe9, 0xed, 0x15, 0xc4, 0x65, 0xc0, 0xce, 0x68, 0x2b, 0x0f, 0xd6, 0xbc, 0x6e, 0xd5, + 0xed, 0xce, 0xb0, 0xef, 0x54, 0x6b, 0x38, 0x79, 0xfa, 0x7d, 0x68, 0xe6, 0xb7, 0xb8, 0x56, 0x12, + 0xbc, 0xad, 0x9d, 0xf5, 0x69, 0xc7, 0x9f, 0x6a, 0x08, 0x26, 0xfe, 0x12, 0xe5, 0x82, 0x37, 0x2c, + 0x62, 0x37, 0x3c, 0x9a, 0x53, 0xa3, 0x8c, 0x61, 0xfb, 0xb4, 0xb9, 0xc2, 0x95, 0x04, 0xde, 0xcc, + 0xbf, 0x2c, 0xc0, 0x80, 0xd3, 0x83, 0x6a, 0x71, 0x0f, 0x74, 0x84, 0x2b, 0x0d, 0xc3, 0x47, 0x5a, + 0x1f, 0xeb, 0x19, 0xbb, 0xa3, 0x9d, 0xdf, 0x67, 0x89, 0xdd, 0x3e, 0xd5, 0xd7, 0xbd, 0xe3, 0xbf, + 0xf5, 0x32, 0x7d, 0x74, 0xf5, 0x91, 0x08, 0xb2, 0x49, 0x04, 0xf9, 0x4a, 0x04, 0x79, 0x4b, 0x45, + 0x6d, 0x93, 0x8a, 0xda, 0x67, 0x2a, 0x6a, 0x0f, 0x27, 0xb3, 0xd0, 0xcc, 0xd7, 0xbe, 0x23, 0xf1, + 0xd9, 0xbd, 0x28, 0xb2, 0xae, 0xc1, 0xbc, 0xa0, 0x5a, 0xb8, 0xe5, 0x02, 0xf1, 0xcf, 0x58, 0xaf, + 0x11, 0x68, 0xbf, 0x95, 0x8f, 0x70, 0xfa, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x8e, 0x94, 0xc6, + 0xcb, 0x01, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // create price for a new oracle round + CreatePrice(ctx context.Context, in *MsgCreatePrice, opts ...grpc.CallOption) (*MsgCreatePriceResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreatePrice(ctx context.Context, in *MsgCreatePrice, opts ...grpc.CallOption) (*MsgCreatePriceResponse, error) { + out := new(MsgCreatePriceResponse) + err := c.cc.Invoke(ctx, "/exocore.oracle.Msg/CreatePrice", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // create price for a new oracle round + CreatePrice(context.Context, *MsgCreatePrice) (*MsgCreatePriceResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) CreatePrice(ctx context.Context, req *MsgCreatePrice) (*MsgCreatePriceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreatePrice not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_CreatePrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreatePrice) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreatePrice(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.oracle.Msg/CreatePrice", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreatePrice(ctx, req.(*MsgCreatePrice)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "exocore.oracle.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreatePrice", + Handler: _Msg_CreatePrice_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "exocore/oracle/tx.proto", +} + +func (m *MsgCreatePrice) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreatePrice) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreatePrice) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Nonce != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Nonce)) + i-- + dAtA[i] = 0x28 + } + if m.BasedBlock != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.BasedBlock)) + i-- + dAtA[i] = 0x20 + } + if len(m.Prices) > 0 { + for iNdEx := len(m.Prices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Prices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.FeederId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.FeederId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreatePriceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreatePriceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreatePriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreatePrice) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.FeederId != 0 { + n += 1 + sovTx(uint64(m.FeederId)) + } + if len(m.Prices) > 0 { + for _, e := range m.Prices { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if m.BasedBlock != 0 { + n += 1 + sovTx(uint64(m.BasedBlock)) + } + if m.Nonce != 0 { + n += 1 + sovTx(uint64(m.Nonce)) + } + return n +} + +func (m *MsgCreatePriceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgCreatePrice) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreatePrice: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreatePrice: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FeederId", wireType) + } + m.FeederId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FeederId |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prices = append(m.Prices, &PriceWithSource{}) + if err := m.Prices[len(m.Prices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BasedBlock", wireType) + } + m.BasedBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BasedBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + m.Nonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Nonce |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreatePriceResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreatePriceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreatePriceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/types.go b/x/oracle/types/types.go new file mode 100644 index 000000000..a99349471 --- /dev/null +++ b/x/oracle/types/types.go @@ -0,0 +1,9 @@ +package types + +import "encoding/binary" + +func Uint64Bytes(value uint64) []byte { + valueBytes := make([]byte, 8) + binary.BigEndian.PutUint64(valueBytes, value) + return valueBytes +} diff --git a/x/oracle/types/validator_update_block.pb.go b/x/oracle/types/validator_update_block.pb.go new file mode 100644 index 000000000..3be936b0d --- /dev/null +++ b/x/oracle/types/validator_update_block.pb.go @@ -0,0 +1,301 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/validator_update_block.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type ValidatorUpdateBlock struct { + Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` +} + +func (m *ValidatorUpdateBlock) Reset() { *m = ValidatorUpdateBlock{} } +func (m *ValidatorUpdateBlock) String() string { return proto.CompactTextString(m) } +func (*ValidatorUpdateBlock) ProtoMessage() {} +func (*ValidatorUpdateBlock) Descriptor() ([]byte, []int) { + return fileDescriptor_2ea66d5cc483dd28, []int{0} +} +func (m *ValidatorUpdateBlock) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorUpdateBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorUpdateBlock.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ValidatorUpdateBlock) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorUpdateBlock.Merge(m, src) +} +func (m *ValidatorUpdateBlock) XXX_Size() int { + return m.Size() +} +func (m *ValidatorUpdateBlock) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorUpdateBlock.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorUpdateBlock proto.InternalMessageInfo + +func (m *ValidatorUpdateBlock) GetBlock() uint64 { + if m != nil { + return m.Block + } + return 0 +} + +func init() { + proto.RegisterType((*ValidatorUpdateBlock)(nil), "exocore.oracle.ValidatorUpdateBlock") +} + +func init() { + proto.RegisterFile("exocore/oracle/validator_update_block.proto", fileDescriptor_2ea66d5cc483dd28) +} + +var fileDescriptor_2ea66d5cc483dd28 = []byte{ + // 171 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4e, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x4b, 0xcc, 0xc9, 0x4c, + 0x49, 0x2c, 0xc9, 0x2f, 0x8a, 0x2f, 0x2d, 0x48, 0x49, 0x2c, 0x49, 0x8d, 0x4f, 0xca, 0xc9, 0x4f, + 0xce, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x2a, 0xd6, 0x83, 0x28, 0x56, 0xd2, + 0xe1, 0x12, 0x09, 0x83, 0xa9, 0x0f, 0x05, 0x2b, 0x77, 0x02, 0xa9, 0x16, 0x12, 0xe1, 0x62, 0x05, + 0x6b, 0x93, 0x60, 0x54, 0x60, 0xd4, 0x60, 0x09, 0x82, 0x70, 0x9c, 0xbc, 0x4e, 0x3c, 0x92, 0x63, + 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, + 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x20, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, + 0x3f, 0x57, 0xdf, 0x15, 0x62, 0x85, 0x5f, 0x6a, 0x49, 0x79, 0x7e, 0x51, 0xb6, 0x3e, 0xcc, 0x79, + 0x15, 0x30, 0x07, 0x96, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x64, 0x0c, 0x08, 0x00, + 0x00, 0xff, 0xff, 0x27, 0x1f, 0x25, 0xe5, 0xbf, 0x00, 0x00, 0x00, +} + +func (m *ValidatorUpdateBlock) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidatorUpdateBlock) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorUpdateBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Block != 0 { + i = encodeVarintValidatorUpdateBlock(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintValidatorUpdateBlock(dAtA []byte, offset int, v uint64) int { + offset -= sovValidatorUpdateBlock(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ValidatorUpdateBlock) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Block != 0 { + n += 1 + sovValidatorUpdateBlock(uint64(m.Block)) + } + return n +} + +func sovValidatorUpdateBlock(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozValidatorUpdateBlock(x uint64) (n int) { + return sovValidatorUpdateBlock(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ValidatorUpdateBlock) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorUpdateBlock + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidatorUpdateBlock: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorUpdateBlock: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + m.Block = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorUpdateBlock + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Block |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipValidatorUpdateBlock(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthValidatorUpdateBlock + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipValidatorUpdateBlock(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidatorUpdateBlock + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidatorUpdateBlock + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidatorUpdateBlock + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthValidatorUpdateBlock + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupValidatorUpdateBlock + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthValidatorUpdateBlock + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthValidatorUpdateBlock = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowValidatorUpdateBlock = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupValidatorUpdateBlock = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/oracle/types/validators.pb.go b/x/oracle/types/validators.pb.go new file mode 100644 index 000000000..8e8117825 --- /dev/null +++ b/x/oracle/types/validators.pb.go @@ -0,0 +1,586 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: exocore/oracle/validators.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Validators struct { + Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` + ValidatorList []*Validator `protobuf:"bytes,2,rep,name=validator_list,json=validatorList,proto3" json:"validator_list,omitempty"` +} + +func (m *Validators) Reset() { *m = Validators{} } +func (m *Validators) String() string { return proto.CompactTextString(m) } +func (*Validators) ProtoMessage() {} +func (*Validators) Descriptor() ([]byte, []int) { + return fileDescriptor_4264e9827808bf71, []int{0} +} +func (m *Validators) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Validators) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Validators.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Validators) XXX_Merge(src proto.Message) { + xxx_messageInfo_Validators.Merge(m, src) +} +func (m *Validators) XXX_Size() int { + return m.Size() +} +func (m *Validators) XXX_DiscardUnknown() { + xxx_messageInfo_Validators.DiscardUnknown(m) +} + +var xxx_messageInfo_Validators proto.InternalMessageInfo + +func (m *Validators) GetBlock() uint64 { + if m != nil { + return m.Block + } + return 0 +} + +func (m *Validators) GetValidatorList() []*Validator { + if m != nil { + return m.ValidatorList + } + return nil +} + +type Validator struct { + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` + Power string `protobuf:"bytes,2,opt,name=power,proto3" json:"power,omitempty"` +} + +func (m *Validator) Reset() { *m = Validator{} } +func (m *Validator) String() string { return proto.CompactTextString(m) } +func (*Validator) ProtoMessage() {} +func (*Validator) Descriptor() ([]byte, []int) { + return fileDescriptor_4264e9827808bf71, []int{1} +} +func (m *Validator) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Validator.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Validator) XXX_Merge(src proto.Message) { + xxx_messageInfo_Validator.Merge(m, src) +} +func (m *Validator) XXX_Size() int { + return m.Size() +} +func (m *Validator) XXX_DiscardUnknown() { + xxx_messageInfo_Validator.DiscardUnknown(m) +} + +var xxx_messageInfo_Validator proto.InternalMessageInfo + +func (m *Validator) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *Validator) GetPower() string { + if m != nil { + return m.Power + } + return "" +} + +func init() { + proto.RegisterType((*Validators)(nil), "exocore.oracle.Validators") + proto.RegisterType((*Validator)(nil), "exocore.oracle.Validator") +} + +func init() { proto.RegisterFile("exocore/oracle/validators.proto", fileDescriptor_4264e9827808bf71) } + +var fileDescriptor_4264e9827808bf71 = []byte{ + // 225 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x4b, 0xcc, 0xc9, 0x4c, + 0x49, 0x2c, 0xc9, 0x2f, 0x2a, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x2a, 0xd0, + 0x83, 0x28, 0x50, 0x4a, 0xe1, 0xe2, 0x0a, 0x83, 0xab, 0x11, 0x12, 0xe1, 0x62, 0x4d, 0xca, 0xc9, + 0x4f, 0xce, 0x96, 0x60, 0x54, 0x60, 0xd4, 0x60, 0x09, 0x82, 0x70, 0x84, 0x1c, 0xb8, 0xf8, 0xe0, + 0xe6, 0xc4, 0xe7, 0x64, 0x16, 0x97, 0x48, 0x30, 0x29, 0x30, 0x6b, 0x70, 0x1b, 0x49, 0xea, 0xa1, + 0x1a, 0xa6, 0x07, 0x37, 0x29, 0x88, 0x17, 0xae, 0xc1, 0x27, 0xb3, 0xb8, 0x44, 0xc9, 0x96, 0x8b, + 0x13, 0x2e, 0x27, 0x24, 0xc5, 0xc5, 0x91, 0x5f, 0x90, 0x5a, 0x04, 0x62, 0x83, 0xed, 0xe1, 0x0c, + 0x82, 0xf3, 0x41, 0x0e, 0x28, 0xc8, 0x2f, 0x4f, 0x2d, 0x92, 0x60, 0x02, 0x4b, 0x40, 0x38, 0x4e, + 0x5e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, + 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x90, 0x9e, 0x59, 0x92, + 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0xef, 0x0a, 0x71, 0x8c, 0x5f, 0x6a, 0x49, 0x79, 0x7e, + 0x51, 0xb6, 0x3e, 0x2c, 0x24, 0x2a, 0x60, 0x61, 0x51, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, + 0x0e, 0x07, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x17, 0x61, 0x71, 0xf1, 0x2a, 0x01, 0x00, + 0x00, +} + +func (m *Validators) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Validators) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Validators) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorList) > 0 { + for iNdEx := len(m.ValidatorList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ValidatorList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintValidators(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Block != 0 { + i = encodeVarintValidators(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Validator) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Validator) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Power) > 0 { + i -= len(m.Power) + copy(dAtA[i:], m.Power) + i = encodeVarintValidators(dAtA, i, uint64(len(m.Power))) + i-- + dAtA[i] = 0x12 + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintValidators(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintValidators(dAtA []byte, offset int, v uint64) int { + offset -= sovValidators(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Validators) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Block != 0 { + n += 1 + sovValidators(uint64(m.Block)) + } + if len(m.ValidatorList) > 0 { + for _, e := range m.ValidatorList { + l = e.Size() + n += 1 + l + sovValidators(uint64(l)) + } + } + return n +} + +func (m *Validator) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovValidators(uint64(l)) + } + l = len(m.Power) + if l > 0 { + n += 1 + l + sovValidators(uint64(l)) + } + return n +} + +func sovValidators(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozValidators(x uint64) (n int) { + return sovValidators(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Validators) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidators + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Validators: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Validators: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + m.Block = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidators + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Block |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidators + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthValidators + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthValidators + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorList = append(m.ValidatorList, &Validator{}) + if err := m.ValidatorList[len(m.ValidatorList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipValidators(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthValidators + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Validator) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidators + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Validator: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Validator: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidators + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthValidators + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthValidators + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Power", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidators + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthValidators + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthValidators + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Power = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipValidators(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthValidators + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipValidators(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidators + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidators + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidators + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthValidators + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupValidators + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthValidators + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthValidators = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowValidators = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupValidators = fmt.Errorf("proto: unexpected end of group") +) From 1a1d0635731572d66323081144f015513bef4ea0 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Wed, 3 Apr 2024 03:05:24 +0800 Subject: [PATCH 31/37] feat(oracle-keeper):implement keeper for state access, msgserver for price update --- x/oracle/keeper/common/common_test.go | 29 ++ x/oracle/keeper/common/expected_keepers.go | 39 ++ x/oracle/keeper/common/mock_keeper_test.go | 270 ++++++++++++++ x/oracle/keeper/common/mock_validator_test.go | 343 ++++++++++++++++++ x/oracle/keeper/common/types.go | 173 +++++++++ x/oracle/keeper/index_recent_msg.go | 33 ++ x/oracle/keeper/index_recent_params.go | 33 ++ x/oracle/keeper/keeper.go | 73 ++++ x/oracle/keeper/msg_server.go | 17 + x/oracle/keeper/msg_server_create_price.go | 32 ++ x/oracle/keeper/params.go | 40 ++ x/oracle/keeper/prices.go | 189 ++++++++++ x/oracle/keeper/query.go | 7 + x/oracle/keeper/query_index_recent_msg.go | 24 ++ x/oracle/keeper/query_index_recent_params.go | 24 ++ x/oracle/keeper/query_params.go | 19 + x/oracle/keeper/query_prices.go | 56 +++ x/oracle/keeper/query_recent_msg.go | 57 +++ x/oracle/keeper/query_recent_params.go | 57 +++ .../keeper/query_validator_update_block.go | 24 ++ x/oracle/keeper/recent_msg.go | 79 ++++ x/oracle/keeper/recent_params.go | 78 ++++ x/oracle/keeper/single.go | 150 ++++++++ x/oracle/keeper/validator_update_block.go | 33 ++ 24 files changed, 1879 insertions(+) create mode 100644 x/oracle/keeper/common/common_test.go create mode 100644 x/oracle/keeper/common/expected_keepers.go create mode 100644 x/oracle/keeper/common/mock_keeper_test.go create mode 100644 x/oracle/keeper/common/mock_validator_test.go create mode 100644 x/oracle/keeper/common/types.go create mode 100644 x/oracle/keeper/index_recent_msg.go create mode 100644 x/oracle/keeper/index_recent_params.go create mode 100644 x/oracle/keeper/keeper.go create mode 100644 x/oracle/keeper/msg_server.go create mode 100644 x/oracle/keeper/msg_server_create_price.go create mode 100644 x/oracle/keeper/params.go create mode 100644 x/oracle/keeper/prices.go create mode 100644 x/oracle/keeper/query.go create mode 100644 x/oracle/keeper/query_index_recent_msg.go create mode 100644 x/oracle/keeper/query_index_recent_params.go create mode 100644 x/oracle/keeper/query_params.go create mode 100644 x/oracle/keeper/query_prices.go create mode 100644 x/oracle/keeper/query_recent_msg.go create mode 100644 x/oracle/keeper/query_recent_params.go create mode 100644 x/oracle/keeper/query_validator_update_block.go create mode 100644 x/oracle/keeper/recent_msg.go create mode 100644 x/oracle/keeper/recent_params.go create mode 100644 x/oracle/keeper/single.go create mode 100644 x/oracle/keeper/validator_update_block.go diff --git a/x/oracle/keeper/common/common_test.go b/x/oracle/keeper/common/common_test.go new file mode 100644 index 000000000..22fa257a5 --- /dev/null +++ b/x/oracle/keeper/common/common_test.go @@ -0,0 +1,29 @@ +package common + +import ( + "math/big" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + . "github.com/smartystreets/goconvey/convey" + "go.uber.org/mock/gomock" +) + +//go:generate mockgen -destination mock_keeper_test.go -package common github.com/ExocoreNetwork/exocore/x/oracle/keeper/common KeeperOracle + +//go:generate mockgen -destination mock_validator_test.go -package common github.com/cosmos/cosmos-sdk/x/staking/types ValidatorI + +func TestMock(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + ko := NewMockKeeperOracle(ctrl) + + ko.EXPECT().GetLastTotalPower(gomock.Any()).Return(big.NewInt(99)) + + x := ko.GetLastTotalPower(sdk.Context{}) + _ = x + + Convey("mock oracle keeper", t, func() { + Convey("GetLastTotalPower", func() { So(x, ShouldResemble, big.NewInt(99)) }) + }) +} diff --git a/x/oracle/keeper/common/expected_keepers.go b/x/oracle/keeper/common/expected_keepers.go new file mode 100644 index 000000000..0eec0d1ff --- /dev/null +++ b/x/oracle/keeper/common/expected_keepers.go @@ -0,0 +1,39 @@ +package common + +import ( + "math/big" + + // "cosmossdk.io/api/tendermint/abci" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + abci "github.com/cometbft/cometbft/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" + stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +type KeeperOracle interface { + GetParams(sdk.Context) types.Params + + IterateBondedValidatorsByPower(sdk.Context, func(index int64, validator stakingTypes.ValidatorI) bool) + GetLastTotalPower(sdk.Context) *big.Int + GetValidatorUpdates(sdk.Context) []abci.ValidatorUpdate + GetValidatorByConsAddr(sdk.Context, sdk.ConsAddress) (stakingTypes.Validator, bool) + + GetIndexRecentMsg(sdk.Context) (types.IndexRecentMsg, bool) + GetAllRecentMsgAsMap(sdk.Context) map[uint64][]*types.MsgItem + + GetIndexRecentParams(sdk.Context) (types.IndexRecentParams, bool) + GetAllRecentParamsAsMap(sdk.Context) map[uint64]*types.Params + + GetValidatorUpdateBlock(sdk.Context) (types.ValidatorUpdateBlock, bool) + + SetIndexRecentMsg(sdk.Context, types.IndexRecentMsg) + SetRecentMsg(sdk.Context, types.RecentMsg) + + SetIndexRecentParams(sdk.Context, types.IndexRecentParams) + SetRecentParams(sdk.Context, types.RecentParams) + + SetValidatorUpdateBlock(sdk.Context, types.ValidatorUpdateBlock) + + RemoveRecentParams(sdk.Context, uint64) + RemoveRecentMsg(sdk.Context, uint64) +} diff --git a/x/oracle/keeper/common/mock_keeper_test.go b/x/oracle/keeper/common/mock_keeper_test.go new file mode 100644 index 000000000..623336961 --- /dev/null +++ b/x/oracle/keeper/common/mock_keeper_test.go @@ -0,0 +1,270 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/ExocoreNetwork/exocore/x/oracle/keeper/common (interfaces: KeeperOracle) +// +// Generated by this command: +// +// mockgen -destination mock_keeper_test.go -package common github.com/ExocoreNetwork/exocore/x/oracle/keeper/common KeeperOracle +// + +// Package common is a generated GoMock package. +package common + +import ( + big "math/big" + reflect "reflect" + + types "github.com/ExocoreNetwork/exocore/x/oracle/types" + types0 "github.com/cometbft/cometbft/abci/types" + types1 "github.com/cosmos/cosmos-sdk/types" + types2 "github.com/cosmos/cosmos-sdk/x/staking/types" + gomock "go.uber.org/mock/gomock" +) + +// MockKeeperOracle is a mock of KeeperOracle interface. +type MockKeeperOracle struct { + ctrl *gomock.Controller + recorder *MockKeeperOracleMockRecorder +} + +// MockKeeperOracleMockRecorder is the mock recorder for MockKeeperOracle. +type MockKeeperOracleMockRecorder struct { + mock *MockKeeperOracle +} + +// NewMockKeeperOracle creates a new mock instance. +func NewMockKeeperOracle(ctrl *gomock.Controller) *MockKeeperOracle { + mock := &MockKeeperOracle{ctrl: ctrl} + mock.recorder = &MockKeeperOracleMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockKeeperOracle) EXPECT() *MockKeeperOracleMockRecorder { + return m.recorder +} + +// GetAllRecentMsgAsMap mocks base method. +func (m *MockKeeperOracle) GetAllRecentMsgAsMap(arg0 types1.Context) map[uint64][]*types.MsgItem { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllRecentMsgAsMap", arg0) + ret0, _ := ret[0].(map[uint64][]*types.MsgItem) + return ret0 +} + +// GetAllRecentMsgAsMap indicates an expected call of GetAllRecentMsgAsMap. +func (mr *MockKeeperOracleMockRecorder) GetAllRecentMsgAsMap(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllRecentMsgAsMap", reflect.TypeOf((*MockKeeperOracle)(nil).GetAllRecentMsgAsMap), arg0) +} + +// GetAllRecentParamsAsMap mocks base method. +func (m *MockKeeperOracle) GetAllRecentParamsAsMap(arg0 types1.Context) map[uint64]*types.Params { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllRecentParamsAsMap", arg0) + ret0, _ := ret[0].(map[uint64]*types.Params) + return ret0 +} + +// GetAllRecentParamsAsMap indicates an expected call of GetAllRecentParamsAsMap. +func (mr *MockKeeperOracleMockRecorder) GetAllRecentParamsAsMap(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllRecentParamsAsMap", reflect.TypeOf((*MockKeeperOracle)(nil).GetAllRecentParamsAsMap), arg0) +} + +// GetIndexRecentMsg mocks base method. +func (m *MockKeeperOracle) GetIndexRecentMsg(arg0 types1.Context) (types.IndexRecentMsg, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetIndexRecentMsg", arg0) + ret0, _ := ret[0].(types.IndexRecentMsg) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetIndexRecentMsg indicates an expected call of GetIndexRecentMsg. +func (mr *MockKeeperOracleMockRecorder) GetIndexRecentMsg(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIndexRecentMsg", reflect.TypeOf((*MockKeeperOracle)(nil).GetIndexRecentMsg), arg0) +} + +// GetIndexRecentParams mocks base method. +func (m *MockKeeperOracle) GetIndexRecentParams(arg0 types1.Context) (types.IndexRecentParams, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetIndexRecentParams", arg0) + ret0, _ := ret[0].(types.IndexRecentParams) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetIndexRecentParams indicates an expected call of GetIndexRecentParams. +func (mr *MockKeeperOracleMockRecorder) GetIndexRecentParams(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIndexRecentParams", reflect.TypeOf((*MockKeeperOracle)(nil).GetIndexRecentParams), arg0) +} + +// GetLastTotalPower mocks base method. +func (m *MockKeeperOracle) GetLastTotalPower(arg0 types1.Context) *big.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetLastTotalPower", arg0) + ret0, _ := ret[0].(*big.Int) + return ret0 +} + +// GetLastTotalPower indicates an expected call of GetLastTotalPower. +func (mr *MockKeeperOracleMockRecorder) GetLastTotalPower(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLastTotalPower", reflect.TypeOf((*MockKeeperOracle)(nil).GetLastTotalPower), arg0) +} + +// GetParams mocks base method. +func (m *MockKeeperOracle) GetParams(arg0 types1.Context) types.Params { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetParams", arg0) + ret0, _ := ret[0].(types.Params) + return ret0 +} + +// GetParams indicates an expected call of GetParams. +func (mr *MockKeeperOracleMockRecorder) GetParams(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParams", reflect.TypeOf((*MockKeeperOracle)(nil).GetParams), arg0) +} + +// GetValidatorByConsAddr mocks base method. +func (m *MockKeeperOracle) GetValidatorByConsAddr(arg0 types1.Context, arg1 types1.ConsAddress) (types2.Validator, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetValidatorByConsAddr", arg0, arg1) + ret0, _ := ret[0].(types2.Validator) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetValidatorByConsAddr indicates an expected call of GetValidatorByConsAddr. +func (mr *MockKeeperOracleMockRecorder) GetValidatorByConsAddr(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorByConsAddr", reflect.TypeOf((*MockKeeperOracle)(nil).GetValidatorByConsAddr), arg0, arg1) +} + +// GetValidatorUpdateBlock mocks base method. +func (m *MockKeeperOracle) GetValidatorUpdateBlock(arg0 types1.Context) (types.ValidatorUpdateBlock, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetValidatorUpdateBlock", arg0) + ret0, _ := ret[0].(types.ValidatorUpdateBlock) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetValidatorUpdateBlock indicates an expected call of GetValidatorUpdateBlock. +func (mr *MockKeeperOracleMockRecorder) GetValidatorUpdateBlock(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorUpdateBlock", reflect.TypeOf((*MockKeeperOracle)(nil).GetValidatorUpdateBlock), arg0) +} + +// GetValidatorUpdates mocks base method. +func (m *MockKeeperOracle) GetValidatorUpdates(arg0 types1.Context) []types0.ValidatorUpdate { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetValidatorUpdates", arg0) + ret0, _ := ret[0].([]types0.ValidatorUpdate) + return ret0 +} + +// GetValidatorUpdates indicates an expected call of GetValidatorUpdates. +func (mr *MockKeeperOracleMockRecorder) GetValidatorUpdates(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorUpdates", reflect.TypeOf((*MockKeeperOracle)(nil).GetValidatorUpdates), arg0) +} + +// IterateBondedValidatorsByPower mocks base method. +func (m *MockKeeperOracle) IterateBondedValidatorsByPower(arg0 types1.Context, arg1 func(int64, types2.ValidatorI) bool) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IterateBondedValidatorsByPower", arg0, arg1) +} + +// IterateBondedValidatorsByPower indicates an expected call of IterateBondedValidatorsByPower. +func (mr *MockKeeperOracleMockRecorder) IterateBondedValidatorsByPower(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateBondedValidatorsByPower", reflect.TypeOf((*MockKeeperOracle)(nil).IterateBondedValidatorsByPower), arg0, arg1) +} + +// RemoveRecentMsg mocks base method. +func (m *MockKeeperOracle) RemoveRecentMsg(arg0 types1.Context, arg1 uint64) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RemoveRecentMsg", arg0, arg1) +} + +// RemoveRecentMsg indicates an expected call of RemoveRecentMsg. +func (mr *MockKeeperOracleMockRecorder) RemoveRecentMsg(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveRecentMsg", reflect.TypeOf((*MockKeeperOracle)(nil).RemoveRecentMsg), arg0, arg1) +} + +// RemoveRecentParams mocks base method. +func (m *MockKeeperOracle) RemoveRecentParams(arg0 types1.Context, arg1 uint64) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RemoveRecentParams", arg0, arg1) +} + +// RemoveRecentParams indicates an expected call of RemoveRecentParams. +func (mr *MockKeeperOracleMockRecorder) RemoveRecentParams(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveRecentParams", reflect.TypeOf((*MockKeeperOracle)(nil).RemoveRecentParams), arg0, arg1) +} + +// SetIndexRecentMsg mocks base method. +func (m *MockKeeperOracle) SetIndexRecentMsg(arg0 types1.Context, arg1 types.IndexRecentMsg) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetIndexRecentMsg", arg0, arg1) +} + +// SetIndexRecentMsg indicates an expected call of SetIndexRecentMsg. +func (mr *MockKeeperOracleMockRecorder) SetIndexRecentMsg(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetIndexRecentMsg", reflect.TypeOf((*MockKeeperOracle)(nil).SetIndexRecentMsg), arg0, arg1) +} + +// SetIndexRecentParams mocks base method. +func (m *MockKeeperOracle) SetIndexRecentParams(arg0 types1.Context, arg1 types.IndexRecentParams) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetIndexRecentParams", arg0, arg1) +} + +// SetIndexRecentParams indicates an expected call of SetIndexRecentParams. +func (mr *MockKeeperOracleMockRecorder) SetIndexRecentParams(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetIndexRecentParams", reflect.TypeOf((*MockKeeperOracle)(nil).SetIndexRecentParams), arg0, arg1) +} + +// SetRecentMsg mocks base method. +func (m *MockKeeperOracle) SetRecentMsg(arg0 types1.Context, arg1 types.RecentMsg) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetRecentMsg", arg0, arg1) +} + +// SetRecentMsg indicates an expected call of SetRecentMsg. +func (mr *MockKeeperOracleMockRecorder) SetRecentMsg(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetRecentMsg", reflect.TypeOf((*MockKeeperOracle)(nil).SetRecentMsg), arg0, arg1) +} + +// SetRecentParams mocks base method. +func (m *MockKeeperOracle) SetRecentParams(arg0 types1.Context, arg1 types.RecentParams) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetRecentParams", arg0, arg1) +} + +// SetRecentParams indicates an expected call of SetRecentParams. +func (mr *MockKeeperOracleMockRecorder) SetRecentParams(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetRecentParams", reflect.TypeOf((*MockKeeperOracle)(nil).SetRecentParams), arg0, arg1) +} + +// SetValidatorUpdateBlock mocks base method. +func (m *MockKeeperOracle) SetValidatorUpdateBlock(arg0 types1.Context, arg1 types.ValidatorUpdateBlock) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetValidatorUpdateBlock", arg0, arg1) +} + +// SetValidatorUpdateBlock indicates an expected call of SetValidatorUpdateBlock. +func (mr *MockKeeperOracleMockRecorder) SetValidatorUpdateBlock(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetValidatorUpdateBlock", reflect.TypeOf((*MockKeeperOracle)(nil).SetValidatorUpdateBlock), arg0, arg1) +} diff --git a/x/oracle/keeper/common/mock_validator_test.go b/x/oracle/keeper/common/mock_validator_test.go new file mode 100644 index 000000000..6e84bfe0a --- /dev/null +++ b/x/oracle/keeper/common/mock_validator_test.go @@ -0,0 +1,343 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/cosmos/cosmos-sdk/x/staking/types (interfaces: ValidatorI) +// +// Generated by this command: +// +// mockgen -destination mock_validator_test.go -package common github.com/cosmos/cosmos-sdk/x/staking/types ValidatorI +// + +// Package common is a generated GoMock package. +package common + +import ( + reflect "reflect" + + math "cosmossdk.io/math" + crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + types "github.com/cosmos/cosmos-sdk/crypto/types" + types0 "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/x/staking/types" + gomock "go.uber.org/mock/gomock" +) + +// MockValidatorI is a mock of ValidatorI interface. +type MockValidatorI struct { + ctrl *gomock.Controller + recorder *MockValidatorIMockRecorder +} + +// MockValidatorIMockRecorder is the mock recorder for MockValidatorI. +type MockValidatorIMockRecorder struct { + mock *MockValidatorI +} + +// NewMockValidatorI creates a new mock instance. +func NewMockValidatorI(ctrl *gomock.Controller) *MockValidatorI { + mock := &MockValidatorI{ctrl: ctrl} + mock.recorder = &MockValidatorIMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockValidatorI) EXPECT() *MockValidatorIMockRecorder { + return m.recorder +} + +// ConsPubKey mocks base method. +func (m *MockValidatorI) ConsPubKey() (types.PubKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ConsPubKey") + ret0, _ := ret[0].(types.PubKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ConsPubKey indicates an expected call of ConsPubKey. +func (mr *MockValidatorIMockRecorder) ConsPubKey() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsPubKey", reflect.TypeOf((*MockValidatorI)(nil).ConsPubKey)) +} + +// GetBondedTokens mocks base method. +func (m *MockValidatorI) GetBondedTokens() math.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBondedTokens") + ret0, _ := ret[0].(math.Int) + return ret0 +} + +// GetBondedTokens indicates an expected call of GetBondedTokens. +func (mr *MockValidatorIMockRecorder) GetBondedTokens() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBondedTokens", reflect.TypeOf((*MockValidatorI)(nil).GetBondedTokens)) +} + +// GetCommission mocks base method. +func (m *MockValidatorI) GetCommission() math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCommission") + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// GetCommission indicates an expected call of GetCommission. +func (mr *MockValidatorIMockRecorder) GetCommission() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCommission", reflect.TypeOf((*MockValidatorI)(nil).GetCommission)) +} + +// GetConsAddr mocks base method. +func (m *MockValidatorI) GetConsAddr() (types0.ConsAddress, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConsAddr") + ret0, _ := ret[0].(types0.ConsAddress) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetConsAddr indicates an expected call of GetConsAddr. +func (mr *MockValidatorIMockRecorder) GetConsAddr() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConsAddr", reflect.TypeOf((*MockValidatorI)(nil).GetConsAddr)) +} + +// GetConsensusPower mocks base method. +func (m *MockValidatorI) GetConsensusPower(arg0 math.Int) int64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConsensusPower", arg0) + ret0, _ := ret[0].(int64) + return ret0 +} + +// GetConsensusPower indicates an expected call of GetConsensusPower. +func (mr *MockValidatorIMockRecorder) GetConsensusPower(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConsensusPower", reflect.TypeOf((*MockValidatorI)(nil).GetConsensusPower), arg0) +} + +// GetDelegatorShares mocks base method. +func (m *MockValidatorI) GetDelegatorShares() math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDelegatorShares") + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// GetDelegatorShares indicates an expected call of GetDelegatorShares. +func (mr *MockValidatorIMockRecorder) GetDelegatorShares() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDelegatorShares", reflect.TypeOf((*MockValidatorI)(nil).GetDelegatorShares)) +} + +// GetMinSelfDelegation mocks base method. +func (m *MockValidatorI) GetMinSelfDelegation() math.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMinSelfDelegation") + ret0, _ := ret[0].(math.Int) + return ret0 +} + +// GetMinSelfDelegation indicates an expected call of GetMinSelfDelegation. +func (mr *MockValidatorIMockRecorder) GetMinSelfDelegation() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMinSelfDelegation", reflect.TypeOf((*MockValidatorI)(nil).GetMinSelfDelegation)) +} + +// GetMoniker mocks base method. +func (m *MockValidatorI) GetMoniker() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMoniker") + ret0, _ := ret[0].(string) + return ret0 +} + +// GetMoniker indicates an expected call of GetMoniker. +func (mr *MockValidatorIMockRecorder) GetMoniker() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMoniker", reflect.TypeOf((*MockValidatorI)(nil).GetMoniker)) +} + +// GetOperator mocks base method. +func (m *MockValidatorI) GetOperator() types0.ValAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOperator") + ret0, _ := ret[0].(types0.ValAddress) + return ret0 +} + +// GetOperator indicates an expected call of GetOperator. +func (mr *MockValidatorIMockRecorder) GetOperator() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperator", reflect.TypeOf((*MockValidatorI)(nil).GetOperator)) +} + +// GetStatus mocks base method. +func (m *MockValidatorI) GetStatus() types1.BondStatus { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetStatus") + ret0, _ := ret[0].(types1.BondStatus) + return ret0 +} + +// GetStatus indicates an expected call of GetStatus. +func (mr *MockValidatorIMockRecorder) GetStatus() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStatus", reflect.TypeOf((*MockValidatorI)(nil).GetStatus)) +} + +// GetTokens mocks base method. +func (m *MockValidatorI) GetTokens() math.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTokens") + ret0, _ := ret[0].(math.Int) + return ret0 +} + +// GetTokens indicates an expected call of GetTokens. +func (mr *MockValidatorIMockRecorder) GetTokens() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokens", reflect.TypeOf((*MockValidatorI)(nil).GetTokens)) +} + +// IsBonded mocks base method. +func (m *MockValidatorI) IsBonded() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsBonded") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsBonded indicates an expected call of IsBonded. +func (mr *MockValidatorIMockRecorder) IsBonded() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsBonded", reflect.TypeOf((*MockValidatorI)(nil).IsBonded)) +} + +// IsJailed mocks base method. +func (m *MockValidatorI) IsJailed() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsJailed") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsJailed indicates an expected call of IsJailed. +func (mr *MockValidatorIMockRecorder) IsJailed() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsJailed", reflect.TypeOf((*MockValidatorI)(nil).IsJailed)) +} + +// IsUnbonded mocks base method. +func (m *MockValidatorI) IsUnbonded() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsUnbonded") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsUnbonded indicates an expected call of IsUnbonded. +func (mr *MockValidatorIMockRecorder) IsUnbonded() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsUnbonded", reflect.TypeOf((*MockValidatorI)(nil).IsUnbonded)) +} + +// IsUnbonding mocks base method. +func (m *MockValidatorI) IsUnbonding() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsUnbonding") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsUnbonding indicates an expected call of IsUnbonding. +func (mr *MockValidatorIMockRecorder) IsUnbonding() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsUnbonding", reflect.TypeOf((*MockValidatorI)(nil).IsUnbonding)) +} + +// SharesFromTokens mocks base method. +func (m *MockValidatorI) SharesFromTokens(arg0 math.Int) (math.LegacyDec, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SharesFromTokens", arg0) + ret0, _ := ret[0].(math.LegacyDec) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SharesFromTokens indicates an expected call of SharesFromTokens. +func (mr *MockValidatorIMockRecorder) SharesFromTokens(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SharesFromTokens", reflect.TypeOf((*MockValidatorI)(nil).SharesFromTokens), arg0) +} + +// SharesFromTokensTruncated mocks base method. +func (m *MockValidatorI) SharesFromTokensTruncated(arg0 math.Int) (math.LegacyDec, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SharesFromTokensTruncated", arg0) + ret0, _ := ret[0].(math.LegacyDec) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SharesFromTokensTruncated indicates an expected call of SharesFromTokensTruncated. +func (mr *MockValidatorIMockRecorder) SharesFromTokensTruncated(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SharesFromTokensTruncated", reflect.TypeOf((*MockValidatorI)(nil).SharesFromTokensTruncated), arg0) +} + +// TmConsPublicKey mocks base method. +func (m *MockValidatorI) TmConsPublicKey() (crypto.PublicKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TmConsPublicKey") + ret0, _ := ret[0].(crypto.PublicKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// TmConsPublicKey indicates an expected call of TmConsPublicKey. +func (mr *MockValidatorIMockRecorder) TmConsPublicKey() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TmConsPublicKey", reflect.TypeOf((*MockValidatorI)(nil).TmConsPublicKey)) +} + +// TokensFromShares mocks base method. +func (m *MockValidatorI) TokensFromShares(arg0 math.LegacyDec) math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TokensFromShares", arg0) + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// TokensFromShares indicates an expected call of TokensFromShares. +func (mr *MockValidatorIMockRecorder) TokensFromShares(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromShares", reflect.TypeOf((*MockValidatorI)(nil).TokensFromShares), arg0) +} + +// TokensFromSharesRoundUp mocks base method. +func (m *MockValidatorI) TokensFromSharesRoundUp(arg0 math.LegacyDec) math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TokensFromSharesRoundUp", arg0) + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// TokensFromSharesRoundUp indicates an expected call of TokensFromSharesRoundUp. +func (mr *MockValidatorIMockRecorder) TokensFromSharesRoundUp(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromSharesRoundUp", reflect.TypeOf((*MockValidatorI)(nil).TokensFromSharesRoundUp), arg0) +} + +// TokensFromSharesTruncated mocks base method. +func (m *MockValidatorI) TokensFromSharesTruncated(arg0 math.LegacyDec) math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TokensFromSharesTruncated", arg0) + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// TokensFromSharesTruncated indicates an expected call of TokensFromSharesTruncated. +func (mr *MockValidatorIMockRecorder) TokensFromSharesTruncated(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromSharesTruncated", reflect.TypeOf((*MockValidatorI)(nil).TokensFromSharesTruncated), arg0) +} diff --git a/x/oracle/keeper/common/types.go b/x/oracle/keeper/common/types.go new file mode 100644 index 000000000..66db474ba --- /dev/null +++ b/x/oracle/keeper/common/types.go @@ -0,0 +1,173 @@ +package common + +import ( + "errors" + "math/big" + "sort" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +const ( + //maxNonce indicates how many messages a validator can submit in a single roudn to offer price + //current we use this as a mock distance + MaxNonce = 3 + //these two threshold value used to set the threshold to tell when the price had come to consensus and was able to get a final price of that round + Threshold_a = 2 + Threshold_b = 3 + //maxDetId each validator can submit, so the calculator can cache maximum of maxDetId*count(validators) values, this is for resistance of malicious validator submmiting invalid detId + MaxDetId = 5 + //consensus mode: v1: as soon as possbile + Mode = 1 +) + +type Params types.Params + +func (p Params) GetTokenFeeders() []*types.TokenFeeder { + return p.TokenFeeders +} + +func (p Params) IsDeterministicSource(sourceId int32) bool { + return p.Sources[int(sourceId)].Deterministic +} + +func (p Params) IsValidSource(sourceId int32) bool { + if sourceId == 0 { + //custom defined source + return true + } + return p.Sources[int(sourceId)].Valid +} + +func (p Params) GetTokenFeeder(feederId int32) *types.TokenFeeder { + for k, v := range p.TokenFeeders { + if int32(k) == feederId { + return v + } + } + return nil +} +func (p Params) GetTokenInfo(feederId int32) *types.Token { + for k, v := range p.TokenFeeders { + if int32(k) == feederId { + return p.Tokens[v.TokenId] + } + } + return nil +} + +func (p Params) CheckRules(feederId int32, prices []*types.PriceWithSource) (bool, error) { + feeder := p.TokenFeeders[feederId] + rule := p.Rules[feeder.RuleId] + //specified sources set, v1 use this rule to set `chainlink` as official source + if rule.SourceIds != nil && len(rule.SourceIds) > 0 { + if len(rule.SourceIds) != len(prices) { + return false, errors.New("count prices should match rule") + } + notFound := false + if rule.SourceIds[0] == 0 { + //match all sources listed + for sId, source := range p.Sources { + if sId == 0 { + continue + } + if source.Valid { + notFound = true + for _, p := range prices { + // fmt.Println("debug rules check _0, p.sourceid", p.SourceId) + if p.SourceId == int32(sId) { + notFound = false + // fmt.Println("debug rules match _0") + break + } + } + + } + } + } else { + for _, source := range rule.SourceIds { + notFound = true + for _, p := range prices { + // fmt.Println("debug rules check, p.sourceid", p.SourceId) + if p.SourceId == source { + notFound = false + // fmt.Println("debug rules match") + break + } + } + //return false, errors.New("price source not match with rule") + } + } + if notFound { + // fmt.Println("debug rules check, rule.sources", rule.SourceIds) + return false, errors.New("price source not match with rule") + } + } + + //TODO: check NOM + //return true if no rule set, we will accept any source + return true, nil +} + +type Set[T comparable] struct { + size int + slice []T +} + +func (s *Set[T]) Add(value T) bool { + if len(s.slice) == s.size { + return false + } + for _, v := range s.slice { + if v == value { + return false + } + } + s.slice = append(s.slice, value) + return true +} + +func (s *Set[T]) Has(value T) bool { + for _, v := range s.slice { + if v == value { + return true + } + } + return false +} + +func (s *Set[T]) Length() int { + return s.size +} + +func NewSet[T comparable](length int) *Set[T] { + return &Set[T]{ + size: length, + slice: make([]T, 0, length), + } +} + +func ExceedsThreshold(power *big.Int, totalPower *big.Int) bool { + return new(big.Int).Mul(power, big.NewInt(Threshold_b)).Cmp(new(big.Int).Mul(totalPower, big.NewInt(Threshold_a))) > 0 +} + +type BigIntList []*big.Int + +func (b BigIntList) Len() int { + return len(b) +} +func (b BigIntList) Less(i, j int) bool { + return b[i].Cmp(b[j]) < 0 +} +func (b BigIntList) Swap(i, j int) { + b[i], b[j] = b[j], b[i] +} + +func (b BigIntList) Median() *big.Int { + sort.Sort(b) + l := len(b) + if l%2 == 1 { + return b[l/2] + } + return new(big.Int).Div(new(big.Int).Add(b[l/2], b[l/2-1]), big.NewInt(2)) +} diff --git a/x/oracle/keeper/index_recent_msg.go b/x/oracle/keeper/index_recent_msg.go new file mode 100644 index 000000000..b12dc77f7 --- /dev/null +++ b/x/oracle/keeper/index_recent_msg.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetIndexRecentMsg set indexRecentMsg in the store +func (k Keeper) SetIndexRecentMsg(ctx sdk.Context, indexRecentMsg types.IndexRecentMsg) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.IndexRecentMsgKey)) + b := k.cdc.MustMarshal(&indexRecentMsg) + store.Set([]byte{0}, b) +} + +// GetIndexRecentMsg returns indexRecentMsg +func (k Keeper) GetIndexRecentMsg(ctx sdk.Context) (val types.IndexRecentMsg, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.IndexRecentMsgKey)) + + b := store.Get([]byte{0}) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveIndexRecentMsg removes indexRecentMsg from the store +func (k Keeper) RemoveIndexRecentMsg(ctx sdk.Context) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.IndexRecentMsgKey)) + store.Delete([]byte{0}) +} diff --git a/x/oracle/keeper/index_recent_params.go b/x/oracle/keeper/index_recent_params.go new file mode 100644 index 000000000..8bf433e79 --- /dev/null +++ b/x/oracle/keeper/index_recent_params.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetIndexRecentParams set indexRecentParams in the store +func (k Keeper) SetIndexRecentParams(ctx sdk.Context, indexRecentParams types.IndexRecentParams) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.IndexRecentParamsKey)) + b := k.cdc.MustMarshal(&indexRecentParams) + store.Set([]byte{0}, b) +} + +// GetIndexRecentParams returns indexRecentParams +func (k Keeper) GetIndexRecentParams(ctx sdk.Context) (val types.IndexRecentParams, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.IndexRecentParamsKey)) + + b := store.Get([]byte{0}) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveIndexRecentParams removes indexRecentParams from the store +func (k Keeper) RemoveIndexRecentParams(ctx sdk.Context) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.IndexRecentParamsKey)) + store.Delete([]byte{0}) +} diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go new file mode 100644 index 000000000..a9fc27939 --- /dev/null +++ b/x/oracle/keeper/keeper.go @@ -0,0 +1,73 @@ +package keeper + +import ( + "fmt" + "math/big" + + // "cosmossdk.io/api/tendermint/abci" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +type ( + Keeper struct { + cdc codec.BinaryCodec + storeKey storetypes.StoreKey + memKey storetypes.StoreKey + paramstore paramtypes.Subspace + stakingKeeper stakingkeeper.Keeper + } +) + +var _ common.KeeperOracle = Keeper{} + +func NewKeeper( + cdc codec.BinaryCodec, + storeKey storetypes.StoreKey, + memKey storetypes.StoreKey, + ps paramtypes.Subspace, + sKeeper stakingkeeper.Keeper, +) Keeper { + // set KeyTable if it has not already been set + if !ps.HasKeyTable() { + ps = ps.WithKeyTable(types.ParamKeyTable()) + } + + return Keeper{ + cdc: cdc, + storeKey: storeKey, + memKey: memKey, + paramstore: ps, + stakingKeeper: sKeeper, + } +} + +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} + +func (k Keeper) GetLastTotalPower(ctx sdk.Context) *big.Int { + return k.stakingKeeper.GetLastTotalPower(ctx).BigInt() +} + +func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, f func(index int64, validator stakingtypes.ValidatorI) bool) { + k.stakingKeeper.IterateBondedValidatorsByPower(ctx, f) +} + +func (k Keeper) GetValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { + return k.stakingKeeper.GetValidatorUpdates(ctx) +} + +func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) (stakingtypes.Validator, bool) { + return k.stakingKeeper.GetValidatorByConsAddr(ctx, addr) +} diff --git a/x/oracle/keeper/msg_server.go b/x/oracle/keeper/msg_server.go new file mode 100644 index 000000000..c4a81b3f6 --- /dev/null +++ b/x/oracle/keeper/msg_server.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} diff --git a/x/oracle/keeper/msg_server_create_price.go b/x/oracle/keeper/msg_server_create_price.go new file mode 100644 index 000000000..ab6ba5a13 --- /dev/null +++ b/x/oracle/keeper/msg_server_create_price.go @@ -0,0 +1,32 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) CreatePrice(goCtx context.Context, msg *types.MsgCreatePrice) (*types.MsgCreatePriceResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + /** + 1. aggregator.rInfo.Tokenid->status == 0(1 ignore and return) + 2. basedBlock is valid [roundInfo.basedBlock, *+5], each base only allow for one submit each validator, window for submition is 5 blocks while every validator only allowed to submit at most 3 transactions each round + 3. check the rule fulfilled(sources check), check the decimal of the 1st mathc the params' definition(among prices the decimal had been checked in ante stage), timestamp:later than previous block's timestamp, [not future than now(+1s), this is checked in anteHandler], timestamp verification is not necessary + **/ + + //newItem, caches, _ := k.GetAggregatorContext(ctx, k.Keeper).NewCreatePrice(ctx, msg) + newItem, caches, _ := GetAggregatorContext(ctx, k.Keeper).NewCreatePrice(ctx, msg) + // fmt.Println("debug after NewCreatePrice", newItem, caches) + if caches != nil { + if newItem != nil { + k.AppendPriceTR(ctx, newItem.TokenId, newItem.PriceTR) + //TODO: move related caches + cs.RemoveCache(caches) + } else { + cs.AddCache(caches) + } + } + + return &types.MsgCreatePriceResponse{}, nil +} diff --git a/x/oracle/keeper/params.go b/x/oracle/keeper/params.go new file mode 100644 index 000000000..3c2e1f097 --- /dev/null +++ b/x/oracle/keeper/params.go @@ -0,0 +1,40 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// GetParams get all parameters as types.Params +//func (k Keeper) GetParams(ctx sdk.Context) types.Params { +// pRes := &types.Params{} +// k.paramstore.GetParamSet(ctx, pRes) +// return *pRes +// // return types.NewParams() +//} +// +//// SetParams set the params +//func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { +// //TODO: update the aggregator's params, call k.UpdateParams +// k.paramstore.SetParamSet(ctx, ¶ms) +//} + +func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ParamsKey) // return types.NewParams() + if bz != nil { + k.cdc.MustUnmarshal(bz, ¶ms) + } + return +} + +// SetParams set the params +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { + store := ctx.KVStore(k.storeKey) + bz, err := k.cdc.Marshal(¶ms) + if err != nil { + return err + } + store.Set(types.ParamsKey, bz) + return nil +} diff --git a/x/oracle/keeper/prices.go b/x/oracle/keeper/prices.go new file mode 100644 index 000000000..ea98ddc86 --- /dev/null +++ b/x/oracle/keeper/prices.go @@ -0,0 +1,189 @@ +package keeper + +import ( + "encoding/binary" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetPrices set a specific prices in the store from its index +func (k Keeper) SetPrices(ctx sdk.Context, prices types.Prices) { + store := k.getPriceTRStore(ctx, prices.TokenId) + for _, v := range prices.PriceList { + b := k.cdc.MustMarshal(v) + store.Set(types.PricesRoundKey(v.RoundId), b) + } + store.Set(types.PricesNextRountIdKey, types.Uint64Bytes(prices.NextRountId)) +} + +// GetPrices returns a prices from its index +func (k Keeper) GetPrices( + ctx sdk.Context, + tokenId int32, + +) (val types.Prices, found bool) { + store := k.getPriceTRStore(ctx, tokenId) + // nextRoundIdB := store.Get(types.PricesNextRountIdKey) + // if nextRoundIdB == nil { + // return val, false + // } + + // nextRoundId := binary.BigEndian.Uint64(nextRoundIdB) + nextRoundId := k.GetNextRoundId(ctx, tokenId) + + val.TokenId = tokenId + val.NextRountId = nextRoundId + val.PriceList = make([]*types.PriceWithTimeAndRound, nextRoundId) + //0 roundId is reserved, expect the roundid corresponds to the slice index + val.PriceList[0] = &types.PriceWithTimeAndRound{} + for i := uint64(1); i < nextRoundId; i++ { + b := store.Get(types.PricesRoundKey(i)) + val.PriceList[i] = &types.PriceWithTimeAndRound{} + if b != nil { + //should alwyas be true since we don't delete prices from history round + k.cdc.MustUnmarshal(b, val.PriceList[i]) + found = true + } + } + + return +} + +// RemovePrices removes a prices from the store +func (k Keeper) RemovePrices( + ctx sdk.Context, + tokenId int32, + +) { + store := k.getPriceTRStore(ctx, tokenId) + // iterator := sdk.KVStorePrefixIterator(store, []byte{}) + iterator := store.Iterator(nil, nil) + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + store.Delete(iterator.Key()) + } +} + +// GetAllPrices returns all prices +func (k Keeper) GetAllPrices(ctx sdk.Context) (list []types.Prices) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + // prevTokenId := uint32(0) + // var val types.PriceWithTimeAndRound + var price types.Prices + prevTokenId := int32(0) + for ; iterator.Valid(); iterator.Next() { + tokenId, _, nextRoundId := parseKey(iterator.Key()) + if prevTokenId == 0 { + prevTokenId = tokenId + price.TokenId = tokenId + } else if prevTokenId != tokenId && price.TokenId > 0 { + list = append(list, price) + prevTokenId = tokenId + price = types.Prices{TokenId: tokenId} + } + if nextRoundId { + price.NextRountId = binary.BigEndian.Uint64(iterator.Value()) + } else { + var val types.PriceWithTimeAndRound + k.cdc.Unmarshal(iterator.Value(), &val) + price.PriceList = append(price.PriceList, &val) + } + } + if price.TokenId > 0 { + list = append(list, price) + } + return +} + +func (k Keeper) AppendPriceTR(ctx sdk.Context, tokenId int32, priceTR types.PriceWithTimeAndRound) { + nextRoundId := k.GetNextRoundId(ctx, tokenId) + if nextRoundId != priceTR.RoundId { + return + } + store := k.getPriceTRStore(ctx, tokenId) + b := k.cdc.MustMarshal(&priceTR) + store.Set(types.PricesRoundKey(nextRoundId), b) + k.IncreaseNextRoundId(ctx, tokenId) +} + +//func(k Keeper) SetPriceTR(ctx sdk.Context, tokenId int32, priceTR){} + +func (k Keeper) GetPriceTRRoundId(ctx sdk.Context, tokenId int32, roundId uint64) (price types.PriceWithTimeAndRound, found bool) { + store := k.getPriceTRStore(ctx, tokenId) + + b := store.Get(types.PricesRoundKey(roundId)) + if b == nil { + return + } + + k.cdc.Unmarshal(b, &price) + found = true + return +} + +func (k Keeper) GetPriceTRLatest(ctx sdk.Context, tokenId int32) (price types.PriceWithTimeAndRound, found bool) { + // store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) + // store = prefix.NewStore(store, types.PricesKey(tokenId)) + store := k.getPriceTRStore(ctx, tokenId) + nextRoundIdB := store.Get(types.PricesNextRountIdKey) + if nextRoundIdB == nil { + return + } + nextRoundId := binary.BigEndian.Uint64(nextRoundIdB) + b := store.Get(types.PricesRoundKey(nextRoundId - 1)) + if b != nil { + //should always be true + k.cdc.Unmarshal(b, &price) + found = true + } + return +} + +func (k Keeper) GetNextRoundId(ctx sdk.Context, tokenId int32) (nextRoundId uint64) { + nextRoundId = 1 + //store := getPriceTRStore(ctx, k.storeKey, tokenId) + store := k.getPriceTRStore(ctx, tokenId) + nextRoundIdB := store.Get(types.PricesNextRountIdKey) + if nextRoundIdB != nil { + if nextRoundId = binary.BigEndian.Uint64(nextRoundIdB); nextRoundId == 0 { + nextRoundId = 1 + } + } + return +} + +func (k Keeper) IncreaseNextRoundId(ctx sdk.Context, tokenId int32) error { + //store := getPriceTRStore(ctx, k.storeKey, tokenId) + store := k.getPriceTRStore(ctx, tokenId) + nextRoundId := k.GetNextRoundId(ctx, tokenId) + b := make([]byte, 8) + binary.BigEndian.PutUint64(b, nextRoundId+1) + store.Set(types.PricesNextRountIdKey, b) + return nil +} + +//func getPriceTRStore(ctx sdk.Context, storeKey storetypes.StoreKey, tokenId int32) prefix.Store { +// store := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(types.PricesKeyPrefix)) +// return prefix.NewStore(store, types.PricesKey(tokenId)) +//} + +func (k Keeper) getPriceTRStore(ctx sdk.Context, tokenId int32) prefix.Store { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) + return prefix.NewStore(store, types.PricesKey(tokenId)) +} + +func parseKey(key []byte) (tokenId int32, roundId uint64, nextRoundId bool) { + tokenId = int32(binary.BigEndian.Uint32(key[:4])) + if len(key) == 17 { + nextRoundId = true + return + } + roundId = binary.BigEndian.Uint64(key[5:13]) + return +} diff --git a/x/oracle/keeper/query.go b/x/oracle/keeper/query.go new file mode 100644 index 000000000..f15058655 --- /dev/null +++ b/x/oracle/keeper/query.go @@ -0,0 +1,7 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +var _ types.QueryServer = Keeper{} diff --git a/x/oracle/keeper/query_index_recent_msg.go b/x/oracle/keeper/query_index_recent_msg.go new file mode 100644 index 000000000..ab769f077 --- /dev/null +++ b/x/oracle/keeper/query_index_recent_msg.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) IndexRecentMsg(goCtx context.Context, req *types.QueryGetIndexRecentMsgRequest) (*types.QueryGetIndexRecentMsgResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetIndexRecentMsg(ctx) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetIndexRecentMsgResponse{IndexRecentMsg: val}, nil +} diff --git a/x/oracle/keeper/query_index_recent_params.go b/x/oracle/keeper/query_index_recent_params.go new file mode 100644 index 000000000..012e6f0fe --- /dev/null +++ b/x/oracle/keeper/query_index_recent_params.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) IndexRecentParams(goCtx context.Context, req *types.QueryGetIndexRecentParamsRequest) (*types.QueryGetIndexRecentParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetIndexRecentParams(ctx) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetIndexRecentParamsResponse{IndexRecentParams: val}, nil +} diff --git a/x/oracle/keeper/query_params.go b/x/oracle/keeper/query_params.go new file mode 100644 index 000000000..9aa073c3c --- /dev/null +++ b/x/oracle/keeper/query_params.go @@ -0,0 +1,19 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil +} diff --git a/x/oracle/keeper/query_prices.go b/x/oracle/keeper/query_prices.go new file mode 100644 index 000000000..cf1543b01 --- /dev/null +++ b/x/oracle/keeper/query_prices.go @@ -0,0 +1,56 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +//func (k Keeper) PricesAll(goCtx context.Context, req *types.QueryAllPricesRequest) (*types.QueryAllPricesResponse, error) { +// if req == nil { +// return nil, status.Error(codes.InvalidArgument, "invalid request") +// } +// +// var pricess []types.Prices +// ctx := sdk.UnwrapSDKContext(goCtx) +// +// store := ctx.KVStore(k.storeKey) +// pricesStore := prefix.NewStore(store, types.KeyPrefix(types.PricesKeyPrefix)) +// pricesTokenStore := prefix.NewStore(pricesStore, types.PricesKey(tokenId)) +// +// pageRes, err := query.Paginate(pricesTokenStore, req.Pagination, func(key []byte, value []byte) error { +// var prices types.Prices +// if err := k.cdc.Unmarshal(value, &prices); err != nil { +// return err +// } +// +// pricess = append(pricess, prices) +// return nil +// }) +// +// if err != nil { +// return nil, status.Error(codes.Internal, err.Error()) +// } +// +// return &types.QueryAllPricesResponse{Prices: pricess, Pagination: pageRes}, nil +//} + +func (k Keeper) Prices(goCtx context.Context, req *types.QueryGetPricesRequest) (*types.QueryGetPricesResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetPrices( + ctx, + req.TokenId, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetPricesResponse{Prices: val}, nil +} diff --git a/x/oracle/keeper/query_recent_msg.go b/x/oracle/keeper/query_recent_msg.go new file mode 100644 index 000000000..7f8e34d3f --- /dev/null +++ b/x/oracle/keeper/query_recent_msg.go @@ -0,0 +1,57 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) RecentMsgAll(goCtx context.Context, req *types.QueryAllRecentMsgRequest) (*types.QueryAllRecentMsgResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var recentMsgs []types.RecentMsg + ctx := sdk.UnwrapSDKContext(goCtx) + + store := ctx.KVStore(k.storeKey) + recentMsgStore := prefix.NewStore(store, types.KeyPrefix(types.RecentMsgKeyPrefix)) + + pageRes, err := query.Paginate(recentMsgStore, req.Pagination, func(key []byte, value []byte) error { + var recentMsg types.RecentMsg + if err := k.cdc.Unmarshal(value, &recentMsg); err != nil { + return err + } + + recentMsgs = append(recentMsgs, recentMsg) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllRecentMsgResponse{RecentMsg: recentMsgs, Pagination: pageRes}, nil +} + +func (k Keeper) RecentMsg(goCtx context.Context, req *types.QueryGetRecentMsgRequest) (*types.QueryGetRecentMsgResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetRecentMsg( + ctx, + req.Block, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetRecentMsgResponse{RecentMsg: val}, nil +} diff --git a/x/oracle/keeper/query_recent_params.go b/x/oracle/keeper/query_recent_params.go new file mode 100644 index 000000000..bb831d6d7 --- /dev/null +++ b/x/oracle/keeper/query_recent_params.go @@ -0,0 +1,57 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) RecentParamsAll(goCtx context.Context, req *types.QueryAllRecentParamsRequest) (*types.QueryAllRecentParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var recentParamss []types.RecentParams + ctx := sdk.UnwrapSDKContext(goCtx) + + store := ctx.KVStore(k.storeKey) + recentParamsStore := prefix.NewStore(store, types.KeyPrefix(types.RecentParamsKeyPrefix)) + + pageRes, err := query.Paginate(recentParamsStore, req.Pagination, func(key []byte, value []byte) error { + var recentParams types.RecentParams + if err := k.cdc.Unmarshal(value, &recentParams); err != nil { + return err + } + + recentParamss = append(recentParamss, recentParams) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllRecentParamsResponse{RecentParams: recentParamss, Pagination: pageRes}, nil +} + +func (k Keeper) RecentParams(goCtx context.Context, req *types.QueryGetRecentParamsRequest) (*types.QueryGetRecentParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetRecentParams( + ctx, + req.Block, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetRecentParamsResponse{RecentParams: val}, nil +} diff --git a/x/oracle/keeper/query_validator_update_block.go b/x/oracle/keeper/query_validator_update_block.go new file mode 100644 index 000000000..241b409dc --- /dev/null +++ b/x/oracle/keeper/query_validator_update_block.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) ValidatorUpdateBlock(goCtx context.Context, req *types.QueryGetValidatorUpdateBlockRequest) (*types.QueryGetValidatorUpdateBlockResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + val, found := k.GetValidatorUpdateBlock(ctx) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetValidatorUpdateBlockResponse{ValidatorUpdateBlock: val}, nil +} diff --git a/x/oracle/keeper/recent_msg.go b/x/oracle/keeper/recent_msg.go new file mode 100644 index 000000000..1a56e745f --- /dev/null +++ b/x/oracle/keeper/recent_msg.go @@ -0,0 +1,79 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetRecentMsg set a specific recentMsg in the store from its index +func (k Keeper) SetRecentMsg(ctx sdk.Context, recentMsg types.RecentMsg) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentMsgKeyPrefix)) + b := k.cdc.MustMarshal(&recentMsg) + store.Set(types.RecentMsgKey( + recentMsg.Block, + ), b) +} + +// GetRecentMsg returns a recentMsg from its index +func (k Keeper) GetRecentMsg( + ctx sdk.Context, + block uint64, + +) (val types.RecentMsg, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentMsgKeyPrefix)) + + b := store.Get(types.RecentMsgKey( + block, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveRecentMsg removes a recentMsg from the store +func (k Keeper) RemoveRecentMsg( + ctx sdk.Context, + block uint64, + +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentMsgKeyPrefix)) + store.Delete(types.RecentMsgKey( + block, + )) +} + +// GetAllRecentMsg returns all recentMsg +func (k Keeper) GetAllRecentMsg(ctx sdk.Context) (list []types.RecentMsg) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentMsgKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.RecentMsg + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} + +func (k Keeper) GetAllRecentMsgAsMap(ctx sdk.Context) (result map[uint64][]*types.MsgItem) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentMsgKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.RecentMsg + k.cdc.MustUnmarshal(iterator.Value(), &val) + // list = append(list, val) + result[val.Block] = val.Msgs + } + + return +} diff --git a/x/oracle/keeper/recent_params.go b/x/oracle/keeper/recent_params.go new file mode 100644 index 000000000..b2413d3cd --- /dev/null +++ b/x/oracle/keeper/recent_params.go @@ -0,0 +1,78 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetRecentParams set a specific recentParams in the store from its index +func (k Keeper) SetRecentParams(ctx sdk.Context, recentParams types.RecentParams) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentParamsKeyPrefix)) + b := k.cdc.MustMarshal(&recentParams) + store.Set(types.RecentParamsKey( + recentParams.Block, + ), b) +} + +// GetRecentParams returns a recentParams from its index +func (k Keeper) GetRecentParams( + ctx sdk.Context, + block uint64, + +) (val types.RecentParams, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentParamsKeyPrefix)) + + b := store.Get(types.RecentParamsKey( + block, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveRecentParams removes a recentParams from the store +func (k Keeper) RemoveRecentParams( + ctx sdk.Context, + block uint64, + +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentParamsKeyPrefix)) + store.Delete(types.RecentParamsKey( + block, + )) +} + +// GetAllRecentParams returns all recentParams +func (k Keeper) GetAllRecentParams(ctx sdk.Context) (list []types.RecentParams) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentParamsKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.RecentParams + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} + +func (k Keeper) GetAllRecentParamsAsMap(ctx sdk.Context) (result map[uint64]*types.Params) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.RecentParamsKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.RecentParams + k.cdc.MustUnmarshal(iterator.Value(), &val) + result[val.Block] = val.Params + } + + return +} diff --git a/x/oracle/keeper/single.go b/x/oracle/keeper/single.go new file mode 100644 index 000000000..4082b6068 --- /dev/null +++ b/x/oracle/keeper/single.go @@ -0,0 +1,150 @@ +package keeper + +import ( + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/aggregator" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/cache" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +var cs *cache.Cache + +var agc *aggregator.AggregatorContext + +func GetCaches() *cache.Cache { + if cs != nil { + return cs + } + cs = cache.NewCache() + return cs +} + +func GetAggregatorContext(ctx sdk.Context, k Keeper) *aggregator.AggregatorContext { + if agc != nil { + return agc + } + + c := GetCaches() + c.ResetCaches() + agc = aggregator.NewAggregatorContext() + if ok := recacheAggregatorContext(ctx, agc, k, c); !ok { + //this is the very first time oracle has been started, fill relalted info as initialization + initAggregatorContext(ctx, agc, k, c) + } + return agc +} + +// func recacheAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k common.KeeperOracle, c *cache.Cache) bool { +func recacheAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k Keeper, c *cache.Cache) bool { + + from := uint64(ctx.BlockHeight()) - common.MaxNonce + to := uint64(ctx.BlockHeight()) - 1 + + h, ok := k.GetValidatorUpdateBlock(ctx) + recentParamsMap := k.GetAllRecentParamsAsMap(ctx) + if !ok || recentParamsMap == nil { + //no cache, this is the very first running, so go to initial proces instead + return false + } + + if h.Block > from { + from = h.Block + } + + totalPower := big.NewInt(0) + validatorPowers := make(map[string]*big.Int) + k.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingtypes.ValidatorI) bool { + power := big.NewInt(validator.GetConsensusPower(validator.GetBondedTokens())) + addr := string(validator.GetOperator()) + validatorPowers[addr] = power + totalPower = new(big.Int).Add(totalPower, power) + return false + }) + agc.SetValidatorPowers(validatorPowers) + // agc.SetTotalPower(totalPower) + //TODO: test only + if k.GetLastTotalPower(ctx).Cmp(totalPower) != 0 { + panic("something wrong when get validatorsPower from staking module") + } + + //reset validators + c.AddCache(cache.CacheItemV(validatorPowers)) + + recentMsgs := k.GetAllRecentMsgAsMap(ctx) + var pTmp common.Params + for ; from < to; from++ { + //fill params + for b, recentParams := range recentParamsMap { + prev := uint64(0) + if b <= from && b > prev { + pTmp = common.Params(*recentParams) + agc.SetParams(&pTmp) + if prev > 0 { + //TODO: safe delete + delete(recentParamsMap, prev) + } + prev = b + } + } + + agc.PrepareRound(ctx, from) + + if msgs := recentMsgs[from+1]; msgs != nil { + for _, msg := range msgs { + //these messages are retreived for recache, just skip the validation check and fill the memory cache + agc.FillPrice(&types.MsgCreatePrice{ + Creator: msg.Validator, + FeederId: msg.FeederId, + Prices: msg.PSources, + }) + } + } + agc.SealRound(ctx, false) + } + + //fill params cache + c.AddCache(cache.CacheItemP(&pTmp)) + + agc.PrepareRound(ctx, to) + + return true +} + +func initAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k common.KeeperOracle, c *cache.Cache) error { + //set params + p := k.GetParams(ctx) + m := make(map[uint64]*types.Params) + m[uint64(ctx.BlockHeight())] = &p + // k.setParams4CacheRecover(m) //used to trace tokenFeeder's update during cache recover + pTmp := common.Params(p) + agc.SetParams(&pTmp) + //set params cache + c.AddCache(cache.CacheItemP(&pTmp)) + + totalPower := big.NewInt(0) + validatorPowers := make(map[string]*big.Int) + k.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingtypes.ValidatorI) bool { + power := big.NewInt(validator.GetConsensusPower(validator.GetBondedTokens())) + //addr := string(validator.GetOperator()) + addr := validator.GetOperator().String() + //agc.validatorsPower[addr] = power + validatorPowers[addr] = power + totalPower = new(big.Int).Add(totalPower, power) + return false + }) + // agc.SetTotalPower(totalPower) + agc.SetValidatorPowers(validatorPowers) + if k.GetLastTotalPower(ctx).Cmp(totalPower) != 0 { + panic("-") + } + + //set validatorPower cache + c.AddCache(cache.CacheItemV(validatorPowers)) + + agc.PrepareRound(ctx, uint64(ctx.BlockHeight())-1) + return nil +} diff --git a/x/oracle/keeper/validator_update_block.go b/x/oracle/keeper/validator_update_block.go new file mode 100644 index 000000000..86d83af1b --- /dev/null +++ b/x/oracle/keeper/validator_update_block.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetValidatorUpdateBlock set validatorUpdateBlock in the store +func (k Keeper) SetValidatorUpdateBlock(ctx sdk.Context, validatorUpdateBlock types.ValidatorUpdateBlock) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorUpdateBlockKey)) + b := k.cdc.MustMarshal(&validatorUpdateBlock) + store.Set([]byte{0}, b) +} + +// GetValidatorUpdateBlock returns validatorUpdateBlock +func (k Keeper) GetValidatorUpdateBlock(ctx sdk.Context) (val types.ValidatorUpdateBlock, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorUpdateBlockKey)) + + b := store.Get([]byte{0}) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveValidatorUpdateBlock removes validatorUpdateBlock from the store +func (k Keeper) RemoveValidatorUpdateBlock(ctx sdk.Context) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorUpdateBlockKey)) + store.Delete([]byte{0}) +} From 9800fb8d22c1cd4b8ca5c8604d084824a39f889e Mon Sep 17 00:00:00 2001 From: leonz789 Date: Wed, 3 Apr 2024 03:10:38 +0800 Subject: [PATCH 32/37] test(oracle-keeper):add test --- x/oracle/keeper/index_recent_msg_test.go | 38 ++ x/oracle/keeper/index_recent_params_test.go | 38 ++ x/oracle/keeper/keeper_suite_test.go | 41 +++ x/oracle/keeper/mock_validator_test.go | 343 ++++++++++++++++++ .../keeper/msg_server_create_price_test.go | 131 +++++++ x/oracle/keeper/msg_server_test.go | 27 ++ x/oracle/keeper/params_test.go | 18 + x/oracle/keeper/prices_test.go | 81 +++++ .../keeper/query_index_recent_msg_test.go | 50 +++ .../keeper/query_index_recent_params_test.go | 50 +++ x/oracle/keeper/query_params_test.go | 21 ++ x/oracle/keeper/query_prices_test.go | 126 +++++++ x/oracle/keeper/query_recent_msg_test.go | 127 +++++++ x/oracle/keeper/query_recent_params_test.go | 127 +++++++ .../query_validator_update_block_test.go | 50 +++ x/oracle/keeper/recent_msg_test.go | 63 ++++ x/oracle/keeper/recent_params_test.go | 63 ++++ x/oracle/keeper/testdata/helper.go | 36 ++ x/oracle/keeper/testdata/info.go | 64 ++++ .../keeper/validator_update_block_test.go | 38 ++ 20 files changed, 1532 insertions(+) create mode 100644 x/oracle/keeper/index_recent_msg_test.go create mode 100644 x/oracle/keeper/index_recent_params_test.go create mode 100644 x/oracle/keeper/keeper_suite_test.go create mode 100644 x/oracle/keeper/mock_validator_test.go create mode 100644 x/oracle/keeper/msg_server_create_price_test.go create mode 100644 x/oracle/keeper/msg_server_test.go create mode 100644 x/oracle/keeper/params_test.go create mode 100644 x/oracle/keeper/prices_test.go create mode 100644 x/oracle/keeper/query_index_recent_msg_test.go create mode 100644 x/oracle/keeper/query_index_recent_params_test.go create mode 100644 x/oracle/keeper/query_params_test.go create mode 100644 x/oracle/keeper/query_prices_test.go create mode 100644 x/oracle/keeper/query_recent_msg_test.go create mode 100644 x/oracle/keeper/query_recent_params_test.go create mode 100644 x/oracle/keeper/query_validator_update_block_test.go create mode 100644 x/oracle/keeper/recent_msg_test.go create mode 100644 x/oracle/keeper/recent_params_test.go create mode 100644 x/oracle/keeper/testdata/helper.go create mode 100644 x/oracle/keeper/testdata/info.go create mode 100644 x/oracle/keeper/validator_update_block_test.go diff --git a/x/oracle/keeper/index_recent_msg_test.go b/x/oracle/keeper/index_recent_msg_test.go new file mode 100644 index 000000000..9f7db965c --- /dev/null +++ b/x/oracle/keeper/index_recent_msg_test.go @@ -0,0 +1,38 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func createTestIndexRecentMsg(keeper *keeper.Keeper, ctx sdk.Context) types.IndexRecentMsg { + item := types.IndexRecentMsg{} + keeper.SetIndexRecentMsg(ctx, item) + return item +} + +func TestIndexRecentMsgGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + item := createTestIndexRecentMsg(keeper, ctx) + rst, found := keeper.GetIndexRecentMsg(ctx) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) +} + +func TestIndexRecentMsgRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + createTestIndexRecentMsg(keeper, ctx) + keeper.RemoveIndexRecentMsg(ctx) + _, found := keeper.GetIndexRecentMsg(ctx) + require.False(t, found) +} diff --git a/x/oracle/keeper/index_recent_params_test.go b/x/oracle/keeper/index_recent_params_test.go new file mode 100644 index 000000000..89f5f2a7c --- /dev/null +++ b/x/oracle/keeper/index_recent_params_test.go @@ -0,0 +1,38 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func createTestIndexRecentParams(keeper *keeper.Keeper, ctx sdk.Context) types.IndexRecentParams { + item := types.IndexRecentParams{} + keeper.SetIndexRecentParams(ctx, item) + return item +} + +func TestIndexRecentParamsGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + item := createTestIndexRecentParams(keeper, ctx) + rst, found := keeper.GetIndexRecentParams(ctx) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) +} + +func TestIndexRecentParamsRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + createTestIndexRecentParams(keeper, ctx) + keeper.RemoveIndexRecentParams(ctx) + _, found := keeper.GetIndexRecentParams(ctx) + require.False(t, found) +} diff --git a/x/oracle/keeper/keeper_suite_test.go b/x/oracle/keeper/keeper_suite_test.go new file mode 100644 index 000000000..19935f0e1 --- /dev/null +++ b/x/oracle/keeper/keeper_suite_test.go @@ -0,0 +1,41 @@ +package keeper_test + +import ( + "context" + "testing" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + gomock "go.uber.org/mock/gomock" +) + +type KeeperSuite struct { + t *testing.T + k keeper.Keeper + ctx sdk.Context + ms types.MsgServer + ctrl *gomock.Controller +} + +var ks *KeeperSuite + +func TestKeeper(t *testing.T) { + var ctxW context.Context + ks = &KeeperSuite{} + ks.ms, ctxW, ks.k = setupMsgServer(t) + ks.ctx = sdk.UnwrapSDKContext(ctxW) + ks.t = t + + RegisterFailHandler(Fail) + RunSpecs(t, "Keeper Suite") +} + +func (k *KeeperSuite) Reset() { + var ctxW context.Context + k.ms, ctxW, k.k = setupMsgServer(k.t) + k.ctx = sdk.UnwrapSDKContext(ctxW) + k.ctrl = gomock.NewController(k.t) +} diff --git a/x/oracle/keeper/mock_validator_test.go b/x/oracle/keeper/mock_validator_test.go new file mode 100644 index 000000000..927beef3d --- /dev/null +++ b/x/oracle/keeper/mock_validator_test.go @@ -0,0 +1,343 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/cosmos/cosmos-sdk/x/staking/types (interfaces: ValidatorI) +// +// Generated by this command: +// +// mockgen -destination mock_validator_test.go -package keeper_test github.com/cosmos/cosmos-sdk/x/staking/types ValidatorI +// + +// Package keeper_test is a generated GoMock package. +package keeper_test + +import ( + reflect "reflect" + + math "cosmossdk.io/math" + crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + types "github.com/cosmos/cosmos-sdk/crypto/types" + types0 "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/x/staking/types" + gomock "go.uber.org/mock/gomock" +) + +// MockValidatorI is a mock of ValidatorI interface. +type MockValidatorI struct { + ctrl *gomock.Controller + recorder *MockValidatorIMockRecorder +} + +// MockValidatorIMockRecorder is the mock recorder for MockValidatorI. +type MockValidatorIMockRecorder struct { + mock *MockValidatorI +} + +// NewMockValidatorI creates a new mock instance. +func NewMockValidatorI(ctrl *gomock.Controller) *MockValidatorI { + mock := &MockValidatorI{ctrl: ctrl} + mock.recorder = &MockValidatorIMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockValidatorI) EXPECT() *MockValidatorIMockRecorder { + return m.recorder +} + +// ConsPubKey mocks base method. +func (m *MockValidatorI) ConsPubKey() (types.PubKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ConsPubKey") + ret0, _ := ret[0].(types.PubKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ConsPubKey indicates an expected call of ConsPubKey. +func (mr *MockValidatorIMockRecorder) ConsPubKey() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsPubKey", reflect.TypeOf((*MockValidatorI)(nil).ConsPubKey)) +} + +// GetBondedTokens mocks base method. +func (m *MockValidatorI) GetBondedTokens() math.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBondedTokens") + ret0, _ := ret[0].(math.Int) + return ret0 +} + +// GetBondedTokens indicates an expected call of GetBondedTokens. +func (mr *MockValidatorIMockRecorder) GetBondedTokens() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBondedTokens", reflect.TypeOf((*MockValidatorI)(nil).GetBondedTokens)) +} + +// GetCommission mocks base method. +func (m *MockValidatorI) GetCommission() math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCommission") + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// GetCommission indicates an expected call of GetCommission. +func (mr *MockValidatorIMockRecorder) GetCommission() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCommission", reflect.TypeOf((*MockValidatorI)(nil).GetCommission)) +} + +// GetConsAddr mocks base method. +func (m *MockValidatorI) GetConsAddr() (types0.ConsAddress, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConsAddr") + ret0, _ := ret[0].(types0.ConsAddress) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetConsAddr indicates an expected call of GetConsAddr. +func (mr *MockValidatorIMockRecorder) GetConsAddr() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConsAddr", reflect.TypeOf((*MockValidatorI)(nil).GetConsAddr)) +} + +// GetConsensusPower mocks base method. +func (m *MockValidatorI) GetConsensusPower(arg0 math.Int) int64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConsensusPower", arg0) + ret0, _ := ret[0].(int64) + return ret0 +} + +// GetConsensusPower indicates an expected call of GetConsensusPower. +func (mr *MockValidatorIMockRecorder) GetConsensusPower(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConsensusPower", reflect.TypeOf((*MockValidatorI)(nil).GetConsensusPower), arg0) +} + +// GetDelegatorShares mocks base method. +func (m *MockValidatorI) GetDelegatorShares() math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDelegatorShares") + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// GetDelegatorShares indicates an expected call of GetDelegatorShares. +func (mr *MockValidatorIMockRecorder) GetDelegatorShares() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDelegatorShares", reflect.TypeOf((*MockValidatorI)(nil).GetDelegatorShares)) +} + +// GetMinSelfDelegation mocks base method. +func (m *MockValidatorI) GetMinSelfDelegation() math.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMinSelfDelegation") + ret0, _ := ret[0].(math.Int) + return ret0 +} + +// GetMinSelfDelegation indicates an expected call of GetMinSelfDelegation. +func (mr *MockValidatorIMockRecorder) GetMinSelfDelegation() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMinSelfDelegation", reflect.TypeOf((*MockValidatorI)(nil).GetMinSelfDelegation)) +} + +// GetMoniker mocks base method. +func (m *MockValidatorI) GetMoniker() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMoniker") + ret0, _ := ret[0].(string) + return ret0 +} + +// GetMoniker indicates an expected call of GetMoniker. +func (mr *MockValidatorIMockRecorder) GetMoniker() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMoniker", reflect.TypeOf((*MockValidatorI)(nil).GetMoniker)) +} + +// GetOperator mocks base method. +func (m *MockValidatorI) GetOperator() types0.ValAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOperator") + ret0, _ := ret[0].(types0.ValAddress) + return ret0 +} + +// GetOperator indicates an expected call of GetOperator. +func (mr *MockValidatorIMockRecorder) GetOperator() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperator", reflect.TypeOf((*MockValidatorI)(nil).GetOperator)) +} + +// GetStatus mocks base method. +func (m *MockValidatorI) GetStatus() types1.BondStatus { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetStatus") + ret0, _ := ret[0].(types1.BondStatus) + return ret0 +} + +// GetStatus indicates an expected call of GetStatus. +func (mr *MockValidatorIMockRecorder) GetStatus() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStatus", reflect.TypeOf((*MockValidatorI)(nil).GetStatus)) +} + +// GetTokens mocks base method. +func (m *MockValidatorI) GetTokens() math.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTokens") + ret0, _ := ret[0].(math.Int) + return ret0 +} + +// GetTokens indicates an expected call of GetTokens. +func (mr *MockValidatorIMockRecorder) GetTokens() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokens", reflect.TypeOf((*MockValidatorI)(nil).GetTokens)) +} + +// IsBonded mocks base method. +func (m *MockValidatorI) IsBonded() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsBonded") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsBonded indicates an expected call of IsBonded. +func (mr *MockValidatorIMockRecorder) IsBonded() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsBonded", reflect.TypeOf((*MockValidatorI)(nil).IsBonded)) +} + +// IsJailed mocks base method. +func (m *MockValidatorI) IsJailed() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsJailed") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsJailed indicates an expected call of IsJailed. +func (mr *MockValidatorIMockRecorder) IsJailed() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsJailed", reflect.TypeOf((*MockValidatorI)(nil).IsJailed)) +} + +// IsUnbonded mocks base method. +func (m *MockValidatorI) IsUnbonded() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsUnbonded") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsUnbonded indicates an expected call of IsUnbonded. +func (mr *MockValidatorIMockRecorder) IsUnbonded() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsUnbonded", reflect.TypeOf((*MockValidatorI)(nil).IsUnbonded)) +} + +// IsUnbonding mocks base method. +func (m *MockValidatorI) IsUnbonding() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsUnbonding") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsUnbonding indicates an expected call of IsUnbonding. +func (mr *MockValidatorIMockRecorder) IsUnbonding() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsUnbonding", reflect.TypeOf((*MockValidatorI)(nil).IsUnbonding)) +} + +// SharesFromTokens mocks base method. +func (m *MockValidatorI) SharesFromTokens(arg0 math.Int) (math.LegacyDec, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SharesFromTokens", arg0) + ret0, _ := ret[0].(math.LegacyDec) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SharesFromTokens indicates an expected call of SharesFromTokens. +func (mr *MockValidatorIMockRecorder) SharesFromTokens(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SharesFromTokens", reflect.TypeOf((*MockValidatorI)(nil).SharesFromTokens), arg0) +} + +// SharesFromTokensTruncated mocks base method. +func (m *MockValidatorI) SharesFromTokensTruncated(arg0 math.Int) (math.LegacyDec, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SharesFromTokensTruncated", arg0) + ret0, _ := ret[0].(math.LegacyDec) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SharesFromTokensTruncated indicates an expected call of SharesFromTokensTruncated. +func (mr *MockValidatorIMockRecorder) SharesFromTokensTruncated(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SharesFromTokensTruncated", reflect.TypeOf((*MockValidatorI)(nil).SharesFromTokensTruncated), arg0) +} + +// TmConsPublicKey mocks base method. +func (m *MockValidatorI) TmConsPublicKey() (crypto.PublicKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TmConsPublicKey") + ret0, _ := ret[0].(crypto.PublicKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// TmConsPublicKey indicates an expected call of TmConsPublicKey. +func (mr *MockValidatorIMockRecorder) TmConsPublicKey() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TmConsPublicKey", reflect.TypeOf((*MockValidatorI)(nil).TmConsPublicKey)) +} + +// TokensFromShares mocks base method. +func (m *MockValidatorI) TokensFromShares(arg0 math.LegacyDec) math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TokensFromShares", arg0) + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// TokensFromShares indicates an expected call of TokensFromShares. +func (mr *MockValidatorIMockRecorder) TokensFromShares(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromShares", reflect.TypeOf((*MockValidatorI)(nil).TokensFromShares), arg0) +} + +// TokensFromSharesRoundUp mocks base method. +func (m *MockValidatorI) TokensFromSharesRoundUp(arg0 math.LegacyDec) math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TokensFromSharesRoundUp", arg0) + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// TokensFromSharesRoundUp indicates an expected call of TokensFromSharesRoundUp. +func (mr *MockValidatorIMockRecorder) TokensFromSharesRoundUp(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromSharesRoundUp", reflect.TypeOf((*MockValidatorI)(nil).TokensFromSharesRoundUp), arg0) +} + +// TokensFromSharesTruncated mocks base method. +func (m *MockValidatorI) TokensFromSharesTruncated(arg0 math.LegacyDec) math.LegacyDec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TokensFromSharesTruncated", arg0) + ret0, _ := ret[0].(math.LegacyDec) + return ret0 +} + +// TokensFromSharesTruncated indicates an expected call of TokensFromSharesTruncated. +func (mr *MockValidatorIMockRecorder) TokensFromSharesTruncated(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromSharesTruncated", reflect.TypeOf((*MockValidatorI)(nil).TokensFromSharesTruncated), arg0) +} diff --git a/x/oracle/keeper/msg_server_create_price_test.go b/x/oracle/keeper/msg_server_create_price_test.go new file mode 100644 index 000000000..e1ac601af --- /dev/null +++ b/x/oracle/keeper/msg_server_create_price_test.go @@ -0,0 +1,131 @@ +package keeper_test + +import ( + "math/big" + reflect "reflect" + + "bou.ke/monkey" + math "cosmossdk.io/math" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/cache" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/testdata" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/cosmos/cosmos-sdk/testutil/mock" + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + gomock "go.uber.org/mock/gomock" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +//go:generate mockgen -destination mock_validator_test.go -package keeper_test github.com/cosmos/cosmos-sdk/x/staking/types ValidatorI + +var _ = Describe("MsgCreatePrice", func() { + var operator1, operator2, operator3 sdk.ValAddress + var c *cache.Cache + BeforeEach(func() { + ks.Reset() + Expect(ks.ms).ToNot(BeNil()) + + validatorC := NewMockValidatorI(ks.ctrl) + validatorC.EXPECT().GetBondedTokens().Return(math.NewInt(1)) + validatorC.EXPECT().GetBondedTokens().Return(math.NewInt(1)) + validatorC.EXPECT().GetBondedTokens().Return(math.NewInt(1)) + + validatorC.EXPECT().GetConsensusPower(gomock.Any()).Return(int64(1)) + validatorC.EXPECT().GetConsensusPower(gomock.Any()).Return(int64(1)) + validatorC.EXPECT().GetConsensusPower(gomock.Any()).Return(int64(1)) + + privVal1 := mock.NewPV() + pubKey1, _ := privVal1.GetPubKey() + operator1 = sdk.ValAddress(pubKey1.Address()) + + privVal2 := mock.NewPV() + pubKey2, _ := privVal2.GetPubKey() + operator2 = sdk.ValAddress(pubKey2.Address()) + + privVal3 := mock.NewPV() + pubKey3, _ := privVal3.GetPubKey() + operator3 = sdk.ValAddress(pubKey3.Address()) + + validatorC.EXPECT().GetOperator().Return(operator1) + validatorC.EXPECT().GetOperator().Return(operator2) + validatorC.EXPECT().GetOperator().Return(operator3) + + monkey.PatchInstanceMethod(reflect.TypeOf(keeper.Keeper{}), "IterateBondedValidatorsByPower", func(k keeper.Keeper, ctx sdk.Context, f func(index int64, validator stakingtypes.ValidatorI) bool) { + f(0, validatorC) + f(0, validatorC) + f(0, validatorC) + }) + monkey.PatchInstanceMethod(reflect.TypeOf(keeper.Keeper{}), "GetLastTotalPower", func(k keeper.Keeper, ctx sdk.Context) *big.Int { return big.NewInt(3) }) + + Expect(ks.ctx.BlockHeight()).To(Equal(int64(2))) + }) + + AfterEach(func() { + ks.ctrl.Finish() + }) + + Context("3 validators with 1 voting power each", func() { + BeforeEach(func() { + ks.ms.CreatePrice(ks.ctx, &types.MsgCreatePrice{ + Creator: operator1.String(), + FeederId: 1, + Prices: testdata.PS1, + BasedBlock: 1, + Nonce: 1, + }) + + c = keeper.GetCaches() + pRes := &common.Params{} + c.GetCache(cache.CacheItemP(pRes)) + Expect(*pRes).Should(BeEquivalentTo(types.DefaultParams())) + }) + + It("success on 3rd message", func() { + + iRes := make([]*cache.CacheItemM, 0) + c.GetCache(&iRes) + Expect(iRes[0].Validator).Should(Equal(operator1.String())) + + ks.ms.CreatePrice(ks.ctx, &types.MsgCreatePrice{ + Creator: operator2.String(), + FeederId: 1, + Prices: testdata.PS2, + BasedBlock: 1, + Nonce: 1, + }, + ) + ks.ms.CreatePrice(ks.ctx, &types.MsgCreatePrice{}) + c.GetCache(&iRes) + Expect(len(iRes)).Should(Equal(2)) + + ks.ms.CreatePrice(ks.ctx, &types.MsgCreatePrice{ + Creator: operator3.String(), + FeederId: 1, + Prices: testdata.PS4, + BasedBlock: 1, + Nonce: 1, + }, + ) + c.GetCache(&iRes) + Expect(len(iRes)).Should(Equal(0)) + prices := ks.k.GetAllPrices(sdk.UnwrapSDKContext(ks.ctx)) + //fmt.Println("GetAllPrices", prices[0]) + Expect(prices[0]).Should(BeEquivalentTo(types.Prices{ + TokenId: 1, + NextRountId: 2, + PriceList: []*types.PriceWithTimeAndRound{ + { + Price: testdata.PTD2.Price, + Decimal: testdata.PTD2.Decimal, + Timestamp: prices[0].PriceList[0].Timestamp, + RoundId: 1, + }, + }, + })) + }) + }) +}) diff --git a/x/oracle/keeper/msg_server_test.go b/x/oracle/keeper/msg_server_test.go new file mode 100644 index 000000000..b13973b15 --- /dev/null +++ b/x/oracle/keeper/msg_server_test.go @@ -0,0 +1,27 @@ +package keeper_test + +import ( + "context" + "testing" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + + // "github.com/cosmos/ibc-go/testing/mock" + + "github.com/stretchr/testify/require" +) + +func setupMsgServer(t testing.TB) (types.MsgServer, context.Context, keeper.Keeper) { + k, ctx := keepertest.OracleKeeper(t) + ctx = ctx.WithBlockHeight(2) + return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx), *k +} + +func TestMsgServer(t *testing.T) { + ms, ctx, _ := setupMsgServer(t) + require.NotNil(t, ms) + require.NotNil(t, ctx) +} diff --git a/x/oracle/keeper/params_test.go b/x/oracle/keeper/params_test.go new file mode 100644 index 000000000..3fb9269b8 --- /dev/null +++ b/x/oracle/keeper/params_test.go @@ -0,0 +1,18 @@ +package keeper_test + +import ( + "testing" + + testkeeper "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/stretchr/testify/require" +) + +func TestGetParams(t *testing.T) { + k, ctx := testkeeper.OracleKeeper(t) + params := types.DefaultParams() + + k.SetParams(ctx, params) + + require.EqualValues(t, params, k.GetParams(ctx)) +} diff --git a/x/oracle/keeper/prices_test.go b/x/oracle/keeper/prices_test.go new file mode 100644 index 000000000..423deeec9 --- /dev/null +++ b/x/oracle/keeper/prices_test.go @@ -0,0 +1,81 @@ +package keeper_test + +import ( + "strconv" + "testing" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/testdata" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNPrices(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.Prices { + items := make([]types.Prices, n) + for i := range items { + items[i].TokenId = int32(i + 1) + items[i] = types.Prices{ + TokenId: int32(i + 1), + NextRountId: 2, + PriceList: []*types.PriceWithTimeAndRound{ + testdata.PTR1, + testdata.PTR2, + testdata.PTR3, + testdata.PTR4, + testdata.PTR5, + }, + } + keeper.SetPrices(ctx, items[i]) + } + return items +} + +func TestPricesGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + keeper.SetPrices(ctx, testdata.P1) + rst, found := keeper.GetPrices(ctx, 1) + require.True(t, found) + pRes := testdata.P1 + pRes.PriceList = append([]*types.PriceWithTimeAndRound{{}}, testdata.P1.PriceList...) + require.Equal(t, pRes, rst) + // items := createNPrices(keeper, ctx, 10) + // + // for _, item := range items { + // rst, found := keeper.GetPrices(ctx, + // item.TokenId, + // ) + // require.True(t, found) + // require.Equal(t, + // nullify.Fill(&item), + // nullify.Fill(&rst), + // ) + // } +} +func TestPricesRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNPrices(keeper, ctx, 10) + for _, item := range items { + keeper.RemovePrices(ctx, + item.TokenId, + ) + _, found := keeper.GetPrices(ctx, + item.TokenId, + ) + require.False(t, found) + } +} + +func TestPricesGetAll(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNPrices(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllPrices(ctx)), + ) +} diff --git a/x/oracle/keeper/query_index_recent_msg_test.go b/x/oracle/keeper/query_index_recent_msg_test.go new file mode 100644 index 000000000..060c3ef07 --- /dev/null +++ b/x/oracle/keeper/query_index_recent_msg_test.go @@ -0,0 +1,50 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func TestIndexRecentMsgQuery(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + item := createTestIndexRecentMsg(keeper, ctx) + tests := []struct { + desc string + request *types.QueryGetIndexRecentMsgRequest + response *types.QueryGetIndexRecentMsgResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetIndexRecentMsgRequest{}, + response: &types.QueryGetIndexRecentMsgResponse{IndexRecentMsg: item}, + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.IndexRecentMsg(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} diff --git a/x/oracle/keeper/query_index_recent_params_test.go b/x/oracle/keeper/query_index_recent_params_test.go new file mode 100644 index 000000000..f934a4ba2 --- /dev/null +++ b/x/oracle/keeper/query_index_recent_params_test.go @@ -0,0 +1,50 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func TestIndexRecentParamsQuery(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + item := createTestIndexRecentParams(keeper, ctx) + tests := []struct { + desc string + request *types.QueryGetIndexRecentParamsRequest + response *types.QueryGetIndexRecentParamsResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetIndexRecentParamsRequest{}, + response: &types.QueryGetIndexRecentParamsResponse{IndexRecentParams: item}, + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.IndexRecentParams(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} diff --git a/x/oracle/keeper/query_params_test.go b/x/oracle/keeper/query_params_test.go new file mode 100644 index 000000000..a587b37d5 --- /dev/null +++ b/x/oracle/keeper/query_params_test.go @@ -0,0 +1,21 @@ +package keeper_test + +import ( + "testing" + + testkeeper "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +func TestParamsQuery(t *testing.T) { + keeper, ctx := testkeeper.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + params := types.DefaultParams() + keeper.SetParams(ctx, params) + + response, err := keeper.Params(wctx, &types.QueryParamsRequest{}) + require.NoError(t, err) + require.Equal(t, &types.QueryParamsResponse{Params: params}, response) +} diff --git a/x/oracle/keeper/query_prices_test.go b/x/oracle/keeper/query_prices_test.go new file mode 100644 index 000000000..b59930787 --- /dev/null +++ b/x/oracle/keeper/query_prices_test.go @@ -0,0 +1,126 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestPricesQuerySingle(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNPrices(keeper, ctx, 2) + tests := []struct { + desc string + request *types.QueryGetPricesRequest + response *types.QueryGetPricesResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetPricesRequest{ + TokenId: msgs[0].TokenId, + }, + response: &types.QueryGetPricesResponse{Prices: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetPricesRequest{ + TokenId: msgs[1].TokenId, + }, + response: &types.QueryGetPricesResponse{Prices: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetPricesRequest{ + TokenId: 100000, + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.Prices(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} + +//func TestPricesQueryPaginated(t *testing.T) { +// keeper, ctx := keepertest.OracleKeeper(t) +// wctx := sdk.WrapSDKContext(ctx) +// msgs := createNPrices(keeper, ctx, 5) +// +// request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllPricesRequest { +// return &types.QueryAllPricesRequest{ +// Pagination: &query.PageRequest{ +// Key: next, +// Offset: offset, +// Limit: limit, +// CountTotal: total, +// }, +// } +// } +// t.Run("ByOffset", func(t *testing.T) { +// step := 2 +// for i := 0; i < len(msgs); i += step { +// resp, err := keeper.PricesAll(wctx, request(nil, uint64(i), uint64(step), false)) +// require.NoError(t, err) +// require.LessOrEqual(t, len(resp.Prices), step) +// require.Subset(t, +// nullify.Fill(msgs), +// nullify.Fill(resp.Prices), +// ) +// } +// }) +// t.Run("ByKey", func(t *testing.T) { +// step := 2 +// var next []byte +// for i := 0; i < len(msgs); i += step { +// resp, err := keeper.PricesAll(wctx, request(next, 0, uint64(step), false)) +// require.NoError(t, err) +// require.LessOrEqual(t, len(resp.Prices), step) +// require.Subset(t, +// nullify.Fill(msgs), +// nullify.Fill(resp.Prices), +// ) +// next = resp.Pagination.NextKey +// } +// }) +// t.Run("Total", func(t *testing.T) { +// resp, err := keeper.PricesAll(wctx, request(nil, 0, 0, true)) +// require.NoError(t, err) +// require.Equal(t, len(msgs), int(resp.Pagination.Total)) +// require.ElementsMatch(t, +// nullify.Fill(msgs), +// nullify.Fill(resp.Prices), +// ) +// }) +// t.Run("InvalidRequest", func(t *testing.T) { +// _, err := keeper.PricesAll(wctx, nil) +// require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) +// }) +//} diff --git a/x/oracle/keeper/query_recent_msg_test.go b/x/oracle/keeper/query_recent_msg_test.go new file mode 100644 index 000000000..ba8538963 --- /dev/null +++ b/x/oracle/keeper/query_recent_msg_test.go @@ -0,0 +1,127 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestRecentMsgQuerySingle(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNRecentMsg(keeper, ctx, 2) + tests := []struct { + desc string + request *types.QueryGetRecentMsgRequest + response *types.QueryGetRecentMsgResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetRecentMsgRequest{ + Block: msgs[0].Block, + }, + response: &types.QueryGetRecentMsgResponse{RecentMsg: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetRecentMsgRequest{ + Block: msgs[1].Block, + }, + response: &types.QueryGetRecentMsgResponse{RecentMsg: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetRecentMsgRequest{ + Block: 100000, + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.RecentMsg(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} + +func TestRecentMsgQueryPaginated(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNRecentMsg(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllRecentMsgRequest { + return &types.QueryAllRecentMsgRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := keeper.RecentMsgAll(wctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.RecentMsg), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.RecentMsg), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.RecentMsgAll(wctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.RecentMsg), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.RecentMsg), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.RecentMsgAll(wctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(msgs), + nullify.Fill(resp.RecentMsg), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.RecentMsgAll(wctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/oracle/keeper/query_recent_params_test.go b/x/oracle/keeper/query_recent_params_test.go new file mode 100644 index 000000000..f7969f3e5 --- /dev/null +++ b/x/oracle/keeper/query_recent_params_test.go @@ -0,0 +1,127 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestRecentParamsQuerySingle(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNRecentParams(keeper, ctx, 2) + tests := []struct { + desc string + request *types.QueryGetRecentParamsRequest + response *types.QueryGetRecentParamsResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetRecentParamsRequest{ + Block: msgs[0].Block, + }, + response: &types.QueryGetRecentParamsResponse{RecentParams: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetRecentParamsRequest{ + Block: msgs[1].Block, + }, + response: &types.QueryGetRecentParamsResponse{RecentParams: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetRecentParamsRequest{ + Block: 100000, + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.RecentParams(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} + +func TestRecentParamsQueryPaginated(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNRecentParams(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllRecentParamsRequest { + return &types.QueryAllRecentParamsRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := keeper.RecentParamsAll(wctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.RecentParams), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.RecentParams), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.RecentParamsAll(wctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.RecentParams), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.RecentParams), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.RecentParamsAll(wctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(msgs), + nullify.Fill(resp.RecentParams), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.RecentParamsAll(wctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/oracle/keeper/query_validator_update_block_test.go b/x/oracle/keeper/query_validator_update_block_test.go new file mode 100644 index 000000000..27cc458e0 --- /dev/null +++ b/x/oracle/keeper/query_validator_update_block_test.go @@ -0,0 +1,50 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func TestValidatorUpdateBlockQuery(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + item := createTestValidatorUpdateBlock(keeper, ctx) + tests := []struct { + desc string + request *types.QueryGetValidatorUpdateBlockRequest + response *types.QueryGetValidatorUpdateBlockResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetValidatorUpdateBlockRequest{}, + response: &types.QueryGetValidatorUpdateBlockResponse{ValidatorUpdateBlock: item}, + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.ValidatorUpdateBlock(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} diff --git a/x/oracle/keeper/recent_msg_test.go b/x/oracle/keeper/recent_msg_test.go new file mode 100644 index 000000000..5304b976f --- /dev/null +++ b/x/oracle/keeper/recent_msg_test.go @@ -0,0 +1,63 @@ +package keeper_test + +import ( + "strconv" + "testing" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNRecentMsg(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.RecentMsg { + items := make([]types.RecentMsg, n) + for i := range items { + items[i].Block = uint64(i) + + keeper.SetRecentMsg(ctx, items[i]) + } + return items +} + +func TestRecentMsgGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRecentMsg(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetRecentMsg(ctx, + item.Block, + ) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) + } +} +func TestRecentMsgRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRecentMsg(keeper, ctx, 10) + for _, item := range items { + keeper.RemoveRecentMsg(ctx, + item.Block, + ) + _, found := keeper.GetRecentMsg(ctx, + item.Block, + ) + require.False(t, found) + } +} + +func TestRecentMsgGetAll(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRecentMsg(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllRecentMsg(ctx)), + ) +} diff --git a/x/oracle/keeper/recent_params_test.go b/x/oracle/keeper/recent_params_test.go new file mode 100644 index 000000000..26ee1a8d9 --- /dev/null +++ b/x/oracle/keeper/recent_params_test.go @@ -0,0 +1,63 @@ +package keeper_test + +import ( + "strconv" + "testing" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNRecentParams(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.RecentParams { + items := make([]types.RecentParams, n) + for i := range items { + items[i].Block = uint64(i) + + keeper.SetRecentParams(ctx, items[i]) + } + return items +} + +func TestRecentParamsGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRecentParams(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetRecentParams(ctx, + item.Block, + ) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) + } +} +func TestRecentParamsRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRecentParams(keeper, ctx, 10) + for _, item := range items { + keeper.RemoveRecentParams(ctx, + item.Block, + ) + _, found := keeper.GetRecentParams(ctx, + item.Block, + ) + require.False(t, found) + } +} + +func TestRecentParamsGetAll(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + items := createNRecentParams(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllRecentParams(ctx)), + ) +} diff --git a/x/oracle/keeper/testdata/helper.go b/x/oracle/keeper/testdata/helper.go new file mode 100644 index 000000000..d30da821d --- /dev/null +++ b/x/oracle/keeper/testdata/helper.go @@ -0,0 +1,36 @@ +package testdata + +import "github.com/ExocoreNetwork/exocore/x/oracle/types" + +func newPTD(detId, price string) *types.PriceWithTimeAndDetId { + return &types.PriceWithTimeAndDetId{ + Price: price, + Decimal: 18, + Timestamp: "-", + DetId: detId, + } +} + +func newPS(sourceId int32, prices ...*types.PriceWithTimeAndDetId) *types.PriceWithSource { + return &types.PriceWithSource{ + SourceId: sourceId, + Prices: prices, + } +} + +func newPTR(price string, roundId uint64) *types.PriceWithTimeAndRound { + return &types.PriceWithTimeAndRound{ + Price: price, + Decimal: 18, + Timestamp: "", + RoundId: roundId, + } +} + +func newPrices(tokenId int32, nextRoundId uint64, pList ...*types.PriceWithTimeAndRound) types.Prices { + return types.Prices{ + TokenId: tokenId, + NextRountId: nextRoundId, + PriceList: pList, + } +} diff --git a/x/oracle/keeper/testdata/info.go b/x/oracle/keeper/testdata/info.go new file mode 100644 index 000000000..ef5dc165c --- /dev/null +++ b/x/oracle/keeper/testdata/info.go @@ -0,0 +1,64 @@ +package testdata + +import ( + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +var ( + One = big.NewInt(1) + Zero = big.NewInt(0) + Ten = big.NewInt(10) + Eleven = big.NewInt(11) + Fifteen = big.NewInt(15) + Twenty = big.NewInt(20) +) + +var ( + PTD1 = newPTD("1", "10") + PTD2 = newPTD("2", "12") + PTD3 = newPTD("3", "15") + PTD2M = newPTD("2", "11") + PTD3M = newPTD("3", "19") + //1-10, 2-12 + PS1 = []*types.PriceWithSource{newPS(1, PTD1, PTD2)} + //2-12, 3-1 + PS2 = []*types.PriceWithSource{newPS(1, PTD3, PTD2)} + //1-10, 2-11(m) + PS3 = []*types.PriceWithSource{newPS(1, PTD1, PTD2M)} + //2-12, 3-19(m) + PS4 = []*types.PriceWithSource{newPS(1, PTD2, PTD3M)} + //1-10, 3-19(m) + PS5 = []*types.PriceWithSource{newPS(1, PTD1, PTD3M)} + + PS6 = []*types.PriceWithSource{newPS(2, PTD1)} + + //1-10, 2-12 + PS21 = []*types.PriceWithSource{newPS(1, PTD1, PTD2), newPS(2, PTD1, PTD3)} + //2-12, 3-15 + PS22 = []*types.PriceWithSource{newPS(1, PTD3, PTD2), newPS(2, PTD2, PTD3)} + //1-10, 2-11(m) + PS23 = []*types.PriceWithSource{newPS(1, PTD1, PTD2M), newPS(2, PTD2M, PTD1)} + //2-12, 3-19(m) + PS24 = []*types.PriceWithSource{newPS(1, PTD2, PTD3M), newPS(2, PTD3, PTD2M)} + //1-10, 3-19(m) + PS25 = []*types.PriceWithSource{newPS(1, PTD1, PTD3M), newPS(2, PTD2M, PTD3M)} +) + +var ( + PTR1 = newPTR("100", 1) + PTR2 = newPTR("109", 2) + PTR3 = newPTR("117", 3) + PTR4 = newPTR("129", 4) + PTR5 = newPTR("121", 5) + P1 = newPrices(1, 6, PTR1, PTR2, PTR3, PTR4, PTR5) +) + +var DefaultParams = types.Params{ + Chains: []*types.Chain{{Name: "-", Desc: "-"}, {Name: "Ethereum", Desc: "-"}}, + Tokens: []*types.Token{{}, {Name: "eth", ChainId: 1, ContractAddress: "0xabc", Decimal: 18, Active: true}}, + Sources: []*types.Source{{}, {Name: "chainLink", Entry: &types.Endpoint{}, Valid: true, Deterministic: true}}, + Rules: []*types.RuleWithSource{{}, {SourceIds: []int32{1}}}, + TokenFeeders: []*types.TokenFeeder{{}, {TokenId: 1, RuleId: 1, StartRoundId: 1, StartBaseBlock: 0, Interval: 10, EndBlock: 0}}, +} diff --git a/x/oracle/keeper/validator_update_block_test.go b/x/oracle/keeper/validator_update_block_test.go new file mode 100644 index 000000000..56bd66356 --- /dev/null +++ b/x/oracle/keeper/validator_update_block_test.go @@ -0,0 +1,38 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" + "github.com/ExocoreNetwork/exocore/testutil/nullify" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +func createTestValidatorUpdateBlock(keeper *keeper.Keeper, ctx sdk.Context) types.ValidatorUpdateBlock { + item := types.ValidatorUpdateBlock{} + keeper.SetValidatorUpdateBlock(ctx, item) + return item +} + +func TestValidatorUpdateBlockGet(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + item := createTestValidatorUpdateBlock(keeper, ctx) + rst, found := keeper.GetValidatorUpdateBlock(ctx) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) +} + +func TestValidatorUpdateBlockRemove(t *testing.T) { + keeper, ctx := keepertest.OracleKeeper(t) + createTestValidatorUpdateBlock(keeper, ctx) + keeper.RemoveValidatorUpdateBlock(ctx) + _, found := keeper.GetValidatorUpdateBlock(ctx) + require.False(t, found) +} From 07bb9e56a300976a4c83c0ffd0cd086c3ec24f8f Mon Sep 17 00:00:00 2001 From: leonz789 Date: Wed, 3 Apr 2024 03:16:15 +0800 Subject: [PATCH 33/37] feat(oracle-keeper):add cache as memory storage for prices collection across blocks --- x/oracle/keeper/cache/caches.go | 229 +++++++++++++++++++++++++++ x/oracle/keeper/cache/caches_test.go | 101 ++++++++++++ x/oracle/keeper/cache/info_test.go | 11 ++ 3 files changed, 341 insertions(+) create mode 100644 x/oracle/keeper/cache/caches.go create mode 100644 x/oracle/keeper/cache/caches_test.go create mode 100644 x/oracle/keeper/cache/info_test.go diff --git a/x/oracle/keeper/cache/caches.go b/x/oracle/keeper/cache/caches.go new file mode 100644 index 000000000..df8ae2867 --- /dev/null +++ b/x/oracle/keeper/cache/caches.go @@ -0,0 +1,229 @@ +package cache + +import ( + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var zeroBig = big.NewInt(0) + +type CacheItemV map[string]*big.Int +type CacheItemP *common.Params +type CacheItemM struct { + FeederId int32 + PSources []*types.PriceWithSource + Validator string +} + +type Cache struct { + msg cacheMsgs + validators *cacheValidator + params *cacheParams +} + +type cacheMsgs map[int32][]*CacheItemM + +// used to track validator change +type cacheValidator struct { + validators map[string]*big.Int + update bool +} + +// used to track params change +type cacheParams struct { + params *common.Params + update bool +} + +func (c cacheMsgs) add(item *CacheItemM) { + if ims, ok := c[item.FeederId]; ok { + for _, im := range ims { + if im.Validator == item.Validator { + for _, p := range im.PSources { + for _, pInput := range item.PSources { + if p.SourceId == pInput.SourceId { + p.Prices = append(p.Prices, pInput.Prices...) + return + } + } + } + im.PSources = append(im.PSources, item.PSources...) + return + } + } + } + c[item.FeederId] = append(c[item.FeederId], item) +} + +func (c cacheMsgs) remove(item *CacheItemM) { + delete(c, item.FeederId) +} + +func (c cacheMsgs) commit(ctx sdk.Context, k common.KeeperOracle) { + block := uint64(ctx.BlockHeight()) + recentMsgs := types.RecentMsg{ + Block: block, + Msgs: make([]*types.MsgItem, 0), + } + for _, msgs4Feeder := range c { + for _, msg := range msgs4Feeder { + recentMsgs.Msgs = append(recentMsgs.Msgs, &types.MsgItem{ + FeederId: msg.FeederId, + PSources: msg.PSources, + Validator: msg.Validator, + }) + } + } + index, _ := k.GetIndexRecentMsg(ctx) + for i, b := range index.Index { + if b >= block-common.MaxNonce { + index.Index = index.Index[i:] + break + } + k.RemoveRecentMsg(ctx, b) + } + k.SetRecentMsg(ctx, recentMsgs) + index.Index = append(index.Index, block) + k.SetIndexRecentMsg(ctx, index) +} + +func (c *cacheValidator) add(validators map[string]*big.Int) { + for operator, newPower := range validators { + if power, ok := c.validators[operator]; ok { + if newPower.Cmp(zeroBig) == 0 { + delete(c.validators, operator) + c.update = true + } else if power.Cmp(newPower) != 0 { + c.validators[operator].Set(newPower) + c.update = true + } + } else { + c.update = true + np := *newPower + c.validators[operator] = &np + } + } +} + +func (c *cacheValidator) commit(ctx sdk.Context, k common.KeeperOracle) { + block := uint64(ctx.BlockHeight()) + k.SetValidatorUpdateBlock(ctx, types.ValidatorUpdateBlock{Block: block}) +} + +func (c *cacheParams) add(p *common.Params) { + //params' update is triggered when params is actually updated, so no need to do comparison here, just udpate and mark the flag + //TODO: add comparison check, that's something should be done for validation + c.params = p + c.update = true +} + +func (c *cacheParams) commit(ctx sdk.Context, k common.KeeperOracle) { + block := uint64(ctx.BlockHeight()) + index, _ := k.GetIndexRecentParams(ctx) + for i, b := range index.Index { + if b >= block-common.MaxNonce { + index.Index = index.Index[i:] + break + } + k.RemoveRecentParams(ctx, b) + } + //remove and append for KVStore + k.SetIndexRecentParams(ctx, index) + index.Index = append(index.Index, block) + k.SetIndexRecentParams(ctx, index) +} + +// memory cache +// func (c *Cache) AddCache(i any, k common.KeeperOracle) { +func (c *Cache) AddCache(i any) { + switch item := i.(type) { + case *CacheItemM: + c.msg.add(item) + // case *params: + case CacheItemP: + c.params.add(item) + case CacheItemV: + c.validators.add(item) + default: + panic("no other types are support") + } +} + +// func (c *Cache) RemoveCache(i any, k common.KeeperOracle) { +func (c *Cache) RemoveCache(i any) { + switch item := i.(type) { + case *CacheItemM: + c.msg.remove(item) + default: + } +} + +func (c *Cache) GetCache(i any) bool { + switch item := i.(type) { + case CacheItemV: + if item == nil { + return false + } + for addr, power := range c.validators.validators { + item[addr] = power + } + case CacheItemP: + //fmt.Println("debug ", c.params.params) + if item == nil { + return false + } + *item = *(c.params.params) + case *[]*CacheItemM: + if item == nil { + return false + } + // fmt.Println("debug getCacheM", c.msg) + tmp := make([]*CacheItemM, 0, len(c.msg)) + for _, msgs := range c.msg { + tmp = append(tmp, msgs...) + } + *item = tmp + default: + return false + } + return true +} + +func (c *Cache) CommitCache(ctx sdk.Context, reset bool, k common.KeeperOracle) { + if len(c.msg) > 0 { + c.msg.commit(ctx, k) + c.msg = make(map[int32][]*CacheItemM) + } + + if c.validators.update { + c.validators.commit(ctx, k) + c.validators.update = false + } + + if c.params.update { + c.params.commit(ctx, k) + c.params.update = false + } + if reset { + c.ResetCaches() + } +} + +func (c *Cache) ResetCaches() { + *c = *(NewCache()) +} + +func NewCache() *Cache { + return &Cache{ + msg: make(map[int32][]*CacheItemM), + validators: &cacheValidator{ + validators: make(map[string]*big.Int), + }, + params: &cacheParams{ + params: &common.Params{}, + }, + } +} diff --git a/x/oracle/keeper/cache/caches_test.go b/x/oracle/keeper/cache/caches_test.go new file mode 100644 index 000000000..6cd9eb183 --- /dev/null +++ b/x/oracle/keeper/cache/caches_test.go @@ -0,0 +1,101 @@ +package cache + +import ( + "math/big" + "testing" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + . "github.com/smartystreets/goconvey/convey" + // "go.uber.org/mock/gomock" +) + +func TestCache(t *testing.T) { + c := NewCache() + p := defaultParams + pWrapped := common.Params(p) + + // ctrl := gomock.NewController(t) + // defer ctrl.Finish() + //ko := common.NewMockKeeperOracle(ctrl) + //c.AddCache(CacheItemP(&pWrapped), ko) + + Convey("test cache", t, func() { + Convey("add pramams item", func() { + c.AddCache(CacheItemP(&pWrapped)) + pReturn := &common.Params{} + c.GetCache(CacheItemP(pReturn)) + So(*pReturn, ShouldResemble, pWrapped) + }) + + Convey("add validatorPower item", func() { + validatorPowers := map[string]*big.Int{ + "v1": big.NewInt(100), + "v2": big.NewInt(109), + "v3": big.NewInt(119), + } + c.AddCache(CacheItemV(validatorPowers)) + vpReturn := make(map[string]*big.Int) + Convey("for empty cache", func() { + c.GetCache(CacheItemV(vpReturn)) + So(vpReturn, ShouldResemble, validatorPowers) + }) + Convey("then update validatorPower item for this cache", func() { + validaotrPowers := map[string]*big.Int{ + //add v5 + "v5": big.NewInt(123), + //remove v1 + "v1": big.NewInt(0), + //update v2 + "v2": big.NewInt(199), + } + c.AddCache(CacheItemV(validaotrPowers)) + c.GetCache(CacheItemV(vpReturn)) + So(vpReturn, ShouldNotContainKey, "v1") + So(vpReturn, ShouldContainKey, "v5") + So(vpReturn["v2"], ShouldResemble, big.NewInt(199)) + }) + }) + + Convey("add msg item", func() { + msgItems := []*CacheItemM{ + { + FeederId: 1, + PSources: []*types.PriceWithSource{ + { + SourceId: 1, + Prices: []*types.PriceWithTimeAndDetId{ + {Price: "600000", Decimal: 1, Timestamp: "-", DetId: "1"}, {Price: "620000", Decimal: 1, Timestamp: "-", DetId: "2"}, + }, + }, + }, + Validator: "v1", + }, + { + FeederId: 1, + PSources: []*types.PriceWithSource{ + {SourceId: 1, Prices: []*types.PriceWithTimeAndDetId{{Price: "600000", Decimal: 1, Timestamp: "-", DetId: "4"}, {Price: "620000", Decimal: 1, Timestamp: "-", DetId: "3"}}}}, + Validator: "v1", + }, + { + FeederId: 2, + PSources: []*types.PriceWithSource{{SourceId: 1, Prices: []*types.PriceWithTimeAndDetId{{Price: "30000", Decimal: 1, Timestamp: "-", DetId: "4"}, {Price: "32000", Decimal: 1, Timestamp: "-", DetId: "3"}}}}, + Validator: "v2", + }, + } + c.AddCache(msgItems[0]) + msgItemsReturn := make([]*CacheItemM, 0, 3) + Convey("add single item", func() { + c.GetCache(&msgItemsReturn) + So(msgItemsReturn, ShouldContain, msgItems[0]) + }) + Convey("add more items", func() { + c.AddCache(msgItems[1]) + c.AddCache(msgItems[2]) + c.GetCache(&msgItemsReturn) + So(msgItemsReturn, ShouldContain, msgItems[2]) + So(msgItemsReturn, ShouldNotContain, msgItems[0]) + }) + }) + }) +} diff --git a/x/oracle/keeper/cache/info_test.go b/x/oracle/keeper/cache/info_test.go new file mode 100644 index 000000000..fb24f6ca6 --- /dev/null +++ b/x/oracle/keeper/cache/info_test.go @@ -0,0 +1,11 @@ +package cache + +import "github.com/ExocoreNetwork/exocore/x/oracle/types" + +var defaultParams = types.Params{ + Chains: []*types.Chain{{Name: "-", Desc: "-"}, {Name: "Ethereum", Desc: "-"}}, + Tokens: []*types.Token{{}, {Name: "eth", ChainId: 1, ContractAddress: "0xabc", Decimal: 18, Active: true}}, + Sources: []*types.Source{{}, {Name: "chainLink", Entry: &types.Endpoint{}, Valid: true, Deterministic: true}}, + Rules: []*types.RuleWithSource{{}, {SourceIds: []int32{1}}}, + TokenFeeders: []*types.TokenFeeder{{}, {TokenId: 1, RuleId: 1, StartRoundId: 1, StartBaseBlock: 0, Interval: 10, EndBlock: 0}}, +} From 8aa9a1bedea78ed6c1e9b2b4095b02fbd861698c Mon Sep 17 00:00:00 2001 From: leonz789 Date: Wed, 3 Apr 2024 03:18:13 +0800 Subject: [PATCH 34/37] feat(oracle-keeper):add aggregator used to implement the mainly function to calculate fianl price from sources provided by validators --- x/oracle/keeper/aggregator/aggregator.go | 288 ++++++++++++++++++ .../aggregator/aggregator_aggregator.go | 173 +++++++++++ .../aggregator/aggregator_aggregator_test.go | 68 +++++ .../aggregator/aggregator_calculator.go | 168 ++++++++++ .../aggregator/aggregator_calculator_test.go | 99 ++++++ .../keeper/aggregator/aggregator_filter.go | 85 ++++++ .../aggregator/aggregator_filter_test.go | 105 +++++++ x/oracle/keeper/aggregator/aggregator_test.go | 88 ++++++ x/oracle/keeper/aggregator/helper_test.go | 19 ++ x/oracle/keeper/aggregator/info_test.go | 55 ++++ x/oracle/keeper/aggregator/worker.go | 71 +++++ 11 files changed, 1219 insertions(+) create mode 100644 x/oracle/keeper/aggregator/aggregator.go create mode 100644 x/oracle/keeper/aggregator/aggregator_aggregator.go create mode 100644 x/oracle/keeper/aggregator/aggregator_aggregator_test.go create mode 100644 x/oracle/keeper/aggregator/aggregator_calculator.go create mode 100644 x/oracle/keeper/aggregator/aggregator_calculator_test.go create mode 100644 x/oracle/keeper/aggregator/aggregator_filter.go create mode 100644 x/oracle/keeper/aggregator/aggregator_filter_test.go create mode 100644 x/oracle/keeper/aggregator/aggregator_test.go create mode 100644 x/oracle/keeper/aggregator/helper_test.go create mode 100644 x/oracle/keeper/aggregator/info_test.go create mode 100644 x/oracle/keeper/aggregator/worker.go diff --git a/x/oracle/keeper/aggregator/aggregator.go b/x/oracle/keeper/aggregator/aggregator.go new file mode 100644 index 000000000..95fbd4dfb --- /dev/null +++ b/x/oracle/keeper/aggregator/aggregator.go @@ -0,0 +1,288 @@ +package aggregator + +import ( + "errors" + "math/big" + "time" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/cache" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + "github.com/ExocoreNetwork/exocore/x/oracle/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type cacheItemM struct { + feederId int32 + pSources []*types.PriceWithSource + validator string +} + +type priceItemKV struct { + TokenId int32 + PriceTR types.PriceWithTimeAndRound +} + +type roundInfo struct { + //this round of price will start from block basedBlock+1, the basedBlock served as a trigger to notify validators to submit prices + basedBlock uint64 + //next round id of the price oracle service, price with thie id will be record on block basedBlock+1 if all prices submitted by validators(for v1, validators serve as oracle nodes) get to consensus immedately + nextRoundId uint64 + //indicate if this round is open for collecting prices or closed in either condition that success with a consensused price or not + //1: open, 2: closed + status int32 +} + +// AggregatorContext keeps memory cache for state params, validatorset, and updatedthese values as they udpated on chain. And it keeps the infomation to track all tokenFeeders' status and data collection +type AggregatorContext struct { + params *common.Params + + //validator->power + validatorsPower map[string]*big.Int + totalPower *big.Int + + //each active feederToken has a roundInfo + rounds map[int32]*roundInfo + + //each roundInfo has a worker + aggregators map[int32]*worker +} + +func (agc *AggregatorContext) sanityCheck(msg *types.MsgCreatePrice) error { + //sanity check + //TODO: check nonce [1,3] in anteHandler, related to params, may not able + //TODO: check the msgCreatePrice's Decimal is correct with params setting + //TODO: check len(price.prices)>0, len(price.prices._range_eachPriceWithSource.Prices)>0, at least has one source, and for each source has at least one price + //TODO: check for each source, at most maxDetId count price (now in filter, ->anteHandler) + if agc.validatorsPower[msg.Creator] == nil { + return errors.New("signer is not validator") + } + + if msg.Nonce < 1 || msg.Nonce > common.MaxNonce { + return errors.New("nonce invalid") + } + + //TODO: sanity check for price(no more than maxDetId count for each source, this should be take care in anteHandler) + if msg.Prices == nil || len(msg.Prices) == 0 { + return errors.New("msg should provide at least one price") + } + + for _, pSource := range msg.Prices { + if pSource.Prices == nil || len(pSource.Prices) == 0 || len(pSource.Prices) > common.MaxDetId || !agc.params.IsValidSource(pSource.SourceId) { + return errors.New("source should be valid and provide at least one price") + } + //check with params is coressponding source is deteministic + if agc.params.IsDeterministicSource(pSource.SourceId) { + for _, pDetId := range pSource.Prices { + //TODO: verify the format of DetId is correct, since this is string, and we will make consensus with validator's power, so it's ok not to verify the format + //just make sure the DetId won't mess up with NS's placeholder id, the limitation of maximum count one validator can submit will be check by filter + if len(pDetId.DetId) == 0 { + //deterministic must have specified deterministicId + return errors.New("ds should have roundid") + } + //DS's price value will go through consensus process, so it's safe to skip the check here + } + } else { + //sanity check: NS submit only one price with detId=="" + if len(pSource.Prices) > 1 || len(pSource.Prices[0].DetId) > 0 { + return errors.New("ns should not have roundid") + } + } + } + return nil +} + +func (agc *AggregatorContext) checkMsg(msg *types.MsgCreatePrice) error { + if err := agc.sanityCheck(msg); err != nil { + return err + } + + //check feeder is active + feederContext := agc.rounds[msg.FeederId] + if feederContext == nil || feederContext.status != 1 { + //feederId does not exist or not alive + return errors.New("context not exist or not available") + } + //senity check on basedBlock + if msg.BasedBlock != feederContext.basedBlock { + return errors.New("baseblock not match") + } + + //check sources rule matches + if ok, err := agc.params.CheckRules(msg.FeederId, msg.Prices); !ok { + return err + } + return nil +} + +func (agc *AggregatorContext) FillPrice(msg *types.MsgCreatePrice) (*priceItemKV, *cache.CacheItemM, error) { + // fmt.Println("debug agc fillprice") + feederWorker := agc.aggregators[msg.FeederId] + //worker initialzed here reduce workload for Endblocker + if feederWorker == nil { + feederWorker = newWorker(msg.FeederId, agc) + agc.aggregators[msg.FeederId] = feederWorker + } + + if feederWorker.sealed { + return nil, nil, errors.New("") + } + + if listFilled := feederWorker.do(msg); listFilled != nil { + if finalPrice := feederWorker.aggregate(); finalPrice != nil { + agc.rounds[msg.FeederId].status = 2 + feederWorker.seal() + return &priceItemKV{agc.params.GetTokenFeeder(msg.FeederId).TokenId, types.PriceWithTimeAndRound{ + Price: finalPrice.String(), + Decimal: agc.params.GetTokenInfo(msg.FeederId).Decimal, + //TODO: check the format + Timestamp: time.Now().String(), + RoundId: agc.rounds[msg.FeederId].nextRoundId, + }}, &cache.CacheItemM{FeederId: msg.FeederId}, nil + } + return nil, &cache.CacheItemM{msg.FeederId, listFilled, msg.Creator}, nil + } + + return nil, nil, errors.New("") +} + +// NewCreatePrice receives msgCreatePrice message, and goes process: filter->aggregator, filter->calculator->aggregator +// non-deterministic data will goes directly into aggregator, and deterministic data will goes into calculator first to get consensus on the deterministic id. +func (agc *AggregatorContext) NewCreatePrice(ctx sdk.Context, msg *types.MsgCreatePrice) (*priceItemKV, *cache.CacheItemM, error) { + // fmt.Println("debug agc.newcreateprice") + if err := agc.checkMsg(msg); err != nil { + // fmt.Println("debug agc.newcreateprice.error", err) + return nil, nil, err + } + // fmt.Println("debug before agc.fillprice") + return agc.FillPrice(msg) +} + +// prepare for new roundInfo, just update the status kept in memory +// executed at EndBlock stage, seall all success or expired roundInfo +// including possible aggregation and state update +// when validatorSet update, set force to true, to seal all alive round +// returns: 1st successful sealed, need to be written to KVStore, 2nd: failed sealed tokenId, use previous price to write to KVStore +func (agc *AggregatorContext) SealRound(ctx sdk.Context, force bool) (success []*priceItemKV, failed []int32) { + //1. check validatorSet udpate + //TODO: if validatoSet has been updated in current block, just seal all active rounds and return + //1. for sealed worker, the KVStore has been updated + for feederId, round := range agc.rounds { + if round.status == 1 { + feeder := agc.params.GetTokenFeeder(feederId) + //TODO: for mode=1, we don't do aggregate() here, since if it donesn't success in the transaction execution stage, it won't success here + //but it's not always the same for other modes, switch modes + switch common.Mode { + case 1: + expired := feeder.EndBlock > 0 && ctx.BlockHeight() >= feeder.EndBlock + outOfWindow := uint64(ctx.BlockHeight())-round.basedBlock >= uint64(common.MaxNonce) + if expired || outOfWindow || force { + //TODO: WRITE TO KVSTORE with previous round data for this round + failed = append(failed, feeder.TokenId) + if expired { + delete(agc.rounds, feederId) + delete(agc.aggregators, feederId) + } else { + round.status = 2 + agc.aggregators[feederId] = nil + } + } + } + } + //all status: 1->2, remove its aggregator + if agc.aggregators[feederId] != nil && agc.aggregators[feederId].sealed { + agc.aggregators[feederId] = nil + } + } + return +} + +//func (agc *AggregatorContext) ForceSeal(ctx sdk.Context) (success []*priceItemKV, failed []int32) { +// +//} + +func (agc *AggregatorContext) PrepareRound(ctx sdk.Context, block uint64) { + //block>0 means recache initialization, all roundInfo is empty + if block == 0 { + block = uint64(ctx.BlockHeight()) + } + + // fmt.Println("debug agc.prepareround, height:", block) + for feederId, feeder := range agc.params.GetTokenFeeders() { + if feederId == 0 { + continue + } + // fmt.Println("debug agc.prepareround, feederId:", feederId) + if (feeder.EndBlock > 0 && uint64(feeder.EndBlock) <= block) || uint64(feeder.StartBaseBlock) > block { + + // fmt.Println("debug agc.prepareround 2, feederId:", feederId, feeder.StartBaseBlock, block) + //this feeder is inactive + continue + } + + // fmt.Println("debug agc.prepareround 3, feederId:", feederId) + + delta := (block - uint64(feeder.StartBaseBlock)) + left := delta % uint64(feeder.Interval) + count := delta / uint64(feeder.Interval) + latestBasedblock := block - left + latestNextRoundId := uint64(feeder.StartRoundId) + count + + feederIdInt32 := int32(feederId) + round := agc.rounds[feederIdInt32] + if round == nil { + round = &roundInfo{ + basedBlock: latestBasedblock, + nextRoundId: latestNextRoundId, + } + if left >= common.MaxNonce { + round.status = 2 + } else { + round.status = 1 + } + agc.rounds[feederIdInt32] = round + } else { + //prepare a new round for exist roundInfo + if left == 0 { + round.basedBlock = latestBasedblock + round.nextRoundId = latestNextRoundId + round.status = 1 + //drop previous worker + agc.aggregators[feederIdInt32] = nil + } else if round.status == 1 && left >= common.MaxNonce { + //this shouldn't happend, if do sealround properly before prepareRound, basically for test only + round.status = 2 + //TODO: just modify the status here, since sealRound should do all the related seal actios already when parepare invoked + } + } + } +} + +func (agc *AggregatorContext) SetParams(p *common.Params) { + agc.params = p +} + +func (agc *AggregatorContext) SetValidatorPowers(vp map[string]*big.Int) { + // t := big.NewInt(0) + agc.totalPower = big.NewInt(0) + agc.validatorsPower = make(map[string]*big.Int) + for addr, power := range vp { + agc.validatorsPower[addr] = power + agc.totalPower = new(big.Int).Add(agc.totalPower, power) + } +} +func (agc *AggregatorContext) GetValidatorPowers() (vp map[string]*big.Int) { + return agc.validatorsPower +} + +//func (agc *AggregatorContext) SetTotalPower(power *big.Int) { +// agc.totalPower = power +//} + +func NewAggregatorContext() *AggregatorContext { + return &AggregatorContext{ + validatorsPower: make(map[string]*big.Int), + totalPower: big.NewInt(0), + rounds: make(map[int32]*roundInfo), + aggregators: make(map[int32]*worker), + } +} diff --git a/x/oracle/keeper/aggregator/aggregator_aggregator.go b/x/oracle/keeper/aggregator/aggregator_aggregator.go new file mode 100644 index 000000000..5dccf33d6 --- /dev/null +++ b/x/oracle/keeper/aggregator/aggregator_aggregator.go @@ -0,0 +1,173 @@ +package aggregator + +import ( + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +type priceWithTimeAndRound struct { + price *big.Int + decimal int32 + timestamp string + detRoundId string //roundId from source if exists +} + +type reportPrice struct { + validator string + //final price, set to -1 as initial + price *big.Int + //sourceId->priceWithTimeAndRound + prices map[int32]*priceWithTimeAndRound + power *big.Int +} + +func (r *reportPrice) aggregate() *big.Int { + if r.price != nil { + return r.price + } + tmp := make([]*big.Int, 0, len(r.prices)) + for _, p := range r.prices { + tmp = append(tmp, p.price) + } + r.price = common.BigIntList(tmp).Median() + return r.price +} + +type aggregator struct { + finalPrice *big.Int + reports []*reportPrice + //total valiadtor power who has submitted pice + reportPower *big.Int + totalPower *big.Int + //validator set total power + // totalPower string + //sourceId->roundId used to track the confirmed DS roundId + //updated by calculator, detId use string + dsPrices map[int32]string +} + +// fill price from validator submittion into aggregator, and calculation the voting power and check with the consensus status of deterministic soruce value to decide when to do the aggregation +// TODO: currently apply mode=1 in V1, add swith modes +func (agg *aggregator) fillPrice(pSources []*types.PriceWithSource, validator string, power *big.Int) { + report := agg.getReport(validator) + if report == nil { + report = &reportPrice{ + validator: validator, + prices: make(map[int32]*priceWithTimeAndRound), + power: power, + } + agg.reports = append(agg.reports, report) + agg.reportPower = new(big.Int).Add(agg.reportPower, power) + } + + for _, pSource := range pSources { + if len(pSource.Prices[0].DetId) == 0 { + //this is an NS price report, price will just be updated instead of append + if pTR := report.prices[pSource.SourceId]; pTR == nil { + pTmp := pSource.Prices[0] + priceBigInt, _ := (&big.Int{}).SetString(pTmp.Price, 10) + pTR = &priceWithTimeAndRound{ + price: priceBigInt, + decimal: pTmp.Decimal, + timestamp: pTmp.Timestamp, + // detRoundId: p.DetId, + } + report.prices[pSource.SourceId] = pTR + } else { + pTR.price, _ = (&big.Int{}).SetString(pSource.Prices[0].Price, 10) + } + } else { + //this is an DS price report + if pTR := report.prices[pSource.SourceId]; pTR == nil { + pTmp := pSource.Prices[0] + pTR = &priceWithTimeAndRound{ + //price: nil, + decimal: pTmp.Decimal, + // timestamp: "", + //detRoundId: "", + } + if len(agg.dsPrices[pSource.SourceId]) > 0 { + for _, reportTmp := range agg.reports { + if priceTmp := reportTmp.prices[pSource.SourceId]; priceTmp != nil && priceTmp.price != nil { + pTR.price = new(big.Int).Set(priceTmp.price) + pTR.detRoundId = priceTmp.detRoundId + pTR.timestamp = priceTmp.timestamp + } + } + } + report.prices[pSource.SourceId] = pTR + } + //skip if this DS's slot exists, DS's value only updated by calculator + } + } +} + +// TODO: for v1 use mode=1, which means agg.dsPrices with each key only be updated once, switch modes +func (agg *aggregator) confirmDSPrice(confirmedRounds []*confirmedPrice) { + for _, priceSourceRound := range confirmedRounds { + //update the latest round-detId for DS, TODO: in v1 we only update this value once since calculator will just ignore any further value once a detId has reached consensus + // agg.dsPrices[priceSourceRound.sourceId] = priceSourceRound.detId + //this id's comparision need to format id to make sure them be the same length + if id := agg.dsPrices[priceSourceRound.sourceId]; len(id) == 0 || (len(id) > 0 && id < priceSourceRound.detId) { + agg.dsPrices[priceSourceRound.sourceId] = priceSourceRound.detId + for _, report := range agg.reports { + if report.price != nil { + //price of IVA has completed + continue + } + if price := report.prices[priceSourceRound.sourceId]; price != nil { + price.detRoundId = priceSourceRound.detId + price.timestamp = priceSourceRound.timestamp + price.price = priceSourceRound.price + } //else TODO: panice in V1 + } + } + } +} + +func (agg *aggregator) getReport(validator string) *reportPrice { + for _, r := range agg.reports { + if r.validator == validator { + return r + } + } + return nil +} + +func (agg *aggregator) aggregate() *big.Int { + if agg.finalPrice != nil { + return agg.finalPrice + } + // fmt.Printf("debug aggregator.aggregate(), reportPower:%s, totalPower:%s\n", agg.reportPower.String(), agg.totalPower.String()) + //TODO: implemetn different MODE for definition of consensus, + //currently: use rule_1+MODE_1: {rule:specified source:`chainlink`, MODE: asap when power exceeds the threshold} + //1. check OVA threshold + //2. check IVA consensus with rule, TODO: for v1 we only implement with mode=1&rule=1 + if common.ExceedsThreshold(agg.reportPower, agg.totalPower) { + //TODO: this is kind of a mock way to suite V1, need update to check with params.rule + //check if IVA all reached consensus + // fmt.Printf("debug aggregator.aggregate() len(dsPrice):%d\n", len(agg.dsPrices)) + if len(agg.dsPrices) > 0 { + validatorPrices := make([]*big.Int, 0, len(agg.reports)) + //do the aggregation to find out the 'final price' + for _, validatorReport := range agg.reports { + validatorPrices = append(validatorPrices, validatorReport.aggregate()) + } + //vTmp := bigIntList(validatorPrices) + agg.finalPrice = common.BigIntList(validatorPrices).Median() + //clear relative aggregator for this feeder, all the aggregator,calculator, filter can be removed since this round has been sealed + } + } + return agg.finalPrice +} + +func newAggregator(validatorSetLength int, totalPower *big.Int) *aggregator { + return &aggregator{ + reports: make([]*reportPrice, 0, validatorSetLength), + reportPower: big.NewInt(0), + dsPrices: make(map[int32]string), + totalPower: totalPower, + } +} diff --git a/x/oracle/keeper/aggregator/aggregator_aggregator_test.go b/x/oracle/keeper/aggregator/aggregator_aggregator_test.go new file mode 100644 index 000000000..e2e603ce8 --- /dev/null +++ b/x/oracle/keeper/aggregator/aggregator_aggregator_test.go @@ -0,0 +1,68 @@ +package aggregator + +import ( + "math/big" + "testing" + + . "github.com/smartystreets/goconvey/convey" +) + +func TestAggregator(t *testing.T) { + Convey("fill prices into aggregator", t, func() { + a := newAggregator(5, big.NewInt(4)) + //a.fillPrice(pS1, "v1", one) //v1:{1, 2} + + Convey("fill v1's report", func() { + a.fillPrice(pS1, "v1", one) //v1:{1, 2} + report := a.getReport("v1") + So(report.prices[1].price, ShouldBeNil) + Convey("fill v2's report", func() { + a.fillPrice(pS2, "v2", one) + report := a.getReport("v2") + So(report.prices[1].price, ShouldBeNil) + Convey("fill more v1's report", func() { + a.fillPrice(pS21, "v1", one) + report := a.getReport("v1") + So(report.prices[1].price, ShouldBeNil) + So(report.prices[2].price, ShouldBeNil) + Convey("confirm deterministic source_1 and source 2", func() { + a.confirmDSPrice([]*confirmedPrice{ + { + sourceId: 1, + detId: "9", + price: ten, + timestamp: "-", + }, + { + sourceId: 2, + detId: "3", + price: twenty, + timestamp: "-", + }, + }) + reportV1 := a.getReport("v1") + reportV2 := a.getReport("v2") + So(reportV1.prices[1].price, ShouldResemble, ten) + So(reportV1.prices[1].detRoundId, ShouldEqual, "9") + + So(reportV2.prices[1].price, ShouldResemble, ten) + So(reportV2.prices[1].detRoundId, ShouldEqual, "9") + + So(reportV1.prices[2].price, ShouldResemble, twenty) + So(reportV1.prices[2].detRoundId, ShouldEqual, "3") + + //current implementation only support v1's single source + Convey("aggregate after all source confirmed", func() { + a.fillPrice(pS6, "v3", one) + a.aggregate() //v1:{s1:9-10, s2:3-20}:15, v2:{s1:9-10}:10 + So(a.getReport("v1").price, ShouldResemble, fifteen) + So(a.getReport("v2").price, ShouldResemble, ten) + So(a.getReport("v3").price, ShouldResemble, twenty) + So(a.finalPrice, ShouldResemble, fifteen) + }) + }) + }) + }) + }) + }) +} diff --git a/x/oracle/keeper/aggregator/aggregator_calculator.go b/x/oracle/keeper/aggregator/aggregator_calculator.go new file mode 100644 index 000000000..cc3fa5d2b --- /dev/null +++ b/x/oracle/keeper/aggregator/aggregator_calculator.go @@ -0,0 +1,168 @@ +package aggregator + +import ( + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +type confirmedPrice struct { + sourceId int32 + detId string + price *big.Int + timestamp string +} + +// internal struct +type priceAndPower struct { + price *big.Int + power *big.Int +} + +// for a specific DS round, it could have multiple values provided by different validators(should not be true if there's no malicious validator) +type roundPrices struct { //0 means NS + detId string + prices []*priceAndPower + price *big.Int + timestamp string + // confirmed bool +} + +// udpate priceAndPower for a specific DSRoundID, if the price exists, increase its power with provided data +// return confirmed=true, when detect power exceeds the threshold +func (r *roundPrices) updatePriceAndPower(pw *priceAndPower, totalPower *big.Int) (updated bool, confirmed bool) { + if r.price != nil { + confirmed = true + return + } + for _, item := range r.prices { + if item.price.Cmp(pw.price) == 0 { + item.power = new(big.Int).Add(item.power, pw.power) + updated = true + if common.ExceedsThreshold(item.power, totalPower) { + r.price = item.price + confirmed = true + } + return + } + } + if len(r.prices) < cap(r.prices) { + r.prices = append(r.prices, pw) + updated = true + if common.ExceedsThreshold(pw.power, totalPower) { + r.price = pw.price + // r.confirmed = true + confirmed = true + } + } + return +} + +// each DS corresponding a roundPriceList to represent its multiple rounds(DS round) in one oracle-round +type roundPricesList struct { + roundPricesList []*roundPrices + //each round can have at most roundPricesCount priceAndPower + roundPricesCount int +} + +// to tell if any round of this DS has reached consensus/confirmed +func (r *roundPricesList) hasConfirmedDetId() bool { + for _, round := range r.roundPricesList { + if round.price != nil { + return true + } + } + return false +} + +// get the roundPriceList correspond to specifid detID of a DS +// if no required data and the pricesList has not reach its limitation, we will add a new slot for this detId +func (r *roundPricesList) getOrNewRound(detId string, timestamp string) (round *roundPrices) { + for _, round = range r.roundPricesList { + if round.detId == detId { + if round.price != nil { + round = nil + } + return + } + } + + if len(r.roundPricesList) < cap(r.roundPricesList) { + round = &roundPrices{ + detId: detId, + prices: make([]*priceAndPower, 0, r.roundPricesCount), + timestamp: timestamp, + } + r.roundPricesList = append(r.roundPricesList, round) + return + } + return +} + +// calculator used to get consensus on deterministic source based data from validator set reports of price +type calculator struct { + //sourceId->{[]{roundId, []{price,power}, confirmed}}, confirmed value will be set in [0] + deterministicSource map[int32]*roundPricesList + validatorLength int + totalPower *big.Int +} + +func (c *calculator) newRoundPricesList() *roundPricesList { + return &roundPricesList{ + roundPricesList: make([]*roundPrices, 0, common.MaxDetId*c.validatorLength), + //for each DS-roundId, the count of prices provided is the number of validators at most + roundPricesCount: c.validatorLength, + } +} + +func (c *calculator) getOrNewSourceId(sourceId int32) *roundPricesList { + rounds := c.deterministicSource[sourceId] + if rounds == nil { + rounds = c.newRoundPricesList() + c.deterministicSource[sourceId] = rounds + } + return rounds +} + +// fillPrice called upon new MsgCreatPrice arrived, to trigger the calculation to get to consensus on the same roundID_of_deterministic_source +// v1 use mode1, TODO: switch modes +func (c *calculator) fillPrice(pSources []*types.PriceWithSource, validator string, power *big.Int) (confirmedRounds []*confirmedPrice) { + // fmt.Println("debug calculator.fillPrice, calculator.ds[1]", c.deterministicSource[1], pSources) + for _, pSource := range pSources { + rounds := c.getOrNewSourceId(pSource.SourceId) + if rounds.hasConfirmedDetId() { + //TODO: this skip is just for V1 to do fast calculation and release EndBlocker pressure, may lead to 'not latest detId' be chosen + break + } + for _, pDetId := range pSource.Prices { + + round := rounds.getOrNewRound(pDetId.DetId, pDetId.Timestamp) + if round == nil { + //this sourceId has reach the limitation of different detId, or has confirmed + continue + } + + roundPrice, _ := new(big.Int).SetString(pDetId.Price, 10) + + // fmt.Printf("debug calculator.fillPrice before updatePriceAndPower. power%s, price%s\n", power.String(), roundPrice.String()) + updated, confirmed := round.updatePriceAndPower(&priceAndPower{roundPrice, power}, c.totalPower) + if updated && confirmed { + //sourceId, detId, price + confirmedRounds = append(confirmedRounds, &confirmedPrice{pSource.SourceId, round.detId, round.price, round.timestamp}) //TODO: just in v1 with mode==1, we use asap, so we just ignore any further data from this DS, even higher detId may get to consensus, in this way, in most case, we can complete the calculation in the transaction execution process. Release the pressure in EndBlocker + //TODO: this may delay to current block finish + break + } + } + } + // fmt.Println("debug calculator.fillPrice, after calculator.ds[1]", c.deterministicSource[1]) + return +} + +func newCalculator(validatorSetLength int, totalPower *big.Int) *calculator { + return &calculator{ + deterministicSource: make(map[int32]*roundPricesList), + validatorLength: validatorSetLength, + totalPower: totalPower, + } +} diff --git a/x/oracle/keeper/aggregator/aggregator_calculator_test.go b/x/oracle/keeper/aggregator/aggregator_calculator_test.go new file mode 100644 index 000000000..b3c9697fa --- /dev/null +++ b/x/oracle/keeper/aggregator/aggregator_calculator_test.go @@ -0,0 +1,99 @@ +package aggregator + +import ( + "math/big" + "testing" + + . "github.com/smartystreets/goconvey/convey" +) + +/* + 1-10, 2-12, 3-15 + +ps1: 1-10, 2-12 +ps2: 2-12, 3-15 +ps3: 1-10, 2-11(m) +--- +ps4: 2-12, 3-19(m) +ps5: 1-10, 3-19(m) +---- +ps1, ps2, ps3, ps4 ---> 2-12 +ps2, ps2, ps3, ps5 ---> 1-10 +*/ +func TestCalculator(t *testing.T) { + //pTD1 := newPTD("1", "10") + //pTD2 := newPTD("2", "12") + //pTD3 := newPTD("3", "15") + //pTD2M := newPTD("2", "11") + //pTD3M := newPTD("3", "19") + ////1-10, 2-12 + //ps1 := []*types.PriceWithSource{newPS(1, pTD1, pTD2)} + ////2-12, 3-15 + //ps2 := []*types.PriceWithSource{newPS(1, pTD3, pTD2)} + ////1-10, 2-11(m) + //ps3 := []*types.PriceWithSource{newPS(1, pTD1, pTD2M)} + ////2-12, 3-19(m) + //ps4 := []*types.PriceWithSource{newPS(1, pTD2, pTD3M)} + ////1-10, 3-19(m) + //ps5 := []*types.PriceWithSource{newPS(1, pTD1, pTD3M)} + + ////1-10, 2-12 + //ps21 := []*types.PriceWithSource{newPS(1, pTD1, pTD2), newPS(2, pTD1, pTD3)} + ////2-12, 3-15 + //ps22 := []*types.PriceWithSource{newPS(1, pTD3, pTD2), newPS(2, pTD2, pTD3)} + ////1-10, 2-11(m) + //ps23 := []*types.PriceWithSource{newPS(1, pTD1, pTD2M), newPS(2, pTD2M, pTD1)} + ////2-12, 3-19(m) + //ps24 := []*types.PriceWithSource{newPS(1, pTD2, pTD3M), newPS(2, pTD3, pTD2M)} + ////1-10, 3-19(m) + //ps25 := []*types.PriceWithSource{newPS(1, pTD1, pTD3M), newPS(2, pTD2M, pTD3M)} + + one := big.NewInt(1) + Convey("fill prices into calculator", t, func() { + c := newCalculator(5, big.NewInt(4)) + Convey("fill prices from single deterministic source", func() { + c.fillPrice(pS1, "v1", one) //1-10, 2-12 + c.fillPrice(pS2, "v2", one) //2-12, 3-15 + c.fillPrice(pS3, "v3", one) //1-10, 2-11 + Convey("consensus on detid=2 and price=12", func() { + confirmed := c.fillPrice(pS4, "v4", one) //2-12, 3-19 + So(confirmed[0].detId, ShouldEqual, "2") + So(confirmed[0].price, ShouldResemble, big.NewInt(12)) + }) + Convey("consensus on detid=1 and price=10", func() { + confirmed := c.fillPrice(pS5, "v5", one) //1-10, 3-19 + So(confirmed[0].detId, ShouldEqual, "1") + So(confirmed[0].price, ShouldResemble, big.NewInt(10)) + + confirmed = c.fillPrice(pS4, "v4", one) + So(confirmed, ShouldBeNil) + }) + }) + Convey("fill prices from multiple deterministic sources", func() { + c.fillPrice(pS21, "v1", one) + c.fillPrice(pS22, "v2", one) + c.fillPrice(pS23, "v3", one) + Convey("consensus on both source 1 and source 2", func() { + confirmed := c.fillPrice(pS24, "v4", one) + So(len(confirmed), ShouldEqual, 2) + i := 0 + if confirmed[0].sourceId == 2 { + i = 1 + } + So(confirmed[i].detId, ShouldEqual, "2") + So(confirmed[i].price, ShouldResemble, big.NewInt(12)) + + So(confirmed[1-i].detId, ShouldEqual, "3") + So(confirmed[1-i].price, ShouldResemble, big.NewInt(15)) + + }) + Convey("consenus on source 1 only", func() { + confirmed := c.fillPrice(pS25, "v5", one) + So(len(confirmed), ShouldEqual, 1) + So(confirmed[0].detId, ShouldEqual, "1") + So(confirmed[0].price, ShouldResemble, big.NewInt(10)) + + }) + }) + }) +} diff --git a/x/oracle/keeper/aggregator/aggregator_filter.go b/x/oracle/keeper/aggregator/aggregator_filter.go new file mode 100644 index 000000000..958ec6c99 --- /dev/null +++ b/x/oracle/keeper/aggregator/aggregator_filter.go @@ -0,0 +1,85 @@ +package aggregator + +import ( + "strconv" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +type filter struct { + maxNonce int + maxDetId int + //nonce start from 1 + validatorNonce map[string]*common.Set[int32] + //validator_sourceId -> roundID, NS use 0 + validatorSource map[string]*common.Set[string] +} + +func newFilter(maxNonce, maxDetId int) *filter { + return &filter{ + maxNonce: maxNonce, + maxDetId: maxDetId, + validatorNonce: make(map[string]*common.Set[int32]), + validatorSource: make(map[string]*common.Set[string]), + } +} + +func (f *filter) newVNSet() *common.Set[int32] { + return common.NewSet[int32](f.maxNonce) +} + +func (f *filter) newVSSet() *common.Set[string] { + return common.NewSet[string](f.maxDetId) +} + +// add priceWithSource into calculator list and aggregator list depends on the source type(deterministic/non-deterministic) +func (f *filter) addPSource(pSources []*types.PriceWithSource, validator string) (list4Calculator []*types.PriceWithSource, list4Aggregator []*types.PriceWithSource) { + for _, pSource := range pSources { + //check conflicts or duplicate data for the same roundId within the same source + if len(pSource.Prices[0].DetId) > 0 { + k := validator + strconv.Itoa(int(pSource.SourceId)) + detIds := f.validatorSource[k] + if detIds == nil { + detIds = f.newVSSet() + f.validatorSource[k] = detIds + } + + pSourceTmp := &types.PriceWithSource{ + SourceId: pSource.SourceId, + Prices: make([]*types.PriceWithTimeAndDetId, 0, len(pSource.Prices)), + Desc: pSource.Desc, + } + + for _, pDetId := range pSource.Prices { + if ok := detIds.Add(pDetId.DetId); ok { + //deterministic id has not seen in filter and limitation of ids this souce has not reached + pSourceTmp.Prices = append(pSourceTmp.Prices, pDetId) + } + } + if len(pSourceTmp.Prices) > 0 { + list4Calculator = append(list4Calculator, pSourceTmp) + list4Aggregator = append(list4Aggregator, pSourceTmp) + } + } else { + //add non-deterministic pSource value into aggregator list + list4Aggregator = append(list4Aggregator, pSource) + } + } + return +} + +// filtrate checks data from MsgCreatePrice, and will drop the conflict or duplicate data, it will then fill data into calculator(for deterministic source data to get to consensus) and aggregator (for both deterministic and non0-deterministic source data run 2-layers aggregation to get the final price) +func (f *filter) filtrate(price *types.MsgCreatePrice) (list4Calculator []*types.PriceWithSource, list4Aggregator []*types.PriceWithSource) { + validator := price.Creator + nonces := f.validatorNonce[validator] + if nonces == nil { + nonces = f.newVNSet() + f.validatorNonce[validator] = nonces + } + + if ok := nonces.Add(price.Nonce); ok { + list4Calculator, list4Aggregator = f.addPSource(price.Prices, validator) + } + return +} diff --git a/x/oracle/keeper/aggregator/aggregator_filter_test.go b/x/oracle/keeper/aggregator/aggregator_filter_test.go new file mode 100644 index 000000000..9b14d2968 --- /dev/null +++ b/x/oracle/keeper/aggregator/aggregator_filter_test.go @@ -0,0 +1,105 @@ +package aggregator + +import ( + "testing" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" + . "github.com/smartystreets/goconvey/convey" +) + +func TestFilter(t *testing.T) { + Convey("test aggregator_filter", t, func() { + f := newFilter(3, 5) + ptd1 := newPTD("1", "600000") + ptd2 := newPTD("2", "600050") + ptd3 := newPTD("3", "600070") + ptd4 := newPTD("4", "601000") + ptd5 := newPTD("5", "602000") + ptd6 := newPTD("6", "603000") + + ps1 := &types.PriceWithSource{ + SourceId: 1, + Prices: []*types.PriceWithTimeAndDetId{ + ptd1, + ptd2, + }, + } + + ps := []*types.PriceWithSource{ps1} + msg := &types.MsgCreatePrice{ + Creator: "v1", + FeederId: 1, + Prices: ps, + BasedBlock: 10, + Nonce: 1, + } + l4c, l4a := f.filtrate(msg) + + Convey("add first valid msg", func() { + So(l4c, ShouldResemble, ps) + So(l4a, ShouldResemble, ps) + }) + + Convey("add duplicate nonce msg", func() { + ps1.Prices[0] = ptd3 + l4c, l4a = f.filtrate(msg) + So(l4c, ShouldBeNil) + So(l4a, ShouldBeNil) + }) + + Convey("add duplicate detId", func() { + msg.Nonce = 2 + l4c, l4a = f.filtrate(msg) + Convey("add with new nonce", func() { + So(l4c, ShouldBeNil) + So(l4a, ShouldBeNil) + }) + Convey("update with new detId but use duplicate nonce", func() { + msg.Nonce = 2 + ps1.Prices[0] = ptd3 + l4c, l4a := f.filtrate(msg) + So(l4c, ShouldBeNil) + So(l4a, ShouldBeNil) + }) + }) + + Convey("add new detId with new nonce", func() { + msg.Nonce = 2 + ps1.Prices[0] = ptd3 + l4c, l4a = f.filtrate(msg) + ps1.Prices = ps1.Prices[:1] + ps1.Prices[0] = ptd3 + psReturn := []*types.PriceWithSource{ps1} + So(l4c, ShouldResemble, psReturn) + So(l4a, ShouldResemble, psReturn) + }) + + Convey("add too many nonce", func() { + msg.Nonce = 2 + ps1.Prices[0] = ptd3 + f.filtrate(msg) + + msg.Nonce = 3 + ps1.Prices[0] = ptd4 + l4c, _ = f.filtrate(msg) + So(l4c[0].Prices, ShouldContain, ptd4) + + msg.Nonce = 4 + ps1.Prices[0] = ptd5 + l4c, _ = f.filtrate(msg) + So(l4c, ShouldBeNil) + + }) + + Convey("add too many DetIds", func() { + msg.Nonce = 2 + ps1.Prices = []*types.PriceWithTimeAndDetId{ptd3, ptd4, ptd5, ptd6} + l4c, l4a = f.filtrate(msg) + So(l4c, ShouldResemble, l4a) + So(l4c[0].Prices, ShouldContain, ptd3) + So(l4c[0].Prices, ShouldContain, ptd4) + So(l4c[0].Prices, ShouldContain, ptd5) + So(l4c[0].Prices, ShouldNotContain, ptd6) + }) + }) +} diff --git a/x/oracle/keeper/aggregator/aggregator_test.go b/x/oracle/keeper/aggregator/aggregator_test.go new file mode 100644 index 000000000..689e0a0a4 --- /dev/null +++ b/x/oracle/keeper/aggregator/aggregator_test.go @@ -0,0 +1,88 @@ +package aggregator + +import ( + "math/big" + "reflect" + "testing" + + "bou.ke/monkey" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + sdk "github.com/cosmos/cosmos-sdk/types" + . "github.com/smartystreets/goconvey/convey" +) + +func TestAggregatorContext(t *testing.T) { + Convey("init aggregatorContext with default params", t, func() { + agc := initAggregatorContext() + var p *monkey.PatchGuard + var ctx sdk.Context + Convey("prepare round to gengerate round info of feeders for next block", func() { + // var ctx sdk.Context + // var p *monkey.PatchGuard + // agc := initAggregatorContext() + Convey("pepare within the window", func() { + p = patchBlockHeight(12) + agc.PrepareRound(ctx, 0) + Convey("for empty round list", func() { + So(*agc.rounds[1], ShouldResemble, roundInfo{10, 2, 1}) + }) + Convey("update already exist round info", func() { + p = patchBlockHeight(10 + common.MaxNonce) + agc.PrepareRound(ctx, 0) + So(agc.rounds[1].status, ShouldEqual, 2) + }) + }) + Convey("pepare outside the window", func() { + Convey("for empty round list", func() { + p = patchBlockHeight(10 + common.MaxNonce) + agc.PrepareRound(ctx, 0) + So(agc.rounds[1].status, ShouldEqual, 2) + }) + }) + }) + Convey("seal existed round without any msg recieved", func() { + p = patchBlockHeight(11) + agc.PrepareRound(ctx, 0) + Convey("seal when exceed the window", func() { + So(agc.rounds[1].status, ShouldEqual, 1) + p = patchBlockHeight(13) + agc.SealRound(ctx, false) + So(agc.rounds[1].status, ShouldEqual, 2) + }) + Convey("force seal by required", func() { + p = patchBlockHeight(12) + agc.SealRound(ctx, false) + So(agc.rounds[1].status, ShouldEqual, 1) + agc.SealRound(ctx, true) + So(agc.rounds[1].status, ShouldEqual, 2) + }) + }) + + if p != nil { + p.Unpatch() + } + }) +} + +func initAggregatorContext() *AggregatorContext { + agc := NewAggregatorContext() + + validatorPowers := map[string]*big.Int{ + "v1": big.NewInt(1), + "v2": big.NewInt(1), + "v3": big.NewInt(1), + } + + p := defaultParams + pWrapped := common.Params(p) + + agc.SetValidatorPowers(validatorPowers) + agc.SetParams(&pWrapped) + return agc +} + +func patchBlockHeight(h int64) *monkey.PatchGuard { + return monkey.PatchInstanceMethod(reflect.TypeOf(sdk.Context{}), "BlockHeight", func(sdk.Context) int64 { + return h + }) +} diff --git a/x/oracle/keeper/aggregator/helper_test.go b/x/oracle/keeper/aggregator/helper_test.go new file mode 100644 index 000000000..13ebd86f5 --- /dev/null +++ b/x/oracle/keeper/aggregator/helper_test.go @@ -0,0 +1,19 @@ +package aggregator + +import "github.com/ExocoreNetwork/exocore/x/oracle/types" + +func newPTD(detId, price string) *types.PriceWithTimeAndDetId { + return &types.PriceWithTimeAndDetId{ + Price: price, + Decimal: 1, + Timestamp: "-", + DetId: detId, + } +} + +func newPS(sourceId int32, prices ...*types.PriceWithTimeAndDetId) *types.PriceWithSource { + return &types.PriceWithSource{ + SourceId: sourceId, + Prices: prices, + } +} diff --git a/x/oracle/keeper/aggregator/info_test.go b/x/oracle/keeper/aggregator/info_test.go new file mode 100644 index 000000000..a05794105 --- /dev/null +++ b/x/oracle/keeper/aggregator/info_test.go @@ -0,0 +1,55 @@ +package aggregator + +import ( + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +var ( + one = big.NewInt(1) + zero = big.NewInt(0) + ten = big.NewInt(10) + eleven = big.NewInt(11) + fifteen = big.NewInt(15) + twenty = big.NewInt(20) +) + +var ( + pTD1 = newPTD("1", "10") + pTD2 = newPTD("2", "12") + pTD3 = newPTD("3", "15") + pTD2M = newPTD("2", "11") + pTD3M = newPTD("3", "19") + //1-10, 2-12 + pS1 = []*types.PriceWithSource{newPS(1, pTD1, pTD2)} + //2-12, 3-1 + pS2 = []*types.PriceWithSource{newPS(1, pTD3, pTD2)} + //1-10, 2-11(m) + pS3 = []*types.PriceWithSource{newPS(1, pTD1, pTD2M)} + //2-12, 3-19(m) + pS4 = []*types.PriceWithSource{newPS(1, pTD2, pTD3M)} + //1-10, 3-19(m) + pS5 = []*types.PriceWithSource{newPS(1, pTD1, pTD3M)} + + pS6 = []*types.PriceWithSource{newPS(2, pTD1)} + + //1-10, 2-12 + pS21 = []*types.PriceWithSource{newPS(1, pTD1, pTD2), newPS(2, pTD1, pTD3)} + //2-12, 3-15 + pS22 = []*types.PriceWithSource{newPS(1, pTD3, pTD2), newPS(2, pTD2, pTD3)} + //1-10, 2-11(m) + pS23 = []*types.PriceWithSource{newPS(1, pTD1, pTD2M), newPS(2, pTD2M, pTD1)} + //2-12, 3-19(m) + pS24 = []*types.PriceWithSource{newPS(1, pTD2, pTD3M), newPS(2, pTD3, pTD2M)} + //1-10, 3-19(m) + pS25 = []*types.PriceWithSource{newPS(1, pTD1, pTD3M), newPS(2, pTD2M, pTD3M)} +) + +var defaultParams = types.Params{ + Chains: []*types.Chain{{Name: "-", Desc: "-"}, {Name: "Ethereum", Desc: "-"}}, + Tokens: []*types.Token{{}, {Name: "eth", ChainId: 1, ContractAddress: "0xabc", Decimal: 18, Active: true}}, + Sources: []*types.Source{{}, {Name: "chainLink", Entry: &types.Endpoint{}, Valid: true, Deterministic: true}}, + Rules: []*types.RuleWithSource{{}, {SourceIds: []int32{1}}}, + TokenFeeders: []*types.TokenFeeder{{}, {TokenId: 1, RuleId: 1, StartRoundId: 1, StartBaseBlock: 0, Interval: 10, EndBlock: 0}}, +} diff --git a/x/oracle/keeper/aggregator/worker.go b/x/oracle/keeper/aggregator/worker.go new file mode 100644 index 000000000..a30124412 --- /dev/null +++ b/x/oracle/keeper/aggregator/worker.go @@ -0,0 +1,71 @@ +package aggregator + +import ( + "math/big" + + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/common" + "github.com/ExocoreNetwork/exocore/x/oracle/types" +) + +// worker is the actual instance used to calculate final price for each tokenFeeder's round. Which means, every tokenFeeder corresponds to a specified token, and for that tokenFeeder, each round we use a worker instance to calculate the final price +type worker struct { + sealed bool + price string + decimal int32 + //mainly used for deterministic source data to check conflics and validation + f *filter + //used to get to consensus on deterministic source's data + c *calculator + //when enough data(exceeds threshold) collected, aggregate to conduct the final price + a *aggregator + ctx *AggregatorContext +} + +func (w *worker) do(msg *types.MsgCreatePrice) []*types.PriceWithSource { + validator := msg.Creator + power := w.ctx.validatorsPower[validator] + list4Calculator, list4Aggregator := w.f.filtrate(msg) + if list4Aggregator != nil { + w.a.fillPrice(list4Aggregator, validator, power) + // fmt.Printf("debug worker.do after fill aggregator\n") + if confirmedRounds := w.c.fillPrice(list4Calculator, validator, power); confirmedRounds != nil { + // fmt.Printf("debug worker.do after fill calculator and have confirmedRounds\n") + w.a.confirmDSPrice(confirmedRounds) + } + } + return list4Aggregator +} + +func (w *worker) aggregate() *big.Int { + return w.a.aggregate() +} + +// not concurrency safe +func (w *worker) seal() { + if w.sealed { + return + } + w.sealed = true + w.price = w.a.aggregate().String() + w.f = nil + w.c = nil + w.a = nil +} + +func (w *worker) getPrice() (string, int32) { + if w.sealed { + return w.price, w.decimal + } + return "", 0 +} + +// newWorker new a instance for a tokenFeeder's specific round +func newWorker(feederId int32, agc *AggregatorContext) *worker { + return &worker{ + f: newFilter(common.MaxNonce, common.MaxDetId), + c: newCalculator(len(agc.validatorsPower), agc.totalPower), + a: newAggregator(len(agc.validatorsPower), agc.totalPower), + decimal: agc.params.GetTokenInfo(feederId).Decimal, + ctx: agc, + } +} From 9acca96003218bf3e852724593488f94267ef4fb Mon Sep 17 00:00:00 2001 From: leonz789 Date: Wed, 3 Apr 2024 03:23:17 +0800 Subject: [PATCH 35/37] feat(oracle):integrate oracle module into app --- app/app.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index 1fa133918..84ccbd786 100644 --- a/app/app.go +++ b/app/app.go @@ -36,6 +36,11 @@ import ( depositKeeper "github.com/ExocoreNetwork/exocore/x/deposit/keeper" depositTypes "github.com/ExocoreNetwork/exocore/x/deposit/types" operatorTypes "github.com/ExocoreNetwork/exocore/x/operator/types" + + "github.com/ExocoreNetwork/exocore/x/oracle" + oracleKeeper "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + oracleTypes "github.com/ExocoreNetwork/exocore/x/oracle/types" + "github.com/ExocoreNetwork/exocore/x/reward" rewardKeeper "github.com/ExocoreNetwork/exocore/x/reward/keeper" rewardTypes "github.com/ExocoreNetwork/exocore/x/reward/types" @@ -267,6 +272,7 @@ var ( withdraw.AppModuleBasic{}, reward.AppModuleBasic{}, exoslash.AppModuleBasic{}, + oracle.AppModuleBasic{}, ) // module account permissions @@ -358,6 +364,7 @@ type ExocoreApp struct { WithdrawKeeper withdrawKeeper.Keeper RewardKeeper rewardKeeper.Keeper OperatorKeeper operatorKeeper.Keeper + OracleKeeper oracleKeeper.Keeper ExoSlashKeeper slashKeeper.Keeper // the module manager @@ -441,11 +448,12 @@ func NewExocoreApp( rewardTypes.StoreKey, exoslashTypes.StoreKey, operatorTypes.StoreKey, + oracleTypes.StoreKey, ) // Add the EVM transient store key tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey, oracleTypes.MemStoreKey) // load state streaming if enabled if _, _, err := streaming.LoadStreamingServices(bApp, appOpts, appCodec, logger, keys); err != nil { @@ -630,6 +638,7 @@ func NewExocoreApp( app.WithdrawKeeper = *withdrawKeeper.NewKeeper(appCodec, keys[withdrawTypes.StoreKey], app.AssetsKeeper, app.DepositKeeper) app.RewardKeeper = *rewardKeeper.NewKeeper(appCodec, keys[rewardTypes.StoreKey], app.AssetsKeeper) app.ExoSlashKeeper = slashKeeper.NewKeeper(appCodec, keys[exoslashTypes.StoreKey], app.AssetsKeeper) + app.OracleKeeper = oracleKeeper.NewKeeper(appCodec, keys[oracleTypes.StoreKey], memKeys[oracleTypes.MemStoreKey], app.GetSubspace(oracleTypes.ModuleName), app.StakingKeeper) // We call this after setting the hooks to ensure that the hooks are set on the keeper evmKeeper.WithPrecompiles( evmkeeper.AvailablePrecompiles( @@ -804,6 +813,7 @@ func NewExocoreApp( withdraw.NewAppModule(appCodec, app.WithdrawKeeper), reward.NewAppModule(appCodec, app.RewardKeeper), exoslash.NewAppModule(appCodec, app.ExoSlashKeeper), + oracle.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper), ) // During begin block slashing happens after distr.BeginBlocker so that @@ -851,6 +861,7 @@ func NewExocoreApp( withdrawTypes.ModuleName, rewardTypes.ModuleName, exoslashTypes.ModuleName, + oracleTypes.ModuleName, ) // NOTE: fee market module must go last in order to retrieve the block gas used. @@ -894,6 +905,7 @@ func NewExocoreApp( withdrawTypes.ModuleName, rewardTypes.ModuleName, exoslashTypes.ModuleName, + oracleTypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -935,6 +947,7 @@ func NewExocoreApp( withdrawTypes.ModuleName, rewardTypes.ModuleName, exoslashTypes.ModuleName, + oracleTypes.ModuleName, // Evmos modules vestingtypes.ModuleName, inflationtypes.ModuleName, @@ -1269,7 +1282,8 @@ func initParamsKeeper( paramsKeeper.Subspace(ibcexported.ModuleName) paramsKeeper.Subspace(icahosttypes.SubModuleName) // ethermint subspaces - paramsKeeper.Subspace(evmtypes.ModuleName).WithKeyTable(evmtypes.ParamKeyTable()) //nolint: staticcheck + paramsKeeper.Subspace(evmtypes.ModuleName).WithKeyTable(evmtypes.ParamKeyTable()) //nolint:staticcheck + paramsKeeper.Subspace(oracleTypes.ModuleName).WithKeyTable(oracleTypes.ParamKeyTable()) //nolint:staticcheck return paramsKeeper } From 5ada640a781dc047756deac18ea5c01158756d6f Mon Sep 17 00:00:00 2001 From: leonz789 Date: Sun, 7 Apr 2024 18:39:36 +0800 Subject: [PATCH 36/37] fix(oracle-message): udpate CreatePrice signer with validatorAddress and responding GetSigners --- proto/exocore/oracle/tx.proto | 3 +- x/oracle/types/message_create_price.go | 4 +-- x/oracle/types/tx.pb.go | 45 ++++++++++++++------------ 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/proto/exocore/oracle/tx.proto b/proto/exocore/oracle/tx.proto index 5d1d8252d..555fc41f2 100644 --- a/proto/exocore/oracle/tx.proto +++ b/proto/exocore/oracle/tx.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package exocore.oracle; import "exocore/oracle/price.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/oracle/types"; @@ -12,7 +13,7 @@ service Msg { rpc CreatePrice (MsgCreatePrice) returns (MsgCreatePriceResponse); } message MsgCreatePrice { - string creator = 1; + string creator = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; //refer to id from Params.TokenFeeders, 0 is reserved, invalid to use int32 feeder_id = 2; repeated PriceWithSource prices = 3; diff --git a/x/oracle/types/message_create_price.go b/x/oracle/types/message_create_price.go index 3a88484fe..ba443005c 100644 --- a/x/oracle/types/message_create_price.go +++ b/x/oracle/types/message_create_price.go @@ -24,11 +24,11 @@ func (msg *MsgCreatePrice) Type() string { } func (msg *MsgCreatePrice) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) + creator, err := sdk.ValAddressFromBech32(msg.Creator) if err != nil { panic(err) } - return []sdk.AccAddress{creator} + return []sdk.AccAddress{sdk.AccAddress(creator)} } func (msg *MsgCreatePrice) GetSignBytes() []byte { diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go index b9d95cad0..ffb03fcd3 100644 --- a/x/oracle/types/tx.pb.go +++ b/x/oracle/types/tx.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" @@ -149,27 +150,29 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/tx.proto", fileDescriptor_02cf64aff79d2288) } var fileDescriptor_02cf64aff79d2288 = []byte{ - // 308 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x51, 0xcd, 0x4a, 0xf3, 0x40, - 0x14, 0xed, 0x7c, 0xfd, 0xf9, 0xec, 0x14, 0xba, 0x18, 0x44, 0x87, 0x0a, 0xd3, 0xd0, 0x85, 0x64, - 0x95, 0x48, 0x5d, 0xb8, 0xaf, 0xb8, 0x50, 0xa8, 0x48, 0x44, 0x04, 0x11, 0x4a, 0x33, 0xb9, 0xb6, - 0xa1, 0xb5, 0x37, 0xcc, 0x4c, 0x31, 0xbe, 0x85, 0x6f, 0xe3, 0x2b, 0xb8, 0xec, 0xd2, 0xa5, 0x24, - 0x2f, 0x22, 0x49, 0x1a, 0x31, 0x5d, 0xb8, 0x3c, 0x3f, 0x73, 0xe6, 0x5c, 0x0e, 0x3d, 0x84, 0x18, - 0x25, 0x2a, 0x70, 0x51, 0x4d, 0xe5, 0x12, 0x5c, 0x13, 0x3b, 0x91, 0x42, 0x83, 0xac, 0xbb, 0x15, - 0x9c, 0x42, 0xe8, 0xf5, 0x76, 0x8c, 0x91, 0x0a, 0x25, 0x14, 0xde, 0xc1, 0x3b, 0xa1, 0xdd, 0xb1, - 0x9e, 0x9d, 0x2b, 0x98, 0x1a, 0xb8, 0xc9, 0x04, 0xc6, 0xe9, 0x7f, 0x99, 0x41, 0x54, 0x9c, 0x58, - 0xc4, 0x6e, 0x7b, 0x25, 0x64, 0x47, 0xb4, 0xfd, 0x04, 0x10, 0x80, 0x9a, 0x84, 0x01, 0xff, 0x67, - 0x11, 0xbb, 0xe9, 0xed, 0x15, 0xc4, 0x65, 0xc0, 0xce, 0x68, 0x2b, 0x0f, 0xd6, 0xbc, 0x6e, 0xd5, - 0xed, 0xce, 0xb0, 0xef, 0x54, 0x6b, 0x38, 0x79, 0xfa, 0x7d, 0x68, 0xe6, 0xb7, 0xb8, 0x56, 0x12, - 0xbc, 0xad, 0x9d, 0xf5, 0x69, 0xc7, 0x9f, 0x6a, 0x08, 0x26, 0xfe, 0x12, 0xe5, 0x82, 0x37, 0x2c, - 0x62, 0x37, 0x3c, 0x9a, 0x53, 0xa3, 0x8c, 0x61, 0xfb, 0xb4, 0xb9, 0xc2, 0x95, 0x04, 0xde, 0xcc, - 0xbf, 0x2c, 0xc0, 0x80, 0xd3, 0x83, 0x6a, 0x71, 0x0f, 0x74, 0x84, 0x2b, 0x0d, 0xc3, 0x47, 0x5a, - 0x1f, 0xeb, 0x19, 0xbb, 0xa3, 0x9d, 0xdf, 0x67, 0x89, 0xdd, 0x3e, 0xd5, 0xd7, 0xbd, 0xe3, 0xbf, - 0xf5, 0x32, 0x7d, 0x74, 0xf5, 0x91, 0x08, 0xb2, 0x49, 0x04, 0xf9, 0x4a, 0x04, 0x79, 0x4b, 0x45, - 0x6d, 0x93, 0x8a, 0xda, 0x67, 0x2a, 0x6a, 0x0f, 0x27, 0xb3, 0xd0, 0xcc, 0xd7, 0xbe, 0x23, 0xf1, - 0xd9, 0xbd, 0x28, 0xb2, 0xae, 0xc1, 0xbc, 0xa0, 0x5a, 0xb8, 0xe5, 0x02, 0xf1, 0xcf, 0x58, 0xaf, - 0x11, 0x68, 0xbf, 0x95, 0x8f, 0x70, 0xfa, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x8e, 0x94, 0xc6, - 0xcb, 0x01, 0x00, 0x00, + // 350 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x51, 0xcd, 0x4a, 0xeb, 0x40, + 0x18, 0xed, 0xdc, 0xfe, 0xdc, 0xdb, 0x29, 0x74, 0x11, 0x2e, 0x1a, 0x23, 0xa6, 0xb1, 0x0b, 0xc9, + 0xc6, 0x44, 0xea, 0xc2, 0x85, 0x2b, 0x2b, 0x2e, 0x14, 0x2a, 0x92, 0xa2, 0x82, 0x08, 0x25, 0x99, + 0x7c, 0xa6, 0xa1, 0x6d, 0xbe, 0x30, 0x33, 0xc5, 0xfa, 0x16, 0x3e, 0x8c, 0x0f, 0xe1, 0xb2, 0xb8, + 0x12, 0x57, 0xd2, 0xbe, 0x88, 0x24, 0xd3, 0x8a, 0xed, 0xc2, 0xe5, 0xf9, 0xce, 0x39, 0x33, 0xe7, + 0x70, 0xe8, 0x26, 0x4c, 0x90, 0x21, 0x07, 0x17, 0xb9, 0xcf, 0x86, 0xe0, 0xca, 0x89, 0x93, 0x72, + 0x94, 0xa8, 0xd5, 0x17, 0x84, 0xa3, 0x08, 0xc3, 0x58, 0x13, 0xa6, 0x3c, 0x66, 0xa0, 0xb4, 0xc6, + 0x16, 0x43, 0x31, 0x42, 0xd1, 0xcb, 0x91, 0xab, 0x80, 0xa2, 0x9a, 0x1f, 0x84, 0xd6, 0x3b, 0x22, + 0x3a, 0xe5, 0xe0, 0x4b, 0xb8, 0xca, 0x3c, 0xda, 0x31, 0xfd, 0xcb, 0x32, 0x88, 0x5c, 0x27, 0x16, + 0xb1, 0xab, 0xed, 0xdd, 0xb7, 0x97, 0xfd, 0x9d, 0x85, 0xeb, 0xc6, 0x1f, 0xc6, 0x61, 0xc6, 0x9d, + 0x84, 0x21, 0x07, 0x21, 0xba, 0x92, 0xc7, 0x49, 0xe4, 0x2d, 0x1d, 0xda, 0x36, 0xad, 0x3e, 0x00, + 0x84, 0xc0, 0x7b, 0x71, 0xa8, 0xff, 0xb1, 0x88, 0x5d, 0xf6, 0xfe, 0xa9, 0xc3, 0x79, 0xa8, 0x1d, + 0xd1, 0x4a, 0x1e, 0x4b, 0xe8, 0x45, 0xab, 0x68, 0xd7, 0x5a, 0x0d, 0x67, 0xb5, 0x84, 0x93, 0x07, + 0xb8, 0x8d, 0x65, 0xbf, 0x8b, 0x63, 0xce, 0xc0, 0x5b, 0xc8, 0xb5, 0x06, 0xad, 0x05, 0xbe, 0x80, + 0xb0, 0x17, 0x0c, 0x91, 0x0d, 0xf4, 0x92, 0x45, 0xec, 0x92, 0x47, 0xf3, 0x53, 0x3b, 0xbb, 0x68, + 0xff, 0x69, 0x39, 0xc1, 0x84, 0x81, 0x5e, 0xce, 0xbf, 0x54, 0xa0, 0xa9, 0xd3, 0x8d, 0xd5, 0x6e, + 0x1e, 0x88, 0x14, 0x13, 0x01, 0xad, 0x7b, 0x5a, 0xec, 0x88, 0x48, 0xbb, 0xa6, 0xb5, 0x9f, 0xcd, + 0xcd, 0xf5, 0x3c, 0xab, 0x6e, 0x63, 0xef, 0x77, 0x7e, 0xf9, 0x7a, 0xfb, 0xe2, 0x75, 0x66, 0x92, + 0xe9, 0xcc, 0x24, 0x9f, 0x33, 0x93, 0x3c, 0xcf, 0xcd, 0xc2, 0x74, 0x6e, 0x16, 0xde, 0xe7, 0x66, + 0xe1, 0xee, 0x20, 0x8a, 0x65, 0x7f, 0x1c, 0x38, 0x0c, 0x47, 0xee, 0x99, 0x7a, 0xeb, 0x12, 0xe4, + 0x23, 0xf2, 0x81, 0xbb, 0xdc, 0x6f, 0xf2, 0x3d, 0xf5, 0x53, 0x0a, 0x22, 0xa8, 0xe4, 0x3b, 0x1d, + 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x5f, 0x3a, 0xf5, 0x09, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. From 86d7212e461e2762c84f083c1ca06604e00a0f0c Mon Sep 17 00:00:00 2001 From: leonz789 Date: Tue, 9 Apr 2024 04:10:15 +0800 Subject: [PATCH 37/37] test(oracle):add test cases, events, logs --- testutil/utils.go | 2 +- x/oracle/keeper/aggregator/aggregator.go | 34 ++---- .../aggregator/aggregator_aggregator.go | 2 - .../aggregator/aggregator_calculator.go | 3 - x/oracle/keeper/aggregator/worker.go | 2 - x/oracle/keeper/cache/caches.go | 2 - x/oracle/keeper/common/types.go | 5 - x/oracle/keeper/keeper_suite_test.go | 35 ++++-- x/oracle/keeper/msg_server_create_price.go | 40 +++++-- .../keeper/msg_server_create_price_test.go | 1 - x/oracle/keeper/msg_server_test.go | 102 ++++++++++++++++++ x/oracle/keeper/single.go | 19 ++-- x/oracle/module.go | 28 ++++- x/oracle/types/errors.go | 4 +- x/oracle/types/events.go | 16 +++ x/oracle/types/message_create_price.go | 2 +- 16 files changed, 223 insertions(+), 74 deletions(-) create mode 100644 x/oracle/types/events.go diff --git a/testutil/utils.go b/testutil/utils.go index 02ab7135e..88b75bf81 100644 --- a/testutil/utils.go +++ b/testutil/utils.go @@ -68,7 +68,7 @@ func (suite *BaseTestSuite) SetupTest() { suite.DoSetupTest() } -// SetupWithGenesisValSet initializes a new EvmosApp with a validator set and genesis accounts +// SetupWithGenesisValSet initializes a new ExocoreApp with a validator set and genesis accounts // that also act as delegators. For simplicity, each validator is bonded with a delegation // of one consensus engine unit (10^6) in the default token of the simapp from first genesis // account. A Nop logger is set in SimApp. diff --git a/x/oracle/keeper/aggregator/aggregator.go b/x/oracle/keeper/aggregator/aggregator.go index 95fbd4dfb..6673f7604 100644 --- a/x/oracle/keeper/aggregator/aggregator.go +++ b/x/oracle/keeper/aggregator/aggregator.go @@ -11,12 +11,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -type cacheItemM struct { - feederId int32 - pSources []*types.PriceWithSource - validator string -} - type priceItemKV struct { TokenId int32 PriceTR types.PriceWithTimeAndRound @@ -53,6 +47,7 @@ func (agc *AggregatorContext) sanityCheck(msg *types.MsgCreatePrice) error { //TODO: check the msgCreatePrice's Decimal is correct with params setting //TODO: check len(price.prices)>0, len(price.prices._range_eachPriceWithSource.Prices)>0, at least has one source, and for each source has at least one price //TODO: check for each source, at most maxDetId count price (now in filter, ->anteHandler) + if agc.validatorsPower[msg.Creator] == nil { return errors.New("signer is not validator") } @@ -72,20 +67,18 @@ func (agc *AggregatorContext) sanityCheck(msg *types.MsgCreatePrice) error { } //check with params is coressponding source is deteministic if agc.params.IsDeterministicSource(pSource.SourceId) { - for _, pDetId := range pSource.Prices { + for _, pDetID := range pSource.Prices { //TODO: verify the format of DetId is correct, since this is string, and we will make consensus with validator's power, so it's ok not to verify the format //just make sure the DetId won't mess up with NS's placeholder id, the limitation of maximum count one validator can submit will be check by filter - if len(pDetId.DetId) == 0 { + if len(pDetID.DetId) == 0 { //deterministic must have specified deterministicId return errors.New("ds should have roundid") } //DS's price value will go through consensus process, so it's safe to skip the check here } - } else { //sanity check: NS submit only one price with detId=="" - if len(pSource.Prices) > 1 || len(pSource.Prices[0].DetId) > 0 { - return errors.New("ns should not have roundid") - } + } else if len(pSource.Prices) > 1 || len(pSource.Prices[0].DetId) > 0 { + return errors.New("ns should not have roundid") } } return nil @@ -115,7 +108,6 @@ func (agc *AggregatorContext) checkMsg(msg *types.MsgCreatePrice) error { } func (agc *AggregatorContext) FillPrice(msg *types.MsgCreatePrice) (*priceItemKV, *cache.CacheItemM, error) { - // fmt.Println("debug agc fillprice") feederWorker := agc.aggregators[msg.FeederId] //worker initialzed here reduce workload for Endblocker if feederWorker == nil { @@ -124,7 +116,7 @@ func (agc *AggregatorContext) FillPrice(msg *types.MsgCreatePrice) (*priceItemKV } if feederWorker.sealed { - return nil, nil, errors.New("") + return nil, nil, types.ErrPriceProposalIgnored.Wrap("price aggregation for this round has sealed") } if listFilled := feederWorker.do(msg); listFilled != nil { @@ -142,18 +134,16 @@ func (agc *AggregatorContext) FillPrice(msg *types.MsgCreatePrice) (*priceItemKV return nil, &cache.CacheItemM{msg.FeederId, listFilled, msg.Creator}, nil } - return nil, nil, errors.New("") + //return nil, nil, errors.New("no valid price proposal to add for aggregation") + return nil, nil, types.ErrPriceProposalIgnored } // NewCreatePrice receives msgCreatePrice message, and goes process: filter->aggregator, filter->calculator->aggregator // non-deterministic data will goes directly into aggregator, and deterministic data will goes into calculator first to get consensus on the deterministic id. func (agc *AggregatorContext) NewCreatePrice(ctx sdk.Context, msg *types.MsgCreatePrice) (*priceItemKV, *cache.CacheItemM, error) { - // fmt.Println("debug agc.newcreateprice") if err := agc.checkMsg(msg); err != nil { - // fmt.Println("debug agc.newcreateprice.error", err) - return nil, nil, err + return nil, nil, types.ErrInvalidMsg.Wrap(err.Error()) } - // fmt.Println("debug before agc.fillprice") return agc.FillPrice(msg) } @@ -176,7 +166,6 @@ func (agc *AggregatorContext) SealRound(ctx sdk.Context, force bool) (success [] expired := feeder.EndBlock > 0 && ctx.BlockHeight() >= feeder.EndBlock outOfWindow := uint64(ctx.BlockHeight())-round.basedBlock >= uint64(common.MaxNonce) if expired || outOfWindow || force { - //TODO: WRITE TO KVSTORE with previous round data for this round failed = append(failed, feeder.TokenId) if expired { delete(agc.rounds, feederId) @@ -206,21 +195,16 @@ func (agc *AggregatorContext) PrepareRound(ctx sdk.Context, block uint64) { block = uint64(ctx.BlockHeight()) } - // fmt.Println("debug agc.prepareround, height:", block) for feederId, feeder := range agc.params.GetTokenFeeders() { if feederId == 0 { continue } - // fmt.Println("debug agc.prepareround, feederId:", feederId) if (feeder.EndBlock > 0 && uint64(feeder.EndBlock) <= block) || uint64(feeder.StartBaseBlock) > block { - // fmt.Println("debug agc.prepareround 2, feederId:", feederId, feeder.StartBaseBlock, block) //this feeder is inactive continue } - // fmt.Println("debug agc.prepareround 3, feederId:", feederId) - delta := (block - uint64(feeder.StartBaseBlock)) left := delta % uint64(feeder.Interval) count := delta / uint64(feeder.Interval) diff --git a/x/oracle/keeper/aggregator/aggregator_aggregator.go b/x/oracle/keeper/aggregator/aggregator_aggregator.go index 5dccf33d6..18d65e6d1 100644 --- a/x/oracle/keeper/aggregator/aggregator_aggregator.go +++ b/x/oracle/keeper/aggregator/aggregator_aggregator.go @@ -140,7 +140,6 @@ func (agg *aggregator) aggregate() *big.Int { if agg.finalPrice != nil { return agg.finalPrice } - // fmt.Printf("debug aggregator.aggregate(), reportPower:%s, totalPower:%s\n", agg.reportPower.String(), agg.totalPower.String()) //TODO: implemetn different MODE for definition of consensus, //currently: use rule_1+MODE_1: {rule:specified source:`chainlink`, MODE: asap when power exceeds the threshold} //1. check OVA threshold @@ -148,7 +147,6 @@ func (agg *aggregator) aggregate() *big.Int { if common.ExceedsThreshold(agg.reportPower, agg.totalPower) { //TODO: this is kind of a mock way to suite V1, need update to check with params.rule //check if IVA all reached consensus - // fmt.Printf("debug aggregator.aggregate() len(dsPrice):%d\n", len(agg.dsPrices)) if len(agg.dsPrices) > 0 { validatorPrices := make([]*big.Int, 0, len(agg.reports)) //do the aggregation to find out the 'final price' diff --git a/x/oracle/keeper/aggregator/aggregator_calculator.go b/x/oracle/keeper/aggregator/aggregator_calculator.go index cc3fa5d2b..94fc5974f 100644 --- a/x/oracle/keeper/aggregator/aggregator_calculator.go +++ b/x/oracle/keeper/aggregator/aggregator_calculator.go @@ -128,7 +128,6 @@ func (c *calculator) getOrNewSourceId(sourceId int32) *roundPricesList { // fillPrice called upon new MsgCreatPrice arrived, to trigger the calculation to get to consensus on the same roundID_of_deterministic_source // v1 use mode1, TODO: switch modes func (c *calculator) fillPrice(pSources []*types.PriceWithSource, validator string, power *big.Int) (confirmedRounds []*confirmedPrice) { - // fmt.Println("debug calculator.fillPrice, calculator.ds[1]", c.deterministicSource[1], pSources) for _, pSource := range pSources { rounds := c.getOrNewSourceId(pSource.SourceId) if rounds.hasConfirmedDetId() { @@ -145,7 +144,6 @@ func (c *calculator) fillPrice(pSources []*types.PriceWithSource, validator stri roundPrice, _ := new(big.Int).SetString(pDetId.Price, 10) - // fmt.Printf("debug calculator.fillPrice before updatePriceAndPower. power%s, price%s\n", power.String(), roundPrice.String()) updated, confirmed := round.updatePriceAndPower(&priceAndPower{roundPrice, power}, c.totalPower) if updated && confirmed { //sourceId, detId, price @@ -155,7 +153,6 @@ func (c *calculator) fillPrice(pSources []*types.PriceWithSource, validator stri } } } - // fmt.Println("debug calculator.fillPrice, after calculator.ds[1]", c.deterministicSource[1]) return } diff --git a/x/oracle/keeper/aggregator/worker.go b/x/oracle/keeper/aggregator/worker.go index a30124412..6d3f4776b 100644 --- a/x/oracle/keeper/aggregator/worker.go +++ b/x/oracle/keeper/aggregator/worker.go @@ -27,9 +27,7 @@ func (w *worker) do(msg *types.MsgCreatePrice) []*types.PriceWithSource { list4Calculator, list4Aggregator := w.f.filtrate(msg) if list4Aggregator != nil { w.a.fillPrice(list4Aggregator, validator, power) - // fmt.Printf("debug worker.do after fill aggregator\n") if confirmedRounds := w.c.fillPrice(list4Calculator, validator, power); confirmedRounds != nil { - // fmt.Printf("debug worker.do after fill calculator and have confirmedRounds\n") w.a.confirmDSPrice(confirmedRounds) } } diff --git a/x/oracle/keeper/cache/caches.go b/x/oracle/keeper/cache/caches.go index df8ae2867..92181e1bc 100644 --- a/x/oracle/keeper/cache/caches.go +++ b/x/oracle/keeper/cache/caches.go @@ -171,7 +171,6 @@ func (c *Cache) GetCache(i any) bool { item[addr] = power } case CacheItemP: - //fmt.Println("debug ", c.params.params) if item == nil { return false } @@ -180,7 +179,6 @@ func (c *Cache) GetCache(i any) bool { if item == nil { return false } - // fmt.Println("debug getCacheM", c.msg) tmp := make([]*CacheItemM, 0, len(c.msg)) for _, msgs := range c.msg { tmp = append(tmp, msgs...) diff --git a/x/oracle/keeper/common/types.go b/x/oracle/keeper/common/types.go index 66db474ba..2e3ca7f47 100644 --- a/x/oracle/keeper/common/types.go +++ b/x/oracle/keeper/common/types.go @@ -74,10 +74,8 @@ func (p Params) CheckRules(feederId int32, prices []*types.PriceWithSource) (boo if source.Valid { notFound = true for _, p := range prices { - // fmt.Println("debug rules check _0, p.sourceid", p.SourceId) if p.SourceId == int32(sId) { notFound = false - // fmt.Println("debug rules match _0") break } } @@ -88,10 +86,8 @@ func (p Params) CheckRules(feederId int32, prices []*types.PriceWithSource) (boo for _, source := range rule.SourceIds { notFound = true for _, p := range prices { - // fmt.Println("debug rules check, p.sourceid", p.SourceId) if p.SourceId == source { notFound = false - // fmt.Println("debug rules match") break } } @@ -99,7 +95,6 @@ func (p Params) CheckRules(feederId int32, prices []*types.PriceWithSource) (boo } } if notFound { - // fmt.Println("debug rules check, rule.sources", rule.SourceIds) return false, errors.New("price source not match with rule") } } diff --git a/x/oracle/keeper/keeper_suite_test.go b/x/oracle/keeper/keeper_suite_test.go index 19935f0e1..80a436d2f 100644 --- a/x/oracle/keeper/keeper_suite_test.go +++ b/x/oracle/keeper/keeper_suite_test.go @@ -4,20 +4,27 @@ import ( "context" "testing" + "github.com/ExocoreNetwork/exocore/testutil" "github.com/ExocoreNetwork/exocore/x/oracle/keeper" "github.com/ExocoreNetwork/exocore/x/oracle/types" sdk "github.com/cosmos/cosmos-sdk/types" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/stretchr/testify/suite" gomock "go.uber.org/mock/gomock" ) type KeeperSuite struct { - t *testing.T - k keeper.Keeper - ctx sdk.Context - ms types.MsgServer - ctrl *gomock.Controller + testutil.BaseTestSuite + + t *testing.T + k keeper.Keeper + ctx sdk.Context + ms types.MsgServer + ctrl *gomock.Controller + valAddr1 sdk.ValAddress + valAddr2 sdk.ValAddress } var ks *KeeperSuite @@ -29,13 +36,23 @@ func TestKeeper(t *testing.T) { ks.ctx = sdk.UnwrapSDKContext(ctxW) ks.t = t + suite.Run(t, ks) + RegisterFailHandler(Fail) RunSpecs(t, "Keeper Suite") } -func (k *KeeperSuite) Reset() { +func (suite *KeeperSuite) Reset() { var ctxW context.Context - k.ms, ctxW, k.k = setupMsgServer(k.t) - k.ctx = sdk.UnwrapSDKContext(ctxW) - k.ctrl = gomock.NewController(k.t) + suite.ms, ctxW, suite.k = setupMsgServer(suite.t) + suite.ctx = sdk.UnwrapSDKContext(ctxW) + suite.ctrl = gomock.NewController(suite.t) +} + +func (suite *KeeperSuite) SetupTest() { + suite.DoSetupTest() + suite.valAddr1, _ = sdk.ValAddressFromBech32(suite.Validators[0].OperatorAddress) + suite.valAddr2, _ = sdk.ValAddressFromBech32(suite.Validators[1].OperatorAddress) + keeper.ResetAggregatorContext() + keeper.ResetCache() } diff --git a/x/oracle/keeper/msg_server_create_price.go b/x/oracle/keeper/msg_server_create_price.go index ab6ba5a13..33a8977c8 100644 --- a/x/oracle/keeper/msg_server_create_price.go +++ b/x/oracle/keeper/msg_server_create_price.go @@ -2,26 +2,46 @@ package keeper import ( "context" + "strconv" "github.com/ExocoreNetwork/exocore/x/oracle/types" sdk "github.com/cosmos/cosmos-sdk/types" ) +// CreatePrice proposes price for new round of specific tokenFeeder func (k msgServer) CreatePrice(goCtx context.Context, msg *types.MsgCreatePrice) (*types.MsgCreatePriceResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - /** - 1. aggregator.rInfo.Tokenid->status == 0(1 ignore and return) - 2. basedBlock is valid [roundInfo.basedBlock, *+5], each base only allow for one submit each validator, window for submition is 5 blocks while every validator only allowed to submit at most 3 transactions each round - 3. check the rule fulfilled(sources check), check the decimal of the 1st mathc the params' definition(among prices the decimal had been checked in ante stage), timestamp:later than previous block's timestamp, [not future than now(+1s), this is checked in anteHandler], timestamp verification is not necessary - **/ - - //newItem, caches, _ := k.GetAggregatorContext(ctx, k.Keeper).NewCreatePrice(ctx, msg) - newItem, caches, _ := GetAggregatorContext(ctx, k.Keeper).NewCreatePrice(ctx, msg) - // fmt.Println("debug after NewCreatePrice", newItem, caches) + + newItem, caches, err := GetAggregatorContext(ctx, k.Keeper).NewCreatePrice(ctx, msg) + if err != nil { + return nil, err + } + + logger := k.Keeper.Logger(ctx) + logger.Info("add price proposal for aggregation", "feederID", msg.FeederId, "basedBlock", msg.BasedBlock, "proposer", msg.Creator) + + ctx.EventManager().EmitEvent(sdk.NewEvent( + types.EventTypeCreatePrice, + sdk.NewAttribute(types.AttributeKeyFeederID, strconv.Itoa(int(msg.FeederId))), + sdk.NewAttribute(types.AttributeKeyBasedBlock, strconv.FormatInt(int64(msg.BasedBlock), 10)), + sdk.NewAttribute(types.AttributeKeyProposer, msg.Creator), + ), + ) + if caches != nil { if newItem != nil { k.AppendPriceTR(ctx, newItem.TokenId, newItem.PriceTR) - //TODO: move related caches + + logger.Info("final price aggregation done", "feederID", msg.FeederId, "roundID", newItem.PriceTR.RoundId, "price", newItem.PriceTR.Price) + + ctx.EventManager().EmitEvent(sdk.NewEvent( + types.EventTypeCreatePrice, + sdk.NewAttribute(types.AttributeKeyFeederID, strconv.Itoa(int(msg.FeederId))), + sdk.NewAttribute(types.AttributeKeyRoundID, strconv.FormatInt(int64(newItem.PriceTR.RoundId), 10)), + sdk.NewAttribute(types.AttributeKeyFinalPrice, newItem.PriceTR.Price), + sdk.NewAttribute(types.AttributeKeyPriceUpdated, types.AttributeValuePriceUpdatedSuccess), + ), + ) cs.RemoveCache(caches) } else { cs.AddCache(caches) diff --git a/x/oracle/keeper/msg_server_create_price_test.go b/x/oracle/keeper/msg_server_create_price_test.go index e1ac601af..eecc89784 100644 --- a/x/oracle/keeper/msg_server_create_price_test.go +++ b/x/oracle/keeper/msg_server_create_price_test.go @@ -113,7 +113,6 @@ var _ = Describe("MsgCreatePrice", func() { c.GetCache(&iRes) Expect(len(iRes)).Should(Equal(0)) prices := ks.k.GetAllPrices(sdk.UnwrapSDKContext(ks.ctx)) - //fmt.Println("GetAllPrices", prices[0]) Expect(prices[0]).Should(BeEquivalentTo(types.Prices{ TokenId: 1, NextRountId: 2, diff --git a/x/oracle/keeper/msg_server_test.go b/x/oracle/keeper/msg_server_test.go index b13973b15..2f03e2651 100644 --- a/x/oracle/keeper/msg_server_test.go +++ b/x/oracle/keeper/msg_server_test.go @@ -6,11 +6,14 @@ import ( keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" "github.com/ExocoreNetwork/exocore/x/oracle/keeper" + "github.com/ExocoreNetwork/exocore/x/oracle/keeper/testdata" "github.com/ExocoreNetwork/exocore/x/oracle/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" // "github.com/cosmos/ibc-go/testing/mock" + // "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -25,3 +28,102 @@ func TestMsgServer(t *testing.T) { require.NotNil(t, ms) require.NotNil(t, ctx) } + +func (suite *KeeperSuite) TestCreatePriceSingleBlock() { + router := suite.App.MsgServiceRouter() + oServer := router.Handler(&types.MsgCreatePrice{}) + require.EqualValues(suite.T(), 2, suite.Ctx.BlockHeight()) + oServer(suite.Ctx, &types.MsgCreatePrice{ + Creator: suite.valAddr1.String(), + Nonce: 1, + FeederId: 1, + Prices: testdata.PS1, + BasedBlock: 1, + }) + oServer(suite.Ctx, &types.MsgCreatePrice{ + Creator: suite.valAddr2.String(), + Nonce: 1, + FeederId: 1, + Prices: testdata.PS2, + BasedBlock: 1, + }) + prices, found := suite.App.OracleKeeper.GetPrices(suite.Ctx, 1) + if suite.Equal(true, found, "final price should be returned") { + suite.EqualValues(prices.TokenId, 1, "final price has tokenId equals to 1") + suite.Equal(2, len(prices.PriceList), "length of price list should be 2 including the 0 index with an empty element as placeholder") + suite.Exactly(types.Prices{ + TokenId: 1, + NextRountId: 2, + PriceList: []*types.PriceWithTimeAndRound{ + {}, + { + Price: testdata.PTD2.Price, + Decimal: 18, + //since timestamp is filled with realtime, so we use the value from result to fill the expected value here + Timestamp: prices.PriceList[1].Timestamp, + RoundId: 1, + }, + }, + }, prices) + } + + //run the endblock to seal and prepare for next block + suite.NextBlock() + require.EqualValues(suite.T(), 3, suite.Ctx.BlockHeight()) + _, err := oServer(suite.Ctx, &types.MsgCreatePrice{ + Creator: suite.valAddr1.String(), + Nonce: 1, + FeederId: 1, + Prices: testdata.PS1, + BasedBlock: 1, + }) + codespace, code, log := sdkerrors.ABCIInfo(err, false) + suite.Equal(codespace, types.ModuleName) + suite.EqualValues(code, 1) + suite.Equal(log, err.Error()) +} + +func (suite *KeeperSuite) TestCreatePriceTwoBlock() { + router := suite.App.MsgServiceRouter() + oServer := router.Handler(&types.MsgCreatePrice{}) + res, _ := oServer(suite.Ctx, &types.MsgCreatePrice{ + Creator: suite.valAddr1.String(), + Nonce: 1, + FeederId: 1, + Prices: testdata.PS1, + BasedBlock: 1, + }) + proposerAttribute, _ := res.GetEvents().GetAttributes(types.AttributeKeyProposer) + proposer := proposerAttribute[0].Value + suite.Equal(suite.valAddr1.String(), proposer) + _, found := suite.App.OracleKeeper.GetPrices(suite.Ctx, 1) + require.Equal(suite.T(), false, found) + if suite.Equal(false, found) { + //run the endblock to seal and prepare for next block + suite.NextBlock() + oServer(suite.Ctx, &types.MsgCreatePrice{ + Creator: suite.valAddr2.String(), + Nonce: 1, + FeederId: 1, + Prices: testdata.PS3, + BasedBlock: 1, + }) + prices, found := suite.App.OracleKeeper.GetPrices(suite.Ctx, 1) + if suite.Equal(true, found) { + suite.Exactly(types.Prices{ + TokenId: 1, + NextRountId: 2, + PriceList: []*types.PriceWithTimeAndRound{ + {}, + { + Price: testdata.PTD1.Price, + Decimal: 18, + //since timestamp is filled with realtime, so we use the value from result to fill the expected value here + Timestamp: prices.PriceList[1].Timestamp, + RoundId: 1, + }, + }, + }, prices) + } + } +} diff --git a/x/oracle/keeper/single.go b/x/oracle/keeper/single.go index 4082b6068..db0a4adf8 100644 --- a/x/oracle/keeper/single.go +++ b/x/oracle/keeper/single.go @@ -23,6 +23,7 @@ func GetCaches() *cache.Cache { return cs } +// GetAggregatorContext returns singleton aggregatorContext used to calculate final price for each round of each tokenFeeder func GetAggregatorContext(ctx sdk.Context, k Keeper) *aggregator.AggregatorContext { if agc != nil { return agc @@ -38,7 +39,6 @@ func GetAggregatorContext(ctx sdk.Context, k Keeper) *aggregator.AggregatorConte return agc } -// func recacheAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k common.KeeperOracle, c *cache.Cache) bool { func recacheAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k Keeper, c *cache.Cache) bool { from := uint64(ctx.BlockHeight()) - common.MaxNonce @@ -57,7 +57,7 @@ func recacheAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext totalPower := big.NewInt(0) validatorPowers := make(map[string]*big.Int) - k.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingtypes.ValidatorI) bool { + k.IterateBondedValidatorsByPower(ctx, func(_ int64, validator stakingtypes.ValidatorI) bool { power := big.NewInt(validator.GetConsensusPower(validator.GetBondedTokens())) addr := string(validator.GetOperator()) validatorPowers[addr] = power @@ -65,7 +65,6 @@ func recacheAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext return false }) agc.SetValidatorPowers(validatorPowers) - // agc.SetTotalPower(totalPower) //TODO: test only if k.GetLastTotalPower(ctx).Cmp(totalPower) != 0 { panic("something wrong when get validatorsPower from staking module") @@ -78,15 +77,11 @@ func recacheAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext var pTmp common.Params for ; from < to; from++ { //fill params + prev := uint64(0) for b, recentParams := range recentParamsMap { - prev := uint64(0) if b <= from && b > prev { pTmp = common.Params(*recentParams) agc.SetParams(&pTmp) - if prev > 0 { - //TODO: safe delete - delete(recentParamsMap, prev) - } prev = b } } @@ -148,3 +143,11 @@ func initAggregatorContext(ctx sdk.Context, agc *aggregator.AggregatorContext, k agc.PrepareRound(ctx, uint64(ctx.BlockHeight())-1) return nil } + +func ResetAggregatorContext() { + agc = nil +} + +func ResetCache() { + cs = nil +} diff --git a/x/oracle/module.go b/x/oracle/module.go index 2b6b2aec3..165205034 100644 --- a/x/oracle/module.go +++ b/x/oracle/module.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "math/big" + "strconv" // this line is used by starport scaffolding # 1 @@ -160,40 +161,59 @@ func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Val forceSeal := false agc := keeper.GetAggregatorContext(ctx, am.keeper) + logger := am.keeper.Logger(ctx) if len(validatorUpdates) > 0 { - //validatorUpdates := am.keeper.GetValidatorUpdates(ctx) validatorList := make(map[string]*big.Int) for _, vu := range validatorUpdates { pubKey, _ := cryptocodec.FromTmProtoPublicKey(vu.PubKey) validator, _ := am.keeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pubKey)) validatorList[validator.OperatorAddress] = big.NewInt(vu.Power) } - // cs.AddCache(validatorList, am.keeper) validatorPowers := make(map[string]*big.Int) cs.GetCache(cache.CacheItemV(validatorPowers)) //update validatorPowerList in aggregatorContext - // keeper.GetAggregatorContext(ctx, am.keeper).SetValidatorPowers(validatorPowers) - // agc := keeper.GetAggregatorContext(ctx, am.keeper) agc.SetValidatorPowers(validatorPowers) //TODO: seal all alive round since validatorSet changed here forceSeal = true + logger.Info("validator set changed, force seal all active rounds") } //TODO: for v1 use mode==1, just check the failed feeders _, failed := agc.SealRound(ctx, forceSeal) //append new round with previous price for fail-seal token for _, tokenId := range failed { + event := sdk.NewEvent( + types.EventTypeCreatePrice, + sdk.NewAttribute(types.AttributeKeyTokenID, strconv.Itoa(int(tokenId))), + sdk.NewAttribute(types.AttributeKeyPriceUpdated, types.AttributeValuePriceUpdatedFail), + ) + logInfo := fmt.Sprintf("add new round with previous price under fail aggregation, tokenID:%d", tokenId) if pTR, ok := am.keeper.GetPriceTRLatest(ctx, tokenId); ok { pTR.RoundId++ am.keeper.AppendPriceTR(ctx, tokenId, pTR) + logger.Info("add new round with previous price under fail aggregation", "tokenID", tokenId, "roundID", pTR.RoundId) + logInfo += fmt.Sprintf(", roundID:%d, price:%s", pTR.RoundId, pTR.Price) + event.AppendAttributes( + sdk.NewAttribute(types.AttributeKeyRoundID, strconv.Itoa(int(pTR.RoundId))), + sdk.NewAttribute(types.AttributeKeyFinalPrice, pTR.Price), + ) } else { nextRoundId := am.keeper.GetNextRoundId(ctx, tokenId) am.keeper.AppendPriceTR(ctx, tokenId, types.PriceWithTimeAndRound{ RoundId: nextRoundId, }) + logInfo += fmt.Sprintf(", roundID:%d, price:-", nextRoundId) + event.AppendAttributes( + sdk.NewAttribute(types.AttributeKeyRoundID, strconv.Itoa(int(nextRoundId))), + sdk.NewAttribute(types.AttributeKeyFinalPrice, "-"), + ) } + logger.Info(logInfo) + ctx.EventManager().EmitEvent(event) } + //TODO: emit events for success sealed rounds(could ignore for v1) + logger.Info("prepare for next oracle round of each tokenFeeder") agc.PrepareRound(ctx, 0) cs.CommitCache(ctx, true, am.keeper) diff --git a/x/oracle/types/errors.go b/x/oracle/types/errors.go index 6d57a417b..ce36be548 100644 --- a/x/oracle/types/errors.go +++ b/x/oracle/types/errors.go @@ -8,5 +8,7 @@ import ( // x/oracle module sentinel errors var ( - ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") + ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") + ErrInvalidMsg = sdkerrors.Register(ModuleName, 1, "invalid input create price") + ErrPriceProposalIgnored = sdkerrors.Register(ModuleName, 2, "price proposal ignored") ) diff --git a/x/oracle/types/events.go b/x/oracle/types/events.go new file mode 100644 index 000000000..4a7ae578e --- /dev/null +++ b/x/oracle/types/events.go @@ -0,0 +1,16 @@ +package types + +const ( + EventTypeCreatePrice = "create_price" + + AttributeKeyFeederID = "feeder_id" + AttributeKeyTokenID = "token_id" + AttributeKeyBasedBlock = "based_block" + AttributeKeyRoundID = "round_id" + AttributeKeyProposer = "proposer" + AttributeKeyFinalPrice = "final_price" + AttributeKeyPriceUpdated = "price_update" + + AttributeValuePriceUpdatedSuccess = "success" + AttributeValuePriceUpdatedFail = "fail" +) diff --git a/x/oracle/types/message_create_price.go b/x/oracle/types/message_create_price.go index ba443005c..ffbc60992 100644 --- a/x/oracle/types/message_create_price.go +++ b/x/oracle/types/message_create_price.go @@ -37,7 +37,7 @@ func (msg *MsgCreatePrice) GetSignBytes() []byte { } func (msg *MsgCreatePrice) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) + _, err := sdk.ValAddressFromBech32(msg.Creator) if err != nil { return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) }